/* =====================================================================
   3D GO — оформление карточек товаров в каталоге WooCommerce
   Загрузить файл в папку темы: /css/shop-cards.css
   (подключается через functions-shop-cards.php)
   ===================================================================== */

/* Сама карточка: рамка + закруглённые углы */
.woocommerce ul.products li.product {
  position: relative;
  border: 1px solid #e3e3e3;
  border-radius: 18px;
  text-align: left;
  box-shadow: none;
  transition: box-shadow .25s ease, border-color .25s ease;
}

.woocommerce ul.products li.product:hover {
  border-color: #1ea7b0;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .08);
}

/* Обёртка-ссылка вокруг картинки и названия */
.woocommerce ul.products li.product a.woocommerce-loop-product__link {
  position: relative;
  display: block;
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
}

.woocommerce ul.products li.product img {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 12px;
  transition: opacity .35s ease;
}

/* Картинка из галереи — скрыта по умолчанию, появляется при наведении */
.woocommerce ul.products li.product img.gi3dgo-hover-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: auto;
  opacity: 0;
  z-index: 2;
}

.woocommerce ul.products li.product:hover img.gi3dgo-hover-image {
  opacity: 1;
}

/* Название товара — фиксированная высота под 2 строки, чтобы карточки
   с короткими и длинными названиями были одинаковой высоты.
   Если название длиннее 2 строк — обрезается многоточием. */
.woocommerce ul.products li.product .woocommerce-loop-product__title {
  font-weight: 700;
  text-transform: uppercase;
  line-height: 1.3;
  margin: 16px 0 10px;
  min-height: calc(30px * 1.3 * 2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* Блок "Общие характеристики" */
.gi3dgo-attrs {
  margin: 0 0 12px;
}

.gi3dgo-attrs-title {
  margin: 0 0 6px;
  font-size: 14px;
}

.gi3dgo-attrs-list {
  list-style: disc;
  padding-left: 18px;
  margin: 0;
  font-size: 13px;
  color: #555;
  line-height: 1.6;
}

/* Кружки цвета — 5 в ряд, блок фиксированной высоты (2 ряда),
   чтобы карточки с разным числом цветов были одинаковой высоты */
.gi3dgo-swatches {
  display: grid;
  grid-template-columns: repeat(5, 20px);
  grid-auto-rows: 20px;
  gap: 6px;
  height: 46px;      /* 2 ряда: 20px + 6px зазор + 20px */
  overflow: hidden;
  margin: 0 0 14px;
  align-content: start;
}

.gi3dgo-swatch {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, .15);
  box-sizing: border-box;
}

.gi3dgo-swatch-more {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f1f1f1 !important;
  color: #666;
  font-size: 9px;
  font-weight: 700;
}

/* Нижняя строка: цена слева, кнопка справа */
.gi3dgo-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}

.gi3dgo-bottom .price {
  font-family: 'Unbounded', sans-serif;
  font-weight: 700;
  font-size: 22px;
  color: #111;
}

.gi3dgo-price-icon {
  align-items: center;
  justify-content: center;
  margin-right: 6px;
  color: #000;
  vertical-align: middle;
}

.gi3dgo-price-icon svg {
  width: 24px;
  height: 24px;
  display: block;
}

/* Кнопка "Купить сейчас" / "Выберите параметры" */
.woocommerce ul.products li.product .button.add_to_cart_button {
  background: #1ea7b0;
  color: #fff !important;
  border: none;
  border-radius: 30px;
  padding: 10px 22px;
  font-size: 14px;
  white-space: nowrap;
  transition: background .2s ease;
  font-weight: 300;
  font-family: 'Unbounded';
}

.woocommerce ul.products li.product .button.add_to_cart_button:hover {
  background: #178289;
}

