/*
  VOICE: playful, warm, confident — a scoop shop on a summer night.
  IDEA: building a sundae; the quote is the order ticket.
  PICTURE: cherry-topped sundae (cherry from the logo), flavor scoops that grow as you add.
  COLOUR and TYPE: Bruster's red #ea0029, deep red #8c1414, charcoal #231f20, cream ground; Nunito.
  LAYOUT: red hero, numbered steps left, sticky ticket right; stacks on phones with a bottom total bar.
*/
:root {
  --red: #ea0029; --red-deep: #8c1414; --ink: #231f20; --cream: #fff8f1; --paper: #fff;
  --muted: #6d6461; --line: #efe3da; --ok: #1f8a4c; --radius: 22px;
  --shadow: 0 1px 2px rgba(35,31,32,.06), 0 12px 32px -12px rgba(140,20,20,.18);
}
* { box-sizing: border-box; min-width: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; }
body { margin: 0; font: 500 16px/1.55 Nunito, "Segoe UI", system-ui, sans-serif; color: var(--ink); background: var(--cream); overflow-x: clip; }
h1, h2 { line-height: 1.05; text-wrap: balance; }
.hidden { display: none !important; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 44px; padding: .7rem 1.3rem;
  border: 0; border-radius: 999px; background: var(--red); color: #fff; font: 800 1rem/1 Nunito, sans-serif; text-decoration: none;
  cursor: pointer; transition: transform .15s ease, box-shadow .15s ease, background .15s; box-shadow: 0 6px 16px -6px rgba(234,0,41,.6); }
