/* =========================================
   1. RESET & BASE
   ========================================= */
@font-face {
  font-family: "CandaraCustom";
  src: url("../fonts/candara-light.ttf") format("truetype");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "CandaraCustom";
  src: url("../fonts/candara-regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "CandaraCustom";
  src: url("../fonts/candara-bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "CandaraCustom", Arial, sans-serif;
  color: #3F3F46;
  background: #FFFFFF;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  text-decoration: none;
  color: inherit;
  transition: color 0.2s ease;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

button {
  font-family: inherit;
  border: none;
  background: none;
  cursor: pointer;
  color: inherit;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 30px;
}

/* =========================================
   2. PRODUCT CARD LAYOUT
   ========================================= */
.product-card {
  padding-bottom: 72px;
  display: flex;
  flex-wrap: wrap;
  gap: 64px;
  align-items: flex-start;
}

.product-card__gallery,
.product-card__info {
  flex: 1 1 calc(50% - 32px);
  min-width: 0;
}

/* =========================================
   3. GALLERY & THUMBNAILS
   ========================================= */
.product-card__gallery {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.product-card__main_image {
  position: relative;
  width: 100%;
  max-width: 100%;
  aspect-ratio: 1 / 1;
  background: #F8F8FA;
  border: 1px solid #ECECF0;
  border-radius: 4px;
  overflow: hidden;
  cursor: zoom-in;
  transition: border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.product-card__main_image:hover {
  border-color: #E5A600;
  box-shadow: 0 8px 24px rgba(229, 166, 0, 0.2);
}

.product-card__main_image img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.product-card__main_image:hover img {
  transform: scale(1.05);
}

.product-card__gallery-hint {
  position: absolute;
  bottom: 14px;
  right: 14px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #fff;
  background: rgba(229, 166, 0, 0.9);
  padding: 6px 12px;
  border-radius: 3px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  pointer-events: none;
}

/* Миниатюры: строго 2 в ряд, высота = половине главной картинки.
   Grid гарантирует, что одиночная картинка в последнем ряду
   НЕ растянется на всю ширину — она займёт свою ячейку. */
.product-card__gallery_grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.gallery-thumb {
  aspect-ratio: 1 / 1; /* при 2 колонках высота = ширина миниатюры ≈ половине главной */
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.2s ease, opacity 0.2s ease;
  background: #F8F8FA;
}

.gallery-thumb:hover {
  border-color: #E5A600;
  opacity: 0.9;
}

.gallery-thumb.active {
  border-color: #E5A600;
}

.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* =========================================
   4. PRODUCT INFO
   ========================================= */
.product-card__info {
  padding-top: 8px;
  display: flex;
  flex-direction: column;
}

.product-card__collection {
  display: block;
  font-size: 15px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.8px;
  color: #E5A600;
  margin-bottom: 14px;
}

.product-card__title {
  font-size: 48px;
  font-weight: 700;
  text-transform: uppercase;
  color: #3F3F46;
  line-height: 1.1;
  margin-bottom: 6px;
}

.product-card__meta {
  margin-top: 32px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.product-card__row {
  display: flex;
  gap: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid #ECECF0;
}

.product-card__row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.product-card__label {
  flex: 0 0 140px;
  font-size: 15px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #93939C;
  padding-top: 3px;
}

.product-card__value {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 20px;
  line-height: 1.55;
  color: #3F3F46;
}

/* =========================================
   5. SIZES TABLE
   ========================================= */
.product-card__sizes-table {
  width: 100%;
  border-collapse: collapse;
}

/* .product-card__sizes-table:not(:has(.wb-link)) thead th:last-child { display: none; } */

/* .product-card__sizes-table:not(:has(.col-price)) thead th:nth-child(2) { display: none; } */

.product-card__sizes-table thead th {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #93939C;
  text-align: left;
  padding: 0 12px 12px;
  border-bottom: 1px solid #ECECF0;
}

.product-card__sizes-table tbody tr {
  transition: background 0.2s ease;
  cursor: pointer;
}

.product-card__sizes-table tbody tr:hover {
  background: #F8F8FA;
}

.product-card__sizes-table td {
  padding: 14px 12px;
  border-bottom: 1px solid #ECECF0;
  font-size: 20px;
  color: #3F3F46;
  vertical-align: middle;
}

.product-card__sizes-table tbody tr:last-child td { border-bottom: none; }

.product-card__sizes-table .col-size,
.product-card__sizes-table .col-price {
  font-weight: 500;
  white-space: nowrap;
  font-size: 20px;
}

.product-card__sizes-table .col-price .currency {
  font-size: 17px;
  color: #E5A600;
  margin-left: 2px;
  font-weight: 700;
}

.product-card__sizes-table .col-action { text-align: right; }

.product-card__sizes-table .wb-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #3F3F46;
  padding: 8px 14px;
  border: 1px solid #ECECF0;
  border-radius: 3px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.product-card__sizes-table .wb-link::after {
  content: "";
  width: 6px;
  height: 6px;
  border-top: 1px solid currentColor;
  border-right: 1px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.product-card__sizes-table .wb-link:hover {
  color: #E5A600;
  border-color: #E5A600;
  background: rgba(229, 166, 0, 0.05);
}

.product-card__sizes-table .wb-link:hover::after {
  transform: rotate(45deg) translate(2px, -2px);
}

/* =========================================
   6. PRICE & CTA
   ========================================= */
.product-card__price-block {
  margin-top: 36px;
  padding-top: 28px;
  border-top: 1px solid #ECECF0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.product-card__price {
  font-size: 43px;
  font-weight: 700;
  color: #3F3F46;
  white-space: nowrap;
}

.product-card__price-currency {
  font-size: 27px;
  color: #E5A600;
  margin-left: 4px;
  font-weight: 700;
}

.product-card__cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #fff;
  background: #E5A600;
  padding: 14px 24px;
  border: 1px solid #E5A600;
  border-radius: 3px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.product-card__cta:hover {
  background: #3F3F46;
  border-color: #3F3F46;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.product-card__cta-line {
  display: inline-block;
  width: 18px;
  height: 1px;
  background: currentColor;
  position: relative;
}

.product-card__cta-line::after {
  content: "";
  position: absolute;
  right: 0;
  top: 50%;
  width: 6px;
  height: 6px;
  border-top: 1px solid currentColor;
  border-right: 1px solid currentColor;
  transform: translateY(-50%) rotate(45deg);
}

/* =========================================
   7. SECTIONS
   ========================================= */
.section {
  padding: 56px 0 72px;
  border-top: 1px solid #ECECF0;
}

.section__header {
  margin-bottom: 40px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.section__title {
  font-size: 37px;
  font-weight: 700;
  text-transform: uppercase;
  color: #3F3F46;
  line-height: 1;
}

/* =========================================
   8. ACCESSORIES (рекомендованные товары — сетка)
   ========================================= */
.accessories__grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 24px;
}

.accessory {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #ECECF0;
  border-radius: 4px;
  overflow: hidden;
  transition: border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.accessory:hover {
  border-color: #E5A600;
  box-shadow: 0 10px 28px rgba(229, 166, 0, 0.18);
  transform: translateY(-3px);
}

.accessory__image {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #F8F8FA;
  overflow: hidden;
  border-bottom: 1px solid #ECECF0;
}

.accessory__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.accessory:hover .accessory__image img {
  transform: scale(1.05);
}

.accessory__image-hint {
  position: absolute;
  bottom: 10px;
  right: 10px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: #fff;
  background: rgba(229, 166, 0, 0.92);
  padding: 5px 10px;
  border-radius: 3px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}

.accessory:hover .accessory__image-hint {
  opacity: 1;
  transform: translateY(0);
}

.accessory__body {
  padding: 18px 18px 22px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  gap: 6px;
}

.accessory__collection {
  display: block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #E5A600;
  margin-bottom: 2px;
}

.accessory__title {
  font-size: 17px;
  font-weight: 700;
  text-transform: uppercase;
  color: #3F3F46;
  line-height: 1.25;
  margin-bottom: 4px;
  transition: color 0.2s ease;
}

.accessory:hover .accessory__title {
  color: #E5A600;
}

.accessory__desc {
  font-size: 14px;
  line-height: 1.45;
  color: #6B6B72;
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.accessory__price {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid #ECECF0;
  font-size: 19px;
  font-weight: 700;
  color: #3F3F46;
  white-space: nowrap;
}

.accessory__price-currency {
  font-size: 15px;
  color: #E5A600;
  margin-left: 3px;
  font-weight: 700;
}

/* =========================================
   9. RELATED SLIDER
   ========================================= */
.slider__viewport { overflow: hidden; }

.slider__track {
  display: flex;
  gap: 24px;
  transition: transform 0.4s ease;
}

.slider__slide {
  flex: 0 0 calc((100% - 72px) / 4);
  min-width: 0;
}

.slider__nav { display: flex; gap: 8px; }

.slider__btn {
  width: 40px;
  height: 40px;
  border: 1px solid #ECECF0;
  border-radius: 4px;
  color: #3F3F46;
  font-size: 21px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.slider__btn:hover:not(:disabled) {
  border-color: #E5A600;
  color: #E5A600;
  background: rgba(229, 166, 0, 0.05);
}

.slider__btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.related { display: block; cursor: pointer; }

.related__image {
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #F8F8FA;
  border: 1px solid #ECECF0;
  border-radius: 4px;
  margin-bottom: 14px;
  transition: border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.related__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.related:hover .related__image {
  border-color: #E5A600;
}

.related:hover .related__image img {
  transform: scale(1.05);
}

.related__collection {
  display: block;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #E5A600;
  margin-bottom: 6px;
}

.related__title {
  font-size: 20px;
  font-weight: 700;
  text-transform: uppercase;
  color: #3F3F46;
  line-height: 1.3;
  margin-bottom: 8px;
}

.related__price {
  font-size: 21px;
  font-weight: 700;
  color: #3F3F46;
}

.related__price-currency {
  font-size: 17px;
  color: #E5A600;
  margin-left: 2px;
  font-weight: 700;
}

/* =========================================
   10. FULLSCREEN LIGHTBOX
   ========================================= */

.lightbox {
  position: fixed;
  inset: 0;

  width: 100%;
  height: 100%;

  background: rgba(0, 0, 0, 0.97);

  display: none;
  align-items: center;
  justify-content: center;

  z-index: 2147483647;

  overflow: hidden;

  /*
   * Важно для touch/pointer.
   * Сам lightbox не должен скроллиться,
   * когда пользователь двигает увеличенную картинку.
   */
  touch-action: none;
}

.lightbox.is-open {
  display: flex;
}

.lightbox.fullscreen,
.lightbox:fullscreen,
.lightbox:-webkit-full-screen,
.lightbox:-ms-fullscreen {
  width: 100%;
  height: 100%;
  background: #000;
}


/* =========================================
   IMAGE
   ========================================= */

.lightbox img {
  /*
   * Ограничиваем исходный размер.
   */
  max-width: 92vw;
  max-height: 85vh;

  width: auto;
  height: auto;

  object-fit: contain;

  /*
   * Начальный transform задаётся JS.
   */
  transform:
    translate3d(0, 0, 0)
    scale(1);

  transform-origin: center center;

  /*
   * Небольшая плавность при zoom.
   * При drag JS отключает transition.
   */
  transition:
    transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.3s ease;

  cursor: zoom-in;

  user-select: none;
  -webkit-user-select: none;

  -webkit-user-drag: none;
  -webkit-touch-callout: none;

  /*
   * Очень важно для нормального drag
   * на телефонах и планшетах.
   */
  touch-action: none;

  will-change: transform;

  /*
   * Не даём браузеру выделять/таскать
   * картинку как обычный элемент.
   */
  -webkit-tap-highlight-color: transparent;
}


/* Увеличенное состояние */

.lightbox img.zoomed {
  cursor: grab;

  /*
   * Никакого scale(2.5) здесь!
   * Реальный scale устанавливает JS.
   */
  max-width: 92vw;
  max-height: 85vh;
}

.lightbox img.zoomed:active {
  cursor: grabbing;
}


/* =========================================
   CLOSE
   ========================================= */

.lightbox__close {
  position: absolute;

  top: 24px;
  right: 24px;

  width: 48px;
  height: 48px;

  border-radius: 50%;

  background: rgba(0, 0, 0, 0.6);

  color: #fff;

  font-size: 32px;
  line-height: 1;

  display: flex;
  align-items: center;
  justify-content: center;

  transition:
    all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

  z-index: 2147483648;

  border:
    1px solid rgba(255, 255, 255, 0.2);
}

.lightbox__close:hover {
  background: #E5A600;

  color: #000;

  border-color: #E5A600;

  transform: rotate(90deg);
}


/* =========================================
   PREV / NEXT
   ========================================= */

.lightbox__prev,
.lightbox__next {
  position: absolute;

  top: 50%;

  transform: translateY(-50%);

  width: 64px;
  height: 64px;

  border-radius: 50%;

  background: rgba(0, 0, 0, 0.6);

  color: #FFFFFF;

  font-size: 40px;
  font-weight: 300;
  line-height: 1;

  display: flex;
  align-items: center;
  justify-content: center;

  transition:
    all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

  z-index: 2147483648;

  border:
    1px solid rgba(255, 255, 255, 0.2);
}

.lightbox__prev {
  left: 30px;
}

.lightbox__next {
  right: 30px;
}

.lightbox__prev:hover,
.lightbox__next:hover {
  background: #E5A600;

  color: #000000;

  border-color: #E5A600;

  transform:
    translateY(-50%)
    scale(1.1);

  box-shadow:
    0 0 20px rgba(229, 166, 0, 0.4);
}


/* =========================================
   ZOOM HINT
   ========================================= */

.lightbox__zoom-hint {
  position: absolute;

  bottom: 30px;
  left: 50%;

  transform: translateX(-50%);

  color:
    rgba(255, 255, 255, 0.6);

  font-size: 14px;

  pointer-events: none;

  transition:
    opacity 0.3s;

  z-index: 2147483648;
}


/*
 * Если картинка увеличена —
 * подсказку можно скрыть.
 */
.lightbox img.zoomed ~ .lightbox__zoom-hint {
  opacity: 0;
}


/* =========================================
   COUNTER
   ========================================= */

.lightbox__counter {
  position: absolute;

  top: 30px;
  left: 50%;

  transform: translateX(-50%);

  color:
    rgba(255, 255, 255, 0.7);

  font-size: 15px;

  font-weight: 500;

  letter-spacing: 1px;

  z-index: 2147483648;

  pointer-events: none;
}


/* =========================================
   RESPONSIVE LIGHTBOX
   ========================================= */

@media (max-width: 768px) {

  .lightbox__prev {
    left: 12px;

    width: 48px;
    height: 48px;

    font-size: 32px;
  }

  .lightbox__next {
    right: 12px;

    width: 48px;
    height: 48px;

    font-size: 32px;
  }

  .lightbox__close {
    top: 12px;
    right: 12px;

    width: 40px;
    height: 40px;

    font-size: 26px;
  }

  .lightbox__counter {
    top: 18px;

    font-size: 13px;
  }

  .lightbox img {
    max-width: 95vw;
    max-height: 80vh;
  }

  .lightbox__zoom-hint {
    bottom: 20px;

    font-size: 12px;
  }

}


@media (max-width: 480px) {

  .lightbox__prev {
    left: 8px;

    width: 40px;
    height: 40px;

    font-size: 26px;
  }

  .lightbox__next {
    right: 8px;

    width: 40px;
    height: 40px;

    font-size: 26px;
  }

  .lightbox__close {
    top: 10px;
    right: 10px;

    width: 36px;
    height: 36px;

    font-size: 22px;
  }

  .lightbox__counter {
    top: 16px;

    font-size: 12px;
  }

  .lightbox img {
    max-width: 98vw;
    max-height: 75vh;
  }

  .lightbox__zoom-hint {
    display: none;
  }

}

/* =========================================
   11. RESPONSIVE
   ========================================= */
@media (max-width: 1024px) {
  .product-card { gap: 40px; }
  .product-card__title { font-size: 40px; }
  .product-card__price { font-size: 37px; }

  .accessories__grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
  }

  .slider__slide { flex: 0 0 calc((100% - 48px) / 3); }
}

@media (max-width: 768px) {
  .container { padding: 0 20px; }

  .product-card {
    gap: 28px;
    padding-bottom: 56px;
  }
  .product-card__gallery,
  .product-card__info {
    flex: 1 1 100%;
  }

  .product-card__title { font-size: 32px; }
  .product-card__price { font-size: 32px; }
  .product-card__price-block {
    flex-direction: column;
    align-items: flex-start;
  }

  .product-card__row {
    flex-direction: column;
    gap: 8px;
  }
  .product-card__label {
    flex: 0 0 auto;
  }

  .product-card__gallery_grid { gap: 10px; }

  .accessories__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }
  .accessory__body { padding: 14px 14px 18px; }
  .accessory__title { font-size: 15px; }
  .accessory__desc { font-size: 13px; }
  .accessory__price { font-size: 17px; }

  .slider__slide { flex: 0 0 calc((100% - 24px) / 2); }
}

@media (max-width: 480px) {
  .container { padding: 0 14px; }
  .product-card__title { font-size: 28px; }
  .product-card__price { font-size: 28px; }
  .section__title { font-size: 24px; }

  .product-card__gallery_grid { gap: 8px; }

  .accessories__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .accessory__body { padding: 12px 12px 16px; gap: 4px; }
  .accessory__collection { font-size: 11px; letter-spacing: 1.2px; }
  .accessory__title { font-size: 14px; }
  .accessory__desc { display: none; }
  .accessory__price { font-size: 16px; padding-top: 8px; }

  .slider__slide { flex: 0 0 100%; }
}