/* ==========================================================================
   Product page
   Mobile: title → gallery → info. Desktop: gallery on the left, title and
   info stacked on the right.
   ========================================================================== */
.product-page {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    "head"
    "gallery"
    "info"
    "lead";
  gap: 24px;
  margin-top: 28px;
  margin-bottom: 64px;
}

.product-page__head {
  grid-area: head;
}

.product-page__title {
  max-width: 640px;
  margin-bottom: 10px;
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: clamp(26px, 3vw, 40px);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.product-page__meta {
  font-size: 13px;
  color: var(--color-text-muted);
}

.product-page__sku {
  color: var(--color-text-light);
}

.product-page__gallery {
  grid-area: gallery;
}

.product-page__info {
  grid-area: info;
}

/* Price: base retail price + wholesale "from" price */
.product-price {
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--color-border);
}

.product-price__base {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  margin-bottom: 12px;
}

.product-price__value {
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: clamp(28px, 2.6vw, 36px);
  line-height: 1;
  letter-spacing: -0.02em;
}

.product-price__from {
  font-size: 0.6em;
  color: var(--color-text-muted);
}

.product-price__label {
  font-size: 14px;
  color: var(--color-text-muted);
}




.product-price__star {
  margin-left: 2px;
  color: var(--color-accent);
}

/* "* Скидки и промо-программы" — expands the panel below */
.product-price__promo-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  font-size: 14px;
  text-align: left;
  color: var(--color-text-light);
}

.product-price__promo-toggle .product-price__star {
  display: inline-block;
  font-size: 18px;
  line-height: 1;
  animation: price-star-pulse 2.4s ease-in-out infinite;
}

.product-price__promo-toggle[aria-expanded="true"] .product-price__star {
  animation: none;
}

.product-price__promo-label {
  border-bottom: 1px dashed var(--color-text-muted);
  transition: border-color 0.2s ease;
}

.product-price__promo-toggle:hover .product-price__promo-label {
  border-bottom-color: var(--color-text-light);
}

.product-price__chevron {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  color: var(--color-text-muted);
  transition: transform 0.3s ease;
}

.product-price__promo-toggle[aria-expanded="true"] .product-price__chevron {
  transform: rotate(180deg);
}

/* Height animates via grid rows 0fr → 1fr, so it fits any text length
   on any screen. visibility keeps the hidden button out of the tab order. */
.product-price__promo {
  display: grid;
  grid-template-rows: 0fr;
  visibility: hidden;
  transition:
    grid-template-rows 0.4s cubic-bezier(0.2, 0.7, 0.3, 1),
    visibility 0s linear 0.4s;
}

.product-price__promo.is-open {
  grid-template-rows: 1fr;
  visibility: visible;
  transition:
    grid-template-rows 0.4s cubic-bezier(0.2, 0.7, 0.3, 1),
    visibility 0s;
}

.product-price__promo-clip {
  min-height: 0;
  overflow: hidden;
}

.product-price__promo-box {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  margin-top: 14px;
  padding: 20px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg-elevated);
  opacity: 0;
  transform: translateY(-8px);
  transition:
    opacity 0.3s ease,
    transform 0.4s cubic-bezier(0.2, 0.7, 0.3, 1);
}

/* soft accent glow in the corner, same idea as .glow-card */
.product-price__promo-box::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(
    120% 140% at 100% 0%,
    rgba(233, 105, 18, 0.18) 0%,
    transparent 60%
  );
}

.product-price__promo.is-open .product-price__promo-box {
  opacity: 1;
  transform: none;
  transition-delay: 0.08s;
}

.product-price__promo-text {
  font-size: 14px;
  line-height: 1.55;
  color: var(--color-text-light);
}

.product-price__promo-text a {
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.product-price__promo-note {
  margin-top: 12px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--color-text-muted);
}

@keyframes price-star-pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.55;
    transform: scale(1.25);
  }
}

