/* ══════════════════════════════════════════════════════════════════════════
   eStorePoint — Product detail page.
   Loaded only by product.php ($head_css = ['product']).
   ══════════════════════════════════════════════════════════════════════════ */

.pdp-crumb{padding:34px 0 0;}
.pdp-main{padding-top:1.6rem;}

/* ── Buy box grid ─────────────────────────────────────────────────────────
   Gallery gets the larger column: at 4:3 the image is the thing being sold,
   and the buy panel needs less width than it needs height. */
.pdp-grid{
  display:grid;
  grid-template-columns:minmax(0,1.12fr) minmax(0,.88fr);
  gap:2.8rem;align-items:start;
}
.pdp-buy{min-width:0;position:sticky;top:92px;}

/* ── Eyebrow: category + rating on one line ───────────────────────────── */
.pdp-eyebrow{display:flex;align-items:center;gap:.85rem;flex-wrap:wrap;margin-bottom:.55rem;}
.pdp-rating-link{
  display:inline-flex;align-items:center;gap:.4rem;text-decoration:none;
  font-size:.82rem;color:var(--muted);font-weight:500;transition:.18s;
}
.pdp-rating-link:hover{color:var(--green-800);}
.pdp-rating-link span{white-space:nowrap;}

.pdp-title{font-size:clamp(1.5rem,3.2vw,2.05rem);line-height:1.2;letter-spacing:-.015em;margin:0;color:var(--green-900);}

/* Eco impact — the headline differentiator, so it gets its own treatment
   rather than sitting in a generic alert box. */
.pdp-eco{
  display:flex;align-items:center;gap:.6rem;margin:.9rem 0 0;
  padding:.6rem .85rem;border-radius:var(--radius-sm);
  background:var(--green-50);border:1px solid var(--green-100);color:var(--green-800);
  font-size:.9rem;font-weight:600;line-height:1.45;
}
.pdp-eco svg{flex:none;color:var(--green-600);}

/* ── Price block ──────────────────────────────────────────────────────── */
.pdp-price-row{display:flex;align-items:baseline;gap:.8rem;flex-wrap:wrap;margin:1.15rem 0 0;}
.pdp-price{font-size:2.1rem;line-height:1.1;}
.pdp-price-note{font-size:.76rem;color:var(--muted);margin-top:.1rem;}

.stock-pill{
  display:inline-flex;align-items:center;gap:.35rem;font-size:.76rem;font-weight:700;
  padding:.26rem .65rem;border-radius:999px;line-height:1.4;
  background:#eaf7ee;color:var(--green-800);border:1px solid #cbe9d4;
}
.stock-pill::before{content:"";width:6px;height:6px;border-radius:50%;background:currentColor;}
/* Low stock is deliberately a warmer, louder treatment — but only at or below
   ten units, so a stock figure of 45 never fabricates scarcity. */
