/* ============================================================
   Страница карточки товара
   ============================================================ */

.product-head {
  margin-top: var(--s-5);
  margin-bottom: var(--s-6);
  display: flex;
  align-items: center;
  gap: var(--s-4);
}
.product-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-sm);
  color: var(--c-text-muted);
  transition: color var(--dur-fast) var(--ease);
}
.product-back:hover { color: var(--c-primary); }

/* ---------- Главный блок: галерея + инфо ---------- */
.product-main {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: var(--s-9);
  align-items: flex-start;
}

/* ---------- Галерея ---------- */
.gallery {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: var(--s-4);
}
.gallery__thumbs {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}
.gallery__thumb {
  width: 84px;
  height: 84px;
  border: 1px solid var(--c-border-soft);
  border-radius: var(--r-md);
  background: #fff;
  padding: 8px;
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease);
  display: flex;
  align-items: center;
  justify-content: center;
}
.gallery__thumb:hover { border-color: var(--c-border-strong); }
.gallery__thumb.is-active { border-color: var(--c-primary); border-width: 2px; padding: 7px; }
.gallery__thumb svg, .gallery__thumb img { width: 100%; height: 100%; object-fit: contain; }

.gallery__main {
  position: relative;
  background: var(--c-bg-soft);
  border-radius: var(--r-xl);
  padding: var(--s-9);
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.gallery__main svg, .gallery__main img {
  max-width: 70%;
  max-height: 70%;
  object-fit: contain;
}
.gallery__badge {
  position: absolute;
  top: var(--s-4);
  left: var(--s-4);
  background: var(--c-cta-dark);
  color: #fff;
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  padding: 6px 12px;
  border-radius: var(--r-sm);
}
.gallery__share {
  position: absolute;
  top: var(--s-4);
  right: var(--s-4);
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}
.gallery__share-btn {
  width: 36px; height: 36px;
  background: #fff;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--c-text-muted);
  border: 1px solid var(--c-border-soft);
  transition: color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.gallery__share-btn:hover { color: var(--c-primary); border-color: var(--c-primary); }

/* ---------- Инфо о товаре справа ---------- */
.product-info { }
.product-info__meta {
  display: flex;
  gap: var(--s-3);
  align-items: center;
  font-size: var(--fs-xs);
  color: var(--c-text-muted);
  margin-bottom: var(--s-3);
}
.product-info__sku { font-family: var(--ff-mono); }
.product-info__sku b { color: var(--c-text); font-weight: var(--fw-semibold); }
.product-info__brand {
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  color: var(--c-text-subtle);
}
.product-info__title {
  font-size: var(--fs-5xl);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-tight);
  line-height: 1.2;
  margin-bottom: var(--s-6);
}

.product-info__specs-mini {
  background: var(--c-bg-soft);
  border-radius: var(--r-lg);
  padding: var(--s-2) var(--s-5);
  margin-bottom: var(--s-6);
}
.product-info__specs-mini-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--s-3) 0;
  border-bottom: 1px solid var(--c-border-soft);
  font-size: var(--fs-sm);
}
.product-info__specs-mini-row:last-child { border-bottom: 0; }
.product-info__specs-mini-row .label { color: var(--c-text-muted); }
.product-info__specs-mini-row .value { font-weight: var(--fw-semibold); }

.product-info__price-box {
  border: 1px solid var(--c-border-soft);
  border-radius: var(--r-lg);
  padding: var(--s-5);
  margin-bottom: var(--s-4);
}
.product-info__price {
  font-size: var(--fs-6xl);
  font-weight: var(--fw-bold);
  line-height: 1;
  margin-bottom: var(--s-3);
}
.product-info__stock {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-sm);
  color: var(--c-success);
  font-weight: var(--fw-medium);
  margin-bottom: var(--s-4);
}
.product-info__stock::before {
  content: '';
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--c-success);
}

.product-info__buy {
  display: flex;
  gap: var(--s-3);
}

/* Стэппер количества */
.qty-stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--c-border-strong);
  border-radius: var(--r-md);
  height: var(--h-input);
  overflow: hidden;
}
.qty-stepper button {
  width: 44px; height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-xl);
  color: var(--c-text);
  transition: background var(--dur-fast) var(--ease);
}
.qty-stepper button:hover { background: var(--c-bg-soft); color: var(--c-primary); }
.qty-stepper input {
  width: 44px;
  height: 44px;
  border: 0;
  text-align: center;
  font-size: var(--fs-base);
  font-weight: var(--fw-semibold);
  background: transparent;
  outline: none;
  -moz-appearance: textfield;
}
.qty-stepper input::-webkit-outer-spin-button,
.qty-stepper input::-webkit-inner-spin-button { -webkit-appearance: none; }

.product-info__buy .btn { flex: 1; }

