/* builder.css — the drink builder (the essence) + bag drawer + checkout. */

.order-head { background: var(--forest); color: #cfe0cf; }
.order-head .wrap { padding-top: 30px; padding-bottom: 30px; }

/* store-sticky bar — the chosen store is visible at all times (dossier) */
.storebar {
  position: sticky; top: var(--nav-h); z-index: 40;
  background: var(--pine); color: #eaf5ee;
  border-bottom: 1px solid rgba(255,255,255,.14);
}
.storebar .wrap { display: flex; align-items: center; gap: 14px; padding-top: 11px; padding-bottom: 11px; }
.storebar .pin { flex: none; }
.storebar .s-name { font-weight: 700; }
.storebar .s-meta { font-size: .86rem; opacity: .82; }
.storebar .s-change { margin-left: auto; }
.storebar .s-change button { background: rgba(255,255,255,.14); color: #fff; border: 1px solid rgba(255,255,255,.28); border-radius: var(--radius-pill); padding: .4rem .9rem; font-weight: 600; font-size: .88rem; cursor: pointer; transition: background .15s; font-family: var(--sans); }
.storebar .s-change button:hover { background: rgba(255,255,255,.26); }
@media (max-width: 560px) { .storebar .s-meta { display: none; } }

/* category rail */
.cat-rail { position: sticky; top: calc(var(--nav-h) + 47px); z-index: 30; background: var(--paper); border-bottom: 1px solid var(--hairline); }
.cat-rail .wrap { display: flex; gap: 8px; padding-top: 12px; padding-bottom: 12px; overflow-x: auto; scrollbar-width: none; }
.cat-rail .wrap::-webkit-scrollbar { display: none; }

/* product grid */
.prod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 20px; }
.prod-card { text-align: left; background: var(--linen); border: 1px solid var(--hairline); border-radius: var(--radius-lg); padding: 16px; cursor: pointer; transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s; font-family: var(--sans); color: inherit; display: flex; flex-direction: column; }
.prod-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--sage); }
.prod-card:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.prod-thumb { aspect-ratio: 1; border-radius: 16px; margin-bottom: 12px; display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; background: radial-gradient(120% 120% at 50% 20%, var(--sage-soft), var(--cream)); }
.prod-thumb img { width: 78%; height: 78%; object-fit: contain; filter: drop-shadow(0 10px 14px rgba(6,48,31,.2)); }
.prod-card h3 { font-size: 1.08rem; margin: 0 0 3px; }
.prod-card .p-meta { font-size: .85rem; color: var(--ink-mute); margin-top: auto; }
.prod-card .p-price { font-weight: 700; color: var(--ink); }
.badge { position: absolute; top: 8px; left: 8px; background: var(--maple); color: #fff; font-size: .68rem; font-weight: 800; letter-spacing: .04em; padding: .2rem .5rem; border-radius: 6px; text-transform: uppercase; }
.badge.pop { background: var(--pine); }

/* ---------- detail overlay ---------- */
.builder-overlay { position: fixed; inset: 0; z-index: 80; background: rgba(6,48,31,.42); backdrop-filter: blur(3px); opacity: 0; pointer-events: none; transition: opacity .3s; }
.builder-overlay.open { opacity: 1; pointer-events: auto; }
.builder {
  position: fixed; inset: 0; z-index: 81;
  display: grid; grid-template-columns: 440px 1fr;
  background: var(--paper);
  transform: translateY(100%); transition: transform .42s var(--ease);
  overflow: hidden;
}
.builder.open { transform: none; }
@media (max-width: 900px) { .builder { grid-template-columns: 1fr; } }

/* left: the cup */
.builder-cup {
  background: linear-gradient(170deg, var(--sage-soft), var(--cream) 60%, var(--cream-deep));
  padding: 26px 28px; position: relative; display: flex; flex-direction: column;
  border-right: 1px solid var(--hairline);
}
@media (max-width: 900px) { .builder-cup { border-right: none; border-bottom: 1px solid var(--hairline); } }
.builder-cup .b-close { position: absolute; top: 16px; left: 16px; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--hairline); background: var(--linen); cursor: pointer; display: flex; align-items: center; justify-content: center; z-index: 9; transition: transform .15s, border-color .15s; }
.builder-cup .b-close:hover { transform: scale(1.06); border-color: var(--pine); }
.cup-holder { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 300px; }
.nameoncup { margin-top: 6px; }
.nameoncup label { display: block; font-size: .78rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--pine-deep); margin-bottom: 6px; }
.nameoncup .row { display: flex; gap: 8px; }
.nameoncup input { flex: 1; min-width: 0; border: 1.5px solid var(--hairline); border-radius: var(--radius-pill); padding: .7rem 1.1rem; font-family: var(--sans); font-size: 1rem; background: var(--linen); }
.nameoncup input:focus { outline: none; border-color: var(--pine); box-shadow: 0 0 0 3px rgba(0,105,74,.14); }
.nameoncup .hint { font-size: .8rem; color: var(--ink-mute); margin-top: 6px; }

