/* ═══════════════════════════════════════════════════════════════
   СТРАНИЦА ТОВАРА
   ═══════════════════════════════════════════════════════════════ */

/* ─── Макет страницы ─────────────────────────────────────────── */

.product-page {
  display: flex;
  flex-direction: column;
  gap: 60px;
  padding-bottom: 140px;
}

/* ─── Главный блок: галерея + инфо ──────────────────────────── */

.product-main {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
}

/* ─── Галерея ────────────────────────────────────────────────── */

.product-gallery {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.product-gallery__main {
  background-color: #F4EDE4EE;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 118 / 95;
  overflow: hidden;
}

.product-gallery__main img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

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

.product-gallery__thumbs--has-slider {
  display: flex;
  overflow-x: auto;
  scrollbar-width: none;
  gap: 20px;
}

.product-gallery__thumbs--has-slider::-webkit-scrollbar {
  display: none;
}

.product-gallery__thumb {
  background: #F4EDE4EE;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  transition: border-color 0.15s;
}

.product-gallery__thumbs--has-slider .product-gallery__thumb {
  flex-shrink: 0;
  width: calc(33.33% - 14px);
}

.product-gallery__thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.product-gallery__thumb--active {
  border-color: var(--secondary);
}

.product-gallery__arrows {
  display: flex;
  justify-content: flex-end;
}

/* ─── Инфо о товаре ──────────────────────────────────────────── */

.product-info {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.product-info .specs-value {
  color: var(--neutral-caption);
}

.product-unit {
  color: var(--neutral-caption);
}

.product-price .amount,
.product-price .amount bdi {
  font-weight: inherit;
  font-size: inherit;
  line-height: inherit;
}

.product-mobile {
  display: none;
}

/* ─── Разделитель ────────────────────────────────────────────── */

.product-line {
  height: 1px;
  background-color: var(--sand);
}

/* ─── Вариации ───────────────────────────────────────────────── */

.product-variations {
  display: flex;
  flex-wrap: wrap;
  gap: 20px 60px;
}

.product-variations__group {
  display: flex;
  flex-direction: column;
  gap: 20px ;
}

.product-variations__btns {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.product-variation {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 102px;
  height: 36px;
  border: 1px solid var(--neutral-caption);
  cursor: pointer;
  color: var(--neutral-caption);
  transition: border-color 0.15s;
}

.product-variation:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.product-variation__active {
  border-color: var(--primary);
  color: var(--primary);
  cursor: default;
}

/* ─── Цветовые свотчи ────────────────────────────────────────── */

.product-variations__colors {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.product-color {
  display: block;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: var(--clr, #ccc);
  cursor: pointer;
  overflow: hidden;
  color: transparent;
  outline: 2px solid transparent;
  outline-offset: 2px;
  transition: outline-color 0.15s;
}

.product-color:hover {
  outline-color: var(--neutral-caption);
}

.product-color__active {
  outline-color: var(--sand);
  cursor: default;
}

.product-color__active:hover {
  outline-color: var(--sand);
}

/* ─── Кнопки действий ────────────────────────────────────────── */

.product-actions {
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.product-btn {
  max-width: 305px;
}


/* ─── Счётчик ────────────────────────────────────────────────── */

.product-count {
  display: grid;
  grid-template-columns: auto 1fr auto;
  border: 1px solid var(--neutral-caption);
  height: 52px;
  width: 203px;
}

.product-count__minus,
.product-count__plus {
  width: 44px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--primary);
  flex-shrink: 0;
  transition: background-color 0.15s;
}

.product-count__minus:hover,
.product-count__plus:hover {
  background-color: var(--neutral-border);
}

.product-count .js-qty-input {
  width: 100%;
  height: 100%;
  border-left: 1px solid var(--neutral-border);
  border-right: 1px solid var(--neutral-border);
  text-align: center;
  color: var(--primary);
}

.product-count .js-qty-input::-webkit-outer-spin-button,
.product-count .js-qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
}

.product-count .js-qty-input[type=number] {
  -moz-appearance: textfield;
}

.product-info > .btn {
  max-width: 100%;
  box-shadow: 0px 2px 4px 0px #00000040;

}

/* ═══════════════════════════════════════════════════════════════
   ВКЛАДКИ
   ═══════════════════════════════════════════════════════════════ */

.product-tabs-wrapper {
  display: flex;
  flex-direction: column;
  box-shadow: 0px 2px 20px 0px #0000001A;
  border: 1px solid #D8D8D8;
}

.product-tabs {
  display: flex;
  border-bottom: 1px solid #D8D8D8;
  padding: 0 10px 7px;
}

.product-tab {
  padding: 13px 24px 6px;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  color: var(--neutral-caption);
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.product-tab:hover {
  color: var(--primary);
}

.product-tab__active {
  border-bottom-color: var(--primary);
  color: var(--primary);
}

.product-panel {
  display: none;
  padding: 20px;
  border-top: none;
}

.product-panel--active {
  display: block;
}

.product-panel__text {
  color: #4B5563;
}

.product-panel__text * {
  color: #4B5563;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ─── Характеристики ─────────────────────────────────────────── */

.product-characteristics {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
}

.product-table {
  width: auto;
  min-width: 547px;
  border-collapse: collapse;
}

.product-row td {
  padding: 12px 20px;
  border: 1px solid #D8D8D8;
  vertical-align: top;
}

.product-row td:first-child {
  width: 274px;
}

/* ═══════════════════════════════════════════════════════════════
   С ЭТИМ ТОВАРОМ ПОКУПАЮТ
   ═══════════════════════════════════════════════════════════════ */

.relative {
  display: flex;
  flex-direction: column;
  gap: 60px;
}

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

.relative__arrows {
  display: none;
}

/* ═══════════════════════════════════════════════════════════════
   АДАПТИВ
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 1080px) {
  .product-main {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .product-gallery {
    max-width: 560px;
            justify-self: center;
  }


   .relative__arrows {
    display: flex;
  }

  .relative__grid {
    display: grid;
    width: 100%;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
  }

  .relative__grid .product-card {
    scroll-snap-align: start;
    width: 386px;
    flex-shrink: 0;
  }

  .relative__grid::-webkit-scrollbar {
    display: none;
  }

  .product-desktop {
    display: none;
  }

  .product-mobile {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .product-price {
    margin-top: 10px;
  }

  .product-line {
    display: none;
  }

  .product-info {
    gap: 20px;
  }

  .product-variations {
    flex-direction: column;
    width: 100%;
    gap: 20px;
  }

  .product-variation {
    height: 48px;
    width: 100%;
  }

  .product-variations__btns {
    display: flex;
    flex-direction: column;
    gap: 20px;
  }

  .product-variations__colors:has(.product-color:nth-child(3)) {
    justify-content: space-between;
  }



}

@media (max-width: 768px) {
  .product-page {
    gap: 40px;
    padding-top: 20px;
    padding-bottom: 60px;
  }

  .product-tab {
    padding: 12px 16px;
  }

  .product-panel {
    padding: 16px;
  }

  .product-actions {
    flex-direction: column;
    gap: 20px;
  }

  .product-count {
    width: 100%;
  }

  .product-btn {
    max-width: 100%;
  }

  .product-table {
    width: 100%;
    min-width: 0px;
  }

  .product-row td {
    padding: 12px 10px;
  }

  .product-row td:first-child {
    width: 140px;
  }
}

@media (max-width: 560px) {
  .product-actions {
    grid-template-columns: 1fr;
  }

  .product-actions > .btn:last-child {
    grid-column: 1;
  }

  .relative__grid {
    display: flex;
    overflow-x: auto;
    scrollbar-width: none;
    gap: 16px;
  }

  .relative__grid::-webkit-scrollbar {
    display: none;
  }

  .relative__grid .product-card {
    min-width: 240px;
    flex-shrink: 0;
  }

  .product-tabs {
    flex-direction: column;
    gap: 20px;
    align-items: center;
  }

  .product-tab {
    width: max-content;
  }
}