.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 22px -8px rgba(234,0,41,.7); }
.btn:active { transform: translateY(0) scale(.98); }
.btn.small { padding: .55rem 1.1rem; font-size: .95rem; }
.btn.big { padding: 1rem 1.8rem; font-size: 1.1rem; }
.btn.full { width: 100%; }
.btn.light { background: #fff; color: var(--red); box-shadow: 0 10px 24px -10px rgba(0,0,0,.45); }
.btn:disabled { opacity: .6; cursor: progress; transform: none; }
:focus-visible { outline: 3px solid #ffcc00; outline-offset: 3px; }

/* ---------- header ---------- */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 1rem; padding: .6rem max(4vw,16px);
  background: rgba(255,255,255,.88); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid rgba(35,31,32,.06); }
.brand img { display: block; height: 52px; width: auto; }
.store { font-weight: 800; color: var(--red-deep); }
.top .btn { margin-left: auto; }

/* ---------- hero ---------- */
.hero { position: relative; display: grid; grid-template-columns: minmax(0,1.1fr) minmax(0,.9fr); align-items: center; gap: 2rem;
  padding: clamp(32px,6vw,80px) max(5vw,16px) clamp(48px,7vw,96px); color: #fff; overflow: hidden;
  background: radial-gradient(120% 90% at 85% 40%, #ff2b4d 0%, var(--red) 45%, #c00022 100%); }
.hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 48px; background: var(--cream);
  clip-path: path("M0 48 V20 Q 10% 0 20% 18 T 40% 16 T 60% 20 T 80% 14 T 100% 20 V48 Z"); }
@supports not (clip-path: path("M0 0")) { .hero::after { display: none; } }
.kicker { margin: 0 0 .6rem; font-weight: 800; opacity: .9; }
.hero h1 { margin: 0; font-size: clamp(36px, 5.4vw, 64px); font-weight: 900; letter-spacing: -.02em; }
.lede { font-size: 1.15rem; max-width: 34em; opacity: .95; }
.facts { display: flex; flex-wrap: wrap; gap: .5rem; padding: 0; margin: 1.4rem 0 1.8rem; list-style: none; }
.facts li { padding: .45rem .9rem; border-radius: 999px; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.3); font-weight: 700; }
.facts strong { font-weight: 900; }
.hero-art { position: relative; height: clamp(300px, 38vw, 460px); }
.sundae { position: absolute; inset: 0; width: 100%; height: 100%; filter: drop-shadow(0 24px 30px rgba(90,0,10,.35)); }
.sundae .cherry { transform-origin: 202px 92px; animation: bob 3.2s ease-in-out infinite; }
.sundae .scoop { transform-box: fill-box; transform-origin: 50% 100%; animation: pop .7s cubic-bezier(.3,1.6,.5,1) both; }
.sundae .sc1 { animation-delay: .15s; } .sundae .sc2 { animation-delay: .3s; } .sundae .sc3 { animation-delay: .45s; }
.sundae .cream, .sundae .sprinkles { animation: pop .7s .6s cubic-bezier(.3,1.6,.5,1) both; transform-box: fill-box; transform-origin: 50% 100%; }
.float { position: absolute; width: 22px; height: 22px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ff7d8e, #c4001c 60%, #7d0012); animation: drift 7s ease-in-out infinite; opacity: .9; }
.float::before { content: ""; position: absolute; width: 2px; height: 14px; background: #2f5d1d; left: 11px; top: -12px; transform: rotate(18deg); border-radius: 2px; }
.f1 { left: 6%; top: 12%; } .f2 { right: 4%; top: 6%; width: 16px; height: 16px; animation-delay: -2s; }
.f3 { left: 2%; bottom: 18%; width: 14px; height: 14px; animation-delay: -4s; } .f4 { right: 10%; bottom: 10%; animation-delay: -1s; }
@keyframes bob { 50% { transform: translateY(-8px) rotate(-4deg); } }
@keyframes pop { from { transform: scale(.2); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes drift { 50% { transform: translate(8px,-14px) rotate(20deg); } }

/* ---------- layout ---------- */
main { max-width: 1240px; margin: -8px auto 0; padding: 0 max(4vw,16px) 4rem; position: relative; z-index: 2; }
form { display: grid; grid-template-columns: minmax(0,1fr) 380px; gap: 1.5rem; align-items: start; }
.steps { display: grid; gap: 1.25rem; }
.card { background: var(--paper); border-radius: var(--radius); padding: clamp(18px,3vw,30px); box-shadow: var(--shadow); }
.card h2 { display: flex; align-items: center; gap: .7rem; margin: 0 0 1rem; font-size: clamp(22px,2.6vw,28px); font-weight: 900; }
.num { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--red); color: #fff; font-size: 1rem; }
.hint, .fine { color: var(--muted); font-size: .92rem; margin: .25rem 0 1rem; }
.opt { color: var(--muted); font-weight: 600; }

/* ---------- inputs ---------- */
label { display: block; margin: .75rem 0; font-weight: 800; font-size: .95rem; }
input[type=text], input[type=tel], input[type=email], input[type=date], input[type=time], textarea {
  display: block; width: 100%; margin-top: .35rem; padding: .8rem .95rem; font: 600 16px Nunito, sans-serif; color: var(--ink);
  background: #fffaf6; border: 2px solid var(--line); border-radius: 14px; transition: border-color .15s, box-shadow .15s, background .15s; }
input:focus, textarea:focus { outline: none; border-color: var(--red); background: #fff; box-shadow: 0 0 0 4px rgba(234,0,41,.12); }
small { display: block; margin-top: .35rem; font-weight: 700; font-size: .85rem; color: var(--muted); }
small.good { color: var(--ok); } small.bad { color: var(--red); }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 0 1rem; }

/* ---------- event chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: .55rem; }
.chip { min-height: 44px; padding: .55rem 1.05rem; border-radius: 999px; border: 2px solid var(--line); background: #fff; color: var(--ink);
  font: 800 .97rem Nunito, sans-serif; cursor: pointer; transition: all .15s ease; }
.chip:hover { border-color: #f5a3b1; transform: translateY(-1px); }
.chip[aria-checked=true] { background: var(--red); border-color: var(--red); color: #fff; box-shadow: 0 6px 14px -6px rgba(234,0,41,.6); }

/* ---------- meter ---------- */
.meter { margin-bottom: 1.1rem; }
.meter-bar { height: 14px; border-radius: 999px; background: #f6e9e1; overflow: hidden; }
.meter-bar span { display: block; height: 100%; width: 0; border-radius: inherit;
  background: linear-gradient(90deg, #ff6a80, var(--red)); transition: width .5s cubic-bezier(.3,1.3,.5,1), background .3s; }
.meter.done .meter-bar span { background: linear-gradient(90deg, #39c27a, var(--ok)); }
.meter p { margin: .45rem 0 0; font-weight: 800; font-size: .95rem; }
.meter.done p { color: var(--ok); }

/* ---------- flavor cards ---------- */
.flavors { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .8rem; }
.flavor { position: relative; padding: 1rem 1rem .9rem; border-radius: 18px; border: 2px solid var(--line); background: #fff;
  transition: border-color .2s, box-shadow .2s, transform .2s; }
.flavor.active { border-color: var(--red); box-shadow: 0 10px 24px -14px rgba(234,0,41,.6); }
.flavor-head { display: flex; align-items: center; gap: .8rem; margin-bottom: .6rem; }
.scoop-ico { flex: none; width: 58px; height: 58px; }
.scoop-ico.bump { animation: bump .35s cubic-bezier(.3,1.8,.5,1); }
@keyframes bump { 40% { transform: scale(1.18) rotate(-6deg); } }
.flavor h3 { margin: 0; font-size: 1.1rem; font-weight: 900; line-height: 1.15; }
.badge { position: absolute; top: .6rem; right: .7rem; min-width: 28px; padding: .1rem .5rem; border-radius: 999px; background: var(--red);
  color: #fff; font-weight: 900; font-size: .85rem; text-align: center; transform: scale(0); transition: transform .25s cubic-bezier(.3,1.8,.5,1); }
.flavor.active .badge { transform: scale(1); }
.stepper { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .35rem 0; }
.stepper + .stepper { border-top: 1px dashed var(--line); }
.stepper .lbl { font-weight: 800; font-size: .95rem; }
.stepper .lbl em { display: block; font-style: normal; font-weight: 700; color: var(--muted); font-size: .82rem; }
.ctrl { display: flex; align-items: center; gap: .25rem; }
.ctrl button { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--line); background: #fff; color: var(--red);
  font: 900 1.3rem/1 Nunito, sans-serif; cursor: pointer; transition: all .12s; }
.ctrl button:hover { background: var(--red); border-color: var(--red); color: #fff; }
.ctrl button:active { transform: scale(.9); }
.ctrl input { width: 56px; height: 40px; padding: 0; text-align: center; font: 900 1.05rem Nunito, sans-serif; color: var(--ink);
  border: 2px solid transparent; border-radius: 10px; background: #fbf3ee; -moz-appearance: textfield; }
.ctrl input::-webkit-inner-spin-button, .ctrl input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.ctrl input:focus { outline: none; border-color: var(--red); }

/* ---------- store dropdown ---------- */
.store-pick { margin: 0; }
.select-wrap { position: relative; display: block; margin-top: .4rem; }
.select-wrap::after { content: ""; position: absolute; right: 1.1rem; top: 50%; width: 10px; height: 10px; margin-top: -7px;
  border-right: 3px solid var(--red); border-bottom: 3px solid var(--red); transform: rotate(45deg); pointer-events: none; }
.select-wrap select { display: block; width: 100%; min-height: 56px; padding: .8rem 3rem .8rem 1rem; font: 800 1.1rem Nunito, sans-serif; color: var(--ink);
  background: #fffaf6; border: 2px solid var(--line); border-radius: 16px; appearance: none; -webkit-appearance: none; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.select-wrap select:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 4px rgba(234,0,41,.12); }
.select-wrap select.chosen { border-color: var(--red); background: #fff4f5; }
.store-addr { display: flex; gap: .5rem; align-items: center; margin: .7rem 0 0; color: var(--muted); font-weight: 700; }
.store-addr.hidden { display: none; }
.store-addr svg { flex: none; width: 22px; height: 22px; fill: var(--red); }
.store-msg { margin: .8rem 0 0; padding: .7rem .9rem; border-radius: 12px; background: #fff7e0; color: #7a5200; font-weight: 800; font-size: .9rem; }
.store-msg.hidden { display: none; }
.foot-stores { list-style: none; padding: 0; margin: .6rem 0; display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem 1.6rem; }
.foot-stores strong { color: var(--ink); }

/* ---------- cups / sundaes toggle ---------- */
.serve-toggle { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: .4rem; padding: .35rem; margin: 0 0 1.1rem; border-radius: 18px; background: #f6ece6; }
.serve-toggle label { margin: 0; cursor: pointer; }
.serve-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.serve-toggle span { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 56px; padding: .5rem; border-radius: 14px; text-align: center; transition: background .2s, color .2s, box-shadow .2s; }
.serve-toggle strong { font-weight: 900; font-size: 1.05rem; line-height: 1.2; }
.serve-toggle em { font-style: normal; font-weight: 700; font-size: .85rem; color: var(--muted); }
.serve-toggle input:checked + span { background: var(--red); color: #fff; box-shadow: 0 8px 18px -8px rgba(234,0,41,.7); }
.serve-toggle input:checked + span em { color: #ffe0e5; }
.serve-toggle input:focus-visible + span { outline: 3px solid #ffcc00; outline-offset: 2px; }

/* ---------- sundae toppings ---------- */
.toppings { margin: -.3rem 0 1.1rem; padding: 1rem; border-radius: 18px; background: #fff4f5; border: 2px dashed #ffc2cc; animation: drop .35s ease both; }
.toppings.hidden { display: none; }
@keyframes drop { from { opacity: 0; transform: translateY(-6px); } }
.top-title { margin: 0 0 .7rem; display: flex; flex-wrap: wrap; gap: .2rem .6rem; align-items: baseline; }
.top-title strong { font-weight: 900; }
.top-title span { color: var(--muted); font-weight: 700; font-size: .88rem; }
.top-chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.topping { display: inline-flex; align-items: center; gap: .45rem; min-height: 42px; padding: .45rem .95rem .45rem .55rem; border-radius: 999px;
  border: 2px solid var(--line); background: #fff; color: var(--muted); font: 800 .93rem Nunito, sans-serif; cursor: pointer; transition: all .15s; }
.topping .tick { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: #f1e6e0; color: transparent; font-size: .8rem; transition: all .15s; }
.topping[aria-pressed=true] { border-color: var(--red); color: var(--ink); }
.topping[aria-pressed=true] .tick { background: var(--red); color: #fff; }

/* ---------- pickup note ---------- */
.pickup-note { display: flex; gap: .8rem; align-items: center; margin: .9rem 0 .4rem; padding: .9rem 1rem; border-radius: 16px; background: #fff4f5; border: 2px solid #ffd3da; }
.pickup-note.hidden { display: none; }
.pickup-note svg { flex: none; width: 30px; height: 30px; fill: var(--red); }
.pickup-note strong { display: block; font-weight: 900; }
.pickup-note span { color: var(--muted); font-weight: 700; }

/* ---------- flavor tabs + search ---------- */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.flavor-tools { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; justify-content: space-between; margin-bottom: .9rem; }
.tabs { display: flex; flex-wrap: wrap; gap: .4rem; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: none; min-height: 40px; padding: .45rem .95rem; border-radius: 999px; border: 0; background: #f6ece6; color: var(--ink);
  font: 800 .92rem Nunito, sans-serif; cursor: pointer; transition: background .15s, color .15s; }
.tab:hover { background: #f1dcd3; }
.tab[aria-selected=true] { background: var(--ink); color: #fff; }
.tab .cnt { display: inline-block; margin-left: .3rem; padding: 0 .45rem; border-radius: 999px; background: var(--red); color: #fff; font-size: .8rem; }
.search { position: relative; margin: 0; flex: 1 1 100%; }
.search svg { position: absolute; left: .8rem; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); fill: none; stroke: var(--muted); stroke-width: 2.4; stroke-linecap: round; }
.search input { margin: 0; padding: .65rem .9rem .65rem 2.4rem; width: 100%; font: 600 16px Nunito, sans-serif; border: 2px solid var(--line); border-radius: 999px; background: #fffaf6; color: var(--ink); }
.search input:focus { outline: none; border-color: var(--red); background: #fff; box-shadow: 0 0 0 4px rgba(234,0,41,.12); }
.flavor-box { max-height: 640px; overflow-y: auto; margin: 0 -6px; padding: 6px; border-radius: 18px; overscroll-behavior: contain;
  mask-image: linear-gradient(#000 calc(100% - 28px), transparent); -webkit-mask-image: linear-gradient(#000 calc(100% - 28px), transparent); padding-bottom: 28px; }
.flavor.off { display: none; }
.no-match { text-align: center; color: var(--muted); font-weight: 700; padding: 2rem 0; }

/* ---------- service options ---------- */
.service { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: .8rem; }
.option { margin: 0; cursor: pointer; }
.option input { position: absolute; opacity: 0; pointer-events: none; }
.opt-body { display: grid; gap: .25rem; height: 100%; padding: 1.1rem; border-radius: 18px; border: 2px solid var(--line); background: #fff; transition: all .18s; }
.opt-body svg { width: 44px; height: 44px; fill: var(--ink); stroke: var(--ink); margin-bottom: .35rem; transition: fill .18s, stroke .18s; }
.opt-body strong { font-size: 1.1rem; font-weight: 900; }
.opt-body span { color: var(--muted); font-weight: 600; font-size: .93rem; }
.option input:checked + .opt-body { border-color: var(--red); background: #fff4f5; box-shadow: 0 10px 24px -14px rgba(234,0,41,.6); }
.option input:checked + .opt-body svg { fill: var(--red); stroke: var(--red); }
.option input:focus-visible + .opt-body { outline: 3px solid #ffcc00; outline-offset: 3px; }

/* ---------- summary ticket ---------- */
.summary { position: sticky; top: 96px; }
.ticket { position: relative; background: var(--ink); color: #fff; border-radius: var(--radius); padding: 1.5rem 1.4rem 1.3rem; box-shadow: 0 24px 50px -24px rgba(35,31,32,.6); }
.ticket::before { content: ""; position: absolute; left: 18px; right: 18px; top: -7px; height: 14px;
  background: radial-gradient(circle at 7px 7px, var(--cream) 6px, transparent 6.5px) 0 0 / 20px 14px repeat-x; }
.ticket h2 { margin: 0 0 .9rem; font-size: 1.5rem; font-weight: 900; }
.lines { list-style: none; padding: 0; margin: 0 0 .8rem; display: grid; gap: .45rem; }
.lines li { display: flex; justify-content: space-between; gap: 1rem; font-weight: 700; color: #e9dfdb; }
.lines li.new { animation: slide .3s ease both; }
.lines li b { color: #fff; white-space: nowrap; }
.lines li.kind { color: #ffb3bf; font-size: .88rem; font-weight: 800; }
.lines li.empty { color: #a99f9b; font-style: italic; justify-content: flex-start; }
@keyframes slide { from { opacity: 0; transform: translateX(-8px); } }
.total-row { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding-top: .8rem; border-top: 2px dashed rgba(255,255,255,.25); }
.total-row span { font-weight: 800; }
.total-row strong { font-size: clamp(30px, 3.2vw, 40px); font-weight: 900; color: #fff; letter-spacing: -.02em; white-space: nowrap; }
.server-note { margin: .2rem 0 0; color: #ffb3bf; font-weight: 800; font-size: .9rem; text-align: right; }
.server-note:empty { display: none; }
.pay { display: grid; gap: .3rem; margin: .9rem 0; padding: .8rem .9rem; border-radius: 14px; background: rgba(255,255,255,.07); }
.pay div { display: flex; justify-content: space-between; gap: 1rem; font-size: .9rem; color: #e9dfdb; font-weight: 700; }
.pay strong { color: #fff; white-space: nowrap; }
.ticket .fine { color: #b9afab; margin: .5rem 0; }
.errors { margin: .4rem 0 .9rem; padding: .8rem .9rem .8rem 2rem; border-radius: 14px; background: #fff0f2; color: #b0001f; font-weight: 800; font-size: .9rem; }
.errors:empty { display: none; }
.errors li + li { margin-top: .25rem; }

/* ---------- mobile total bar ---------- */
.mobile-bar { display: none; }

/* ---------- footer ---------- */
.foot { text-align: center; padding: 2.5rem 1rem 6rem; color: var(--muted); font-weight: 700; }
.foot img { opacity: .9; }
.foot p { margin: .3rem 0; }

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  form { grid-template-columns: minmax(0,1fr); }
  .summary { position: static; }
  .mobile-bar { display: flex; position: fixed; z-index: 30; left: 12px; right: 12px; bottom: 12px; align-items: center; justify-content: space-between;
    gap: 1rem; padding: .7rem .8rem .7rem 1.2rem; border-radius: 999px; background: var(--ink); color: #fff; box-shadow: 0 14px 30px -10px rgba(0,0,0,.5);
    transition: transform .3s, opacity .3s; }
  .mobile-bar small { display: block; margin: 0; color: #b9afab; font-size: .78rem; }
  .mobile-bar strong { font-size: 1.35rem; font-weight: 900; }
  .mobile-bar.away { transform: translateY(140%); opacity: 0; }
}
@media (max-width: 760px) {
  .service { grid-template-columns: minmax(0,1fr); }
  .hero { grid-template-columns: minmax(0,1fr); text-align: left; }
  .hero-art { order: -1; height: 240px; margin: -10px 0 -20px; }
  .store { display: none; }
  .brand img { height: 44px; }
}
@media (max-width: 560px) {
  .grid2, .service { grid-template-columns: minmax(0,1fr); }
  .flavors { grid-template-columns: minmax(0,1fr); }
  .flavor-box { max-height: 70vh; }
  .tabs { flex-wrap: nowrap; margin-inline: -4px; padding-inline: 4px; }
  .search { max-width: none; }
  .top .btn { padding: .5rem .9rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
