/* Product page v2: the jar on its label colour, a calm ivory buying panel, real details below. */
.pdp-page { background: var(--ivory); color: var(--cocoa); }
.pdp-page .nav-mark { opacity: 1; transform: none; }

/* ---------- Hero ---------- */
.pdp-hero {
  --field: var(--almond);
  position: relative;
  height: 76svh;
  min-height: 540px;
  overflow: hidden;
  color: var(--ivory);
}
.pdp-word {
  position: absolute;
  left: 0;
  right: 0;
  top: 15svh;
  text-align: center;
  font: 500 21vw/.9 var(--serif);
  letter-spacing: .06em;
  text-transform: uppercase;
  white-space: nowrap;
  opacity: .96;
}
.pdp-jar {
  position: absolute;
  z-index: 2;
  left: 0;
  right: 0;
  margin: 0 auto;
  top: 11svh;
  height: 58svh;
  width: calc(58svh * 555 / 1194);
}
.pdp-jar img { width: 100%; height: 100%; filter: drop-shadow(0 30px 30px rgba(12, 4, 3, .35)); }
.pdp-back {
  position: absolute;
  z-index: 3;
  left: var(--gutter);
  bottom: 44px;
  font-size: 14px;
  border-bottom: 1px solid rgba(244, 239, 231, .5);
  padding-bottom: 2px;
}

/* ---------- Buying panel ---------- */
.pdp-buy {
  position: relative;
  z-index: 4;
  margin-top: -28px;
  border-radius: 28px 28px 0 0;
  background: var(--ivory);
  padding: 34px var(--gutter) 48px;
}
.pdp-buy-inner { max-width: 480px; margin: 0 auto; }
.pdp-buy h1 { font: 500 clamp(40px, 10vw, 64px)/1 var(--serif); letter-spacing: -.01em; }
.pdp-short { margin-top: 12px; color: var(--cocoa-soft); }
.pdp-price { margin-top: 18px; font: 500 34px/1 var(--serif); }
.pdp-price s { font-size: 22px; color: var(--cocoa-soft); margin-right: 10px; }

