/*
 * Single product page. Spec: mockup 2 "Продукт" (desktop 1440, mobile 390),
 * style guide 2.2 (stepper), 2.5 (price, rating, variations), 2.6 (tabs), 2.7 (notices).
 * Tablet (768–1199) is derived: one column like mobile (the buy row doesn't fit
 * beside the gallery), with tabs and the normal buy row. Tokens only.
 */

.product-page {
  padding-top: var(--space-6);
}

/* ── Hero: gallery | info ──────────────────────────────────────────── */
.product-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-5);
  align-items: start;
  margin-top: var(--space-6);
}

@media (min-width: 768px) {
  .product-hero {
    gap: var(--space-8);
  }
}

@media (min-width: 1200px) {
  .product-hero {
    grid-template-columns: minmax(0, 1fr) var(--pdp-info-w);
    gap: var(--pdp-gap);
  }
}

/* ── Gallery ───────────────────────────────────────────────────────── */
.product-gallery {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-4);
}

@media (min-width: 1200px) {
  .product-gallery {
    position: sticky;
    top: var(--space-6);
  }
}

.product-gallery__thumbs {
  display: none;
  flex-direction: column;
  gap: var(--space-3);
  max-height: var(--gallery-h);
  margin: 0;
  padding: 0;
  overflow-y: auto;
  list-style: none;
  scrollbar-width: none;
}

.product-gallery__thumb {
  display: block;
  width: var(--gallery-thumb);
  height: var(--gallery-thumb);
  padding: 0;
  overflow: hidden;
  border: var(--gallery-thumb-border) solid transparent;
  border-radius: var(--radius-image);
  background: var(--color-image-bg);
  cursor: pointer;
}

.product-gallery__thumb[aria-current="true"] {
  border-color: var(--color-ink);
}

.product-gallery__thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  mix-blend-mode: multiply;
}

.product-gallery__stage {
  position: relative;
}

.product-gallery__track {
  display: flex;
  height: var(--gallery-h);
  overflow-x: auto;
  border-radius: var(--radius-panel);
  background: var(--color-image-bg);
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}

.product-gallery__track::-webkit-scrollbar {
  display: none;
}

.product-gallery__slide {
  display: flex;
  flex: 0 0 100%;
  align-items: center;
  justify-content: center;
  margin: 0;
  scroll-snap-align: start;
}

.product-gallery__image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  mix-blend-mode: multiply;
}

.product-gallery__image--none {
  display: block;
}

.product-gallery__badge {
  position: absolute;
  top: var(--space-5);
  left: var(--space-5);
  padding: var(--badge-l-pad);
  border-radius: var(--radius-badge-l);
  font-size: var(--fs-badge-l);
  pointer-events: none;
}

.product-gallery__wish {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--tap-min);
  height: var(--tap-min);
  padding: 0;
  border: 0;
  border-radius: var(--radius-round);
  background: var(--color-surface);
  color: var(--color-ink);
  cursor: pointer;
}

.product-gallery__wish .icon {
  width: var(--icon-sm);
  height: var(--icon-sm);
}

.product-gallery__zoom {
  position: absolute;
  right: var(--space-5);
  bottom: var(--space-5);
  height: var(--gallery-pill-h);
  padding-inline: var(--space-4);
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--color-surface);
  color: var(--color-ink);
  font-size: var(--fs-small);
  font-weight: var(--fw-bold);
  cursor: zoom-in;
}

.product-gallery__dots {
  position: absolute;
  right: 0;
  bottom: var(--space-4);
  left: 0;
  display: flex;
  justify-content: center;
  gap: var(--space-2);
  pointer-events: none;
}

.product-gallery__dot {
  width: var(--gallery-dot);
  height: var(--gallery-dot);
  border-radius: var(--radius-tile-sm);
  background: var(--color-dot);
  transition: width var(--dur-base) var(--ease-out), background var(--dur-base) var(--ease-out);
}

.product-gallery__dot.is-active {
  width: var(--gallery-dot-active);
  background: var(--color-ink);
}

