/* Product page. Builds on styles.css tokens; same radius rule (pills, 14px cells). */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.pdp .nav { background: rgba(12, 12, 11, 0.72); backdrop-filter: blur(16px) saturate(140%); -webkit-backdrop-filter: blur(16px) saturate(140%); }
.nav__links a[aria-current="page"]::after { transform: scaleX(1); }

/* hero */
.pdp-hero { display: grid; grid-template-columns: 1.08fr 1fr; gap: clamp(32px, 5vw, 80px); align-items: start; padding-top: 128px; padding-bottom: clamp(80px, 10vw, 140px); }
.stage {
  position: relative; height: min(84vh, 880px); min-height: 560px; border-radius: var(--r); overflow: clip; isolation: isolate;
  background: radial-gradient(62% 56% at 50% 40%, #f6f5f1 0%, #e4e3df 55%, #cfcec9 100%);
  perspective: 1200px;
}
.stage__word {
  position: absolute; inset: 0; display: grid; place-items: center; z-index: -1;
  font-family: var(--serif); font-style: italic; font-size: clamp(10rem, 24vw, 22rem); line-height: 1; letter-spacing: -0.05em;
  color: transparent; -webkit-text-stroke: 1.5px rgba(20, 20, 19, 0.14); user-select: none; padding-bottom: 0.1em;
}
.stage__bag { position: absolute; left: 50%; top: 47%; width: 46%; translate: -50% -50%; transform-style: preserve-3d; will-change: transform; }
.stage__bag img { width: 100%; filter: drop-shadow(0 30px 40px rgba(20, 20, 19, 0.35)) drop-shadow(0 6px 10px rgba(20, 20, 19, 0.25)); }
.stage__shadow { position: absolute; left: 50%; bottom: 7%; width: 40%; height: 26px; translate: -50% 0; border-radius: 50%; background: radial-gradient(closest-side, rgba(20, 20, 19, 0.38), rgba(20, 20, 19, 0)); }

.buy { position: sticky; top: 120px; padding-top: 8px; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 0.875rem; color: var(--fg-2); }
.crumbs i { font-size: 12px; }
.crumbs a { transition: color 200ms ease; }
@media (hover: hover) and (pointer: fine) { .crumbs a:hover { color: var(--fg); } }
.buy__title { font-family: var(--serif); font-size: clamp(3.25rem, 6.4vw, 5.75rem); line-height: 0.98; letter-spacing: -0.03em; margin-top: 18px; }
.buy__rating { display: inline-flex; align-items: center; gap: 10px; margin-top: 16px; font-size: 0.9375rem; color: var(--fg-2); }
.stars { display: inline-flex; gap: 2px; color: var(--accent); font-size: 15px; }
.roast-ind { margin-top: 24px; }
.roast-ind__head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; font-size: 0.9375rem; font-weight: 500; }
.roast-ind__level { font-family: var(--serif); font-weight: 400; font-size: 2rem; line-height: 1; color: var(--accent); }
.scale--lg { margin-top: 12px; padding: 18px clamp(20px, 3vw, 36px); }
.scale--lg img { width: 44px; }
.scale--lg .scale__marker { width: 80px; height: 80px; margin-top: -40px; }
.roast-ind__ends { display: flex; justify-content: space-between; margin-top: 10px; font-size: 0.8125rem; color: var(--fg-2); }
.buy__lede { margin-top: 20px; color: #cfcec9; font-size: 1.125rem; max-width: 46ch; }
.buy__price { margin-top: 28px; display: flex; align-items: baseline; gap: 14px; }
.price { font-family: var(--serif); font-size: 3rem; line-height: 1; display: inline-block; font-variant-numeric: tabular-nums; }
.per { color: var(--fg-2); font-size: 0.9375rem; display: inline-block; }

.buy__form { margin-top: 28px; display: grid; gap: 20px; }
.seg { border: 0; margin: 0; padding: 0; min-width: 0; }
.seg legend { font-size: 0.875rem; font-weight: 500; margin-bottom: 10px; padding: 0; }
.seg__track { position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 4px; border-radius: 999px; background: var(--bg-2); border: 1px solid var(--line); }
.seg__thumb { position: absolute; left: 0; top: 4px; bottom: 4px; width: 0; border-radius: 999px; background: var(--fg); box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35); will-change: transform, width; }
.seg label { position: relative; z-index: 1; height: 46px; display: grid; place-items: center; cursor: pointer; border-radius: 999px; font-size: 0.9375rem; font-weight: 500; color: var(--fg-2); transition: color 250ms ease; white-space: nowrap; padding-inline: 10px; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label:has(input:checked) { color: var(--tile-fg); }
.seg label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) { .seg label:not(:has(input:checked)):hover { color: var(--fg); } }
.no-js-thumb .seg label:has(input:checked) { background: var(--fg); }

