/* ==========================================================================
   Ionix — product.css (PDP page-specific styles).
   ionix.css (shell + tokens) is already loaded globally via ionix-home.css,
   so the @import is intentionally dropped here to avoid loading it twice.
   ========================================================================== */

/* ==========================================================================
   PDP LAYOUT
   ========================================================================== */
.st-pdp {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
  padding-top: 28px;
}
@media (max-width: 991px) { .st-pdp { grid-template-columns: 1fr; gap: 32px; } }

/* ==========================================================================
   PRODUCT GALLERY
   Layout is ported from the base product.css: a vertical thumb rail
   beside the main image on desktop, a horizontal scroller on mobile — the
   theme thumb-position behaviour is kept intact (the mockup's single-column
   gallery was rejected). The only addition is the arrow rail below: the thumbs
   are a Swiper and the prev/next arrows are pinned to the strip's ends, always
   on screen and outside the flow, so nothing reflows when they enable/disable.
   Base tokens are already bridged to the design palette, so it all harmonizes.
   ========================================================================== */
/* The rail is the positioning context for the arrows and takes the thumb
   column's place in the gallery grid, so mirror the base order (below the main
   image on mobile, beside it on desktop). On desktop it stretches to the main
   image's height — which is fixed by aspect-ratio — and the thumb Swiper is
   absolutely positioned inside it, so the row height never depends on how many
   thumbs there are and nothing shifts once images load.
   --thumbnav: arrow box + its gap, reserved at both ends of the strip in every
   state, so an arrow never covers a thumb and toggling one moves nothing. */
.st-pdp-gallery__rail { position: relative; min-width: 0; order: 2; --thumbnav: 48px; }
.st-pdp-gallery__rail .st-pdp-gallery__thumbs { margin-inline: var(--thumbnav); }
@media (min-width: 768px) {
  html:not([data-thumbs="horizontal"]) .st-pdp-gallery__rail { order: 1; align-self: stretch; }
  html:not([data-thumbs="horizontal"]) .st-pdp-gallery__rail .st-pdp-gallery__thumbs {
    position: absolute; inset: var(--thumbnav) 0; margin-inline: 0;
  }
}
/* The arrows are .st-rail-btn at the same 42px box: the same editorial square,
   hairline and invert-on-hover as the product-rail arrows, so the gallery reads
   as part of that set and the target is comfortable to hit. Radius follows the
   shape knob (0 in the sharp preset), so they stay in step when the preset
   changes. Markup is direction-neutral (caret-left/right); the vertical rail
   rotates the glyph a quarter turn. */
.st-pdp-gallery__thumbnav {
  position: absolute; z-index: 2;
  display: flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; padding: 0;
  border: 1px solid var(--color-border-strong); border-radius: var(--radius);
  background: var(--color-surface); color: var(--color-heading);
  font-size: 1.05rem; line-height: 1;
  cursor: pointer; transition: all var(--dur) var(--ease);
}
.st-pdp-gallery__thumbnav:hover { background: var(--color-heading); border-color: var(--color-heading); color: #fff; }
/* Always visible: when the strip can't move any further the arrow only dims. */
.st-pdp-gallery__thumbnav.swiper-button-disabled { opacity: 0.35; pointer-events: none; }
/* Mobile: horizontal strip → arrows at the left/right ends, icons as authored. */
.st-pdp-gallery__thumbnav--prev { top: 50%; left: 0; transform: translateY(-50%); }
.st-pdp-gallery__thumbnav--next { top: 50%; right: 0; transform: translateY(-50%); }
/* Desktop: vertical strip → arrows at the top/bottom ends, glyphs rotated. */
@media (min-width: 768px) {
  html:not([data-thumbs="horizontal"]) .st-pdp-gallery__thumbnav--prev { top: 0; left: 50%; right: auto; transform: translateX(-50%); }
  html:not([data-thumbs="horizontal"]) .st-pdp-gallery__thumbnav--next { top: auto; bottom: 0; left: 50%; right: auto; transform: translateX(-50%); }
  html:not([data-thumbs="horizontal"]) .st-pdp-gallery__thumbnav i { transform: rotate(90deg); }
}

/* --------------------------------------------------------------------------
   Gallery layout "tiles" (theme setting -> html[data-gallery="grid"]), desktop only:
   no big photo + thumbnails — every photo is a tile, two per row, going down the page;
   the buy column stays on screen (sticky). The thumbnail direction setting only applies
   to the standard gallery. Phones keep the swipe gallery. main.js does not start Swiper
   in this mode, so the slides are plain grid items (a click opens the lightbox).
   -------------------------------------------------------------------------- */
@media (min-width: 768px) {
  html[data-gallery="grid"] .st-pdp-gallery { grid-template-columns: minmax(0, 1fr); }
  html[data-gallery="grid"] .st-pdp-gallery__rail,
  html[data-gallery="grid"] .st-pdp-gallery__nav,
  html[data-gallery="grid"] .st-pdp-gallery__zoom { display: none; }
  html[data-gallery="grid"] .st-pdp-gallery__main { aspect-ratio: auto; height: auto; overflow: visible; clip-path: none; isolation: auto; background: none; border-radius: 0; order: 1; }
  html[data-gallery="grid"] .st-pdp-gallery__main .swiper { overflow: visible; height: auto; cursor: default; }
  html[data-gallery="grid"] .st-pdp-gallery__main .swiper-wrapper {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3);
    height: auto; transform: none !important;
  }
  html[data-gallery="grid"] .st-pdp-gallery__main .swiper-slide {
    width: auto !important; height: auto; margin: 0 !important;
    aspect-ratio: var(--product-aspect); overflow: hidden;
    background: var(--color-bg-alt); border-radius: var(--radius); cursor: zoom-in;
  }
  html[data-gallery="grid"] .st-pdp-info { position: sticky; top: var(--st-pdp-info-top, 24px); align-self: start; }
}