/* Desktop: thumbnails column, counter pill, ♡ moves next to the buy button */
@media (min-width: 1200px) {
  .product-gallery {
    grid-template-columns: var(--gallery-thumb) minmax(0, 1fr);
  }

  .product-gallery:not(:has(.product-gallery__thumbs)) {
    grid-template-columns: minmax(0, 1fr);
  }

  .product-gallery__thumbs {
    display: flex;
  }

  .product-gallery__dots {
    display: none;
  }
}

/* ♡ on the photo only on phones; tablet/desktop have it next to the buy button */
@media (min-width: 768px) {
  .product-gallery__wish {
    display: none;
  }
}

/* Tablet/mobile: no counter pill in the mockup (the dots show the position);
   tapping a photo opens the zoom view instead (product.js). */
@media (max-width: 1199px) {
  .product-gallery__zoom {
    display: none;
  }

  .js .product-gallery__slide {
    cursor: zoom-in;
  }
}

@media (max-width: 767px) {
  .product-gallery__badge {
    top: var(--space-3);
    left: var(--space-3);
  }

  .product-gallery__track {
    border-radius: var(--radius-panel);
  }
}

/* ── Lightbox ──────────────────────────────────────────────────────── */
.lightbox {
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--color-surface);
  color: var(--color-ink);
}

.lightbox::backdrop {
  background: var(--color-scrim);
}

.lightbox[open] {
  display: flex;
  flex-direction: column;
}

.lightbox__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
}

.lightbox__counter {
  font-family: var(--font-heading);
  font-weight: var(--fw-bold);
}

.lightbox__track {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.lightbox__slide {
  display: flex;
  flex: 0 0 100%;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  scroll-snap-align: start;
}

.lightbox__slide img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.lightbox__nav {
  position: absolute;
  top: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--lightbox-nav);
  height: var(--lightbox-nav);
  border: var(--border-field);
  border-radius: var(--radius-round);
  background: var(--color-surface);
  color: var(--color-ink);
  font-family: var(--font-heading);
  font-size: var(--fs-h4);
  font-weight: var(--fw-bold);
  box-shadow: var(--shadow-icon);
  transform: translateY(-50%);
  cursor: pointer;
}

.lightbox__nav--prev { left: var(--space-4); }
.lightbox__nav--next { right: var(--space-4); }

.lightbox__nav:disabled {
  color: var(--color-disabled);
  cursor: default;
}

/* ── Info column ───────────────────────────────────────────────────── */
.product-summary {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  min-width: 0;
}

.product-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-2);
  color: var(--color-muted);
  font-size: var(--fs-small);
  font-weight: var(--fw-semibold);
}

.product-meta__brand {
  color: var(--color-ink);
  font-family: var(--font-heading);
  font-weight: var(--fw-extrabold);
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
  text-underline-offset: .2em;
}

.product-title {
  margin: 0;
  font-size: var(--fs-h2);
  font-weight: var(--fw-extrabold);
  line-height: var(--lh-heading);
  text-wrap: balance;
}

.product-rating {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  margin: 0;
  font-size: var(--fs-body-s);
  font-weight: var(--fw-semibold);
}

.product-rating__link {
  color: var(--color-muted);
}

/* Price block (guide 2.5) */
.product-price {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3) var(--space-4);
}

.product-price__current {
  font-family: var(--font-heading);
  font-size: var(--fs-price-l);
  font-weight: var(--fw-black);
  line-height: var(--lh-tight);
}

.product-price__old {
  color: var(--color-muted); /* AA contrast (subtle is for large/decorative text only) */
  font-size: var(--fs-price-old);
  font-weight: var(--fw-semibold);
  text-decoration: line-through;
}

.product-price__save {
  padding: var(--save-pad);
  border-radius: var(--radius-pill);
  background: var(--tint-orange);
  font-size: var(--fs-small);
  font-weight: var(--fw-bold);
}

.product-price__save-short {
  display: none;
}

.product-price.is-out-of-stock .product-price__current {
  color: var(--color-subtle);
}

/* Age + stock */
.product-facts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--fs-body-s);
  font-weight: var(--fw-semibold);
}

.product-facts__age {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
}