.product-info__links {
  display: flex;
  gap: var(--s-5);
  margin-top: var(--s-4);
  flex-wrap: wrap;
}
.product-info__links a,
.product-info__links .product-info__fav,
.product-info__links .product-info__compare,
.product-info__links .product-info__share {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-sm);
  color: var(--c-text-muted);
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
  transition: color var(--dur-fast) var(--ease);
}
.product-info__links a:hover,
.product-info__links .product-info__fav:hover,
.product-info__links .product-info__compare:hover,
.product-info__links .product-info__share:hover { color: var(--c-primary); }
.product-info__links .product-info__fav.is-active {
  color: var(--c-danger);
}
.product-info__links .product-info__fav.is-active svg {
  fill: var(--c-danger);
  stroke: var(--c-danger);
}
.product-info__links .product-info__compare.is-active {
  color: var(--c-primary);
}

/* ---------- Детали под главным блоком ---------- */
.product-details {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: var(--s-9);
  margin-top: var(--s-12);
  align-items: flex-start;
}
.product-details__main { }
.product-details__heading {
  font-size: var(--fs-3xl);
  font-weight: var(--fw-bold);
  margin-bottom: var(--s-4);
  letter-spacing: var(--ls-tight);
}
.product-details__desc {
  font-size: var(--fs-base);
  line-height: var(--lh-relax);
  color: var(--c-text);
  margin-bottom: var(--s-9);
}
.product-details__desc p { margin-bottom: var(--s-3); }
.product-details__desc ul { padding-left: 0; }
.product-details__desc li {
  padding-left: var(--s-4);
  position: relative;
  margin-bottom: 6px;
}
.product-details__desc li::before {
  content: '·';
  position: absolute;
  left: var(--s-2);
  color: var(--c-primary);
  font-weight: bold;
}

.specs-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: var(--s-9);
}
.specs-table tr { border-bottom: 1px solid var(--c-border-soft); }
.specs-table tr:nth-child(odd) td { background: var(--c-bg-soft); }
.specs-table td {
  padding: var(--s-3) var(--s-4);
  font-size: var(--fs-sm);
}
.specs-table td:first-child {
  color: var(--c-text-muted);
  width: 50%;
}
.specs-table td:last-child {
  font-weight: var(--fw-medium);
}

.product-docs {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}
.product-docs a {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-size: var(--fs-sm);
  color: var(--c-primary);
  padding: var(--s-2) 0;
  transition: color var(--dur-fast) var(--ease);
  width: fit-content;
}
.product-docs a:hover { color: var(--c-primary-hover); }
.product-docs a::before {
  content: '';
  width: 16px; height: 16px;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232C5281' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><path d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/><polyline points='14,2 14,8 20,8'/></svg>") center / contain no-repeat;
  flex-shrink: 0;
}

/* ---------- Сайдбар: «Поможем с подбором» ---------- */
.product-consult {
  background: var(--c-bg-soft);
  border-radius: var(--r-lg);
  padding: var(--s-6);
  position: sticky;
  top: calc(var(--h-header) + var(--s-4));
}
.product-consult__eyebrow {
  font-size: var(--fs-xs);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  font-weight: var(--fw-semibold);
  color: var(--c-text-muted);
  margin-bottom: var(--s-2);
}
.product-consult__title {
  font-size: var(--fs-xl);
  font-weight: var(--fw-bold);
  margin-bottom: var(--s-2);
  letter-spacing: var(--ls-tight);
}
.product-consult__text {
  font-size: var(--fs-sm);
  color: var(--c-text-muted);
  line-height: var(--lh-relax);
  margin-bottom: var(--s-4);
}
.product-consult .btn { width: 100%; }

/* ---------- Похожие товары ---------- */
.product-similar {
  margin-top: var(--s-14);
}

/* ============================================================
   Адаптив карточки товара
   ============================================================ */
@media (max-width: 1023px) {
  .product-main {
    grid-template-columns: 1fr;
    gap: var(--s-6);
  }
  .product-info__title { font-size: var(--fs-4xl); }
  .product-info__price { font-size: var(--fs-5xl); }
  .product-details {
    grid-template-columns: 1fr;
    gap: var(--s-6);
  }
  .product-consult { position: static; }
}

@media (max-width: 767px) {
  .gallery {
    grid-template-columns: 1fr;
  }
  .gallery__thumbs {
    flex-direction: row;
    overflow-x: auto;
    order: 2;
  }
  .gallery__main { order: 1; }
  .gallery__thumb { width: 64px; height: 64px; flex-shrink: 0; }
  .product-info__title { font-size: var(--fs-3xl); }
  .product-info__price { font-size: var(--fs-4xl); }
  .product-info__price-box { padding: var(--s-4); }
  .product-info__buy { flex-wrap: wrap; }
  .product-info__buy .btn { width: 100%; flex: none; }
  .specs-table td { padding: var(--s-2) var(--s-3); font-size: var(--fs-xs); }
}
