/* ═══════════════════════════════════════════════════════════════════════════
   product.css — product detail page (/product/{slug})
   IDENTICAL ACROSS ALL TENANTS. Patch once, copy.

   Deliberately a SEPARATE file from storefront.css: naturalcureayurveda
   appends a tenant-specific large-tile override to the end of storefront.css,
   so editing that file risks clobbering an intentional divergence. Everything
   here derives from the CSS custom properties brand-config.js injects, so the
   page picks up each tenant's palette with no per-tenant edits.

   Layout: single column on phones; two columns (gallery | buy box) from
   768px with a sticky buy box on desktop.
   ═══════════════════════════════════════════════════════════════════════════ */

*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{
  margin:0;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',system-ui,Arial,sans-serif;
  background:var(--ds-bg,var(--bg,#fff));color:var(--ds-text,var(--text,#222));
  overflow-x:hidden;-webkit-font-smoothing:antialiased;
}
img{max-width:100%}
a{color:var(--primary,#2e7d32)}

.pd-wrap{max-width:1100px;margin:0 auto;padding:0 14px 90px}

/* ── Breadcrumb ─────────────────────────────────────────────────────────── */
.pd-crumb{
  display:flex;align-items:center;gap:6px;flex-wrap:wrap;
  font-size:12.5px;color:var(--muted,#777);padding:12px 2px 4px;
}
.pd-crumb a{color:var(--muted,#777);text-decoration:none}
.pd-crumb a:hover{color:var(--primary,#2e7d32);text-decoration:underline}
.pd-crumb .sep{opacity:.5}
.pd-crumb .cur{color:var(--text,#222);font-weight:600;
  max-width:52vw;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

/* ── Two-column shell ───────────────────────────────────────────────────── */
.pd-main{display:grid;grid-template-columns:1fr;gap:22px;align-items:start}
@media(min-width:768px){
  .pd-main{grid-template-columns:minmax(0,1fr) minmax(300px,380px);gap:34px}
  .pd-wrap{padding-bottom:40px}
}
@media(min-width:1024px){
  .pd-main{grid-template-columns:minmax(0,1fr) 400px;gap:44px}
}

/* ── Gallery ────────────────────────────────────────────────────────────── */
.pd-gallery{position:relative}
.pd-stage{
  position:relative;width:100%;aspect-ratio:1/1;background:#fff;
  border:1px solid var(--ds-border,var(--border,#eee));
  border-radius:var(--ds-radius,14px);overflow:hidden;
  display:flex;align-items:center;justify-content:center;
}
@media(min-width:768px){.pd-stage{aspect-ratio:4/3}}
.pd-stage img{width:100%;height:100%;object-fit:contain;padding:10px;transition:opacity .18s}
.pd-badges{position:absolute;top:10px;left:10px;display:flex;flex-direction:column;gap:6px;z-index:2}
.pd-badge{
  font-size:11px;font-weight:800;letter-spacing:.03em;padding:4px 9px;
  border-radius:20px;background:var(--primary,#2e7d32);color:#fff;
}
.pd-badge.sale{background:#d32f2f}
.pd-badge.oos{background:#616161}

.pd-thumbs{display:flex;gap:8px;margin-top:10px;overflow-x:auto;padding-bottom:4px;scrollbar-width:thin}
.pd-thumb{
  flex:0 0 auto;width:62px;height:62px;border-radius:10px;overflow:hidden;
  border:2px solid var(--ds-border,var(--border,#eee));background:#fff;
  cursor:pointer;padding:0;transition:border-color .15s;
}
.pd-thumb[aria-current="true"]{border-color:var(--primary,#2e7d32)}
.pd-thumb img{width:100%;height:100%;object-fit:contain}

/* ── Buy box ────────────────────────────────────────────────────────────── */
@media(min-width:768px){
  .pd-buy{position:sticky;top:16px}
}
.pd-title{font-size:22px;line-height:1.25;font-weight:800;margin:2px 0 6px}
@media(min-width:768px){.pd-title{font-size:26px}}
.pd-unit{font-size:14px;color:var(--muted,#777);margin-bottom:12px}
.pd-labels{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:10px}
.pd-lbl{font-size:10.5px;font-weight:800;letter-spacing:.03em;padding:3px 8px;border-radius:6px;
  background:var(--primaryLight,#e8f5e9);color:var(--primary,#2e7d32)}

.pd-price-row{display:flex;align-items:baseline;gap:10px;flex-wrap:wrap;margin-bottom:4px}
.pd-price{font-size:27px;font-weight:800;color:var(--text,#222)}
.pd-orig{font-size:16px;color:var(--muted,#999);text-decoration:line-through}
.pd-off{font-size:12.5px;font-weight:800;color:#d32f2f;background:#ffebee;padding:3px 8px;border-radius:6px}
.pd-tax{font-size:12px;color:var(--muted,#888);margin-bottom:16px}

.pd-actions{display:flex;gap:10px;align-items:center;margin-bottom:8px}
.pd-add{
  flex:1;min-height:48px;border:none;border-radius:var(--ds-radius,12px);
  background:var(--primary,#2e7d32);color:#fff;font-size:15px;font-weight:800;
  cursor:pointer;letter-spacing:.02em;transition:filter .15s;
}
.pd-add:hover{filter:brightness(1.07)}
.pd-add:disabled{background:#bdbdbd;cursor:not-allowed}
.pd-step{
  flex:1;display:flex;align-items:center;justify-content:space-between;
  min-height:48px;border:2px solid var(--primary,#2e7d32);
  border-radius:var(--ds-radius,12px);overflow:hidden;background:#fff;
}
.pd-step button{
  width:48px;min-height:44px;border:none;background:none;font-size:22px;line-height:1;
  color:var(--primary,#2e7d32);cursor:pointer;font-weight:700;
}
.pd-step span{font-size:16px;font-weight:800}
.pd-share{
  width:48px;height:48px;flex:0 0 auto;border-radius:var(--ds-radius,12px);
  border:1px solid var(--ds-border,var(--border,#ddd));background:#fff;
  font-size:18px;cursor:pointer;color:var(--text,#333);
}
.pd-share:hover{border-color:var(--primary,#2e7d32)}
.pd-note{font-size:12.5px;color:var(--muted,#777);margin-top:10px;line-height:1.5}

/* ── Rich detail body (sanitized admin HTML) ────────────────────────────── */
.pd-section{margin-top:34px}
.pd-section h2.pd-h{
  font-size:16px;font-weight:800;margin:0 0 12px;padding-bottom:8px;
  border-bottom:1px solid var(--ds-border,var(--border,#eee));
}
.pd-body{font-size:14.5px;line-height:1.7;color:var(--text,#333);overflow-wrap:break-word}
.pd-body h2{font-size:17px;margin:22px 0 8px}
.pd-body h3{font-size:15px;margin:18px 0 6px}
.pd-body h4{font-size:14px;margin:16px 0 6px}
.pd-body p{margin:0 0 12px}
.pd-body ul,.pd-body ol{margin:0 0 12px;padding-left:22px}
.pd-body li{margin-bottom:6px}
.pd-body img{border-radius:10px;margin:10px 0;height:auto}
.pd-body blockquote{
  margin:12px 0;padding:10px 14px;border-left:3px solid var(--primary,#2e7d32);
  background:var(--primaryLight,#f4f8f5);border-radius:0 8px 8px 0;color:var(--muted,#555);
}
.pd-body hr{border:none;border-top:1px solid var(--ds-border,var(--border,#eee));margin:18px 0}
.pd-body a{word-break:break-word}

/* ── Related rail ───────────────────────────────────────────────────────── */
.pd-rail{display:grid;grid-template-columns:repeat(auto-fill,minmax(132px,1fr));gap:12px}
.pd-rcard{
  display:block;text-decoration:none;color:inherit;background:var(--card,#fff);
  border:1px solid var(--ds-border,var(--border,#eee));
  border-radius:var(--ds-radius,12px);overflow:hidden;transition:box-shadow .15s,transform .15s;
}
.pd-rcard:hover{box-shadow:0 6px 20px rgba(0,0,0,.09);transform:translateY(-2px)}
.pd-rcard .ri{width:100%;aspect-ratio:1.15;object-fit:cover;background:#fafafa;display:block}
.pd-rcard .rn{font-size:12.5px;font-weight:600;line-height:1.35;padding:8px 8px 2px;
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;min-height:38px}
.pd-rcard .rp{font-size:13.5px;font-weight:800;padding:0 8px 10px}

/* ── Sticky bottom cart bar (mobile) ────────────────────────────────────── */
.pd-cartbar{
  position:fixed;left:0;right:0;bottom:0;z-index:40;
  display:none;align-items:center;justify-content:space-between;gap:12px;
  padding:10px 14px calc(10px + env(safe-area-inset-bottom,0));
  background:var(--primary,#2e7d32);color:#fff;text-decoration:none;
  box-shadow:0 -4px 18px rgba(0,0,0,.16);
}
.pd-cartbar.on{display:flex}
.pd-cartbar .cb-l{font-size:13px;font-weight:600}
.pd-cartbar .cb-r{font-size:14px;font-weight:800;display:flex;align-items:center;gap:6px}

/* ── States ─────────────────────────────────────────────────────────────── */
.pd-skel{animation:pdpulse 1.25s ease-in-out infinite;background:#eee;border-radius:8px}
@keyframes pdpulse{0%,100%{opacity:1}50%{opacity:.55}}
.pd-missing{text-align:center;padding:64px 16px}
.pd-missing h1{font-size:20px;margin:0 0 8px}
.pd-missing p{color:var(--muted,#777);font-size:14px;margin:0 0 20px}
.pd-btn{
  display:inline-block;padding:12px 22px;border-radius:var(--ds-radius,12px);
  background:var(--primary,#2e7d32);color:#fff;text-decoration:none;font-weight:700;font-size:14px;
}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}

@media(prefers-reduced-motion:reduce){
  *{animation-duration:.01ms !important;transition-duration:.01ms !important;scroll-behavior:auto !important}
}

/* ══════════════════════════════════════════════════════════════════════════
   FULL-SCREEN VIEWER + STRUCTURED SECTIONS

   ⚠ EVERY BUTTON SETS ITS OWN `color`. These sit on a near-black backdrop, and
   a control that inherits a page colour it was never designed against is how
   the category-order arrows shipped white-on-white and invisible.
   ══════════════════════════════════════════════════════════════════════════ */

/* The hero is now a control, and says so. */
.pd-stage.pd-zoomable { cursor: zoom-in; }
.pd-stage.pd-zoomable img:focus-visible {
  outline: 3px solid var(--primary, #2e7d32); outline-offset: -3px;
}
/* ⚠ A GARMENT IS TALLER THAN IT IS WIDE. 4/3 landscape crops a shirt's hem on
   the one page where the photograph IS the product. Portrait on desktop, and
   the shopper can still open it full-screen for the rest. */
@media (min-width: 768px) {
  .pd-stage { aspect-ratio: 3 / 4; max-height: 74vh; }
}

.pdz {
  position: fixed; inset: 0; z-index: 4000; display: none;
  background: rgba(8, 8, 10, .96);
  align-items: center; justify-content: center;
  -webkit-user-select: none; user-select: none;
}
.pdz.open { display: flex; }
.pdz-stage {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; cursor: zoom-in; touch-action: none;
}
.pdz.pdz-zoomed .pdz-stage { cursor: grab; }
.pdz.pdz-zoomed .pdz-stage:active { cursor: grabbing; }
.pdz-img {
  max-width: 94vw; max-height: 86vh; object-fit: contain;
  transform-origin: center center; transition: transform .12s ease-out;
  -webkit-user-drag: none; user-drag: none; pointer-events: none;
}

.pdz-close, .pdz-nav, .pdz-zbtn {
  position: absolute; z-index: 2;
  background: rgba(255, 255, 255, .12); color: #fff;
  border: 1px solid rgba(255, 255, 255, .26); border-radius: 50%;
  cursor: pointer; line-height: 1; padding: 0;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.pdz-close:hover, .pdz-nav:hover, .pdz-zbtn:hover { background: rgba(255, 255, 255, .26); }
.pdz-close { top: 16px; right: 16px; width: 46px; height: 46px; font-size: 26px; }
.pdz-nav { top: 50%; transform: translateY(-50%); width: 50px; height: 50px; font-size: 30px; }
.pdz-nav[hidden] { display: none; }
.pdz-prev { left: 14px; }
.pdz-next { right: 14px; }

.pdz-bar {
  position: absolute; left: 50%; transform: translateX(-50%); bottom: 96px;
  z-index: 2; display: flex; align-items: center; gap: 12px;
  padding: 6px 10px; border-radius: 22px;
  background: rgba(255, 255, 255, .10); border: 1px solid rgba(255, 255, 255, .2);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.pdz-zbtn { position: static; width: 34px; height: 34px; font-size: 19px; }
.pdz-count { color: rgba(255, 255, 255, .82); font: 600 13px/1 system-ui, sans-serif; min-width: 52px; text-align: center; }

.pdz-thumbs {
  position: absolute; left: 0; right: 0; bottom: 16px; z-index: 2;
  display: flex; gap: 8px; justify-content: center;
  padding: 0 16px; overflow-x: auto; scrollbar-width: none;
}
.pdz-thumbs::-webkit-scrollbar { display: none; }
.pdz-thumb {
  flex: 0 0 auto; width: 58px; height: 58px; padding: 2px;
  background: rgba(255, 255, 255, .08); color: #fff;
  border: 2px solid transparent; border-radius: 8px; cursor: pointer;
}
.pdz-thumb[aria-current="true"] { border-color: #fff; background: rgba(255, 255, 255, .2); }
.pdz-thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }

@media (max-width: 560px) {
  .pdz-nav { width: 42px; height: 42px; font-size: 25px; }
  .pdz-bar { bottom: 86px; }
  .pdz-thumb { width: 48px; height: 48px; }
}

/* ── Structured sections ───────────────────────────────────────────────── */
.pd-specs { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.pd-specs th, .pd-specs td {
  text-align: left; padding: 10px 12px; vertical-align: top;
  border-bottom: 1px solid var(--ds-border, var(--border, #eee));
}
.pd-specs th { width: 38%; font-weight: 600; color: var(--muted, #6b7280); }
.pd-specs tr:last-child th, .pd-specs tr:last-child td { border-bottom: none; }

/* ⚠ THE CHART SCROLLS ITSELF. A table wider than a phone that is NOT wrapped
   gives the whole product page a horizontal scrollbar — the photo, the price
   and the Add button all slide sideways with it. */
.pd-chart-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.pd-chart { border-collapse: collapse; font-size: 14px; min-width: 100%; }
.pd-chart th, .pd-chart td {
  padding: 9px 14px; text-align: center; white-space: nowrap;
  border: 1px solid var(--ds-border, var(--border, #eee));
}
.pd-chart thead th { background: var(--ds-surface-2, #f6f7f9); font-weight: 700; }
.pd-chart tbody th { background: var(--ds-surface-2, #fafafa); font-weight: 700; text-align: left; }
.pd-chart-note { margin: 10px 0 0; font-size: 12.5px; color: var(--muted, #6b7280); }

.pd-list { margin: 0; padding-left: 20px; font-size: 14.5px; line-height: 1.85; }
.pd-highlights .pd-list { list-style: none; padding-left: 0; }
.pd-highlights .pd-list li { position: relative; padding-left: 24px; }
.pd-highlights .pd-list li::before {
  content: "\2713"; position: absolute; left: 0; top: 0;
  color: var(--primary, #2e7d32); font-weight: 800;
}

/* Tables typed into the rich description now survive the sanitizer, so they
   need to look like the structured ones rather than like raw HTML. */
.pd-body table { border-collapse: collapse; width: 100%; font-size: 14px; margin: 12px 0; display: block; overflow-x: auto; }
.pd-body th, .pd-body td { padding: 9px 12px; border: 1px solid var(--ds-border, var(--border, #eee)); text-align: left; }
.pd-body thead th { background: var(--ds-surface-2, #f6f7f9); font-weight: 700; }

/* ══ SIZE PICKER ON THE PRODUCT PAGE ═══════════════════════════════════════
   ⚠ THE PAGE USED TO SHOW NO SIZES AT ALL, and adding to the basket from here
   wrote a line with no size — which storefront.js then discarded on the next
   load, emptying the shopper's basket. The picker is the other half of that
   fix: a shirt cannot be added until a size is chosen.

   .size-chip / .size-pick come from storefront.css, which this page also
   loads. Only the page-specific wrapper lives here. */
.pd-sizes { margin: 14px 0 12px; }
.pd-size-lbl {
  display: flex; align-items: baseline; gap: 8px;
  font-size: 12px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted, #6B615A); margin-bottom: 8px;
}
.pd-size-cur {
  font-size: 13px; font-weight: 800; letter-spacing: .04em;
  text-transform: none; color: var(--text, #14110F);
}
.pd-sizes .size-pick { justify-content: flex-start; }
/* ⚠ THE CHOSEN SIZE MUST LOOK CHOSEN. Without this the picker accepts a tap
   and looks identical afterwards, which reads as a control that does nothing. */
.pd-sizes .size-chip.on {
  background: var(--primary, #0B0B0B); border-color: var(--primary, #0B0B0B);
  color: #fff;
}
/* Tapping ADD without a size scrolls here and pulses, rather than appearing
   to ignore the tap. */
@keyframes pdSizesAsk {
  0%, 100% { box-shadow: 0 0 0 0 rgba(164, 18, 63, 0); }
  30%      { box-shadow: 0 0 0 4px rgba(164, 18, 63, .28); }
}
.pd-sizes-ask {
  border-radius: 10px;
  animation: pdSizesAsk .9s ease-in-out 2;
}