.age-tile {
  padding: var(--age-tile-pad);
  border-radius: var(--radius-tile);
  color: var(--color-ink);
  font-family: var(--font-heading);
  font-size: var(--fs-age-tile);
  font-weight: var(--fw-black);
  line-height: var(--lh-snug);
  transform: rotate(var(--tile-rotate-badge));
}

.age-tile--yellow { background: var(--tile-yellow); }
.age-tile--lime   { background: var(--tile-lime); }
.age-tile--orange { background: var(--tile-orange); }
.age-tile--teal   { background: var(--tile-teal); }
.age-tile--blue   { background: var(--tile-blue); }
.age-tile--green  { background: var(--tile-green); }

.product-facts__sep {
  width: 1px;
  height: var(--facts-sep-h);
  background: var(--color-border);
}

/* "2 бр. в магазин Елин Пелин" (inc/store-stock.php) */
.product-facts__stores {
  color: var(--color-text-2);
}

.stock-status--l {
  color: var(--color-ink);
  font-size: var(--fs-body-s);
}

.stock-status--out {
  color: var(--color-muted);
}

.stock-status--backorder::before {
  background: var(--color-warning);
}

.product-divider {
  width: 100%;
  height: 1px;
  margin: 0;
  border: 0;
  background: var(--color-line);
}

/* Safety info (GPSR) */
.product-safety {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.product-safety__label {
  font-weight: var(--fw-extrabold);
}

.product-safety__details {
  border-radius: var(--radius-input);
  background: var(--color-surface);
}

.product-safety__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--tap-min);
  padding: var(--space-2) var(--space-4);
  font-family: var(--font-heading);
  font-size: var(--fs-small);
  font-weight: var(--fw-bold);
  list-style: none;
  cursor: pointer;
}

.product-safety__summary::-webkit-details-marker {
  display: none;
}

.product-safety__summary::after {
  content: "+";
  color: var(--color-muted);
  font-size: var(--fs-h5);
  font-weight: var(--fw-regular);
}

.product-safety__details[open] .product-safety__summary::after {
  content: "−";
}

.product-safety__list {
  display: grid;
  gap: var(--space-1) var(--space-4);
  margin: 0;
  padding: 0 var(--space-4) var(--space-4);
  font-size: var(--fs-small);
}

.product-safety__list dt {
  color: var(--color-muted);
  font-weight: var(--fw-semibold);
}

.product-safety__list dd {
  margin: 0 0 var(--space-2);
  font-weight: var(--fw-semibold);
}

/* ── Buy box: options, quantity, button, ♡ ─────────────────────────── */
.product-buy {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.product-buy form.cart {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  margin: 0;
}

/* The row: [− 1 +] [Добави в количката] [♡] */
.product-buy form.cart:not(.variations_form):not(.grouped_form),
.product-buy .woocommerce-variation-add-to-cart {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-1);
}

.single_add_to_cart_button {
  display: inline-flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  min-width: 0;
  height: var(--btn-h-l);
  padding-inline: var(--btn-pad-m);
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--color-cta);
  color: var(--color-on-cta);
  font-family: var(--font-heading);
  font-size: var(--fs-btn-l);
  font-weight: var(--fw-extrabold);
  white-space: nowrap;
  box-shadow: var(--shadow-cta-lg);
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}

/* Cart icon (same path as the inline SVG icons) */
.single_add_to_cart_button::before {
  content: "";
  flex: none;
  width: var(--icon-size);
  height: var(--icon-size);
  background: currentColor;
  -webkit-mask: url("../img/icon-cart.svg") center / contain no-repeat;
  mask: url("../img/icon-cart.svg") center / contain no-repeat;
}

.single_add_to_cart_button:hover  { background: var(--color-cta-hover); }
.single_add_to_cart_button:active { background: var(--color-cta-active); transform: translateY(1px); }

.single_add_to_cart_button.disabled,
.single_add_to_cart_button:disabled {
  background: var(--color-line);
  color: var(--color-disabled);
  box-shadow: none;
  cursor: not-allowed;
}

.single_add_to_cart_button.is-loading {
  opacity: .7;
  pointer-events: none;
}

