/* Pantry Pass — snack subscription (fictional demo shop)
   BATCH C FORMAT: build-a-box subscription flow — pick a box size, pick
   exactly N snacks, pick a delivery frequency, see a live price summary,
   then add the whole custom box as one cart line.
   Playful cream light theme + deep navy ink + sunny yellow accent, rounded display type. */

:root {
  --bg: #fdf6e3;
  --bg-2: #f7ecc9;
  --panel: #ffffff;
  --line: #e5d9ad;
  --navy: #12213b;
  --muted: #6b6450;
  --yellow: #f4c430;
  --yellow-ink: #d9ab1a;
  --coral: #ef6f5b;
  --danger: #d43f3f;
  --r: 18px;
  --wrap: 1200px;
  --display: "Fredoka", "Segoe UI", sans-serif;
  --sans: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: var(--sans); color: var(--navy); background: var(--bg); line-height: 1.6; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.1; margin: 0; }

.eyebrow { font-size: 12px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--coral); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 9px; font-weight: 700; font-size: 15px; padding: 14px 28px; border-radius: 100px; cursor: pointer; border: 2px solid transparent; transition: transform .15s, background .15s, color .15s, border-color .15s; font-family: var(--display); }
.btn-accent { background: var(--yellow); color: var(--navy); }
.btn-accent:hover { transform: translateY(-2px) rotate(-1deg); background: var(--yellow-ink); }
.btn-outline { background: transparent; color: var(--navy); border-color: var(--line); }
.btn-outline:hover { border-color: var(--navy); transform: translateY(-2px); }
.btn-full { width: 100%; }
.btn:disabled { opacity: .35; cursor: not-allowed; transform: none !important; }

.site-header { position: sticky; top: 0; z-index: 60; background: rgba(253,246,227,.92); backdrop-filter: blur(10px); border-bottom: 3px solid var(--navy); }
.nav { display: flex; align-items: center; justify-content: space-between; height: 76px; }
.brand { font-family: var(--display); font-weight: 600; font-size: 22px; display: flex; align-items: center; gap: 9px; }
.brand .badge { width: 18px; height: 18px; border-radius: 6px; background: var(--yellow); transform: rotate(8deg); }
.nav-links { display: flex; gap: 26px; list-style: none; margin: 0; padding: 0; }
.nav-links a { font-size: 14px; font-weight: 700; color: var(--muted); }
.nav-links a:hover { color: var(--navy); }
.nav-right { display: flex; align-items: center; gap: 18px; }
.cart-btn { position: relative; background: none; border: 0; color: var(--navy); cursor: pointer; padding: 8px; display: flex; }
.cart-badge { position: absolute; top: -2px; right: -2px; background: var(--coral); color: #fff; font-size: 10.5px; font-weight: 800; min-width: 17px; height: 17px; border-radius: 50%; display: flex; align-items: center; justify-content: center; padding: 0 2px; }
.menu-btn { display: none; background: none; border: 0; cursor: pointer; padding: 8px; }
.menu-btn span { display: block; width: 22px; height: 2px; background: var(--navy); margin: 5px 0; border-radius: 2px; transition: transform .25s, opacity .25s; }
.menu-btn[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-btn[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-btn[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.announce { background: var(--navy); color: var(--yellow); text-align: center; font-size: 12.5px; font-weight: 700; padding: 9px; }

.hero { position: relative; height: 78vh; min-height: 520px; display: flex; align-items: center; overflow: hidden; }
.hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(253,246,227,.96) 0%, rgba(253,246,227,.62) 55%, rgba(253,246,227,.12) 100%); }
.hero-inner { position: relative; z-index: 1; max-width: 620px; }
.hero h1 { font-size: clamp(38px, 5.6vw, 66px); }
.hero h1 em { font-style: normal; color: var(--coral); }
.hero-lead { font-size: 17px; color: var(--muted); max-width: 46ch; margin: 20px 0 26px; }

section { padding: 76px 0; }
.sec-head { text-align: center; max-width: 46ch; margin: 0 auto 40px; }
.sec-head h2 { font-size: clamp(30px, 4.4vw, 46px); }
.sec-head h2 em { font-style: normal; color: var(--coral); }
.sec-head p { color: var(--muted); margin: 14px 0 0; }

.value-strip { background: var(--bg-2); border-top: 3px solid var(--navy); border-bottom: 3px solid var(--navy); }
.value-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px 44px; padding: 20px 0; }
.value-row span { font-size: 13px; color: var(--muted); }
.value-row b { color: var(--navy); }

/* ---------- Box builder (centerpiece) ---------- */
.builder { background: var(--bg-2); }
.builder-steps { display: grid; gap: 40px; }
.step-block .step-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 20px; }
.step-block .step-num { font-family: var(--display); font-size: 22px; color: var(--coral); }
.step-block h3 { font-size: 22px; }
.step-block .step-sub { color: var(--muted); font-size: 14px; margin: 4px 0 0 34px; }