.woocommerce:where(body:not(.woocommerce-uses-block-theme)) ul.products li.product .price {
    color: #000000;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Стрелки родного FlexSlider галереи товара */
.woocommerce-product-gallery {
  position: relative;
}

.woocommerce-product-gallery ul.flex-direction-nav {
  position: absolute;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  width: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
  z-index: 5;
  pointer-events: none;
}

.woocommerce-product-gallery ul.flex-direction-nav li {
  pointer-events: auto;
}

.woocommerce-product-gallery li.flex-nav-prev {
  position: absolute;
  left: 12px;
  top: 0;
}

.woocommerce-product-gallery li.flex-nav-next {
  position: absolute;
  right: 12px;
  top: 0;
}

.woocommerce-product-gallery ul.flex-direction-nav a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .9);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .15);
  font-size: 0;
  text-indent: -9999px;
  overflow: hidden;
  transition: background .2s ease;
}

.woocommerce-product-gallery ul.flex-direction-nav a::before {
  content: '';
  display: block;
  width: 9px;
  height: 9px;
  border-top: 2px solid #222;
  border-right: 2px solid #222;
  text-indent: 0;
}

.woocommerce-product-gallery ul.flex-direction-nav a.flex-prev::before {
  transform: rotate(-135deg);
  margin-left: 4px;
}

.woocommerce-product-gallery ul.flex-direction-nav a.flex-next::before {
  transform: rotate(45deg);
  margin-right: 4px;
}

.woocommerce-product-gallery ul.flex-direction-nav a:hover {
  background: #1ea7b0;
}

.woocommerce-product-gallery ul.flex-direction-nav a:hover::before {
  border-color: #fff;
}


/* Область главного фото — точка отсчёта для стрелок */
.woocommerce-product-gallery .flex-viewport {
  position: relative;
}

.woocommerce-product-gallery ul.flex-direction-nav {
  position: absolute;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  width: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
  z-index: 5;
  pointer-events: none;
}

.woocommerce-product-gallery ul.flex-direction-nav li {
  pointer-events: auto;
}

.woocommerce-product-gallery li.flex-nav-prev { position: absolute; left: 12px; top: 0; }
.woocommerce-product-gallery li.flex-nav-next { position: absolute; right: 12px; top: 0; }

.woocommerce-product-gallery ul.flex-direction-nav a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .9);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .15);
  font-size: 0;
  text-indent: -9999px;
  overflow: hidden;
  transition: background .2s ease;
}

.woocommerce-product-gallery ul.flex-direction-nav a::before {
  content: '';
  display: block;
  width: 9px;
  height: 9px;
  border-top: 2px solid #222;
  border-right: 2px solid #222;
  text-indent: 0;
}

.woocommerce-product-gallery ul.flex-direction-nav a.flex-prev::before { transform: rotate(-135deg); margin-left: 4px; }
.woocommerce-product-gallery ul.flex-direction-nav a.flex-next::before { transform: rotate(45deg); margin-right: 4px; }