.buy__row { display: flex; gap: 12px; margin-top: 4px; }
.qty { display: flex; align-items: center; height: 56px; border-radius: 999px; border: 1px solid var(--line); padding: 4px; }
.qty__btn { width: 46px; height: 46px; border-radius: 999px; border: 0; background: transparent; cursor: pointer; display: grid; place-items: center; font-size: 16px; transition: background-color 200ms ease, transform 160ms var(--ease-out); }
.qty__btn:active { transform: scale(0.92); }
@media (hover: hover) and (pointer: fine) { .qty__btn:hover { background: rgba(236, 235, 231, 0.1); } }
.qty__n { width: 28px; text-align: center; font-variant-numeric: tabular-nums; font-weight: 500; }
.buy__cta { flex: 1; height: 56px; justify-content: space-between; padding-inline: 28px; font-size: 1.0625rem; }
.buy__cta-price { font-variant-numeric: tabular-nums; padding-left: 16px; border-left: 1px solid rgba(20, 20, 19, 0.2); }
.buy__cta.is-going { pointer-events: none; }

.buy__facts { list-style: none; margin: 32px 0 0; padding: 0; border-top: 1px solid var(--line); }
.buy__facts li { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 0.9375rem; color: #cfcec9; }
.buy__facts i { font-size: 20px; width: 70px; text-align: center; }

/* tasting notes */
.notes { position: relative; background: #2a0b10; overflow: clip; }
.notes__pin { position: relative; height: 100dvh; min-height: 560px; display: grid; place-items: center; }
.notes__stage { position: relative; width: 100%; height: 60%; }
.note { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; text-align: center; padding-inline: var(--gutter); pointer-events: none; }
.note__word { font-family: var(--serif); font-size: clamp(4.25rem, 13vw, 12.5rem); line-height: 0.92; letter-spacing: -0.04em; padding-bottom: 0.1em; }
.note__word .nc { display: inline-block; will-change: transform; }
.note__line { margin-top: 24px; font-size: clamp(1.0625rem, 1.6vw, 1.375rem); color: rgba(236, 235, 231, 0.78); max-width: 34ch; }
.note:not(.is-active) { visibility: hidden; }
.notes__tabs { position: absolute; bottom: 40px; left: 0; right: 0; display: flex; justify-content: center; gap: 28px; margin: 0; padding: 0 var(--gutter); list-style: none; font-size: 0.9375rem; }
.notes__tabs li { color: rgba(236, 235, 231, 0.45); position: relative; padding-bottom: 8px; transition: color 300ms ease; }
.notes__tabs li::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--fg); transform: scaleX(0); transition: transform 500ms var(--ease-out); }
.notes__tabs li.is-active { color: var(--fg); }
.notes__tabs li.is-active::after { transform: scaleX(1); }
.notes__bean { position: absolute; pointer-events: none; will-change: transform; }
.notes__bean--a { width: clamp(220px, 30vw, 460px); left: -6%; top: 8%; filter: blur(7px) brightness(0.7); opacity: 0.55; }
.notes__bean--b { width: clamp(64px, 8vw, 128px); right: 5%; bottom: 6%; filter: drop-shadow(0 24px 30px rgba(0, 0, 0, 0.6)); }

/* profile */
.profile__grid { margin-top: 56px; display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 16px; }
.pcell { border-radius: var(--r); padding: clamp(24px, 3vw, 40px); background: var(--bg-2); border: 1px solid var(--line); display: flex; flex-direction: column; min-height: 320px; }
.pcell h3 { font-family: var(--serif); font-size: 2rem; line-height: 1.05; }
.pcell p { color: var(--fg-2); margin-top: 8px; }
.pcell--roast .scale { margin-top: auto; }
.pcell--body { background: var(--bg-3); }
.pcell__big { font-family: var(--serif); font-size: clamp(5rem, 8vw, 7.5rem); line-height: 0.85; color: var(--fg) !important; margin: 0 0 auto !important; letter-spacing: -0.04em; }
.pcell--quote { background: var(--tile); color: var(--tile-fg); border-color: transparent; justify-content: space-between; }
.pcell--quote blockquote { margin: 0; font-family: var(--serif); font-size: clamp(1.75rem, 2.4vw, 2.25rem); line-height: 1.15; }
.pcell--quote p { color: var(--tile-fg-2); }