@media (prefers-reduced-motion: reduce) {
  .product-price__promo,
  .product-price__promo.is-open,
  .product-price__promo-box,
  .product-price__chevron {
    transition: none;
  }

  .product-price__promo-toggle .product-price__star {
    animation: none;
  }
}

/* Description, shown in full. Mobile: last, after the buttons.
   Desktop: under the gallery, filling the space next to the taller info. */
.product-lead {
  grid-area: lead;
  margin-top: 16px;
}

.product-lead__title {
  margin-bottom: 12px;
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 20px;
}

.product-page__lead {
  max-width: 560px;
  margin-bottom: 28px;
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-text-muted);
}

/* Colour picker */
.product-option {
  margin-bottom: 28px;
}

.product-option__label {
  margin-bottom: 12px;
  font-size: 14px;
  color: var(--color-text-muted);
}

.product-option__label span {
  color: var(--color-text-light);
}

.color-swatches {
  display: flex;
  align-items: center;
  gap: 10px;
}

.color-swatch {
  position: relative;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid transparent;
  padding: 0;
  background: var(--swatch);
}

.product-option .color-swatch {
  width: 32px;
  height: 32px;
}

/* Picked colour: a ring in the swatch's own colour, set off by a gap in the
   page colour — reads the same in the dark and the light theme. */
.color-swatch.is-active {
  box-shadow:
    0 0 0 2px var(--color-bg),
    0 0 0 4px var(--swatch);
}

.color-swatch.is-active::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 6px;
  height: 10px;
  border: solid #ffffff;
  border-width: 0 2px 2px 0;
  transform: translate(-50%, -60%) rotate(45deg);
  filter: drop-shadow(0 0 1px rgba(0, 0, 0, 0.6));
}

/* ==========================================================================
   Buyer mode: "Для бизнеса | Для себя"
   ========================================================================== */
.buyer-switch {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-bottom: 24px;
  padding: 4px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: var(--color-bg-elevated);
}

/* the sliding pill behind the active option */
.buyer-switch::before {
  content: "";
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: calc(50% - 4px);
  border-radius: 8px;
  background: var(--color-text-light);
  transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.3, 1);
}

.buyer-switch[data-mode="b2c"]::before {
  transform: translateX(100%);
}

.buyer-switch__btn {
  position: relative;
  padding: 11px 16px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  color: var(--color-text-muted);
  transition: color 0.25s ease;
}

.buyer-switch__btn:hover {
  color: var(--color-text-light);
}

.buyer-switch__btn.is-active {
  color: var(--color-bg);
}

@media (min-width: 640px) {
  .buyer-switch {
    max-width: 380px;
  }
}

/* mode-specific blocks fade in when the mode changes */
[data-buyer-panel].is-entering {
  animation: buyer-panel-in 0.35s cubic-bezier(0.2, 0.7, 0.3, 1);
}

@keyframes buyer-panel-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .buyer-switch::before,
  .buyer-switch__btn {
    transition: none;
  }

  [data-buyer-panel].is-entering {
    animation: none;
  }
}

/* Actions */
.product-page__actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.product-page__actions .btn {
  padding-block: 16px;
  font-size: 15px;
}

.product-page__cta-note {
  margin-top: 12px;
  font-size: 13px;
  color: var(--color-text-muted);
}

.product-page__cta-note a {
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s ease;
}

.product-page__cta-note a:hover {
  color: var(--color-text-light);
}

/* Delivery note under the CTA -> help.html#delivery */
.product-delivery {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 10px;
  padding: 14px 16px;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-sm);
  background: var(--color-card-bg);
  transition: border-color 0.2s ease;
}

.product-delivery:hover {
  border-color: var(--color-accent);
}

.product-delivery__icon {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  color: var(--color-accent);
}

.product-delivery__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.product-delivery__text strong {
  font-weight: 500;
  font-size: 14px;
}