/* ==========================================================================
   PDP INFO PANEL
   ========================================================================== */
.st-pdp-info {}
.st-pdp-info__brand {
  font-family: var(--f-mono); font-size: 11.5px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--c-accent);
  margin-bottom: 8px; display: block;
}
.st-pdp-info__title {
  font-size: 28px; font-weight: 800; line-height: 1.12; letter-spacing: -0.02em;
  margin-bottom: 14px;
}
@media (max-width: 575px) { .st-pdp-info__title { font-size: 22px; } }
.st-pdp-info__meta {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin-bottom: 18px; padding-bottom: 18px; border-bottom: 1px solid var(--c-border-soft);
}
.st-pdp-info__sku { font-family: var(--f-mono); font-size: 12px; color: var(--c-text-soft); }
.st-pdp-info__sku span { color: var(--c-text); font-weight: 600; }

/* Price in PDP — reuses the DS st-price atom, scoped bigger for the PDP context */
.st-pdp-price {
  margin-bottom: 20px;
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
}
.st-pdp-price .st-price__now {
  font-family: var(--f-heading); font-weight: 800; font-size: 36px;
  letter-spacing: -0.02em; color: var(--c-text); line-height: 1;
}
.st-pdp-price .st-price__now--sale { color: var(--c-sale); }
.st-pdp-price .st-price__old {
  font-size: 20px; color: var(--c-text-soft);
  text-decoration: line-through; font-weight: 400;
}
.st-pdp-price .st-price__save {
  font-family: var(--f-mono); font-size: 13px; font-weight: 700;
  color: var(--c-sale); background: var(--c-sale-soft);
  padding: 4px 9px; border-radius: var(--r-xs);
}
.st-pdp-price .st-price__tax { font-size: 12.5px; color: var(--c-text-muted); }

/* Short description */
.st-pdp-info__desc {
  font-size: 14.5px; line-height: 1.65; color: var(--c-text-muted);
  margin-bottom: 22px; padding-bottom: 22px; border-bottom: 1px solid var(--c-border-soft);
}

/* ==========================================================================
   VARIANT PICKERS
   ========================================================================== */
.st-variant-group { margin-bottom: 20px; }
.st-variant-group__label {
  font-size: 13px; font-weight: 700; color: var(--c-text);
  margin-bottom: 10px; display: flex; align-items: center; gap: 8px;
}
.st-variant-group__label-val { color: var(--c-text-soft); font-weight: 500; }

