/* ======================================================================
   ADONAI THRIFT STORE — PRODUCT DETAIL PAGE (PDP) DESIGN SYSTEM v1.0
   Mobile-first, conversion-focused layout for one-of-one thrift stock.

   Desktop (≥1024px): 3-column asymmetric grid
       45% sticky media gallery · 30% specs & storytelling · 25% buy box
   Mobile  (≤1023px): single column
       swipeable carousel → pricing → badges → accordions → fixed CTA bar

   Depends on css/storefront.css for the shared palette and typography.
   ====================================================================== */

:root {
  --pdp-gap: 28px;
  --pdp-head-offset: 92px;        /* 72px sticky header + breathing room */
  --grade-bnwt: #059669;
  --grade-a: #2563EB;
  --grade-b: #D97706;
  --grade-vintage: #7C3AED;
  --wa-green: #25D366;
  --wa-green-dark: #1DA851;
  --pdp-line: #E5E7EB;
  --pdp-slate-50: #F8FAFC;
  --pdp-slate-500: #64748B;
  --pdp-slate-900: #0F172A;
}

/* CRITICAL: the page body must stay the single, freely scrolling container.
   No overflow:hidden and no fixed heights here — mobile shoppers have to be
   able to scroll the whole specification stack behind the fixed action bar. */
body.pdp-body {
  background: var(--page);
  min-height: 100vh;
  overflow-x: clip;
  padding-bottom: 0;
}
body.pdp-lightbox-open { overflow: hidden; }

.pdp-main { padding: 0 0 56px; }

/* ============================================================
   BREADCRUMB
   ============================================================ */
