/* ═══════════════════════════════════════════════════════════════════════════
   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}
}