.woocommerce-product-gallery ul.flex-direction-nav a:hover { background: #1ea7b0; }
.woocommerce-product-gallery ul.flex-direction-nav a:hover::before { border-color: #fff; }

/* Миниатюры — одна строка с горизонтальной прокруткой */
.woocommerce-product-gallery ol.flex-control-thumbs {
  display: flex !important;
  flex-wrap: nowrap !important;
  overflow-x: auto;
  overflow-y: hidden;
  gap: 8px;
  margin: 12px 0 0;
  padding: 0 0 8px;
  list-style: none;
  scrollbar-width: thin;
}

.woocommerce-product-gallery ol.flex-control-thumbs li {
  flex: 0 0 84px !important;
  width: 84px !important;
  margin: 0 !important;
  list-style: none;
}

.woocommerce-product-gallery ol.flex-control-thumbs li img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  cursor: pointer;
  opacity: .6;
  transition: opacity .2s ease;
}

.woocommerce-product-gallery ol.flex-control-thumbs li img.flex-active,
.woocommerce-product-gallery ol.flex-control-thumbs li img:hover {
  opacity: 1;
}

/* Закругление большого изображения галереи */
.woocommerce-product-gallery .flex-viewport {
  border-radius: 16px;
  overflow: hidden;
}

.woocommerce-product-gallery .woocommerce-product-gallery__image img {
  border-radius: 16px;
}
/* ===== Фильтры каталога ===== */
.gi3dgo-filters {
  font-size: 14px;
}

.gi3dgo-filter-block {
  margin-bottom: 10px;
}

.gi3dgo-filter-title {
  font-size: 13px;
  color: #777;
  margin: 0 0 10px;
}

.gi3dgo-filter-count {
  color: #b3b3b3;
}

.gi3dgo-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.gi3dgo-pill {
  display: inline-block;
  flex: 0 0 auto;
  font-size: 13px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid #ddd;
  color: #222 !important;
  text-decoration: none !important;
  white-space: nowrap;
  transition: background .2s ease, border-color .2s ease, color .2s ease;
}

.gi3dgo-pill:hover {
  border-color: #1ea7b0;
}

.gi3dgo-pill.is-active {
  background: #1ea7b0;
  border-color: #1ea7b0;
  color: #fff !important;
}

.gi3dgo-pill-count {
  color: #999;
}

.gi3dgo-pill.is-active .gi3dgo-pill-count {
  color: rgba(255, 255, 255, .75);
}

.gi3dgo-filter-swatches {
  display: grid;
  grid-template-columns: repeat(auto-fill, 30px);
  gap: 8px;
}

.gi3dgo-filter-swatch {
  display: block;
  position: relative;
  width: 35px;
  height: 35px;
  border-radius: 50%;
  padding: 3px;
  box-sizing: border-box;
  border: 1px solid transparent;
  transition: border-color .2s ease;
}

.gi3dgo-filter-swatch span {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12);
}

.gi3dgo-filter-swatch:hover {
  border-color: #bbb;
}

.gi3dgo-filter-swatch.is-active {
  border-color: #1ea7b0;
}

/* чекбокс-переключатель и кнопка «показать все» нужны только на мобильных */
.gi3dgo-colors-toggle,
.gi3dgo-colors-more {
  display: none;
}

.gi3dgo-filter-reset {
  display: inline-block;
  margin-top: 4px;
  font-size: 13px;
  color: #1ea7b0 !important;
  text-decoration: none !important;
}

.gi3dgo-filter-reset:hover {
  text-decoration: underline !important;
}

/* ===== Мобильные ===== */
@media (max-width: 767px) {

  /* покрытия и материалы — лента с горизонтальной прокруткой */
  .gi3dgo-pills {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 6px;
    margin-right: -14px;
    padding-right: 14px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .gi3dgo-pills::-webkit-scrollbar {
    display: none;
  }

  /* цвета — свёрнуты до двух рядов */
  .gi3dgo-filter-block--colors {
    position: relative;
  }

  .gi3dgo-filter-swatches {
    grid-template-columns: repeat(auto-fill, 30px);
    gap: 7px;
    max-height: 80px;
    overflow: hidden;
    transition: max-height .3s ease;
}

  .gi3dgo-filter-swatch {
    width: 35px;
    height: 35px;
  }

  .gi3dgo-colors-toggle:checked ~ .gi3dgo-filter-swatches {
    max-height: 1200px;
  }

  .gi3dgo-colors-more {
    display: inline-block;
    margin-top: 10px;
    font-size: 13px;
    color: #1ea7b0;
    cursor: pointer;
  }

  .gi3dgo-colors-more::after {
    content: 'Показать все цвета ↓';
  }

  .gi3dgo-colors-toggle:checked ~ .gi3dgo-colors-more::after {
    content: 'Свернуть ↑';
  }
}

/* Подсказка "выберите цвет" */
.gi3dgo-variation-hint {
  display: none;
  margin: 10px 0;
  padding: 10px 14px;
  border-radius: 8px;
  background: #ffddda;
  border: 1px solid #dc4639;
  color: #dc4639;
  font-size: 14px;
  max-width: 355px;
}

.gi3dgo-variation-hint.is-visible {
  display: block;
}

/* Короткое покачивание кружков, чтобы взгляд зацепился */
.gi3dgo-attention {
  animation: gi3dgo-nudge .35s ease 2;
}

@keyframes gi3dgo-nudge {
  0%, 100% { transform: translateX(0); }
  25%      { transform: translateX(-4px); }
  75%      { transform: translateX(4px); }
}

/* Кнопка в неактивном состоянии — чтобы было видно, что она ждёт выбора */
.single_add_to_cart_button.disabled {
  opacity: .5;
  cursor: not-allowed;
}

body {
  overflow-x: clip !important;
  overflow-y: visible !important;
}

/* Совместимые бренды в карточке товара */
.gi3dgo-brands {
  margin: 22px 0;
  padding: 16px 18px;
  background: #fff;
  border: 1px solid #ececec;
  border-radius: 14px;
}

.gi3dgo-brands__title {
  margin: 0 0 12px;
  font-weight: 700;
}

.gi3dgo-brands__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px 8px;
  align-items: center;
}