/* right: controls */
.builder-body { display: flex; flex-direction: column; min-height: 0; }
.builder-scroll { flex: 1; overflow-y: auto; padding: 26px 30px 24px; scroll-behavior: smooth; }
.builder-scroll::-webkit-scrollbar { width: 10px; }
.builder-scroll::-webkit-scrollbar-thumb { background: var(--cream-deep); border-radius: 8px; border: 3px solid var(--paper); }
.b-title { font-family: var(--display); font-size: 1.9rem; line-height: 1.05; margin: 0 0 4px; }
.b-desc { color: var(--ink-soft); font-size: .98rem; max-width: 56ch; margin: 0 0 20px; }

.opt-group { padding: 20px 0; border-top: 1px solid var(--hairline-soft); }
.opt-group:first-of-type { border-top: none; padding-top: 4px; }
.opt-label { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.opt-label h4 { font-family: var(--sans); font-size: .8rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); margin: 0; }
.opt-label .sub { font-size: .82rem; color: var(--ink-mute); }

/* size segmented (graduated cup icons) */
.size-seg { display: flex; gap: 10px; flex-wrap: wrap; }
.size-opt { border: 1.5px solid var(--hairline); background: var(--linen); border-radius: 14px; padding: 10px 6px 8px; cursor: pointer; min-width: 66px; text-align: center; transition: all .16s var(--ease); font-family: var(--sans); }
.size-opt:hover { border-color: var(--moss); }
.size-opt[aria-pressed="true"] { border-color: var(--pine); background: var(--sage-soft); box-shadow: 0 0 0 1px var(--pine) inset; }
.size-opt .cupicon { display: block; margin: 0 auto 6px; width: 22px; background: var(--moss); border-radius: 2px 2px 4px 4px; opacity: .85; }
.size-opt[aria-pressed="true"] .cupicon { background: var(--pine); }
.size-opt .sz-name { font-weight: 700; font-size: .84rem; }
.size-opt .sz-oz { font-size: .72rem; color: var(--ink-mute); }