.product-buy__wish {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: var(--wish-btn);
  height: var(--wish-btn);
  padding: 0;
  border: var(--border-w-strong) solid var(--color-border);
  border-radius: var(--radius-round);
  background: var(--color-surface);
  color: var(--color-ink);
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease-out);
}

.product-buy__wish:hover {
  border-color: var(--color-ink);
}

.product-buy__wish[aria-pressed="true"] .icon,
.product-gallery__wish[aria-pressed="true"] .icon {
  fill: currentColor;
}

/* Variable products: hide WooCommerce's own price/stock lines (mirrored into the
   theme's price block and stock line by product.js). */
.product-buy .woocommerce-variation-price,
.product-buy .woocommerce-variation-availability {
  display: none;
}

.product-buy .woocommerce-variation-description {
  color: var(--color-text-2);
  font-size: var(--fs-body-s);
}

.product-buy .single_variation_wrap {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

/* Fallback when no variation plugin replaces the selects (guide 2.2 select) */
.product-buy table.variations {
  width: 100%;
  border-collapse: collapse;
}

.product-buy table.variations th,
.product-buy table.variations td {
  display: block;
  padding: 0;
  text-align: left;
}

.product-buy table.variations th {
  margin-bottom: var(--space-2);
  font-size: var(--fs-body-s);
  font-weight: var(--fw-bold);
}

.product-buy table.variations tr + tr th {
  margin-top: var(--space-4);
}

.product-buy table.variations select {
  width: 100%;
  height: var(--btn-h-m);
  padding-inline: var(--space-4);
  border: var(--border-field);
  border-radius: var(--radius-input);
  background: var(--color-input-bg);
}

.reset_variations {
  display: inline-block;
  margin-top: var(--space-2);
  color: var(--color-muted);
  font-size: var(--fs-small);
  font-weight: var(--fw-bold);
}

/* "Размер: 16 инча" above the variation buttons */
.product-options__label {
  margin: 0 0 calc(var(--space-2) * -1);
  font-size: var(--fs-body-s);
  font-weight: var(--fw-bold);
}

.product-options__value {
  color: var(--color-muted);
  font-weight: var(--fw-semibold);
}

/* ACV (Aproxian Cooler Variations): one button per variation, styled as the guide's
   size buttons (2.5): white with a border, selected = ink fill, unavailable = struck out. */
.product-summary .acv-selector-wrap {
  margin: 0;
}

.product-summary .acv-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.product-summary .acv-card {
  display: flex;
  align-items: center;
  min-width: var(--option-min-w);
  min-height: var(--option-h);
  border: var(--border-w-strong) solid var(--color-border);
  border-radius: var(--radius-option);
  background: var(--color-surface);
  color: var(--color-ink);
  box-shadow: none;
  transition: border-color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
}

.product-summary .acv-card:not(.acv-out-of-stock):hover {
  border-color: var(--color-ink);
}

.product-summary .acv-card.is-selected {
  border-color: var(--color-ink);
  background: var(--color-ink);
  box-shadow: none;
}

.product-summary .acv-card.is-selected .acv-card-label,
.product-summary .acv-card.is-selected .acv-card-price {
  color: var(--color-bg);
}

.product-summary .acv-card.is-selected .acv-card-price del {
  color: var(--color-disabled);
}

.product-summary .acv-card.acv-out-of-stock {
  opacity: 1;
}

.product-summary .acv-card.acv-out-of-stock .acv-card-label {
  color: var(--color-disabled);
  text-decoration: line-through;
}

.product-summary .acv-card-row {
  width: 100%;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-4);
}

.product-summary .acv-card-img {
  width: var(--tap-min);
  height: var(--tap-min);
  border-radius: var(--radius-tile-lg);
  background: var(--color-image-bg);
}

.product-summary .acv-card-img img {
  object-fit: contain;
  mix-blend-mode: multiply;
}

.product-summary .acv-card[data-has-own-image="0"] .acv-card-img {
  display: none;
}

.product-summary .acv-card-body {
  align-items: center;
  gap: 0;
  width: 100%;
  text-align: center;
}