.woo-variation-swatches .variable-items-wrapper.radio-variable-items-wrapper {
    -webkit-box-orient: horizontal;
    display: flex;
    flex-direction: row;
}

.gi3dgo-brands .gi3dgo-brands__item img {
  display: block !important;
  height: 40px !important;
  width: auto !important;
  max-width: 100% !important;
  object-fit: contain;
  margin: 0;
}

.gi3dgo-brands__grid br {
  display: none;
}

@media (min-width: 801px) {
  .woocommerce ul.products li.product .woocommerce-loop-product__title {
    font-size: 15px;
  }

  .woocommerce ul.products li.product {
    padding: 22px;
  }
}

@media (max-width: 800px) {
  .woocommerce ul.products li.product .woocommerce-loop-product__title {
    font-size: 10px;
  }

  .woocommerce .products ul, .woocommerce ul.products {
    font-size: 12px;
    line-height: 1.2;
}

.gi3dgo-bottom {
    display: grid;
    gap: 0px;
}

.woocommerce ul.products li.product {
    padding: 8px;
}

.gi3dgo-brands {
    padding: 12px;
  }

  .gi3dgo-brands__grid {
    gap: 8px 6px;
  }

  .gi3dgo-brands .gi3dgo-brands__item img {
    height: 26px !important;
  }
}

/* Кнопка перехода на маркетплейс */
.gi3dgo-marketplace-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  border: 1px solid #d5d5d5;
  border-radius: 12px;
  background: #fff;
  color: #1f2a37 !important;
  font-size: 17px;
  font-weight: 500;
  line-height: 1;
  text-decoration: none !important;
  transition: border-color .2s ease, box-shadow .2s ease;
}

.gi3dgo-marketplace-btn:hover {
  border-color: #b5b5b5;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .07);
}

.gi3dgo-marketplace-btn__icon {
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  background: url('/wp-content/uploads/2026/08/kaspi.png') no-repeat center / contain;
}

@media (max-width: 600px) {
  .gi3dgo-marketplace-btn {
    width: 100%;
    justify-content: center;
    font-size: 15px;
    padding: 12px 18px;
  }
}

/* Подсказка «выгоднее набором» */
.gi3dgo-bundle-hint {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0 14px;
  padding: 9px 16px;
  border: 1px solid #cbe9ec;
  border-radius: 10px;
  background: #f0fafb;
  color: #0d6b78 !important;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.3;
  text-decoration: none !important;
  transition: background .2s ease, border-color .2s ease;
}

.gi3dgo-bundle-hint:hover {
  background: #e2f5f7;
  border-color: #9dd8de;
}

.gi3dgo-bundle-hint__arrow {
  transition: transform .2s ease;
}

.gi3dgo-bundle-hint:hover .gi3dgo-bundle-hint__arrow {
  transform: translateX(3px);
}

@media (max-width: 600px) {
  .gi3dgo-bundle-hint {
    width: 100%;
    justify-content: space-between;
    font-size: 13px;
    padding: 9px 14px;
  }
}
