/* ==========================================================
   Sandy's Donuts & Ice Cream: design system
   Palette: retro soda-fountain cobalt, mint, strawberry scoop, sherbet orange, vanilla
   Mobile-first: base styles target phones, min-width queries
   layer on tablet (761px+) and desktop (961px+) layouts.
   ========================================================== */
:root {
  --cobalt: #2340a8;        /* 8.3:1 on vanilla, 8.7:1 with white text */
  --cobalt-dark: #182d7a;
  --mint: #c9f0e1;          /* backgrounds only */
  --mint-soft: #e6f8f1;
  --scoop: #ffb3c1;         /* decorative, dark text on top */
  --scoop-soft: #ffe3e9;
  --sherbet: #ff8a4c;       /* decorative / focus ring only */
  --ink: #1d1b3a;           /* body text, 15:1 on vanilla */
  --ink-soft: #4a4766;      /* secondary text, 8.4:1 on vanilla */
  --vanilla: #fffbf3;
  --vanilla-alt: #fff1dc;
  --white: #ffffff;
  --radius: 22px;
  --shadow: 0 10px 30px rgba(29, 27, 58, 0.10);
  --font-display: "Lilita One", "Arial Rounded MT Bold", system-ui, sans-serif;
  --font-body: "Outfit", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --header-h: 100px;
  --gutter: 16px;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { animation: none !important; transition: none !important; } }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--vanilla);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--cobalt); }
a:hover { color: var(--cobalt-dark); }

h1, h2, h3 { line-height: 1.08; margin: 0 0 .5em; color: var(--ink); }
h1, h2 { font-family: var(--font-display); font-weight: 400; letter-spacing: .005em; }
h1 { font-size: clamp(2.2rem, 9vw, 4rem); }
h2 { font-size: clamp(1.8rem, 7vw, 2.8rem); }
h3 { font-family: var(--font-body); font-size: 1.15rem; font-weight: 700; }
p { margin: 0 0 1em; }

.container { width: min(1140px, 100% - var(--gutter) * 2); margin-inline: auto; }
.narrow { width: min(760px, 100% - var(--gutter) * 2); }

/* ---------- Accessibility ---------- */
.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 1000;
  background: var(--ink); color: var(--white); padding: 10px 16px; border-radius: 8px; font-weight: 700;
}
.skip-link:focus { top: 12px; color: var(--white); }
.sr-only, .hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--sherbet); outline-offset: 3px; border-radius: 6px; }

/* ---------- Buttons (48px min tap targets) ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 48px; padding: .75em 1.4em;
  background: var(--cobalt); color: var(--white);
  font: 700 1rem/1 var(--font-body); text-decoration: none;
  border: 2px solid var(--cobalt); border-radius: 999px; cursor: pointer;
  box-shadow: 0 4px 0 var(--cobalt-dark);
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn:hover { background: var(--cobalt-dark); border-color: var(--cobalt-dark); color: var(--white); transform: translateY(-1px); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--cobalt-dark); }
.btn-outline { background: var(--white); color: var(--cobalt); }
.btn-outline:hover { background: var(--cobalt); color: var(--white); }
.btn-small { min-height: 40px; padding: .55em 1.1em; font-size: .9rem; box-shadow: none; }
.btn-block { width: 100%; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--cobalt); text-decoration: underline; cursor: pointer; }

/* ---------- Header ---------- */
.sticky-header { position: sticky; top: 0; z-index: 50; }
.top-bar { background: var(--cobalt-dark); color: var(--white); text-align: center; font-size: .78rem; font-weight: 600; padding: 7px var(--gutter); }
.top-bar p { margin: 0; }
.status-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--mint); margin-right: 4px; vertical-align: 1px; }
.status-dot.open { background: #5ee08a; animation: pulse 2s infinite; }
.status-dot.closed { background: #ff9e8a; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(94,224,138,.7); } 70% { box-shadow: 0 0 0 8px rgba(94,224,138,0); } 100% { box-shadow: 0 0 0 0 rgba(94,224,138,0); } }

.site-header { position: relative; background: rgba(255, 251, 243, .96); backdrop-filter: blur(8px); border-bottom: 1px solid rgba(29,27,58,.08); }
.nav-wrap { display: flex; align-items: center; justify-content: space-between; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--cobalt); }
.brand img { width: 38px; height: 38px; }
.brand-text { font-family: var(--font-display); font-size: 1.45rem; line-height: 1; display: flex; flex-direction: column; }
.brand-text small { font-family: var(--font-body); font-size: .64rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); margin-top: 3px; }
.nav-toggle { display: grid; place-items: center; width: 48px; height: 48px; background: none; border: 0; color: var(--ink); cursor: pointer; margin-right: -8px; }