/* origin */
.origin { background: var(--bg-2); border-block: 1px solid var(--line); padding-block: clamp(96px, 12vw, 168px); }
.origin__grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(40px, 7vw, 112px); align-items: start; }
.origin__copy { position: sticky; top: 140px; }
.origin__copy .lab__read { max-width: 30ch; }
.ofact { padding: 36px 0; border-top: 1px solid var(--line); }
.ofact:last-child { border-bottom: 1px solid var(--line); }
.ofact h3 { font-size: 0.9375rem; font-weight: 500; color: var(--fg-2); font-family: var(--sans); }
.ofact__big { font-family: var(--serif); font-size: clamp(2.25rem, 3.6vw, 3.25rem); line-height: 1.05; margin-top: 8px; font-variant-numeric: tabular-nums; }
.ofact__big small { font-size: 0.5em; color: var(--fg-2); }
.ofact > p:not(.ofact__big) { color: var(--fg-2); margin-top: 12px; max-width: 46ch; }
.ofact .facts { margin: 16px 0 0; }
.elev { position: relative; height: 10px; margin: 26px 0 30px; border-radius: 999px; background: rgba(236, 235, 231, 0.1); }
.elev__band { position: absolute; top: 0; bottom: 0; left: var(--from); width: calc(var(--to) - var(--from)); border-radius: 999px; background: var(--accent); transform-origin: left; }
.elev__tick { position: absolute; top: 20px; translate: -50% 0; font-size: 0.8125rem; color: var(--fg-2); white-space: nowrap; }
.elev__tick:first-of-type { translate: 0 0; }
.elev__tick:last-of-type { translate: -100% 0; }
.months { list-style: none; margin: 22px 0 0; padding: 0; display: grid; grid-template-columns: repeat(12, 1fr); gap: 6px; }
.months li { height: 44px; border-radius: 8px; background: rgba(236, 235, 231, 0.07); display: grid; place-items: center; font-size: 0.8125rem; color: var(--fg-2); }
.months li.on { background: var(--accent); color: #fff; }

/* reviews */
.pdp-reviews { display: grid; grid-template-columns: 0.8fr 1.6fr; gap: clamp(40px, 6vw, 96px); align-items: start; }
.pdp-reviews__head { position: sticky; top: 140px; }
.pdp-reviews__head .link { margin-top: 28px; }
.stack { display: grid; gap: 24px; padding-bottom: 8vh; }
.stack__card { position: sticky; top: calc(130px + var(--i, 0) * 26px); margin: 0; padding: clamp(28px, 3.5vw, 44px); border-radius: var(--r); background: var(--bg-2); border: 1px solid var(--line); min-height: 280px; display: flex; flex-direction: column; box-shadow: 0 -18px 40px rgba(0, 0, 0, 0.35); transform-origin: 50% 0; }
.stack__card:nth-child(1) { --i: 0; }
.stack__card:nth-child(2) { --i: 1; background: var(--bg-3); }
.stack__card:nth-child(3) { --i: 2; }
.stack__card:nth-child(4) { --i: 3; background: #262624; }
.stack__title { font-weight: 500; font-size: 0.9375rem; color: var(--accent); }
.stack__card blockquote { margin: 14px 0 0; font-family: var(--serif); font-size: clamp(1.625rem, 2.5vw, 2.25rem); line-height: 1.2; }
.stack__card figcaption { margin-top: auto; padding-top: 24px; font-size: 0.9375rem; font-weight: 500; }

/* sticky buy bar */
.bar {
  position: fixed; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); z-index: 45;
  width: min(640px, calc(100% - 32px)); display: flex; align-items: center; gap: 14px; padding: 8px 8px 8px 16px;
  border-radius: 999px; background: rgba(29, 29, 27, 0.82); border: 1px solid var(--line);
  backdrop-filter: blur(18px) saturate(140%); -webkit-backdrop-filter: blur(18px) saturate(140%);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  translate: -50% 160%; transition: translate 600ms var(--ease-out);
}
.bar.is-on { translate: -50% 0; }
.bar img { width: 26px; height: auto; }
.bar__info { flex: 1; min-width: 0; }
.bar__name { font-family: var(--serif); font-size: 1.25rem; line-height: 1.1; }
.bar__variant { font-size: 0.8125rem; color: var(--fg-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar__cta { height: 48px; padding-inline: 20px; gap: 14px; }

@media (max-width: 1100px) {
  .pdp-hero { grid-template-columns: 1fr; padding-top: 112px; }
  .stage { height: min(72vh, 640px); min-height: 440px; }
  .buy { position: static; }
  .profile__grid { grid-template-columns: 1fr 1fr; }
  .pcell--roast { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
  .origin__grid, .pdp-reviews { grid-template-columns: 1fr; }
  .origin__copy, .pdp-reviews__head { position: static; }
}
@media (max-width: 640px) {
  .pdp-hero { padding-top: 96px; gap: 28px; }
  .stage { height: 460px; min-height: 0; }
  .stage__bag { width: 54%; }
  .buy__row { flex-direction: column; }
  .qty { align-self: flex-start; }
  .buy__cta { flex: none; }
  .profile__grid { grid-template-columns: 1fr; }
  .pcell { min-height: 0; }
  .pcell__big { margin-bottom: 20px !important; }
  .notes__tabs { gap: 16px; font-size: 0.8125rem; bottom: 104px; }
  .months li { height: 36px; font-size: 0.75rem; }
  .notes__bean--b { width: 56px; bottom: auto; top: 16%; right: 8%; }
  .stack__card { min-height: 220px; top: calc(96px + var(--i, 0) * 18px); }
  .bar { padding-left: 12px; gap: 10px; }
  .bar__name { font-size: 1.0625rem; }
  .bar__cta { padding-inline: 16px; }
  .bar__cta > span:first-child { display: none; }
  .bar__cta .buy__cta-price { border-left: 0; padding-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .notes__pin { height: auto; padding-block: 120px; }
  .notes__stage { height: auto; display: grid; gap: 64px; }
  .note { position: relative; visibility: visible !important; }
  .notes__tabs { display: none; }
  .stack__card { position: relative; top: auto; }
  .bar { transition: none; }
}