/* Color swatches */
.st-swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.st-swatch {
  width: 32px; height: 32px; border-radius: 50%;
  cursor: pointer; position: relative;
  border: 3px solid transparent;
  box-shadow: 0 0 0 1px var(--c-border);
  transition: box-shadow 0.15s, transform 0.15s;
}
.st-swatch:hover { transform: scale(1.1); }
.st-swatch.is-active { box-shadow: 0 0 0 2px var(--c-bg), 0 0 0 4px var(--c-text); }
.st-swatch--white { background: #fff; box-shadow: 0 0 0 1px var(--c-border); }
.st-swatch--black { background: #0F1216; }
.st-swatch--silver{ background: #C2C4CC; }
.st-swatch--gold  { background: #C9A84C; }
.st-swatch--blue  { background: #2B5FC8; }
.st-swatch--red   { background: #D83A2E; }
.st-swatch--green { background: #2E7D52; }

/* Size chips */
.st-size-chips { display: flex; gap: 7px; flex-wrap: wrap; }
.st-size-chip {
  min-width: 44px; height: 36px; padding: 0 12px;
  border: 2px solid var(--c-border); border-radius: var(--r-sm);
  background: var(--c-card); cursor: pointer;
  font-family: var(--f-mono); font-size: 12.5px; font-weight: 700; color: var(--c-text);
  display: flex; align-items: center; justify-content: center;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.st-size-chip:hover { border-color: var(--c-text); }
.st-size-chip.is-active { border-color: var(--c-text); background: var(--c-text); color: var(--c-bg); }
.st-size-chip.is-oos {
  opacity: 0.38; cursor: not-allowed;
  position: relative; overflow: hidden;
  text-decoration: line-through;
}

/* ==========================================================================
   PDP BUY ROW
   ========================================================================== */
.st-pdp-buy {
  display: flex; gap: 10px; align-items: stretch; flex-wrap: wrap;
  margin-bottom: 20px; margin-top: 24px;
}
.st-qty {
  display: flex; align-items: stretch;
  background: var(--c-card); border: 1px solid var(--c-border);
  border-radius: var(--st-btn-radius); overflow: hidden; height: 52px; flex-shrink: 0; /* a stepper is a control: it follows the button corners */
}
.st-qty__btn {
  width: 46px; background: transparent; border: 0;
  display: grid; place-items: center; cursor: pointer;
  color: var(--c-text-soft); font-size: 18px;
  transition: background 0.15s, color 0.15s;
}
.st-qty__btn:hover { background: var(--c-bg-alt); color: var(--c-text); }
.st-qty__val {
  width: 48px; background: transparent; border: 0; border-left: 1px solid var(--c-border); border-right: 1px solid var(--c-border);
  font-family: var(--f-mono); font-size: 16px; font-weight: 700; color: var(--c-text);
  text-align: center; padding: 0;
}
.st-qty__val::-webkit-inner-spin-button { display: none; }
.st-pdp-buy__add {
  flex: 1; min-width: 200px; height: 52px;
  border-radius: var(--r-md); font-size: 15px;
}
.st-pdp-buy__wish {
  width: 52px; height: 52px; flex-shrink: 0;
  border-radius: var(--r-md);
  background: var(--c-card); border: 1px solid var(--c-border);
  display: grid; place-items: center; cursor: pointer; color: var(--c-text-soft);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.st-pdp-buy__wish .st-icon { font-size: 20px; }
.st-pdp-buy__wish:hover, .st-pdp-buy__wish.is-active {
  background: var(--c-sale-soft); border-color: var(--c-sale); color: var(--c-sale);
}

/* Sticky buy (mobile) */
.st-pdp-buymobile {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 80;
  background: var(--c-card); border-top: 1px solid var(--c-border);
  padding: 12px 18px;
}
@media (max-width: 767px) { .st-pdp-buymobile { display: flex; gap: 10px; align-items: center; } }
.st-pdp-buymobile__price { font-size: 20px; font-weight: 800; letter-spacing: -0.01em; flex: 1; }
.st-pdp-buymobile__add { height: 48px; font-size: 14px; }

/* ==========================================================================
   PDP STOCK + ADDONS + TRUST RAIL
   ========================================================================== */
.st-pdp-stock { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.st-pdp-stock__dot {
  width: 10px; height: 10px; border-radius: 50%;
  flex-shrink: 0;
}
.st-pdp-stock__dot--in  { background: oklch(0.62 0.15 152); box-shadow: 0 0 0 3px oklch(0.62 0.15 152 / 0.2); }
.st-pdp-stock__dot--low { background: oklch(0.65 0.15 50); box-shadow: 0 0 0 3px oklch(0.65 0.15 50 / 0.2); }
.st-pdp-stock__dot--out { background: oklch(0.62 0.15 25); }
.st-pdp-stock__text { font-size: 13.5px; font-weight: 600; }
.st-pdp-stock__text--in  { color: oklch(0.55 0.14 152); }
.st-pdp-stock__text--low { color: oklch(0.58 0.14 50); }
.st-pdp-stock__text--out { color: oklch(0.55 0.14 25); }
.st-pdp-stock__progress { flex: 1; max-width: 120px; height: 4px; background: var(--c-border); border-radius: 2px; overflow: hidden; }
.st-pdp-stock__bar { height: 100%; background: oklch(0.62 0.15 152); transition: width 0.4s; }
.st-pdp-stock__bar--low { background: oklch(0.65 0.15 50); }

.st-pdp-addons {
  display: flex; flex-direction: column; gap: 8px;
  background: var(--c-bg-alt); border: 1px solid var(--c-border);
  border-radius: var(--r-md); padding: 16px 18px; margin-bottom: 18px;
}
.st-pdp-addons__title { font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--c-text-soft); margin-bottom: 4px; }
.st-pdp-addon { display: flex; align-items: flex-start; gap: 10px; }
.st-pdp-addon input[type="checkbox"] { margin-top: 2px; accent-color: var(--c-text); flex-shrink: 0; }
.st-pdp-addon__label { font-size: 13.5px; color: var(--c-text); flex: 1; }
.st-pdp-addon__price { font-family: var(--f-mono); font-size: 13px; font-weight: 700; color: var(--c-text-soft); white-space: nowrap; }

.st-trust-rail {
  display: flex; flex-wrap: wrap; gap: 12px;
  padding: 14px 0; border-top: 1px solid var(--c-border-soft); margin-bottom: 16px;
}
.st-trust-rail__item {
  display: flex; align-items: center; gap: 8px;
  font-size: 12.5px; color: var(--c-text-soft); flex: 1 0 calc(50% - 6px);
}
.st-trust-rail__item .st-icon { font-size: 18px; color: var(--c-text); flex-shrink: 0; }
.st-trust-rail__item strong { color: var(--c-text); font-weight: 600; }

/* ==========================================================================
   PDP TABS (Specs / Description / Reviews)
   ========================================================================== */
.st-pdp-tabs { padding-top: 48px; }

/* position:sticky must live on .st-pdp-nav, not on the bar itself — the bar's
   direct parent (.container) is exactly as tall as the bar, leaving no room
   for it to visibly "stick" (a sticky element can only stick while its own
   parent is taller than it is). .st-pdp-nav's parent is <main>, which spans
   the whole page, so the room to stick actually exists there. */
.st-pdp-nav {
  position: relative; /* Lite: not pinned */
  z-index: 39;
  background: var(--c-card);
  transition: box-shadow 0.2s;
}
/* Full-bleed background past the container edges — absolutely positioned
   pseudo-element clipped to the nav's own height, not a box-shadow spread
   (which paints equally in all directions and covers content above/below). */
.st-pdp-nav::before {
  content: "";
  position: absolute;
  top: 0; bottom: 0; left: 50%; right: 50%;
  margin-left: -50vw; margin-right: -50vw;
  background: var(--c-card);
  z-index: -1;
}
.st-pdp-nav.is-stuck { box-shadow: 0 4px 16px rgba(15, 18, 22, 0.06); }

.st-pdp-tabs__bar {
  display: flex; gap: 0;
  border-bottom: 2px solid var(--c-border);
  margin-bottom: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.st-pdp-tabs__bar::-webkit-scrollbar { display: none; }
.st-pdp-tabs__btn {
  flex-shrink: 0;
  padding: 14px 22px; background: transparent; border: 0;
  font-family: inherit; font-size: 14.5px; font-weight: 700;
  color: var(--c-text-soft); cursor: pointer;
  white-space: nowrap;
  border-bottom: 2px solid transparent; margin-bottom: -2px;
  transition: color 0.15s, border-color 0.15s;
}
.st-pdp-tabs__btn:hover { color: var(--c-text); }
.st-pdp-tabs__btn.is-active { color: var(--c-text); border-bottom-color: var(--c-text); }
.st-pdp-tabs__badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; padding: 0 5px;
  background: var(--c-bg-alt); border-radius: var(--r-pill);
  font-size: 11px; font-weight: 700; font-family: var(--f-mono);
  color: var(--c-text-soft); margin-left: 6px;
}
.st-pdp-tabs__btn.is-active .st-pdp-tabs__badge { background: var(--c-text); color: var(--c-bg); }

.st-pdp-tabs__panel { padding: 28px 0; }
.st-pdp-tabs__panel:not(:first-child) { border-top: 1px solid var(--c-border-soft); }

/* Two-column area: sections + a sticky mini buy box on the right (desktop only) */
.st-pdp-tabs__body { display: block; }
@media (min-width: 992px) {
  .st-pdp-tabs__body { display: grid; grid-template-columns: minmax(0, 1fr) 260px; align-items: start; gap: 0 32px; }
}
.st-pdp-tabs__main { min-width: 0; }

.st-pdp-buybox { display: none; }
@media (min-width: 992px) {
  .st-pdp-buybox {
    display: block; /* Lite: not pinned */
  }
}
.st-pdp-buybox__inner {
  padding: 18px;
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  background: var(--c-card);
  box-shadow: 0 2px 10px rgba(15, 18, 22, 0.05);
}
.st-pdp-buybox__product { display: flex; gap: 12px; margin-bottom: 16px; }
.st-pdp-buybox__thumb {
  width: 64px; height: 64px; object-fit: cover; flex-shrink: 0;
  border: 1px solid var(--c-border); border-radius: var(--r-sm);
}
.st-pdp-buybox__name {
  font-size: 13px; font-weight: 600; line-height: 1.4; color: var(--c-text);
  margin-bottom: 6px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.st-pdp-buybox__price .st-price__now--sale { font-size: 18px; font-weight: 700; color: var(--c-sale); }
.st-pdp-buybox__price .st-price__old { font-size: 12.5px; color: var(--c-text-soft); text-decoration: line-through; margin-left: 6px; }
.st-pdp-buybox__add { width: 100%; justify-content: center; }

/* Specs table */
.st-specs-table { width: 100%; border-collapse: collapse; }
.st-specs-table tr:nth-child(even) td { background: var(--c-bg-alt); }
.st-specs-table td {
  padding: 12px 18px; font-size: 14px;
  border-bottom: 1px solid var(--c-border-soft);
}
.st-specs-table td:first-child { font-weight: 700; color: var(--c-text); width: 40%; }
.st-specs-table td:last-child { color: var(--c-text-muted); }

/* Description content */
.st-pdp-desc { font-size: 14.5px; line-height: 1.7; color: var(--c-text-muted); }
.st-pdp-desc h2, .st-pdp-desc h3 { color: var(--c-text); margin: 24px 0 10px; }
.st-pdp-desc ul { padding-left: 18px; }
.st-pdp-desc li { margin-bottom: 6px; }
.st-pdp-desc p { margin-bottom: 14px; }

/* Reviews */
.st-reviews-summary {
  display: flex; align-items: center; gap: 36px;
  padding: 24px 0; border-bottom: 1px solid var(--c-border-soft); margin-bottom: 24px;
}
.st-reviews-summary__score {
  text-align: center; flex-shrink: 0;
}
.st-reviews-summary__score-num {
  font-size: 52px; font-weight: 800; letter-spacing: -0.04em; line-height: 1;
}
.st-reviews-summary__total { font-family: var(--f-mono); font-size: 12px; color: var(--c-text-soft); margin-top: 4px; }
.st-reviews-summary__bars { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.st-reviews-bar { display: flex; align-items: center; gap: 10px; }
.st-reviews-bar__label { font-family: var(--f-mono); font-size: 12px; color: var(--c-text-soft); min-width: 10px; }
.st-reviews-bar__track { flex: 1; height: 6px; background: var(--c-border); border-radius: 3px; overflow: hidden; }
.st-reviews-bar__fill { height: 100%; background: var(--c-star); border-radius: 3px; transition: width 0.6s; }
.st-reviews-bar__count { font-family: var(--f-mono); font-size: 12px; color: var(--c-text-soft); min-width: 24px; text-align: right; }
.st-review-list { display: flex; flex-direction: column; gap: 22px; }
.st-review-card {
  background: var(--c-card); border: 1px solid var(--c-border);
  border-radius: var(--r-md); padding: 20px 22px;
}
.st-review-card__header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 10px; }
.st-review-card__author { font-weight: 700; font-size: 14.5px; }
.st-review-card__date { font-family: var(--f-mono); font-size: 11.5px; color: var(--c-text-soft); }
.st-review-card__title { font-weight: 700; margin-bottom: 6px; }
.st-review-card__body { font-size: 14px; color: var(--c-text-muted); line-height: 1.6; }

/* ==========================================================================
   RELATED PRODUCTS GRID
   ========================================================================== */
.st-related { padding-top: 48px; }
.st-related__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
@media (max-width: 991px) { .st-related__grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 399px) { .st-related__grid { grid-template-columns: 1fr; } }