.size-opts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.size-opt { background: var(--panel); border: 3px solid var(--line); border-radius: var(--r); padding: 20px; cursor: pointer; text-align: center; transition: border-color .15s, transform .15s; }
.size-opt:hover { border-color: var(--yellow); transform: translateY(-2px); }
.size-opt.active { border-color: var(--navy); background: rgba(244,196,48,.14); }
.size-opt .sz-name { font-family: var(--display); font-size: 19px; margin-bottom: 4px; }
.size-opt .sz-count { color: var(--muted); font-size: 13px; margin-bottom: 10px; }
.size-opt .sz-price { font-family: var(--display); color: var(--coral); font-size: 22px; }

.roast-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.roast-card { background: var(--panel); border: 3px solid var(--line); border-radius: var(--r); overflow: hidden; cursor: pointer; position: relative; transition: border-color .15s, transform .15s; }
.roast-card:hover { transform: translateY(-2px); }
.roast-card.selected { border-color: var(--navy); }
.roast-card .rc-media { aspect-ratio: 4/3; position: relative; }
.roast-card .rc-media img { width: 100%; height: 100%; object-fit: cover; }
.roast-card .rc-check { position: absolute; top: 10px; right: 10px; width: 26px; height: 26px; border-radius: 50%; background: rgba(18,33,59,.65); border: 2px solid #fff; display: grid; place-items: center; color: transparent; font-size: 14px; }
.roast-card.selected .rc-check { background: var(--yellow); border-color: var(--yellow); color: var(--navy); }
.roast-card .rc-body { padding: 14px 16px; }
.roast-card h4 { font-family: var(--display); font-size: 16px; margin: 0 0 4px; }
.roast-card p { font-size: 12.5px; color: var(--muted); margin: 0; }
.roast-card.disabled { opacity: .4; cursor: not-allowed; }

.freq-opts { display: flex; flex-wrap: wrap; gap: 10px; }
.freq-opt { background: var(--panel); border: 3px solid var(--line); border-radius: 100px; padding: 12px 22px; cursor: pointer; font-size: 14px; font-weight: 700; font-family: var(--display); transition: all .15s; }
.freq-opt:hover { border-color: var(--yellow); }
.freq-opt.active { background: var(--navy); color: var(--yellow); border-color: var(--navy); }
.freq-opt .fq-save { display: block; font-size: 11px; font-weight: 700; opacity: .8; margin-top: 2px; font-family: var(--sans); }

/* Summary panel */
.summary-panel { position: sticky; bottom: 20px; background: var(--panel); border: 3px solid var(--navy); border-radius: var(--r); padding: 22px 26px; display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: center; box-shadow: 0 20px 50px -24px rgba(18,33,59,.35); margin-top: 10px; }
.summary-info .prog { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.summary-info .prog b { color: var(--coral); }
.summary-info .sel-list { font-size: 13.5px; color: var(--navy); }
.summary-price { text-align: right; }
.summary-price .amt { font-family: var(--display); font-size: 30px; color: var(--coral); display: block; }
.summary-price .per { font-size: 12px; color: var(--muted); }

/* Singles shop */
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.card { background: var(--panel); border: 3px solid var(--line); border-radius: var(--r); overflow: hidden; cursor: pointer; transition: transform .2s, border-color .2s; }
.card:hover { transform: translateY(-3px) rotate(-0.5deg); border-color: var(--yellow); }
.card-media { aspect-ratio: 1/1; background: var(--bg-2); }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 16px; display: flex; justify-content: space-between; align-items: baseline; }
.card-body h3 { font-size: 15.5px; font-family: var(--sans); font-weight: 700; }
.card-body .price { font-family: var(--display); color: var(--coral); font-weight: 600; }

.lifestyle img { width: 100%; aspect-ratio: 16/8; object-fit: cover; border-radius: var(--r); }

.site-footer { background: var(--navy); color: #cbd3e0; padding: 52px 0 28px; border-top: 3px solid var(--navy); }
.foot-top { display: flex; justify-content: space-between; gap: 36px; flex-wrap: wrap; padding-bottom: 28px; border-bottom: 1px solid #2a3c5c; }
.foot-brand { max-width: 30ch; } .foot-brand .brand { margin-bottom: 12px; color: #fff; } .foot-brand p { color: #9aa6bd; font-size: 13.5px; margin: 0; }
.foot-cols { display: flex; gap: 48px; flex-wrap: wrap; }
.foot-col h5 { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--yellow); margin: 0 0 12px; }
.foot-col a { display: block; color: #9aa6bd; font-size: 13.5px; margin-bottom: 9px; }
.foot-col a:hover { color: #fff; }
.foot-bottom { padding-top: 18px; font-size: 12px; color: #6b7994; display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; }

/* ---------- Overlay shell (singles quick-view, cart, checkout) ---------- */
.overlay-scrim { position: fixed; inset: 0; background: rgba(18,33,59,.55); z-index: 100; opacity: 0; pointer-events: none; transition: opacity .25s ease; }
.overlay-scrim.open { opacity: 1; pointer-events: auto; }

.quickview { position: fixed; top: 50%; left: 50%; transform: translate(-50%,-48%); width: min(820px, calc(100% - 40px)); max-height: 86vh; overflow-y: auto; background: var(--panel); border: 3px solid var(--navy); border-radius: var(--r); z-index: 101; opacity: 0; pointer-events: none; transition: opacity .25s ease, transform .25s ease; }
.quickview.open { opacity: 1; pointer-events: auto; transform: translate(-50%,-50%); }
.qv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.qv-media img { width: 100%; height: 100%; object-fit: cover; border-radius: 15px 0 0 15px; }
.qv-body { padding: 32px; position: relative; }
.qv-close { position: absolute; top: 16px; right: 16px; background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 22px; line-height: 1; }
.qv-close:hover { color: var(--navy); }
.qv-body h3 { font-size: 24px; margin: 6px 0 6px; }
.qv-price { font-family: var(--display); font-size: 21px; color: var(--coral); margin-bottom: 14px; }
.qv-desc { color: var(--muted); font-size: 14.5px; margin: 0 0 18px; }
.qty-row { display: flex; align-items: center; gap: 14px; margin: 18px 0; }
.qty-stepper { display: flex; align-items: center; border: 2px solid var(--line); border-radius: 100px; }
.qty-stepper button { width: 36px; height: 36px; background: none; border: 0; color: var(--navy); font-size: 16px; cursor: pointer; }
.qty-stepper span { min-width: 30px; text-align: center; font-weight: 700; }

.cart-drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 100%); background: var(--panel); border-left: 3px solid var(--navy); z-index: 101; transform: translateX(100%); transition: transform .3s ease; display: flex; flex-direction: column; }
.cart-drawer.open { transform: none; }
.cart-head { display: flex; align-items: center; justify-content: space-between; padding: 22px 24px; border-bottom: 2px solid var(--line); }
.cart-head h3 { font-size: 18px; }
.cart-close { background: none; border: 0; color: var(--muted); font-size: 22px; cursor: pointer; }
.cart-close:hover { color: var(--navy); }
.cart-items { flex: 1; overflow-y: auto; padding: 10px 24px; }
.cart-empty { color: var(--muted); text-align: center; padding: 60px 20px; font-size: 14px; }
.cart-line { display: grid; grid-template-columns: 60px 1fr auto; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.cart-line img { width: 60px; height: 60px; object-fit: cover; border-radius: 10px; background: var(--bg-2); }
.cart-line .cl-name { font-size: 14px; font-weight: 700; }
.cart-line .cl-variant { font-size: 12px; color: var(--muted); margin-top: 2px; }
.cart-line .cl-price { font-family: var(--display); color: var(--coral); font-size: 14px; margin-top: 8px; }
.cart-line .cl-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.cart-line .qty-stepper button { width: 26px; height: 26px; font-size: 13px; }
.cart-line .remove-btn { background: none; border: 0; color: var(--muted); font-size: 12px; cursor: pointer; text-decoration: underline; }
.cart-line .remove-btn:hover { color: var(--danger); }
.cart-foot { padding: 22px 24px; border-top: 2px solid var(--line); }
.cart-subtotal { display: flex; justify-content: space-between; font-size: 15px; font-weight: 700; margin-bottom: 16px; }
.cart-subtotal b { color: var(--coral); font-family: var(--display); }

.checkout { position: fixed; top: 50%; left: 50%; transform: translate(-50%,-48%); width: min(720px, calc(100% - 32px)); max-height: 88vh; overflow-y: auto; background: var(--panel); border: 3px solid var(--navy); border-radius: var(--r); z-index: 102; opacity: 0; pointer-events: none; transition: opacity .25s ease, transform .25s ease; }
.checkout.open { opacity: 1; pointer-events: auto; transform: translate(-50%,-50%); }
.checkout-inner { padding: 36px; position: relative; }
.checkout-close { position: absolute; top: 16px; right: 16px; background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 22px; }
.checkout-close:hover { color: var(--navy); }
.steps-track { display: flex; gap: 8px; margin-bottom: 30px; }
.steps-track span { flex: 1; height: 4px; background: var(--line); border-radius: 4px; overflow: hidden; }
.steps-track span::after { content: ""; display: block; height: 100%; width: 0; background: var(--yellow); transition: width .3s ease; }
.steps-track span.done::after, .steps-track span.active::after { width: 100%; }
.co-step { display: none; }
.co-step.active { display: block; }
.co-step h3 { font-size: 22px; margin-bottom: 22px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 12.5px; font-weight: 700; margin-bottom: 8px; color: var(--muted); }
.field input, .field select, .field textarea { width: 100%; font: inherit; font-size: 15px; padding: 12px 14px; border: 2px solid var(--line); border-radius: 12px; background: var(--bg); color: var(--navy); }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--yellow); }
.field textarea { resize: vertical; min-height: 80px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-error { font-size: 12px; color: var(--danger); margin-top: 6px; display: none; }
.field.invalid input { border-color: var(--danger); }
.field.invalid .field-error { display: block; }
.co-actions { display: flex; gap: 12px; margin-top: 26px; }
.demo-note { font-size: 12px; color: var(--muted); text-align: center; margin-top: 16px; }
.review-list { border: 2px solid var(--line); border-radius: 12px; padding: 4px 16px; margin-bottom: 14px; }
.review-line { display: flex; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.review-line:last-child { border-bottom: 0; }
.upsell-row { display: flex; align-items: center; gap: 10px; background: var(--bg-2); border: 2px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 18px; font-size: 13.5px; }
.upsell-row input { accent-color: var(--coral); width: 16px; height: 16px; }
.upsell-row b { color: var(--coral); }
.review-total { display: flex; justify-content: space-between; font-size: 17px; font-weight: 700; padding-top: 14px; }
.review-total b { color: var(--coral); font-family: var(--display); }
.confirm { text-align: center; padding: 20px 0; }
.confirm .check { width: 64px; height: 64px; border-radius: 50%; background: var(--yellow); color: var(--navy); display: grid; place-items: center; margin: 0 auto 20px; font-size: 30px; font-weight: 800; }
.confirm h3 { font-size: 26px; margin-bottom: 10px; }
.confirm .order-no { font-family: var(--display); color: var(--coral); font-size: 15px; margin-bottom: 18px; }
.confirm p { color: var(--muted); max-width: 40ch; margin: 0 auto 24px; }

html.js .reveal { opacity: 0; transform: translateY(20px); transition: opacity .7s ease, transform .7s ease; }
html.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { html.js .reveal { opacity: 1; transform: none; transition: none; } }

@media (max-width: 900px) {
  .size-opts { grid-template-columns: 1fr; }
  .roast-grid { grid-template-columns: repeat(2, 1fr); }
  .grid { grid-template-columns: repeat(2, 1fr); }
  .summary-panel { grid-template-columns: 1fr; text-align: center; }
  .summary-price { text-align: center; }
  .qv-grid { grid-template-columns: 1fr; }
  .qv-media img { border-radius: 15px 15px 0 0; max-height: 280px; }
}
@media (max-width: 640px) {
  .nav-links { display: none; }
  .menu-btn { display: block; }
  .nav-links.open { display: flex; position: absolute; top: 76px; left: 0; right: 0; flex-direction: column; gap: 4px; padding: 16px 24px 22px; background: var(--bg); border-bottom: 3px solid var(--navy); z-index: 59; }
  .nav-links.open a { padding: 10px 0; font-size: 14px; }
  .roast-grid, .grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .field-row { grid-template-columns: 1fr; }
  section { padding: 54px 0; }
  .checkout-inner, .qv-body { padding: 22px; }
  .step-block .step-sub { margin-left: 0; }
}