.product-delivery__text span {
  font-size: 13px;
  color: var(--color-text-muted);
}

.product-delivery__arrow {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  color: var(--color-text-muted);
  transition: color 0.2s ease;
}

.product-delivery:hover .product-delivery__arrow {
  color: var(--color-accent);
}

/* Marketplace buttons in "Для себя" */
.mp-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}

.mp-link {
  --mp-color: var(--color-accent);

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 56px;
  padding-inline: 18px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: var(--color-bg-elevated);
  transition:
    border-color 0.25s ease,
    transform 0.25s cubic-bezier(0.2, 0.7, 0.3, 1);
}

.mp-link--ozon {
  --mp-color: #005bff;
}

.mp-link--wb {
  --mp-color: #cb11ab;
}

.mp-link img {
  width: auto;
  height: 18px;
}

.mp-link__arrow {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  color: var(--color-text-muted);
  transition:
    color 0.25s ease,
    transform 0.25s ease;
}

.mp-link:hover,
.mp-link:focus-visible {
  border-color: var(--mp-color);
  transform: translateY(-2px);
}

.mp-link:hover .mp-link__arrow,
.mp-link:focus-visible .mp-link__arrow {
  color: var(--mp-color);
  transform: translate(2px, -2px);
}

/* Specs: three key rows always visible, the rest in two collapsed groups */
.product-specs-block {
  margin-bottom: 28px;
}

.product-specs__title {
  margin-bottom: 8px;
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 20px;
}

.product-specs div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-block: 12px;
  border-bottom: 1px solid var(--color-border);
  font-size: 14px;
}

.product-specs dt {
  color: var(--color-text-muted);
}

.product-specs dd {
  margin: 0;
  text-align: right;
}

@media (min-width: 640px) {
  .product-page__actions {
    flex-direction: row;
  }

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

@media (min-width: 1200px) {
  .product-page {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    grid-template-rows: auto auto 1fr;
    grid-template-areas:
      "gallery head"
      "gallery info"
      "lead info";
    column-gap: 80px;
    row-gap: 28px;
    margin-top: 40px;
    margin-bottom: 110px;
  }

  .product-page__head {
    padding-top: 8px;
  }
}

/* Accordion (used on the help page) */
.accordion-item {
  border-bottom: 1px solid var(--color-border);
}

.accordion-item summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-block: 18px;
  font-size: 18px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
}

.accordion-item summary::-webkit-details-marker {
  display: none;
}

.accordion-item__icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  position: relative;
}

.accordion-item__icon::before,
.accordion-item__icon::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  background: var(--color-text-light);
  transform: translate(-50%, -50%);
}

.accordion-item__icon::before {
  width: 12px;
  height: 1.5px;
}

.accordion-item__icon::after {
  width: 1.5px;
  height: 12px;
  transition: opacity 0.15s ease;
}

.accordion-item[open] .accordion-item__icon::after {
  opacity: 0;
}

.accordion-item__body {
  padding-bottom: 20px;
  font-size: 14px;
  color: var(--color-text-muted);
  line-height: 1.6;
}

/* Compact accordion: spec groups on the product page */
.accordion-item--compact summary {
  padding-block: 14px;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  transition: color 0.2s ease;
}

.accordion-item--compact summary:hover {
  color: var(--color-accent);
}

/* Open group: the last row's own line closes it, no extra gap or second line */
.accordion-item--compact[open] {
  border-bottom: 0;
}

.accordion-item--compact .accordion-item__body {
  padding-bottom: 0;
  line-height: 1.4;
}

.accordion-item--compact .product-specs dd {
  color: var(--color-text-light);
}

.accordion-item--compact .product-specs div:first-child {
  padding-top: 0;
}

/* Gallery */
.product-gallery__main {
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 5 / 4;
  background: var(--color-bg-elevated);
}

.product-gallery__main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-gallery__thumbs {
  display: flex;
  gap: 12px;
  margin-top: 12px;
}