/* Phone nav: full-width drop panel with large tap rows */
.main-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; align-items: stretch; background: var(--vanilla); border-bottom: 1px solid rgba(29,27,58,.1); padding: 8px var(--gutter) 16px; box-shadow: 0 12px 24px rgba(29,27,58,.08); }
.main-nav.open { display: flex; }
.main-nav a:not(.btn) { color: var(--ink); text-decoration: none; font-weight: 700; padding: 14px 4px; border-bottom: 1px solid #ece6d8; }
.main-nav a:not(.btn):hover { color: var(--cobalt); }
.main-nav .btn { margin-top: 12px; }

/* ---------- Hero: phones get a full-bleed photo first ---------- */
.hero { padding: 0 0 48px; background: radial-gradient(600px 420px at 88% 40%, var(--scoop-soft), transparent 65%), radial-gradient(600px 420px at 0% 100%, var(--mint-soft), transparent 60%); }
.hero-grid { display: flex; flex-direction: column; gap: 24px; }
.hero-media { order: -1; margin-inline: calc(var(--gutter) * -1); }
.hero-media img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 0 0 32px 32px; box-shadow: var(--shadow); }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; font-weight: 700; color: var(--cobalt); margin-bottom: .75em; }
.accent { color: var(--cobalt); }
.lead { font-size: 1.1rem; color: var(--ink-soft); max-width: 34em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 20px 0; }
.hero-actions .btn { flex: 1 1 100%; }
.proof { list-style: none; padding: 0; margin: 20px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.proof li { display: flex; flex-direction: column; }
.proof strong { font-family: var(--font-display); font-weight: 400; font-size: 1.5rem; line-height: 1.1; color: var(--cobalt); }
.proof span { font-size: .8rem; color: var(--ink-soft); font-weight: 600; line-height: 1.3; }

/* ---------- Sections ---------- */
.section { padding: 56px 0; }
.section-alt { background: var(--vanilla-alt); }
.section-lead { font-size: 1.05rem; color: var(--ink-soft); max-width: 40em; margin-bottom: 28px; }
.card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.small-note { font-size: .95rem; color: var(--ink-soft); margin: 0; }

/* Swipe rails: horizontal scroll-snap on phones, grids on bigger screens */
.rail { display: grid; grid-auto-flow: column; grid-auto-columns: 80%; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; margin-inline: calc(var(--gutter) * -1); padding: 4px var(--gutter) 18px; scroll-padding-inline: var(--gutter); scrollbar-width: none; }
.rail::-webkit-scrollbar { display: none; }
.rail > * { scroll-snap-align: start; }
.swipe-hint { font-size: .85rem; font-weight: 700; color: var(--ink-soft); margin: -8px 0 12px; }
.swipe-hint::after { content: " \2192"; }

.pillar-grid { margin-top: 24px; }
.pillar { padding: 12px 12px 20px; }
.pillar-photo { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 16px; margin-bottom: 14px; background: var(--mint-soft); }
.pillar h3, .pillar p { padding-inline: 8px; }
.pillar p { color: var(--ink-soft); margin: 0; font-size: .95rem; }
.inline-photo { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 16px; margin-bottom: 12px; }

/* Menu tabs (scrollable pill row on phones) */
.tab-list { display: flex; flex-wrap: nowrap; gap: 8px; margin: 0 calc(var(--gutter) * -1) 16px; padding: 0 var(--gutter) 4px; overflow-x: auto; scrollbar-width: none; }
.tab-list::-webkit-scrollbar { display: none; }
.tab-list [role="tab"] { font: 700 .98rem var(--font-body); min-height: 44px; padding: 10px 18px; border-radius: 999px; border: 2px solid #c8cdea; background: var(--white); color: var(--ink); cursor: pointer; white-space: nowrap; }
.tab-list [role="tab"][aria-selected="true"] { background: var(--cobalt); border-color: var(--cobalt); color: var(--white); }
.tab-panel { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.menu-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 24px; }
.menu-cols h3 { color: var(--cobalt); border-bottom: 3px dotted var(--scoop); padding-bottom: 10px; font-size: 1.1rem; }
.menu-cols ul { list-style: none; margin: 0; padding: 0; }
.menu-cols li { padding: 7px 0; border-bottom: 1px solid #eceaf4; font-weight: 600; }
.menu-cols li:last-child { border-bottom: 0; }
.menu-note { margin: 20px 0 0; padding: 12px 16px; background: var(--mint-soft); border-radius: 12px; }

/* Order your way */
.order-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
.order-card { position: relative; display: flex; flex-direction: column; text-decoration: none; color: var(--ink); border: 2px solid transparent; transition: transform .15s ease, border-color .15s ease; }
.order-card:hover { transform: translateY(-3px); border-color: var(--cobalt); color: var(--ink); }
.order-card p { color: var(--ink-soft); flex: 1; }
.order-cta { font-weight: 700; color: var(--cobalt); }
.order-card.featured { background: var(--cobalt); color: var(--white); }
.order-card.featured h3, .order-card.featured p, .order-card.featured .order-cta { color: var(--white); }
.order-card.featured:hover { border-color: var(--sherbet); }
.badge { align-self: flex-start; background: var(--scoop); color: var(--ink); font-size: .75rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; margin-bottom: 10px; text-transform: uppercase; letter-spacing: .06em; }

/* Pre-orders */
.party { display: grid; grid-template-columns: 1fr; gap: 32px; align-items: center; }
.party-art { display: grid; place-items: center; aspect-ratio: 1; max-width: 200px; width: 100%; margin-inline: auto; border-radius: 50%; background: var(--mint); }
.party-art img { width: 62%; transform: rotate(-12deg); }

/* Reviews */
.review { margin: 0; border-top: 6px solid var(--scoop); display: flex; flex-direction: column; gap: 12px; }
.review:nth-child(even) { border-top-color: var(--mint); }
.stars { color: var(--sherbet); font-size: 1.15rem; letter-spacing: 2px; line-height: 1; }
.review blockquote { margin: 0; flex: 1; }
.review blockquote p { margin: 0; font-size: 1.2rem; font-weight: 700; line-height: 1.35; color: var(--ink); }
.review figcaption { font-size: .9rem; color: var(--ink-soft); }
.review figcaption strong { color: var(--ink); }
.review-links { font-weight: 600; margin: 20px 0 0; }

/* Gallery */
.gallery { display: grid; grid-template-columns: 1fr 1fr; grid-auto-rows: 150px; gap: 10px; }
.gallery img { width: 100%; height: 100%; object-fit: cover; border-radius: 16px; background: var(--mint-soft); }
.gallery .tall { grid-row: span 2; }
.gallery .wide { grid-column: span 2; }

/* Visit */
.visit-grid { display: grid; grid-template-columns: 1fr; gap: 32px; align-items: center; }
.visit-address { font-style: normal; font-size: 1.1rem; margin-bottom: 10px; }
.visit-note { color: var(--ink-soft); max-width: 30em; }
.hours { border-collapse: collapse; width: 100%; max-width: 380px; }
.hours th, .hours td { text-align: left; padding: 8px 10px; border-bottom: 1px solid #e6e1d4; }
.hours th { font-weight: 700; }
.hours tr.today { background: var(--mint); }
.hours tr.today th::after { content: " (today)"; font-weight: 600; color: var(--cobalt); font-size: .85em; }
.map-frame { min-height: 300px; border-radius: var(--radius); overflow: hidden; background: var(--mint-soft); display: grid; place-items: center; box-shadow: var(--shadow); }
.map-frame iframe { width: 100%; height: 100%; min-height: 300px; border: 0; }

/* FAQ */
details { background: var(--white); border-radius: 16px; box-shadow: var(--shadow); margin-bottom: 12px; }
summary { cursor: pointer; min-height: 56px; padding: 16px 20px; font-weight: 700; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font-size: 1.4rem; line-height: 1; color: var(--cobalt); }
details[open] summary::after { content: "\2212"; }
details p { padding: 0 20px 18px; margin: 0; color: var(--ink-soft); }

/* Footer (bottom padding clears the phone action bar) */
.site-footer { background: var(--cobalt-dark); color: #e3e8fb; padding: 44px 0 110px; }
.site-footer a, .site-footer .link-btn { color: var(--mint); }
.footer-grid { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px; }
.footer-brand { font-family: var(--font-display); font-size: 1.6rem; color: var(--white); margin-bottom: .3em; }
.footer-links { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; }
.footer-legal { border-top: 1px solid rgba(255,255,255,.18); margin-top: 28px; padding-top: 20px; font-size: .9rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; }
.footer-legal p { margin: 0; }

/* Phone quick-action bar: thumb-reach actions */
.mobile-bar { display: grid; grid-template-columns: 1fr 1fr 1.3fr; gap: 8px; position: fixed; left: 0; right: 0; bottom: 0; z-index: 55; background: var(--white); padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); box-shadow: 0 -6px 20px rgba(29,27,58,.12); }
.mobile-bar a { display: grid; place-items: center; min-height: 48px; border-radius: 999px; font: 700 .95rem var(--font-body); text-decoration: none; border: 2px solid var(--cobalt); color: var(--cobalt); background: var(--white); }
.mobile-bar a.primary { background: var(--cobalt); color: var(--white); }

/* Modal: bottom sheet on phones, centered card on desktop */
dialog { border: 0; border-radius: 24px 24px 0 0; padding: 0; width: 100%; max-width: 100%; max-height: 92vh; margin: auto 0 0; box-shadow: 0 30px 80px rgba(0,0,0,.3); color: var(--ink); }
dialog::backdrop { background: rgba(24,45,122,.55); backdrop-filter: blur(3px); }
.order-form { padding: 22px 20px calc(22px + env(safe-area-inset-bottom)); display: grid; gap: 6px; }
.modal-head { display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.modal-head h2 { font-size: 1.6rem; margin: 0; }
.modal-close { background: var(--vanilla-alt); border: 0; width: 44px; height: 44px; border-radius: 50%; font-size: 1.5rem; cursor: pointer; color: var(--ink); flex-shrink: 0; }
.form-note { color: var(--ink-soft); margin-bottom: 8px; }
.order-form label { font-weight: 700; font-size: .9rem; margin-top: 8px; }
/* 16px+ inputs stop iOS from zooming on focus */
.order-form input, .order-form textarea { width: 100%; font: inherit; font-size: 1rem; min-height: 48px; padding: 11px 13px; border: 2px solid #d6d3e6; border-radius: 12px; background: var(--white); color: var(--ink); }
.order-form input:focus, .order-form textarea:focus { border-color: var(--cobalt); outline: none; box-shadow: 0 0 0 3px #c8d2f5; }
.form-row { display: grid; grid-template-columns: 1fr; gap: 12px; }
.form-row > div { display: grid; gap: 6px; }
.order-form .btn { margin-top: 14px; }
.form-fine { font-size: .8rem; color: var(--ink-soft); margin: 8px 0 0; text-align: center; }

/* Notice banner (sits above the phone action bar) */
.notice { position: fixed; left: 12px; right: 12px; bottom: 84px; z-index: 60; max-width: 560px; margin-inline: auto; background: var(--white); border-radius: 16px; box-shadow: 0 12px 40px rgba(0,0,0,.18); padding: 10px 12px; display: flex; gap: 10px; align-items: center; font-size: .8rem; }
.notice[hidden] { display: none; }
.notice p { margin: 0; }
.notice .btn-small { min-height: 40px; flex-shrink: 0; white-space: nowrap; }

/* Simple pages (success / privacy / 404) */
.page { min-height: 70vh; padding: 64px 0; }
.page h1 { font-size: clamp(2rem, 5vw, 3rem); }
.page h2 { font-size: 1.5rem; margin-top: 1.4em; }

/* ---------- Large phones (480px+) ---------- */
@media (min-width: 480px) {
  .hero-actions .btn { flex: 0 1 auto; }
  .order-grid { grid-template-columns: 1fr 1fr; }
  .form-row { grid-template-columns: 1fr 1fr; }
  .rail { grid-auto-columns: 60%; }
}

/* ---------- Tablet (761px+) ---------- */
@media (min-width: 761px) {
  :root { --header-h: 112px; }
  h3 { font-size: 1.2rem; }
  .top-bar { font-size: .875rem; padding: 8px 16px; }
  .nav-wrap { min-height: 70px; }
  .brand img { width: 42px; height: 42px; }
  .brand-text { font-size: 1.7rem; }
  .brand-text small { font-size: .72rem; }
  .nav-toggle { display: none; }
  .main-nav, .main-nav.open { display: flex; position: static; flex-direction: row; align-items: center; gap: 22px; padding: 0; background: none; border: 0; box-shadow: none; }
  .main-nav a:not(.btn) { padding: 0; border: 0; }
  .main-nav .btn { margin-top: 0; }

  .section { padding: clamp(64px, 8vw, 100px) 0; }
  .section-lead { font-size: 1.125rem; margin-bottom: 36px; }
  .card { padding: 24px; }

  .rail { grid-auto-flow: row; grid-auto-columns: auto; grid-template-columns: repeat(2, 1fr); gap: 22px; overflow: visible; margin-inline: 0; padding: 0; }
  .review-rail { grid-template-columns: repeat(3, 1fr); }
  .swipe-hint { display: none; }
  .pillar-grid { margin-top: 32px; }
  .pillar { padding: 14px 14px 24px; }

  .tab-list { flex-wrap: wrap; margin: 0 0 20px; padding: 0; overflow: visible; }
  .tab-panel { padding: 28px; }

  .gallery { grid-template-columns: repeat(3, 1fr); grid-auto-rows: 220px; gap: 16px; }

  .mobile-bar { display: none; }
  .site-footer { padding-bottom: 48px; }
  .notice { left: 16px; right: 16px; bottom: 16px; padding: 14px 16px; gap: 14px; font-size: .9rem; }

  dialog { width: min(520px, calc(100% - 24px)); border-radius: 24px; margin: auto; }
  .order-form { padding: 26px; }
  .modal-head h2 { font-size: 1.7rem; }
}

/* ---------- Desktop (961px+) ---------- */
@media (min-width: 961px) {
  .hero { padding: clamp(48px, 7vw, 90px) 0 clamp(56px, 7vw, 96px); background: radial-gradient(800px 460px at 88% 18%, var(--scoop-soft), transparent 65%), radial-gradient(700px 420px at 0% 100%, var(--mint-soft), transparent 60%); }
  .hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center; }
  .hero-media { order: 0; margin: 0; }
  .hero-media img { aspect-ratio: 8 / 7; border-radius: 40px; box-shadow: 0 24px 50px rgba(29,27,58,.2); transform: rotate(-1.5deg); }
  .lead { font-size: 1.2rem; }
  .hero-actions { margin: 24px 0; }
  .proof { display: flex; flex-wrap: wrap; gap: 14px 30px; margin-top: 28px; }
  .proof strong { font-size: 1.8rem; }
  .proof span { font-size: .9rem; }

  .order-grid { grid-template-columns: 1.3fr 1fr 1fr 1fr; gap: 18px; }
  .party { grid-template-columns: .7fr 1.3fr; gap: 56px; }
  .party-art { max-width: 300px; }
  .visit-grid { grid-template-columns: 1fr 1.1fr; gap: 48px; }
  .map-frame, .map-frame iframe { min-height: 380px; }
  .page { padding: 80px 0; }
}

@media (min-width: 1021px) {
  .pillar-grid { grid-template-columns: repeat(4, 1fr); }
}