.product-summary .acv-card-label {
  color: var(--color-ink);
  font-family: var(--font-heading);
  font-size: var(--fs-body-m);
  font-weight: var(--fw-bold);
}

.product-summary .acv-card-price {
  color: var(--color-muted);
  font-size: var(--fs-caption);
  font-weight: var(--fw-semibold);
}

.product-summary .acv-card-price del {
  color: var(--color-muted); /* AA contrast (subtle is for large/decorative text only) */
}

.product-summary .acv-card-price ins {
  text-decoration: none;
}

.product-summary .acv-oos-label {
  color: var(--color-muted);
  font-size: var(--fs-caption);
  letter-spacing: 0;
  text-transform: none;
}

.product-summary .acv-card:focus-visible {
  outline: 2px solid transparent;
  box-shadow: var(--focus-ring);
}

/* AMVS (several variations at once): same card language */
.product-summary .amvs-selector-wrap {
  margin: 0;
}

.product-summary .amvs-card {
  border: var(--border-w-strong) solid var(--color-border);
  border-radius: var(--radius-option);
  background: var(--color-surface);
}

.product-summary .amvs-card.is-selected {
  border-color: var(--color-ink);
  box-shadow: none;
}

.product-summary .amvs-card-label {
  font-family: var(--font-heading);
  font-weight: var(--fw-bold);
}

.product-summary .amvs-qty-row {
  border: var(--border-w-strong) solid var(--color-border);
  border-radius: var(--radius-pill);
}

.product-summary .amvs-actions button,
.product-summary .amvs-add-to-cart {
  height: var(--btn-h-l);
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--color-cta);
  color: var(--color-on-cta);
  font-family: var(--font-heading);
  font-size: var(--fs-btn-l);
  font-weight: var(--fw-extrabold);
  box-shadow: var(--shadow-cta-lg);
}

.product-compare {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--tap-min);
  margin-top: calc(var(--space-3) * -1);
  padding: 0;
  border: 0;
  background: none;
  color: var(--color-muted);
  font-size: var(--fs-small);
  font-weight: var(--fw-semibold);
  cursor: pointer;
}

.product-compare .icon {
  width: var(--icon-xxs);
  height: var(--icon-xxs);
}

.product-compare[aria-pressed="true"] {
  color: var(--color-ink);
}

/* Delivery / service rows */
.product-services {
  margin: 0;
  padding: var(--service-pad);
  border-radius: var(--radius-card);
  background: var(--color-surface);
  list-style: none;
}

.product-services__row {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding-block: var(--service-row-pad);
}

.product-services__row + .product-services__row {
  border-top: var(--border-hairline);
}

.product-services__tile {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: var(--service-tile);
  height: var(--service-tile);
  border-radius: var(--radius-tile-lg);
}

.product-services__row:nth-child(odd)  .product-services__tile { transform: rotate(var(--tile-rotate-badge)); }
.product-services__row:nth-child(even) .product-services__tile { transform: rotate(var(--tile-rotate-age)); }

.product-services__tile .icon {
  width: var(--icon-sm);
  height: var(--icon-sm);
}

.product-services__tile--yellow { background: var(--tint-yellow); }
.product-services__tile--blue   { background: var(--tint-blue); }
.product-services__tile--teal   { background: var(--tint-teal); }
.product-services__tile--lime   { background: var(--tint-lime); }

.product-services__text {
  display: flex;
  flex-direction: column;
}

.product-services__title {
  font-family: var(--font-heading);
  font-size: var(--fs-body-s);
  font-weight: var(--fw-bold);
}

.product-services__sub {
  color: var(--color-muted);
  font-size: var(--fs-small);
}

/* ── Tabs (desktop/tablet) / accordions (mobile) ───────────────────── */
.product-tabs {
  margin-top: var(--section-gap);
}

.product-tabs__list {
  display: none;
  gap: var(--space-2);
  overflow-x: auto;
  border-bottom: var(--border-w-strong) solid var(--color-line);
  scrollbar-width: none;
}