.product-gallery__thumbs button {
  width: 88px;
  aspect-ratio: 5 / 4;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid transparent;
  opacity: 0.55;
  transition:
    opacity 0.2s ease,
    border-color 0.2s ease;
}

.product-gallery__thumbs button.is-active {
  opacity: 1;
  border-color: var(--color-accent);
}

.product-gallery__thumbs img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (min-width: 1200px) {
  .product-gallery__thumbs {
    margin-top: 16px;
  }

  .product-gallery__thumbs button {
    width: 112px;
  }
}

/* ==========================================================================
   Accessories / similar products
   ========================================================================== */
.product-combo {
  margin-bottom: 64px;
}

.product-combo__tabs {
  display: flex;
  gap: 28px;
  margin-bottom: 12px;
}

.product-combo__tab {
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: clamp(20px, 2vw, 26px);
  letter-spacing: -0.01em;
  color: var(--color-text-muted);
  transition: color 0.2s ease;
}

.product-combo__tab:hover,
.product-combo__tab.is-active {
  color: var(--color-text-light);
}

.product-combo__hint {
  margin-bottom: 20px;
  font-size: 14px;
  color: var(--color-text-muted);
}

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

.variant-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
  margin-top: 20px;
}

.product-combo__hint + .variant-list {
  margin-top: 0;
}

.variant-list[hidden] {
  display: none;
}

.variant-list__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 100%;
  padding: 18px 20px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 15px;
}

.variant-list__item:focus-visible {
  background: var(--color-header-bg);
  color: var(--color-text-dark);
}

.variant-list__name {
  min-width: 0;
}

.variant-list__arrow {
  flex-shrink: 0;
  color: var(--color-text-muted);
}

.variant-list__item:focus-visible .variant-list__arrow {
  color: inherit;
}

@media (min-width: 1200px) {
  .product-combo {
    margin-bottom: 110px;
  }
}

/* ==========================================================================
   Retail marketplaces modal
   ========================================================================== */
.retail-modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  visibility: hidden;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.retail-modal.is-open {
  visibility: visible;
  pointer-events: auto;
}

.retail-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.retail-modal.is-open .retail-modal__overlay {
  opacity: 1;
}

.retail-modal__panel {
  position: relative;
  width: 100%;
  max-width: 860px;
  background: var(--color-bg-elevated);
  border-radius: var(--radius-lg);
  padding: 28px 20px 20px;
  opacity: 0;
  transform: scale(0.96);
  transition:
    opacity 0.3s ease,
    transform 0.3s ease;
}

.retail-modal.is-open .retail-modal__panel {
  opacity: 1;
  transform: scale(1);
}

.retail-modal__close {
  position: absolute;
  top: 24px;
  right: 20px;
  width: 20px;
  height: 20px;
}

.retail-modal__close::before,
.retail-modal__close::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 1px;
  background: var(--color-text-light);
}

.retail-modal__close::before {
  transform: rotate(45deg);
}

.retail-modal__close::after {
  transform: rotate(-45deg);
}

.retail-modal__title {
  margin-bottom: 10px;
  padding-right: 36px;
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: clamp(24px, 3vw, 32px);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.retail-modal__text {
  max-width: 520px;
  margin-bottom: 24px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--color-text-muted);
}

.retail-modal__cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.retail-modal__cards .market-card {
  min-height: 170px;
  padding: 24px;
}

@media (min-width: 640px) {
  .retail-modal__panel {
    padding: 40px;
  }

  .retail-modal__close {
    top: 28px;
    right: 28px;
  }

  .retail-modal__text {
    margin-bottom: 32px;
  }

  .retail-modal__cards {
    grid-template-columns: 1fr 1fr;
  }

  .retail-modal__cards .market-card {
    min-height: 200px;
    padding: 28px;
  }
}

/* ==========================================================================
   Cart panel
   ========================================================================== */