.choice { border: 0; margin-top: 26px; min-width: 0; }
.choice legend { font: 600 14px/1 var(--sans); margin-bottom: 12px; display: flex; gap: 10px; align-items: baseline; }
.choice-hint { font-weight: 500; color: var(--cocoa-soft); }
.choice.is-missing .choice-hint { color: #9a2a22; }
.choice.is-missing .choice-row { animation: nudge .4s var(--ease); }
@keyframes nudge { 30% { transform: translateX(-6px); } 60% { transform: translateX(5px); } }
.choice-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.opt {
  font: inherit;
  color: inherit;
  text-align: left;
  background: transparent;
  border: 1px solid rgba(42, 22, 18, .2);
  border-radius: 14px;
  padding: 14px 16px;
  cursor: pointer;
  display: grid;
  gap: 2px;
  transition: border-color .25s, background-color .25s, box-shadow .25s;
}
.opt b { font: 600 16px/1.2 var(--sans); }
.opt small { font-size: 14px; color: var(--cocoa-soft); }
.opt:hover { border-color: rgba(42, 22, 18, .45); }
.opt[aria-pressed="true"] { background: #fff; border-color: var(--cocoa); box-shadow: inset 0 0 0 1px var(--cocoa); }
.opt:disabled { opacity: .4; cursor: not-allowed; }

/* Finish cards: each one shows its nut, and the tapped one cracks open inside it (js/v2/nut-crack.js) */
.finish { padding: 8px 8px 14px; align-content: start; }
.finish b, .finish small { padding: 0 8px; }
.finish-well {
  position: relative;
  display: block;
  aspect-ratio: 1 / .8;
  margin-bottom: 10px;
  border-radius: 9px;
  background: radial-gradient(ellipse 60% 62% at 50% 50%, #faf6f0 0%, #efe6db 66%, #e6dbce 100%);
}
.finish-row:not(.has-nuts) .finish-well { display: none; }
.finish-well .nut {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 8% 13% 10%;
  object-fit: contain;
  filter: drop-shadow(0 10px 9px rgba(42, 22, 18, .26));
  will-change: transform, opacity;
}
.nut-dust { position: absolute; inset: -20%; width: 140%; height: 140%; z-index: 3; pointer-events: none; }
.crumb { position: absolute; left: 50%; top: 48%; z-index: 4; background: #3b2216; pointer-events: none; }

.buy-row { display: grid; grid-template-columns: auto 1fr; gap: 12px; margin-top: 28px; }
.stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(42, 22, 18, .2);
  border-radius: 999px;
  height: 52px;
}
.stepper button { width: 44px; height: 100%; font: 500 20px var(--sans); background: none; border: 0; color: inherit; cursor: pointer; }
.stepper output { min-width: 22px; text-align: center; font-weight: 600; }
.add { width: 100%; }
.add:disabled { opacity: .45; cursor: not-allowed; }
.stock { margin-top: 12px; font-size: 14px; color: #2f6b45; }
.stock.low { color: #9a5b12; }
.stock.out { color: #9a2a22; }
.assure { list-style: none; margin-top: 26px; border-top: 1px solid rgba(42, 22, 18, .12); }
.assure li { padding: 13px 0; border-bottom: 1px solid rgba(42, 22, 18, .12); font-size: 15px; }
.assure a { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Story & details ---------- */
.pdp-story { padding: 72px var(--gutter); background: #EFE7DD; }
.pdp-desc { font: 400 clamp(24px, 6vw, 38px)/1.35 var(--serif); max-width: 30ch; margin: 0 auto; text-wrap: pretty; }
.pdp-facts { max-width: 640px; margin: 44px auto 0; border-top: 1px solid rgba(42, 22, 18, .16); }
.pdp-facts details { border-bottom: 1px solid rgba(42, 22, 18, .16); }
.pdp-facts summary {
  list-style: none;
  cursor: pointer;
  padding: 18px 0;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.pdp-facts summary::-webkit-details-marker { display: none; }
.pdp-facts summary::after { content: "+"; font: 400 22px/1 var(--sans); transition: transform .3s var(--ease); }
.pdp-facts details[open] summary::after { transform: rotate(45deg); }
.pdp-facts details p { padding: 0 0 20px; color: var(--cocoa-soft); max-width: 60ch; }

/* ---------- Reviews ---------- */
.pdp-reviews { padding: 72px var(--gutter) 24px; max-width: 1100px; margin: 0 auto; }
.pdp-reviews h2, .pdp-more h2 { font-size: clamp(34px, 7vw, 56px); }
.reviews-score { margin-top: 8px; color: var(--cocoa-soft); }
.reviews-list { display: grid; gap: 18px; margin-top: 28px; }
.review { padding: 24px; background: #fff; border-radius: 18px; }
.review q { display: block; font: 400 21px/1.4 var(--serif); quotes: "“" "”"; }
.review p { margin-top: 12px; font-size: 14px; color: var(--cocoa-soft); }

/* ---------- More flavours ---------- */
.pdp-more { padding: 72px 0 80px; }
.pdp-more h2 { padding: 0 var(--gutter); }
.more-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 62%;
  gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--gutter);
  padding: 28px var(--gutter) 6px;
  scrollbar-width: none;
}
.more-row::-webkit-scrollbar { display: none; }
.tile { scroll-snap-align: start; display: grid; gap: 12px; }
.tile-field {
  position: relative;
  display: block;
  aspect-ratio: 4 / 5;
  border-radius: 20px;
  overflow: hidden;
  --ly: 40%;
}
.tile-field img {
  position: absolute;
  left: 50%;
  bottom: 7%;
  height: 84%;
  width: auto;
  transform: translateX(-50%);
  filter: drop-shadow(0 18px 16px rgba(12, 4, 3, .35));
  transition: transform .5s var(--ease);
}
.tile:hover .tile-field img { transform: translate(-50%, -3%); }
.tile b { font: 500 22px/1.15 var(--serif); }
.tile span { font-size: 14px; color: var(--cocoa-soft); }

/* ---------- Sticky buy bar (phones) ---------- */
.buybar {
  position: fixed;
  z-index: 40;
  left: 12px;
  right: 12px;
  bottom: max(12px, env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 10px 10px 18px;
  border-radius: 999px;
  background: rgba(244, 239, 231, .92);
  backdrop-filter: blur(12px);
  box-shadow: 0 10px 30px rgba(42, 22, 18, .18);
  transform: translateY(140%);
  transition: transform .45s var(--ease);
}
.buybar.show { transform: none; }
.buybar strong { display: block; font: 600 15px/1.2 var(--sans); }
.buybar span { font-size: 14px; color: var(--cocoa-soft); }
.buybar .btn { min-height: 46px; padding: 0 22px; }

/* ---------- Added to bag ---------- */
.added {
  position: fixed;
  z-index: 60;
  left: 12px;
  right: 12px;
  bottom: max(12px, env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 16px;
  padding: 18px;
  border-radius: 22px;
  background: #fff;
  color: var(--cocoa);
  box-shadow: 0 20px 50px rgba(42, 22, 18, .28);
  animation: rise .45s var(--ease);
}
.added[hidden] { display: none; }
@keyframes rise { from { transform: translateY(30px); opacity: 0; } }
.added img { width: 64px; height: auto; align-self: center; }
.added-title { font-weight: 600; }
.added-line { font-size: 14px; color: var(--cocoa-soft); margin-top: 2px; }
.added-actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.added-actions .btn { min-height: 44px; padding: 0 18px; font-size: 14px; }
.btn-ghost { background: transparent; border: 1px solid rgba(42, 22, 18, .25); color: var(--cocoa); cursor: pointer; }
.toast {
  position: fixed;
  z-index: 70;
  left: 50%;
  bottom: 90px;
  transform: translateX(-50%);
  background: var(--cocoa);
  color: var(--ivory);
  padding: 12px 18px;
  border-radius: 12px;
  font-size: 14px;
  max-width: calc(100vw - 32px);
}
.toast[hidden] { display: none; }

/* ---------- Wider screens: photo left (sticky), buying panel right ---------- */
@media (min-width: 900px) {
  .pdp-page .nav nav { color: var(--cocoa); }
  .pdp-top { display: grid; grid-template-columns: 58fr 42fr; }
  .pdp-hero { grid-column: 1; position: sticky; top: 0; height: 100vh; min-height: 640px; --lx: 50%; --ly: 48%; }
  .pdp-word { top: 50%; transform: translateY(-58%); font-size: 8.4vw; letter-spacing: .05em; }
  .pdp-jar { top: 8vh; height: 84vh; width: calc(84vh * 555 / 1194); }
  .pdp-buy {
    grid-column: 2;
    margin: 0;
    border-radius: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 110px clamp(32px, 4vw, 72px) 64px;
  }
  .pdp-buy-inner { margin: 0; width: 100%; }
  .pdp-story { display: grid; grid-template-columns: 1.1fr 1fr; gap: 6vw; padding: 110px var(--gutter); align-items: start; }
  .pdp-desc { margin: 0; font-size: clamp(30px, 2.8vw, 44px); }
  .pdp-facts { margin: 0; }
  .reviews-list { grid-template-columns: repeat(3, 1fr); }
  .more-row { grid-auto-flow: row; grid-template-columns: repeat(5, 1fr); overflow: visible; }
  .buybar { display: none; }
  .added { left: auto; right: 24px; top: 88px; bottom: auto; width: 380px; }
}