.product-tabs__tab {
  display: flex;
  align-items: center;
  height: var(--tab-h);
  margin-bottom: calc(var(--border-w-strong) * -1);
  padding: 0 var(--space-6);
  border: 0;
  border-bottom: var(--border-tab);
  border-bottom-color: transparent;
  background: none;
  color: var(--color-muted);
  font-family: var(--font-heading);
  font-size: var(--fs-h5);
  font-weight: var(--fw-bold);
  white-space: nowrap;
  cursor: pointer;
}

.product-tabs__tab:hover {
  color: var(--color-ink);
}

.product-tabs__tab[aria-selected="true"] {
  border-bottom-color: var(--color-ink);
  color: var(--color-ink);
}

.product-tabs__heading {
  margin: 0;
  font-size: inherit;
}

.product-tabs__toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: var(--accordion-h);
  padding: 0;
  border: 0;
  border-bottom: var(--border-hairline);
  background: none;
  color: var(--color-ink);
  font-family: var(--font-heading);
  font-size: var(--fs-accordion);
  font-weight: var(--fw-extrabold);
  text-align: left;
  cursor: pointer;
}

.product-tabs__icon::before {
  content: "+";
  color: var(--color-subtle);
  font-size: var(--fs-accordion-icon);
  font-weight: var(--fw-regular);
}

.product-tabs__toggle[aria-expanded="true"] .product-tabs__icon::before {
  content: "−";
}

.product-tabs__body {
  padding-block: var(--space-5);
}

/* Without JS every section stays open and the toggles act as headings */
html:not(.js) .product-tabs__icon {
  display: none;
}

.js .product-tabs__body[hidden] {
  display: none;
}

@media (min-width: 768px) {
  .js .product-tabs__list {
    display: flex;
  }

  .js .product-tabs__heading {
    display: none;
  }

  .js .product-tabs__body {
    min-height: var(--tabs-min-h);
    padding-block: var(--space-8) 0;
  }
}

/* Description */
.product-description {
  max-width: var(--measure);
  color: var(--color-text-2);
  font-size: var(--fs-body-l);
  line-height: var(--lh-long);
  text-wrap: pretty;
}

.product-description > :first-child { margin-top: 0; }
.product-description > :last-child  { margin-bottom: 0; }

.product-description p {
  margin: 0 0 var(--space-4);
}

.product-description ul {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin: 0 0 var(--space-4);
  padding: 0;
  color: var(--color-ink);
  font-size: var(--fs-body-m);
  font-weight: var(--fw-semibold);
  list-style: none;
}

.product-description ul li {
  position: relative;
  padding-left: var(--space-7);
}

/* Teal rotated square bullet (mockup 2) */
.product-description ul li::before {
  content: "";
  position: absolute;
  top: .35em;
  left: 0;
  width: var(--icon-xxs);
  height: var(--icon-xxs);
  border-radius: var(--radius-marker);
  background: var(--tile-teal);
  transform: rotate(var(--tile-rotate-marker));
}

.product-description ol {
  margin: 0 0 var(--space-4);
  padding-left: var(--space-6);
}

.product-description img {
  border-radius: var(--radius-image);
}

.product-description h2,
.product-description h3,
.product-description h4 {
  margin: var(--space-6) 0 var(--space-3);
  color: var(--color-ink);
  font-size: var(--fs-h4);
}

/* Specs table */
.product-specs {
  max-width: var(--specs-max-w);
  margin: 0;
  overflow: hidden;
  border-radius: var(--radius-card);
  background: var(--color-surface);
  font-size: var(--fs-body-m);
}

.product-specs__row {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  gap: var(--space-4);
  padding: var(--space-4) var(--space-6);
}

.product-specs__row:nth-child(odd) {
  background: var(--color-surface-warm);
}

.product-specs dt {
  color: var(--color-muted);
  font-weight: var(--fw-semibold);
}

.product-specs dd {
  margin: 0;
  font-weight: var(--fw-bold);
}

@media (min-width: 768px) {
  .product-specs__row {
    grid-template-columns: var(--specs-key-w) minmax(0, 1fr);
  }
}

@media (max-width: 767px) {
  .product-specs__row {
    padding: var(--space-3) var(--space-4);
  }
}