.cart-panel {
  position: fixed;
  inset: 0;
  z-index: 300;
  visibility: hidden;
  pointer-events: none;
}

.cart-panel.is-open {
  visibility: visible;
  pointer-events: auto;
}

.cart-panel__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.cart-panel.is-open .cart-panel__overlay {
  opacity: 1;
}

.cart-panel__panel {
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  max-width: 560px;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--color-bg);
  padding: 24px 20px 32px;
  transform: translateX(100%);
  transition: transform 0.3s ease;
}

.cart-panel.is-open .cart-panel__panel {
  transform: translateX(0);
}

.cart-panel__head {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--color-border);
}

.cart-panel__title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: auto;
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 24px;
  letter-spacing: -0.01em;
}

.cart-panel__count {
  display: grid;
  place-items: center;
  min-width: 26px;
  height: 26px;
  padding-inline: 8px;
  border-radius: 999px;
  background: var(--color-accent);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  color: var(--color-text-white);
}

.cart-panel__count[hidden],
.cart-panel__clear[hidden] {
  display: none;
}

.cart-panel__clear {
  font-size: 13px;
  color: var(--color-text-muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s ease;
}

.cart-panel__clear:hover {
  color: var(--color-error);
}

.cart-panel__clear:focus-visible,
.cart-panel__close:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 4px;
  border-radius: 4px;
}

.cart-panel__close {
  width: 18px;
  height: 18px;
  position: relative;
  flex-shrink: 0;
}

.cart-panel__close::before,
.cart-panel__close::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 1.5px;
  background: var(--color-text-light);
}

.cart-panel__close::before {
  transform: rotate(45deg);
}

.cart-panel__close::after {
  transform: rotate(-45deg);
}

.cart-panel__body {
  flex: 1;
  overflow-y: auto;
  margin-inline: -20px;
  padding-inline: 20px;
}

/* ---- empty state ---- */
.cart-panel__empty {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 56px 16px;
  text-align: center;
}

.cart-panel__empty[hidden] {
  display: none;
}

.cart-panel__empty svg {
  width: 44px;
  height: 44px;
  margin-bottom: 6px;
  color: var(--color-text-muted);
}

.cart-panel__empty-title {
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 20px;
}

.cart-panel__empty-text {
  max-width: 300px;
  margin-bottom: 10px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--color-text-muted);
}

/* ---- item: photo · name/meta · delete, quantity under the name ---- */
.cart-item {
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr) auto;
  grid-template-areas:
    "media info remove"
    "media qty  qty";
  align-items: start;
  gap: 10px 16px;
  padding-block: 18px;
  border-bottom: 1px solid var(--color-border);
}

.cart-item__media {
  grid-area: media;
  display: grid;
  place-items: center;
  width: 80px;
  height: 80px;
  overflow: hidden;
  border-radius: 12px;
  background: var(--color-card-bg-strong);
  color: var(--color-text-muted);
}

.cart-item__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* no photo: a quiet placeholder that follows the theme */
.cart-item__media:has(svg) {
  background: var(--color-bg-elevated);
}

.cart-item__media svg {
  width: 28px;
  height: 28px;
}

.cart-item__info {
  grid-area: info;
  min-width: 0;
}

.cart-item__name {
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  font-weight: 600;
  font-size: 16px;
  line-height: 1.35;
}

.cart-item__meta {
  margin-top: 4px;
  font-size: 13px;
  color: var(--color-text-muted);
}

.cart-item__remove {
  grid-area: remove;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin: -6px -6px 0 0;
  border-radius: 8px;
  color: var(--color-text-muted);
  transition:
    color 0.2s ease,
    background-color 0.2s ease;
}

.cart-item__remove svg {
  width: 18px;
  height: 18px;
}

.cart-item__remove:hover,
.cart-item__remove:focus-visible {
  color: var(--color-error);
  background: rgba(227, 72, 72, 0.1);
  outline: none;
}