/* temp toggle */
.seg-toggle { display: inline-flex; border: 1.5px solid var(--hairline); border-radius: var(--radius-pill); padding: 3px; background: var(--linen); }
.seg-toggle button { border: none; background: none; padding: .5rem 1.2rem; border-radius: var(--radius-pill); font-family: var(--sans); font-weight: 640; font-size: .92rem; color: var(--ink-soft); cursor: pointer; transition: all .16s; }
.seg-toggle button[aria-pressed="true"] { background: var(--pine); color: #fff; }

/* radio pills (milk, roast) */
.pill-list { display: flex; flex-wrap: wrap; gap: 8px; }
.opt-pill { border: 1.5px solid var(--hairline); background: var(--linen); border-radius: var(--radius-pill); padding: .5rem 1rem; font-size: .92rem; font-weight: 600; color: var(--ink-soft); cursor: pointer; font-family: var(--sans); transition: all .15s var(--ease); }
.opt-pill:hover { border-color: var(--moss); color: var(--pine); }
.opt-pill[aria-pressed="true"] { background: var(--pine); border-color: var(--pine); color: #fff; }
.opt-pill .swatch { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; border: 1px solid rgba(0,0,0,.08); }

/* stepper */
.stepper { display: inline-flex; align-items: center; gap: 4px; border: 1.5px solid var(--hairline); border-radius: var(--radius-pill); background: var(--linen); padding: 2px; }
.stepper button { width: 34px; height: 34px; border-radius: 50%; border: none; background: var(--sage-soft); color: var(--pine); font-size: 1.3rem; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background .14s, transform .1s; font-family: var(--sans); }
.stepper button:hover { background: var(--sage); }
.stepper button:active { transform: scale(.9); }
.stepper button[disabled] { opacity: .35; cursor: not-allowed; }
.stepper .val { min-width: 30px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }

/* checklist rows (flavors, sweeteners, addins, toppings with steppers) */
.opt-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--hairline-soft); }
.opt-row:last-child { border-bottom: none; }
.opt-row .name { font-weight: 600; font-size: .96rem; }
.opt-row .name .tag { font-size: .68rem; font-weight: 800; color: var(--maple); letter-spacing: .04em; margin-left: 6px; text-transform: uppercase; }
.opt-row .price-note { font-size: .8rem; color: var(--ink-mute); }
.opt-row .ctl { margin-left: auto; }
.level-seg { display: inline-flex; border: 1.5px solid var(--hairline); border-radius: 12px; overflow: hidden; }
.level-seg button { border: none; background: var(--linen); padding: .42rem .7rem; font-size: .82rem; font-weight: 600; color: var(--ink-soft); cursor: pointer; font-family: var(--sans); border-left: 1px solid var(--hairline); transition: background .14s; }
.level-seg button:first-child { border-left: none; }
.level-seg button[aria-pressed="true"] { background: var(--pine); color: #fff; }

.cap-warn { color: var(--maple); font-size: .8rem; margin-top: 6px; display: none; }
.cap-warn.show { display: block; }

/* pinned footer with live price + cal + Add */
.builder-foot { border-top: 1px solid var(--hairline); background: var(--linen); padding: 16px 30px; display: flex; align-items: center; gap: 18px; box-shadow: 0 -8px 24px -12px rgba(6,48,31,.16); }
.foot-totals { display: flex; flex-direction: column; }
.foot-price { font-family: var(--display); font-size: 1.7rem; font-weight: 600; line-height: 1; transition: color .2s; }
.foot-price.flash { color: var(--pine); }
.foot-cal { font-size: .82rem; color: var(--ink-mute); font-variant-numeric: tabular-nums; }
.builder-foot .btn { margin-left: auto; }
.builder-foot .fav-btn { background: none; border: 1.5px solid var(--hairline); border-radius: 50%; width: 46px; height: 46px; cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--ink-mute); transition: all .15s; }
.builder-foot .fav-btn:hover { border-color: var(--maple); color: var(--maple); }
.builder-foot .fav-btn.on { color: var(--maple); border-color: var(--maple); background: #f6e6d5; }
@media (max-width: 560px) { .builder-foot { padding: 12px 18px; gap: 10px; } .foot-price { font-size: 1.4rem; } .builder-foot .btn { padding: .7rem 1.1rem; } }

/* ---------- bag drawer ---------- */
.drawer-scrim { position: fixed; inset: 0; z-index: 90; background: rgba(6,48,31,.42); opacity: 0; pointer-events: none; transition: opacity .3s; }
.drawer-scrim.open { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 94vw); z-index: 91; background: var(--paper); box-shadow: var(--shadow-lg); transform: translateX(100%); transition: transform .38s var(--ease); display: flex; flex-direction: column; }
.drawer.open { transform: none; }
.drawer-head { padding: 22px 24px 16px; border-bottom: 1px solid var(--hairline); display: flex; align-items: center; justify-content: space-between; }
.drawer-head h3 { margin: 0; font-size: 1.4rem; }
.drawer-close { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--hairline); background: var(--linen); cursor: pointer; font-size: 1.2rem; }
.drawer-body { flex: 1; overflow-y: auto; padding: 8px 24px; }
.bag-item { padding: 16px 0; border-bottom: 1px solid var(--hairline-soft); }
.bag-item .bi-top { display: flex; gap: 12px; align-items: flex-start; }
.bag-item .bi-name { font-weight: 700; font-size: 1.02rem; }
.bag-item .bi-price { margin-left: auto; font-weight: 700; }
.bag-item .bi-mods { list-style: none; margin: 8px 0 0; padding: 0 0 0 2px; }
.bag-item .bi-mods li { font-size: .84rem; color: var(--ink-soft); padding: 1px 0 1px 12px; position: relative; }
.bag-item .bi-mods li::before { content: "–"; position: absolute; left: 0; color: var(--ink-mute); }
.bag-item .bi-actions { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.bag-item .bi-actions a { font-size: .84rem; color: var(--pine); font-weight: 600; cursor: pointer; }
.bag-item .bi-actions a:hover { text-decoration: underline; }
.drawer-foot { border-top: 1px solid var(--hairline); padding: 18px 24px 22px; background: var(--linen); }
.drawer-foot .line { display: flex; justify-content: space-between; margin-bottom: 6px; font-size: .95rem; }
.drawer-foot .line.total { font-weight: 800; font-size: 1.1rem; margin: 10px 0 14px; }
.bag-empty { text-align: center; padding: 60px 20px; color: var(--ink-mute); }
.bag-empty svg { color: var(--sage); margin-bottom: 12px; }

/* checkout / confirmation reuse .card; specific bits */
.checkout-field { margin-bottom: 16px; }
.checkout-field label { display: block; font-weight: 700; font-size: .82rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 6px; }
.checkout-field input, .checkout-field select, .checkout-field textarea { width: 100%; border: 1.5px solid var(--hairline); border-radius: 12px; padding: .75rem 1rem; font-family: var(--sans); font-size: 1rem; background: var(--linen); }
.checkout-field input:focus, .checkout-field select:focus, .checkout-field textarea:focus { outline: none; border-color: var(--pine); box-shadow: 0 0 0 3px rgba(0,105,74,.14); }
.checkout-field .err { color: var(--maple); font-size: .82rem; margin-top: 4px; display: none; }
.checkout-field.invalid .err { display: block; }
.checkout-field.invalid input, .checkout-field.invalid select { border-color: var(--maple); }
.pickup-opts, .tip-opts { display: flex; gap: 8px; flex-wrap: wrap; }
.demo-note { background: #f7eccf; border: 1px solid var(--gold-soft); border-radius: 12px; padding: .8rem 1rem; font-size: .88rem; color: #7a5c14; display: flex; gap: 10px; }