.stock-pill.is-low{background:#fef3e2;color:#a15c07;border-color:#f6d9ab;}
.stock-pill.is-out{background:#fdeaea;color:#a01c1c;border-color:#f3c4c4;}
/* A pre-order is neither a shortage nor a warning — it is a scheduled wait, so
   it gets a calm informational treatment rather than the alarming red that
   "we do not have this" deserves. */
.stock-pill.is-pre{background:#eef4ff;color:#1d4ed8;border-color:#cddcfb;}

.pdp-preorder-note{
  margin:.9rem 0 0;padding:.75rem .9rem;border-radius:12px;
  background:#f7f9ff;border:1px solid #e2eafb;color:#3b4a6b;
  font-size:.85rem;line-height:1.6;max-width:44ch;
}

.pdp-short{margin:1rem 0 0;color:var(--muted);line-height:1.65;font-size:.95rem;}

/* ── Actions ──────────────────────────────────────────────────────────── */
.pdp-actions{display:flex;align-items:center;gap:.9rem;margin:1.5rem 0 0;flex-wrap:wrap;}
.pdp-add{min-width:200px;justify-content:center;}
.pdp-qty{cursor:pointer;}

.gal-zoom-hint{
  position:absolute;left:.8rem;bottom:.8rem;
  width:32px;height:32px;border-radius:50%;display:grid;place-items:center;
  background:rgba(255,255,255,.92);color:var(--green-800);
  box-shadow:0 2px 8px rgba(17,34,24,.14);
  opacity:0;transition:opacity .2s;pointer-events:none;
}
.pdp-main .gal-main{cursor:zoom-in;}
.pdp-main .gal-main:hover > img{transform:scale(2.1);cursor:zoom-out;}
.pdp-main .gal-main:hover .gal-zoom-hint{opacity:1;}

/* ── Trust strip ──────────────────────────────────────────────────────── */
.pdp-trust{
  display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.7rem;
  margin:1.5rem 0 0;padding:1rem;border-radius:var(--radius-sm);
  background:#fff;border:1px solid var(--line);
}
.pdp-trust-item{display:flex;align-items:center;gap:.55rem;font-size:.83rem;color:var(--ink);line-height:1.35;}
.pdp-trust-item svg{flex:none;color:var(--green-600);}
.pdp-trust-item span{min-width:0;}

.pdp-payments{margin:1rem 0 0;}

/* ── Share ────────────────────────────────────────────────────────────── */
.pdp-share{display:flex;align-items:center;gap:.45rem;flex-wrap:wrap;margin:1.2rem 0 0;}
.pdp-share .share-label{margin-right:.2rem;}
.pdp-share .share-hint{flex-basis:100%;margin:.35rem 0 0;}

/* ── Accordions ─────────────────────────────────────────────────────────
   Native <details> so the panels are usable with JavaScript off and the
   browser handles the disclosure semantics. */
.pdp-panels{margin:2.8rem 0 0;border:1px solid var(--line);border-radius:var(--radius);overflow:hidden;background:#fff;}
.pdp-panel + .pdp-panel{border-top:1px solid var(--line);}
.pdp-panel > summary{
  display:flex;align-items:center;justify-content:space-between;gap:1rem;
  padding:1.05rem 1.4rem;cursor:pointer;list-style:none;
  font-weight:700;color:var(--green-900);font-size:1rem;transition:background .15s;
}
.pdp-panel > summary::-webkit-details-marker{display:none;}
.pdp-panel > summary:hover{background:var(--green-50);}
.pdp-panel > summary i{
  width:9px;height:9px;flex:none;color:var(--muted);
  border-right:2px solid currentColor;border-bottom:2px solid currentColor;
  transform:rotate(45deg);transition:transform .2s;
}
.pdp-panel[open] > summary i{transform:rotate(-135deg);}
.pdp-panel-body{padding:0 1.4rem 1.4rem;}

/* The description reuses the article typography so headings, lists and links
   inside admin-authored copy look the same here as on the blog. */
.pdp-prose{max-width:none;font-size:.95rem;line-height:1.75;color:#2c3540;}
.pdp-prose p{margin:0 0 .9rem;}
.pdp-prose p:last-child{margin-bottom:0;}
.pdp-impact{color:var(--green-800);}

.pdp-list{margin:0;padding-left:1.2rem;font-size:.93rem;line-height:1.7;color:#2c3540;}
.pdp-list li{margin-bottom:.5rem;}
.pdp-list li::marker{color:var(--green-600);}
.pdp-list a{color:var(--green-700);font-weight:600;}
.pdp-panel-foot{margin:1rem 0 0;font-size:.86rem;}
.pdp-panel-foot a{color:var(--green-700);font-weight:600;}

/* ── FAQ ──────────────────────────────────────────────────────────────── */
.pdp-faq{margin:3.4rem 0 0;}
.faq-list{max-width:820px;margin:0 auto;}
.faq-item{border:1px solid var(--line);border-radius:var(--radius-sm);background:#fff;margin-bottom:.7rem;}
.faq-item > summary{
  display:flex;align-items:center;justify-content:space-between;gap:1rem;
  padding:.95rem 1.15rem;cursor:pointer;list-style:none;
  font-weight:600;color:var(--green-900);font-size:.96rem;transition:background .15s;
}
.faq-item > summary::-webkit-details-marker{display:none;}
.faq-item > summary:hover{background:var(--green-50);}
.faq-item > summary i{
  width:8px;height:8px;flex:none;color:var(--muted);
  border-right:2px solid currentColor;border-bottom:2px solid currentColor;
  transform:rotate(45deg);transition:transform .2s;
}
.faq-item[open] > summary i{transform:rotate(-135deg);}
.faq-answer{padding:0 1.15rem 1.05rem;}
.faq-answer p{margin:0;color:var(--muted);font-size:.92rem;line-height:1.7;}

/* ── Reviews ──────────────────────────────────────────────────────────── */
.pdp-reviews{margin:3.4rem 0 0;}
.pdp-reviews .rev-summary{max-width:900px;}
.review-form{padding:1.5rem;margin-top:1.6rem;max-width:900px;}
.pdp-review-list{margin-top:1.6rem;max-width:900px;}

/* Signed-out gate — the form is replaced by a way in, not by a disabled shell.
   A greyed-out form just invites the visitor to fight it. */
.rev-gate-text{margin:0 0 1.1rem;max-width:52ch;line-height:1.65;}
.rev-gate{display:flex;gap:.65rem;flex-wrap:wrap;}

/* Signed-in identity line: shown rather than asked for, because the server
   reads the name and email from the session and ignores anything posted. */
.rev-as{display:flex;align-items:center;gap:.5rem;flex-wrap:wrap;margin:0 0 1.2rem;
  padding:.6rem .85rem;border-radius:12px;background:var(--green-50);
  border:1px solid var(--green-100);color:var(--green-800);font-size:.9rem;}
.rev-as svg{color:var(--green-600);flex:none;}
.rev-as b{font-weight:700;}
.rev-as-mail{font-size:.82rem;}

/* The avatar changes the review head from a text row to a proper identity
   block, so it needs to stack rather than sit inline. */
.review-head{display:flex;align-items:center;gap:.8rem;flex-wrap:wrap;}
.review-head-text{display:flex;flex-direction:column;gap:.05rem;min-width:0;}
.review-head-text strong{color:var(--ink);}
.review-head .avatar{width:38px;height:38px;font-size:.95rem;background:var(--green-700);}

/* ── Recently viewed / related ────────────────────────────────────────── */
.pdp-recent{margin:3.4rem 0 0;}
.pdp-related{background:var(--green-50);}

/* ── Prev / next ──────────────────────────────────────────────────────── */
.pdp-nav{
  display:grid;grid-template-columns:1fr 1fr;gap:1rem;margin:3rem 0 0;
  max-width:900px;
}

/* ── Sticky buy bar ─────────────────────────────────────────────────────
   Appears only after the primary button has left the viewport, so it never
   covers content the shopper is still reading. `hidden` is toggled by JS;
   the transition needs the element rendered, hence the two-step reveal. */
/* `visibility:hidden` is used instead of the `hidden` attribute because the
   bar is meant to slide. JS releases `hidden` once, so an off-screen bar would
   otherwise keep its Add-to-Cart button focusable inside an aria-hidden region
   — a tab lands on a control the shopper cannot see. visibility removes it
   from both the tab order and the a11y tree, and the delayed flip lets the
   transform finish sliding out before it disappears. */
.pdp-sticky{
  position:fixed;left:0;right:0;bottom:0;z-index:90;
  background:rgba(255,255,255,.96);backdrop-filter:blur(10px);
  border-top:1px solid var(--line);
  box-shadow:0 -4px 18px rgba(17,34,24,.08);
  transform:translateY(100%);visibility:hidden;
  transition:transform .28s cubic-bezier(.22,.8,.3,1),visibility 0s linear .28s;
}
.pdp-sticky[hidden]{display:none;}
.pdp-sticky.is-in{
  transform:translateY(0);visibility:visible;
  transition:transform .28s cubic-bezier(.22,.8,.3,1),visibility 0s;
}
.pdp-sticky-inner{display:flex;align-items:center;gap:1rem;padding:.6rem 0;}
.pdp-sticky-img{
  width:48px;height:48px;flex:none;border-radius:10px;object-fit:cover;
  background:var(--green-50);border:1px solid var(--line);
}
.pdp-sticky-text{display:flex;flex-direction:column;gap:.1rem;min-width:0;flex:1;}
.pdp-sticky-name{
  font-weight:700;color:var(--green-900);font-size:.92rem;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
.pdp-sticky-price{font-weight:800;color:var(--green-800);font-size:1rem;}
.pdp-sticky-qty select{
  padding:.5rem .6rem;border:1px solid var(--line);border-radius:10px;
  font-weight:700;background:#fff;cursor:pointer;font-family:inherit;
}

/* Room for the bar so it never sits on top of the footer. */
body.pdp-sticky-on{padding-bottom:80px;}

/* ── Responsive ───────────────────────────────────────────────────────── */
@media (max-width:960px){
  .pdp-grid{grid-template-columns:minmax(0,1fr);gap:1.8rem;}
  .pdp-buy{position:static;}   /* sticky buy box would fight the sticky bar */
}
@media (max-width:640px){
  .pdp-trust{grid-template-columns:minmax(0,1fr);}
  .pdp-actions{gap:.7rem;}
  .pdp-add{min-width:0;flex:1;}
  .pdp-nav{grid-template-columns:1fr;}
  .pdp-nav .post-nav-item.empty{display:none;}
  .pdp-nav .post-nav-item.next{text-align:left;}
  .pdp-sticky-text{flex:none;min-width:0;}
  .pdp-sticky-name{display:none;}     /* name is already the H1 one screen up */
  .pdp-sticky-img{width:40px;height:40px;}
  .pdp-panel > summary,.pdp-panel-body{padding-left:1rem;padding-right:1rem;}
}