.cart-item__qty {
  grid-area: qty;
  justify-self: start;
  display: flex;
  align-items: center;
  border: 1px solid var(--color-border);
  border-radius: 999px;
}

.cart-item__qty button {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 18px;
  line-height: 1;
  color: var(--color-text-light);
  transition: color 0.2s ease;
}

.cart-item__qty button:hover:not(:disabled) {
  color: var(--color-accent);
}

.cart-item__qty button:disabled {
  color: var(--color-border);
  cursor: default;
}

/* the number is an input: click, type 100, Enter */
.cart-item__qty-field {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 72px;
  height: 30px;
  padding-inline: 6px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: text;
  transition: background-color 0.2s ease;
}

.cart-item__qty-field:hover {
  background: var(--color-card-bg);
}

.cart-item__qty-field:focus-within {
  background: var(--color-bg-elevated);
  box-shadow: inset 0 0 0 1px var(--color-accent);
}

.cart-item__qty-field input {
  width: 5ch;
  min-width: 1ch;
  padding: 0;
  line-height: 1;
  /* grows with the number where supported */
  field-sizing: content;
  border: 0;
  background: none;
  font: inherit;
  font-variant-numeric: tabular-nums;
  text-align: right;
  color: var(--color-text-light);
  outline: none;
}

.cart-item__qty-field span {
  line-height: 1;
  color: var(--color-text-muted);
  font-weight: 500;
}

/* ---- footer ---- */
.cart-panel__foot {
  flex-shrink: 0;
  padding-top: 20px;
  border-top: 1px solid var(--color-border);
}

.cart-panel__summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 0 0 12px;
}

.cart-panel__summary div {
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--color-bg-elevated);
}

.cart-panel__summary dt {
  font-size: 12px;
  color: var(--color-text-muted);
}

.cart-panel__summary dd {
  margin: 4px 0 0;
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 24px;
  font-variant-numeric: tabular-nums;
}

.cart-panel__note {
  margin-bottom: 16px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--color-text-muted);
}

.cart-panel__moq-warning {
  font-size: 12px;
  line-height: 1.5;
  color: var(--color-error);
  margin-bottom: 12px;
}

.cart-panel__moq-warning[hidden] {
  display: none;
}

.cart-panel__checkout {
  width: 100%;
  height: 54px;
  font-size: 15px;
}

.cart-panel__retail-link {
  display: block;
  text-align: center;
  margin-top: 14px;
  font-size: 13px;
  color: var(--color-text-muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s ease;
}

.cart-panel__retail-link:hover {
  color: var(--color-text-light);
}

@media (min-width: 768px) {
  .cart-panel__panel {
    padding: 28px 32px 32px;
  }

  .cart-panel__body {
    margin-inline: -32px;
    padding-inline: 32px;
  }

  .cart-item {
    grid-template-columns: 88px minmax(0, 1fr) auto auto;
    grid-template-areas: "media info qty remove";
    align-items: center;
  }

  .cart-item__media {
    width: 88px;
    height: 88px;
  }

  .cart-item__remove {
    margin: 0;
  }
}

/* ==========================================================================
   Checkout panel
   ========================================================================== */
.checkout-panel__back {
  display: inline-block;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: 20px;
}

.checkout-form {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  max-width: none;
}

.checkout-form__buyer-type {
  display: flex;
  gap: 24px;
  padding-bottom: 16px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--color-border);
}

.checkout-form__buyer-type-btn {
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.checkout-form__buyer-type-btn.is-active {
  color: var(--color-text-light);
  font-weight: 700;
}

.checkout-form__legal-fields[hidden] {
  display: none;
}

.checkout-form__section-title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
  margin-top: 28px;
  margin-bottom: 4px;
}

.checkout-form__inn-row {
  display: flex;
  align-items: flex-end;
  gap: 16px;
}