/* ── Reviews ───────────────────────────────────────────────────────── */
.reviews {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-6);
  align-items: start;
}

@media (min-width: 1200px) {
  .reviews {
    grid-template-columns: var(--reviews-aside-w) minmax(0, 1fr);
    gap: var(--space-10);
  }
}

.reviews__summary {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-6);
  border-radius: var(--radius-card);
  background: var(--color-surface);
}

.reviews__score {
  font-family: var(--font-heading);
  font-size: var(--fs-review-score);
  font-weight: var(--fw-black);
  line-height: 1;
}

.reviews__empty-title {
  font-family: var(--font-heading);
  font-size: var(--fs-h4);
  font-weight: var(--fw-extrabold);
}

.reviews__count,
.reviews__note {
  margin: 0;
  color: var(--color-muted);
  font-size: var(--fs-body-s);
}

.reviews__write {
  height: var(--btn-h-s);
  margin-top: var(--space-2);
}

.reviews__main {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  min-width: 0;
}

.reviews__list {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin: 0;
  padding: 0;
  list-style: none;
}

.review__card {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-5) var(--space-6);
  border-radius: var(--radius-card);
  background: var(--color-surface);
}

.review__head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-2);
}

.review__name {
  font-family: var(--font-heading);
  font-size: var(--fs-body-m);
  font-weight: var(--fw-bold);
}

.review__date {
  color: var(--color-muted); /* AA contrast (subtle is for large/decorative text only) */
  font-size: var(--fs-body-s);
}

.review__stars,
.review__verified,
.review__pending {
  margin: 0;
}

.review__verified,
.review__pending {
  color: var(--color-muted);
  font-size: var(--fs-small);
  font-weight: var(--fw-semibold);
}

.review__text {
  color: var(--color-text-2);
  font-size: var(--fs-body-m);
  line-height: var(--lh-body);
}

.review__text p {
  margin: 0;
}

.reviews__pagination ul {
  display: flex;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Review form */
.reviews__form {
  padding: var(--space-6);
  border-radius: var(--radius-card);
  background: var(--color-surface);
}

.js .reviews__form[hidden] {
  display: none;
}

.reviews__form-title {
  margin: 0 0 var(--space-4);
  font-size: var(--fs-h4);
}

.reviews__form .comment-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.reviews__form .form-submit {
  margin: 0;
}

.reviews__form #cancel-comment-reply-link {
  margin-left: var(--space-3);
  font-size: var(--fs-small);
}

/* Star rating input: radio buttons 1–5 */
.rating-input {
  margin: 0;
  padding: 0;
  border: 0;
}

.rating-input legend {
  margin-bottom: var(--space-2);
  padding: 0;
  font-size: var(--fs-small);
  font-weight: var(--fw-bold);
}

.rating-input__stars {
  display: inline-flex;
  gap: var(--space-1);
}

.rating-input__stars input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.rating-input__stars label {
  color: var(--color-star-empty);
  font-size: var(--rating-star);
  line-height: 1;
  cursor: pointer;
}

/* Fill the stars up to the checked one; while hovering, up to the hovered one */
.rating-input__stars:has(input:nth-of-type(1):checked) label:nth-of-type(-n+1),
.rating-input__stars:has(input:nth-of-type(2):checked) label:nth-of-type(-n+2),
.rating-input__stars:has(input:nth-of-type(3):checked) label:nth-of-type(-n+3),
.rating-input__stars:has(input:nth-of-type(4):checked) label:nth-of-type(-n+4),
.rating-input__stars:has(input:nth-of-type(5):checked) label:nth-of-type(-n+5) {
  color: var(--color-star);
}

@media (hover: hover) {
  .rating-input__stars:hover label {
    color: var(--color-star);
  }

  .rating-input__stars:hover label:hover ~ label {
    color: var(--color-star-empty);
  }
}

.rating-input__stars input:focus-visible + label {
  border-radius: var(--radius-tile);
  box-shadow: var(--focus-ring);
}

/* ── "Подобни продукти" ────────────────────────────────────────────── */
.product-similar {
  padding-block: var(--space-11) var(--space-13);
}