.pdp-crumbs { padding-top: 16px; padding-bottom: 6px; }
.pdp-crumbs ol {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  font-size: 12.5px; color: var(--muted);
}
.pdp-crumbs li { display: flex; align-items: center; gap: 6px; min-width: 0; }
.pdp-crumbs li + li::before { content: "›"; color: #CBD5E1; }
.pdp-crumbs a { color: var(--muted); text-decoration: none; }
.pdp-crumbs a:hover { color: var(--rust); text-decoration: underline; }
.pdp-crumbs li[aria-current] {
  color: var(--ink); font-weight: 600;
  max-width: 55ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ============================================================
   LOADING SKELETON + EMPTY STATE
   ============================================================ */
.pdp-skeleton { display: grid; gap: 20px; padding-top: 18px; grid-template-columns: 1fr; }
.sk-media, .sk-line {
  background: linear-gradient(90deg, #EEF2F7 25%, #F8FAFC 50%, #EEF2F7 75%);
  background-size: 400% 100%; animation: skShimmer 1.4s ease infinite; border-radius: 12px;
}
.sk-media { aspect-ratio: 4 / 5; width: 100%; }
.sk-lines { display: grid; gap: 12px; }
.sk-line { height: 16px; }
.sk-line.w40 { width: 40%; } .sk-line.w60 { width: 60%; }
.sk-line.w75 { width: 75%; } .sk-line.w90 { width: 90%; }
@keyframes skShimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

.pdp-missing { padding: 60px 22px 80px; text-align: center; }
.pdp-missing h1 { font-size: clamp(24px, 4vw, 34px); margin-bottom: 10px; }
.pdp-missing p { color: var(--muted); max-width: 58ch; margin: 0 auto 22px; }
.pdp-missing-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ============================================================
   3-COLUMN ASYMMETRIC GRID
   ============================================================ */
.pdp-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
  align-items: start;
  padding-top: 10px;
}

/* ============================================================
   LEFT COLUMN — PRIMARY MEDIA GALLERY
   ============================================================ */
.pdp-media-sticky { display: grid; gap: 10px; }
.pdp-gallery { display: grid; grid-template-columns: 1fr; gap: 12px; }

.pdp-stage-wrap {
  position: relative;
  background: #fff;
  border: 1px solid var(--pdp-line);
  border-radius: 14px;
  overflow: hidden;
}
.pdp-stage-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  cursor: zoom-in;
}
.pdp-stage-track::-webkit-scrollbar { display: none; }
.pdp-slide {
  flex: 0 0 100%;
  scroll-snap-align: center;
  margin: 0;
  /* Explicit ratio reserves the box before the photo decodes → zero CLS */
  aspect-ratio: 4 / 5;
  background: #fff;
}
.pdp-slide picture, .pdp-slide img {
  width: 100%; height: 100%; display: block;
  object-fit: contain;
}
.pdp-stage.empty, .pdp-stage-wrap.empty {
  aspect-ratio: 4 / 5; display: grid; place-items: center;
  color: var(--muted); font-size: 13px; text-align: center; padding: 24px;
  border: 1px dashed var(--pdp-line); border-radius: 14px; background: #fff;
}

/* Sold-out treatment: dim the media, stamp the badge, kill the CTAs */
.pdp-gallery.is-sold .pdp-stage-track { opacity: .5; filter: grayscale(.25); }
.pdp-sold-overlay {
  position: absolute; inset: 0; z-index: 3;
  display: grid; place-items: center; pointer-events: none;
}
.pdp-sold-overlay span {
  background: #DC2626; color: #fff; font-weight: 800; letter-spacing: .14em;
  font-size: 15px; padding: 10px 22px; border-radius: 6px;
  transform: rotate(-6deg); box-shadow: 0 10px 28px rgba(220, 38, 38, .35);
}

.pdp-stage-badges {
  position: absolute; top: 12px; left: 12px; z-index: 4;
  display: flex; gap: 6px; flex-wrap: wrap;
}
.pdp-grade-chip {
  background: var(--grade, #475569); color: #fff;
  font-size: 11px; font-weight: 700; letter-spacing: .04em;
  padding: 5px 10px; border-radius: 999px;
}
.pdp-disc-chip {
  background: #111827; color: #fff; font-size: 11px; font-weight: 700;
  padding: 5px 10px; border-radius: 999px;
}

.pdp-stage-nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 4;
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--pdp-line); background: rgba(255, 255, 255, .94);
  color: var(--ink); font-size: 22px; line-height: 1; cursor: pointer;
  display: grid; place-items: center;
}
.pdp-stage-nav.prev { left: 10px; }
.pdp-stage-nav.next { right: 10px; }
.pdp-stage-nav:hover { background: #fff; border-color: var(--ink); }

.pdp-zoom-btn {
  position: absolute; right: 10px; bottom: 10px; z-index: 4;
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(17, 24, 39, .82); color: #fff; border: 0;
  border-radius: 999px; padding: 7px 13px; font: 600 12px var(--font-text); cursor: pointer;
}
.pdp-zoom-btn svg { width: 14px; height: 14px; }
.pdp-zoom-btn:hover { background: var(--ink); }

.pdp-counter {
  position: absolute; left: 12px; bottom: 12px; z-index: 4;
  background: rgba(17, 24, 39, .78); color: #fff;
  font-size: 11.5px; font-weight: 600; padding: 5px 10px; border-radius: 999px;
}

/* Thumbnail rail — horizontal under the stage on mobile, vertical on desktop */
.pdp-thumbrail {
  display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px;
  scrollbar-width: thin; order: 2;
}
.pdp-thumb {
  position: relative; flex: 0 0 auto;
  width: 64px; padding: 0; cursor: pointer;
  background: #fff; border: 2px solid var(--pdp-line); border-radius: 10px;
  overflow: hidden; transition: border-color .15s ease, box-shadow .15s ease;
}
.pdp-thumb picture, .pdp-thumb img {
  width: 100%; height: 72px; display: block; object-fit: cover;
}
.pdp-thumb.active { border-color: var(--ink); box-shadow: 0 0 0 2px rgba(17, 24, 39, .12); }
.pdp-thumb:hover { border-color: var(--rust); }
/* Mandatory flaw disclosure: the close-up photo is flagged in amber so a
   shopper cannot miss it before buying a one-of-one piece. */
.pdp-thumb.is-flaw { border-color: #D97706; }
.pdp-thumb.is-flaw.active { box-shadow: 0 0 0 2px rgba(217, 119, 6, .28); }
.pdp-thumb.is-flaw .pdp-thumb-tag { background: #D97706; color: #fff; }
.pdp-thumb-tag {
  display: block; font-size: 9.5px; font-weight: 700; letter-spacing: .03em;
  text-transform: uppercase; color: var(--pdp-slate-500);
  padding: 3px 2px; background: var(--pdp-slate-50);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.pdp-dots { display: flex; gap: 6px; justify-content: center; }
.pdp-dot {
  width: 7px; height: 7px; border-radius: 50%; border: 0; padding: 0;
  background: #CBD5E1; cursor: pointer;
}
.pdp-dot.active { background: var(--ink); width: 20px; border-radius: 999px; }

.pdp-media-note { font-size: 11.5px; color: var(--muted); text-align: center; }

/* ============================================================
   MIDDLE COLUMN — SPECS & STORYTELLING
   ============================================================ */
.pdp-detail { min-width: 0; display: grid; gap: 14px; align-content: start; }
.pdp-eyebrow {
  font-size: 12px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--rust);
}
.pdp-title {
  font-family: var(--font-display); font-size: clamp(23px, 3.4vw, 31px);
  line-height: 1.18; color: var(--ink); margin: -6px 0 0;
}

.pdp-identity { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pdp-sku {
  font-size: 11px; font-weight: 700; letter-spacing: .05em;
  color: var(--pdp-slate-500); background: var(--pdp-slate-50);
  border: 1px solid var(--pdp-line); padding: 4px 9px; border-radius: 6px;
}
.pdp-grade-badge {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--grade-tint, #F1F5F9); color: var(--grade, #475569);
  border: 1px solid color-mix(in srgb, var(--grade, #475569) 28%, transparent);
  font-size: 12.5px; font-weight: 700; padding: 5px 12px; border-radius: 999px;
}
.pdp-grade-badge i {
  width: 8px; height: 8px; border-radius: 50%; background: var(--grade, #475569);
}
.pdp-grade-blurb { font-size: 13px; color: var(--muted); margin-top: -6px; }

.pdp-price-block {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px;
  padding: 14px 0; border-top: 1px solid var(--pdp-line); border-bottom: 1px solid var(--pdp-line);
}
.pdp-price { font-size: clamp(26px, 4vw, 32px); font-weight: 800; color: var(--ink); letter-spacing: -.02em; }
.pdp-compare { font-size: 15px; color: var(--muted); text-decoration: line-through; }
.pdp-save {
  background: #FEF2F2; color: #DC2626; font-size: 12px; font-weight: 800;
  padding: 4px 9px; border-radius: 6px;
}
.pdp-price-note { flex-basis: 100%; font-size: 11.5px; color: var(--muted); }

/* Amazon-style "top highlights" key/value table */
.pdp-highlights {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 16px; margin: 0;
}
.pdp-highlights > div { min-width: 0; }
.pdp-highlights dt {
  font-size: 10.5px; font-weight: 700; letter-spacing: .05em;
  text-transform: uppercase; color: var(--pdp-slate-500);
}
.pdp-highlights dd { margin: 2px 0 0; font-size: 13.5px; font-weight: 600; color: var(--ink); }

/* ---------- flat-lay measurements ---------- */
.measurements-card {
  background: var(--pdp-slate-50);
  border: 1px solid #E2E8F0; border-radius: 12px; padding: 16px;
}
.measurements-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; flex-wrap: wrap; margin-bottom: 4px;
}
.measurements-card h4 {
  font-family: var(--font-text); font-size: 13.5px; font-weight: 700;
  color: var(--pdp-slate-900); letter-spacing: -.01em;
}
.unit-toggle {
  display: inline-flex; background: #fff; border: 1px solid var(--pdp-line);
  border-radius: 999px; padding: 2px;
}
.unit-toggle button {
  border: 0; background: transparent; cursor: pointer;
  font: 600 11px var(--font-text); color: var(--pdp-slate-500);
  padding: 4px 11px; border-radius: 999px;
}
.unit-toggle button.active { background: var(--ink); color: #fff; }
.measurements-intro { font-size: 11.5px; color: var(--pdp-slate-500); margin: 2px 0 10px; }
.measurements-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 14px; }
.measure-row {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
  font-size: 12.5px; padding-bottom: 6px; border-bottom: 1px dotted #CBD5E1;
}
.measure-k { color: var(--pdp-slate-500); font-weight: 500; }
.measure-v { color: var(--pdp-slate-900); font-weight: 700; white-space: nowrap; }
.measurements-note { font-size: 12px; color: var(--body); margin-top: 10px; }
.measurements-foot { font-size: 11px; color: var(--pdp-slate-500); margin-top: 10px; }
.measurements-card.empty p { font-size: 12.5px; color: var(--pdp-slate-500); margin-top: 6px; }

/* ---------- flaw disclosure ---------- */
.flaw-callout {
  border: 1px solid #FCD34D; background: #FFFBEB;
  border-left: 4px solid var(--grade-b); border-radius: 10px; padding: 14px;
}
.flaw-callout.clean { border-color: #A7F3D0; background: #ECFDF5; border-left-color: var(--grade-bnwt); }
.flaw-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.flaw-head h4 { font-family: var(--font-text); font-size: 13px; font-weight: 700; color: var(--ink); }
.flaw-icon { font-size: 15px; }
.flaw-callout p { font-size: 12.5px; color: #4B3A10; line-height: 1.55; }
.flaw-callout.clean p { color: #065F46; }
.flaw-photo-link {
  margin-top: 8px; background: none; border: 0; padding: 0; cursor: pointer;
  font: 700 12.5px var(--font-text); color: #B45309; text-decoration: underline;
}

/* ---------- accordions ---------- */
.pdp-accordions { display: grid; gap: 0; border-top: 1px solid var(--pdp-line); }
.pdp-acc { border-bottom: 1px solid var(--pdp-line); }
.pdp-acc summary {
  list-style: none; cursor: pointer; user-select: none;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 14px 2px; font: 700 14px var(--font-text); color: var(--ink);
}
.pdp-acc summary::-webkit-details-marker { display: none; }
.acc-sign { position: relative; width: 14px; height: 14px; flex: 0 0 14px; }
.acc-sign::before, .acc-sign::after {
  content: ""; position: absolute; background: var(--pdp-slate-500);
  transition: transform .2s ease, opacity .2s ease;
}
.acc-sign::before { top: 6px; left: 0; width: 14px; height: 2px; }
.acc-sign::after { left: 6px; top: 0; width: 2px; height: 14px; }
.pdp-acc[open] .acc-sign::after { transform: rotate(90deg); opacity: 0; }
.pdp-acc-body { padding: 0 2px 16px; display: grid; gap: 10px; font-size: 13.5px; color: var(--body); line-height: 1.6; }
.pdp-bullets { margin: 0; padding-left: 18px; display: grid; gap: 6px; }
.pdp-bullets li { font-size: 13px; }
.pdp-store-note {
  background: var(--pdp-slate-50); border-left: 3px solid var(--rust);
  padding: 8px 10px; border-radius: 6px; font-size: 12.5px;
}
.pdp-muted { font-size: 12px; color: var(--pdp-slate-500); }

/* ============================================================
   RIGHT COLUMN — STICKY BUY BOX
   ============================================================ */
.pdp-buybox-col { min-width: 0; }
.pdp-buybox {
  background: #fff; border: 1px solid var(--pdp-line); border-radius: 14px;
  padding: 16px; display: grid; gap: 14px;
  box-shadow: 0 6px 24px rgba(15, 23, 42, .06);
}
.buybox-price-row { display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap; }
.buybox-price { font-size: 24px; font-weight: 800; color: var(--ink); letter-spacing: -.02em; }
.buybox-compare { font-size: 14px; color: var(--muted); text-decoration: line-through; }

.buybox-stock {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 13px; font-weight: 700; margin-bottom: -8px;
}
.buybox-stock .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.buybox-stock.in { color: #047857; }
.buybox-stock.last { color: #B45309; }
.buybox-stock.sold { color: #DC2626; }
.buybox-stock-detail { font-size: 12px; color: var(--muted); }

.buybox-actions { display: grid; gap: 9px; }
.buybox-label {
  font-size: 10.5px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--pdp-slate-500);
}

.buybox-delivery { display: grid; gap: 7px; border-top: 1px solid var(--pdp-line); padding-top: 14px; }
.buybox-select {
  width: 100%; border: 1px solid var(--pdp-line); border-radius: 9px;
  padding: 10px 11px; font: 600 13px var(--font-text); color: var(--ink);
  background: #fff; cursor: pointer;
}
.delivery-estimate {
  background: var(--pdp-slate-50); border: 1px solid #E2E8F0;
  border-radius: 10px; padding: 11px; display: grid; gap: 6px;
}
.de-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: 12px; }
.de-row span { color: var(--pdp-slate-500); }
.de-row strong { color: var(--ink); text-align: right; font-weight: 700; }
.de-hubs { font-size: 11px; color: var(--pdp-slate-500); border-top: 1px dotted #CBD5E1; padding-top: 6px; }

.buybox-trust { border-top: 1px solid var(--pdp-line); padding-top: 14px; display: grid; gap: 9px; }
.pay-icons { display: flex; flex-wrap: wrap; gap: 6px; }
.pay-chip {
  background: var(--pay); color: var(--pay-ink);
  font-size: 11px; font-weight: 700; padding: 5px 10px; border-radius: 6px;
  border: 1px solid rgba(17, 24, 39, .08);
}
.trust-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; }
.trust-list li { font-size: 12px; color: var(--body); }

/* ============================================================
   BUTTONS
   ============================================================ */
.pdp-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 10px; padding: 13px 18px; cursor: pointer;
  font: 700 14px var(--font-text); text-decoration: none; border: 1px solid transparent;
  transition: background .15s ease, border-color .15s ease, transform .1s ease;
}
.pdp-btn.block { width: 100%; }
.pdp-btn svg { width: 17px; height: 17px; }
.pdp-btn.primary { background: var(--ink); color: #fff; }
.pdp-btn.primary:hover { background: #1F2937; }
.pdp-btn.outline { background: #fff; color: var(--ink); border-color: var(--ink); }
.pdp-btn.outline:hover { background: var(--tint); }
.pdp-btn.ghost { background: transparent; color: var(--muted); border-color: var(--pdp-line); }
.pdp-btn.whatsapp { background: var(--wa-green); color: #0B2E13; }
.pdp-btn.whatsapp:hover { background: var(--wa-green-dark); color: #fff; }
.pdp-btn.whatsapp.muted { background: #E2E8F0; color: #475569; }
.pdp-btn:disabled, .pdp-btn[disabled] {
  background: #E5E7EB !important; color: #9CA3AF !important;
  border-color: #E5E7EB !important; cursor: not-allowed;
}
.pdp-btn:active:not(:disabled) { transform: translateY(1px); }

/* ============================================================
   MOBILE FIXED BOTTOM ACTION BAR
   ============================================================ */
.pdp-actionbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  background: rgba(255, 255, 255, .97);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--pdp-line);
  box-shadow: 0 -6px 24px rgba(15, 23, 42, .1);
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  display: grid; gap: 8px;
}
.pdp-actionbar-price { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.pab-price { font-size: 18px; font-weight: 800; color: var(--ink); }
.pab-stock { font-size: 11.5px; font-weight: 700; }
.pab-stock.in { color: #047857; }
.pab-stock.last { color: #B45309; }
.pab-stock.sold { color: #DC2626; }
.pdp-actionbar-btns { display: grid; grid-template-columns: 1fr 1.2fr; gap: 8px; }
.pdp-actionbar-btns .pdp-btn { padding: 13px 10px; font-size: 13.5px; }

/* ============================================================
   ADDED-TO-BAG CONFIRMATION
   ============================================================ */
.pdp-added {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(15, 23, 42, .45);
  display: grid; place-items: center; padding: 22px;
}
.pdp-added-card {
  background: #fff; border-radius: 16px; padding: 22px;
  width: min(380px, 100%); display: grid; gap: 8px; text-align: center;
  box-shadow: 0 24px 60px rgba(15, 23, 42, .28);
}
.pdp-added-title { font-size: 16px; font-weight: 800; color: #047857; }
.pdp-added-sub { font-size: 13px; color: var(--muted); }
.pdp-added-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }

/* ============================================================
   FULL-SCREEN LIGHTBOX
   ============================================================ */
.pdp-lightbox {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(10, 15, 25, .94);
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px;
  padding: 20px;
}
.plb-stage {
  margin: 0; max-height: 86vh; display: grid; place-items: center;
  overflow: auto; overscroll-behavior: contain; cursor: zoom-in;
}
.plb-stage.zoomed { cursor: zoom-out; }
.plb-stage picture, .plb-stage img {
  max-width: 100%; max-height: 86vh; width: auto; height: auto;
  object-fit: contain; transition: transform .25s ease;
}
.plb-stage.zoomed img { transform: scale(1.9); }
.plb-close, .plb-nav {
  background: rgba(255, 255, 255, .14); color: #fff; border: 0; cursor: pointer;
  width: 44px; height: 44px; border-radius: 50%; font-size: 22px; line-height: 1;
  display: grid; place-items: center;
}
.plb-close { position: absolute; top: 18px; right: 18px; z-index: 2; font-size: 17px; }
.plb-close:hover, .plb-nav:hover { background: rgba(255, 255, 255, .28); }
.plb-counter {
  position: absolute; bottom: 20px; left: 0; right: 0; text-align: center;
  color: rgba(255, 255, 255, .78); font-size: 12.5px;
}

/* ============================================================
   RELATED PIECES
   ============================================================ */
.pdp-related { margin-top: 40px; padding-top: 28px; border-top: 1px solid var(--pdp-line); }
.pdp-related .section-title { font-size: clamp(20px, 3vw, 26px); margin-bottom: 16px; }
.pdp-related-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px;
}
.rel-card {
  text-decoration: none; color: inherit; display: grid; gap: 4px;
  background: #fff; border: 1px solid var(--pdp-line); border-radius: 12px;
  padding: 8px; transition: border-color .15s ease, transform .15s ease;
}
.rel-card:hover { border-color: var(--ink); transform: translateY(-2px); }
.rel-media { position: relative; border-radius: 9px; overflow: hidden; background: var(--pdp-slate-50); }
.rel-media picture, .rel-media img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; display: block; }
.rel-noimg { display: grid; place-items: center; aspect-ratio: 4 / 5; font-size: 11px; color: var(--muted); }
.rel-grade {
  position: absolute; top: 7px; left: 7px; background: var(--grade, #475569); color: #fff;
  font-size: 9.5px; font-weight: 700; padding: 3px 7px; border-radius: 999px;
}
.rel-name {
  font-size: 13px; font-weight: 600; color: var(--ink); margin-top: 4px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.rel-meta { font-size: 11px; color: var(--muted); }
.rel-price { font-size: 14px; font-weight: 800; color: var(--ink); }

/* ======================================================================
   TABLET — ≥720px
   ====================================================================== */
@media (min-width: 720px) {
  .pdp-skeleton { grid-template-columns: 45% 1fr; }
  .pdp-highlights { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pdp-related-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .pdp-actionbar { padding-left: 22px; padding-right: 22px; }
  .pdp-actionbar-btns { grid-template-columns: 1fr 1fr; max-width: 520px; margin-left: auto; }
  .pdp-actionbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
}

/* ======================================================================
   DESKTOP — ≥1024px : 45% / 30% / 25% asymmetric grid
   ====================================================================== */
@media (min-width: 1024px) {
  .pdp-grid {
    grid-template-columns: minmax(0, 45fr) minmax(0, 30fr) minmax(0, 25fr);
    gap: var(--pdp-gap);
    padding-top: 14px;
  }

  /* Sticky media column + sticky buy box follow the shopper down the page */
  .pdp-media-sticky { position: sticky; top: var(--pdp-head-offset); }
  .pdp-buybox { position: sticky; top: var(--pdp-head-offset); }

  /* Vertical thumbnail strip to the LEFT of the main stage */
  .pdp-gallery { grid-template-columns: 72px minmax(0, 1fr); align-items: start; }
  .pdp-thumbrail {
    order: 0; flex-direction: column; overflow-y: auto; overflow-x: hidden;
    max-height: 520px; padding-right: 2px;
  }
  .pdp-thumb { width: 100%; }
  .pdp-dots { display: none; }          /* thumbnails replace dots on desktop */
  .pdp-actionbar { display: none !important; }   /* buy box is always visible */
  .pdp-title { font-size: 26px; }
  .pdp-highlights { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pdp-crumbs { padding-top: 20px; }
}

@media (min-width: 1280px) {
  .pdp-title { font-size: 29px; }
  .pdp-gallery { grid-template-columns: 80px minmax(0, 1fr); }
}

/* ======================================================================
   MOBILE — ≤1023px refinements
   ====================================================================== */
@media (max-width: 1023px) {
  /* Reserve room for the fixed action bar so the last section is reachable */
  body.pdp-body { padding-bottom: 104px; }

  /* Edge-to-edge swipeable carousel */
  .pdp-media { margin-left: -22px; margin-right: -22px; }
  .pdp-stage-wrap { border-radius: 0; border-left: 0; border-right: 0; }
  .pdp-media-note, .pdp-dots { padding: 0 22px; }
  .pdp-thumbrail { padding: 0 22px 4px; }
  .pdp-thumb { width: 58px; }
  .pdp-thumb picture, .pdp-thumb img { height: 64px; }

  /* The buy box drops below the specs; its CTAs are mirrored in the bar */
  .pdp-buybox { box-shadow: none; }
  .pdp-buybox .buybox-actions { display: none; }
}

@media (max-width: 420px) {
  .measurements-grid { grid-template-columns: 1fr; }
  .pdp-highlights { grid-template-columns: 1fr 1fr; }
  .pdp-added-actions { grid-template-columns: 1fr; }
}

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
  .pdp-stage-track { scroll-behavior: auto; }
  .sk-media, .sk-line { animation: none; }
  .plb-stage img { transition: none; }
}

/* A video is a gallery view, not a zoomable photo. Controls keep their space. */
.pdp-slide-video { position:relative; background:#16271e; cursor:default; }
.pdp-slide-video video { display:block; width:100%; height:100%; object-fit:contain; background:#16271e; }
.pdp-video-thumb-cover { display:block; height:72px; position:relative; background:#213d2d; }
.pdp-video-play { position:absolute; inset:0; display:grid; place-items:center; color:white; background:rgba(15,35,23,.25); font-size:22px; text-shadow:0 2px 8px #0008; }
.pdp-stage-wrap.is-video .pdp-counter { top:12px; right:12px; left:auto; bottom:auto; }
.pdp-stage-wrap.is-video .pdp-stage-nav { background:rgba(255,255,255,.75); opacity:.8; }
.pdp-zoom-btn[hidden],.pdp-video-error[hidden] { display:none!important; }
.pdp-video-error { position:absolute; inset:35% 12% auto; padding:15px; color:#e5f0e8; background:#192d23e8; border-radius:10px; font-size:12px; line-height:1.6; text-align:center; }
.pdp-video-error button { display:block; margin:10px auto 0; padding:7px 13px; background:#ecf2ea; border:0; border-radius:6px; color:#294b36; font-weight:600; cursor:pointer; }

.pdp-video-play svg { width:30px; height:30px; filter:drop-shadow(0 2px 6px #0008); }
.pdp-back-link { display:inline-flex; align-items:center; gap:6px; white-space:nowrap; }
.pdp-back-link svg { width:15px; height:15px; flex:none; }
.pdp-back-short { display:none; }
@media(max-width:640px) {
  .pdp-back-link { padding:8px 11px; font-size:11px; }
  .pdp-back-long { display:none; }
  .pdp-back-short { display:inline; }
  .pdp-body .head-actions { gap:7px; }
}