.checkout-form__inn-row .btn {
  flex-shrink: 0;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.checkout-form__inn-field {
  flex: 1;
}

.checkout-form__upload {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 12px;
  cursor: pointer;
}

.order-success-modal__cta {
  padding: 18px 48px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ==========================================================================
   Reviews
   ========================================================================== */
.reviews {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  padding-bottom: 60px;
}

.reviews__title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 20px;
}

.reviews__title span {
  color: var(--color-text-muted);
  font-weight: 400;
}

.rating-summary {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.rating-summary__score {
  font-family: var(--font-heading);
  font-size: 48px;
  line-height: 1;
}

.rating-summary__stars {
  color: var(--color-accent);
  letter-spacing: 2px;
  margin-bottom: 4px;
}

.rating-summary__based {
  font-size: 12px;
  color: var(--color-text-muted);
}

.rating-bars {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 24px;
}

.rating-bars li {
  display: grid;
  grid-template-columns: 64px 1fr 32px;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--color-text-muted);
}

.rating-bars__track {
  height: 3px;
  background: var(--color-border);
  border-radius: 2px;
  overflow: hidden;
}

.rating-bars__track span {
  display: block;
  height: 100%;
  background: var(--color-accent);
}

.reviews__write {
  width: 100%;
}

.reviews__highlights-title {
  font-size: 15px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.highlight-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
}

.highlight-tags button {
  padding: 10px 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.highlight-tags button.is-active {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--color-text-white);
}

.reviews__tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.reviews__tabs button {
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--color-text-muted);
}

.reviews__tabs button.is-active {
  background: var(--color-header-bg);
  color: var(--color-text-dark);
}

.reviews__filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 28px;
}

.reviews__filters button,
.reviews__search {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--color-text-muted);
}

.reviews__search input {
  background: none;
  border: 0;
  color: var(--color-text-light);
  font-size: 13px;
  width: 140px;
}

.review {
  padding-block: 24px;
  border-top: 1px solid var(--color-border);
}

.review__head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.review__avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--color-badge-bg);
  flex-shrink: 0;
}

.review__name {
  font-weight: 500;
  font-size: 14px;
}

.review__date {
  font-size: 12px;
  color: var(--color-text-muted);
}

.review__stars {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--color-accent);
  font-size: 14px;
  white-space: nowrap;
}

.review__stars span {
  color: var(--color-text-light);
  font-size: 13px;
}

.review__points {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}

.review__points li {
  position: relative;
  padding-left: 20px;
  font-size: 13px;
  color: var(--color-text-muted);
}

.review__points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.review__points li.is-pro::before {
  background: #4caf50;
}

.review__points li.is-con::before {
  background: #e34848;
}

.review__points li.is-neutral::before {
  background: var(--color-text-muted);
}

.review__source {
  font-size: 12px;
  color: var(--color-text-muted-2);
}

.reviews__more {
  display: inline-block;
  margin-top: 16px;
  font-size: 14px;
  text-decoration: underline;
}

@media (min-width: 1200px) {
  .reviews {
    grid-template-columns: 320px 1fr;
    gap: 60px;
  }
}

/* ==========================================================================
   Hover-only interactions — skipped on touch devices so a tap never needs
   a second tap to register (no simulated :hover state to "clear" first)
   ========================================================================== */
@media (hover: hover) {
  .variant-list__item {
    transition:
      background-color 0.2s ease,
      border-color 0.2s ease,
      color 0.2s ease;
  }

  .variant-list__item:hover {
    background: var(--color-header-bg);
    border-color: var(--color-header-bg);
    color: var(--color-text-dark);
  }

  .variant-list__arrow {
    transition: transform 0.2s ease;
  }

  .variant-list__item:hover .variant-list__arrow {
    color: inherit;
    transform: translateX(3px);
  }

  .checkout-panel__back:hover {
    color: var(--color-text-light);
  }
}