@media (max-width: 767px) {
  .product-similar {
    padding-block: var(--space-6) var(--space-8);
  }

  /* Swipeable row of small cards (mockup 2 mobile) */
  .product-grid--row {
    display: flex;
    gap: var(--space-3);
    margin-inline: calc(var(--container-pad) * -1);
    padding-inline: var(--container-pad);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: var(--container-pad);
    scrollbar-width: none;
  }

  .product-grid--row > li {
    flex: 0 0 var(--similar-card-w);
    scroll-snap-align: start;
  }
}

@media (min-width: 768px) and (max-width: 1199px) {
  /* Tablet: 3 columns, the 4th and 5th wrap */
  .product-grid--row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ── Mobile sticky buy bar ─────────────────────────────────────────── */
.sticky-buy {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4) calc(var(--space-3) + env(safe-area-inset-bottom));
  border-top: var(--border-hairline);
  background: var(--color-surface);
  box-shadow: var(--shadow-sticky);
}

.sticky-buy[hidden] {
  display: none;
}

.sticky-buy__price {
  display: flex;
  flex: none;
  flex-direction: column;
}

.sticky-buy__old {
  color: var(--color-muted); /* AA contrast (subtle is for large/decorative text only) */
  font-size: var(--fs-caption);
  font-weight: var(--fw-semibold);
  text-decoration: line-through;
}

.sticky-buy__current {
  font-family: var(--font-heading);
  font-size: var(--fs-sticky-price);
  font-weight: var(--fw-black);
  line-height: var(--lh-snug);
}

.sticky-buy__from {
  color: var(--color-muted);
  font-family: var(--font-body);
  font-size: var(--fs-small);
  font-weight: var(--fw-semibold);
}

.sticky-buy__btn {
  flex: 1;
  height: var(--sticky-btn-h);
  font-size: var(--fs-btn-l);
  font-weight: var(--fw-extrabold);
}

.sticky-buy__btn .icon {
  width: var(--icon-sm);
  height: var(--icon-sm);
}

/* ── Mobile layout (mockup 2, 390) ─────────────────────────────────── */
@media (max-width: 767px) {
  .product-page {
    padding-top: 0;
  }

  /* The header's "‹" replaces the breadcrumbs on phones */
  .product-page > .breadcrumbs {
    display: none;
  }

  .product-hero {
    margin-top: 0;
  }

  .product-summary {
    gap: var(--space-4);
  }

  .product-meta__brand {
    text-decoration: none;
  }

  .product-price {
    align-items: baseline;
    gap: var(--space-3);
  }

  .product-price__save-long {
    display: none;
  }

  .product-price__save-short {
    display: inline;
  }

  .product-facts {
    gap: var(--space-2) var(--space-3);
  }

  .product-facts__sep {
    display: none;
  }

  .product-facts__age::after {
    content: "·";
  }

  .product-divider {
    display: none;
  }

  /* With JS the sticky bar is the buy button on phones (product.js adds the class) */
  .has-sticky-buy .product-buy form.cart:not(.variations_form):not(.grouped_form),
  .has-sticky-buy .product-buy .woocommerce-variation-add-to-cart {
    display: none;
  }

  body.has-sticky-buy {
    padding-bottom: calc(var(--sticky-btn-h) + var(--space-8));
  }

  /* Toasts sit above the sticky bar */
  body.has-sticky-buy .toast-region {
    bottom: calc(var(--sticky-btn-h) + var(--space-8));
  }

  .product-compare {
    display: none;
  }

  .product-tabs {
    margin-top: var(--space-2);
  }
}

/* The zoom view covers the page: stop the page behind it from scrolling */
html:has(.lightbox[open]) {
  overflow: hidden;
}

/* Review form: "remember me" checkbox (guide 2.2 checkbox) */
.comment-form-cookies-consent {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin: 0;
  color: var(--color-text-2);
  font-size: var(--fs-small);
}

.comment-form-cookies-consent input {
  flex: none;
  width: var(--check);
  height: var(--check);
  margin: 0;
  accent-color: var(--color-ink);
}
