/* ============================================================
   Melody Sweets N Treats :  shared design system
   ------------------------------------------------------------
   Tailwind handles layout/utilities; this layer holds the
   token vocabulary (so harvested sections stay brand-skinnable),
   the app-shell pieces (tabbar, cart drawer, product modal,
   accordion, marquee) and motion. Mobile-first, app-like.
   ============================================================ */

:root {
  /* --- Cuzzo token vocabulary (matches platform/design/tokens.json) --- */
  --bg: #fff8f5;          /* warm ivory */
  --surface: #ffffff;
  --surface-2: #fdecf4;   /* baby pink wash (banded sections) */
  --text: #4b2432;        /* espresso plum */
  --muted: #8a6b75;
  --quiet: #b39aa3;
  --line: rgba(75, 36, 50, 0.10);
  --brand: #e93e8b;       /* primary pink */
  --brand-2: #b31255;     /* deep berry */
  --accent: #d4a24c;      /* gold */
  --blush: #f7cadb;
  --wash: #fdecf4;
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Manrope", system-ui, -apple-system, sans-serif;
  --font-script: "Sacramento", "Brush Script MT", cursive;
  --radius: 18px;
  --maxw: 1200px;
  --tab-h: 70px;
}

/* ----------------------------- base ----------------------------- */
* { -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
.serif, .font-display { font-family: var(--font-display); }
.script { font-family: var(--font-script); }
::selection { background: var(--blush); color: var(--brand-2); }

/* soft custom scrollbar (desktop) */
@media (pointer: fine) {
  ::-webkit-scrollbar { width: 10px; height: 10px; }
  ::-webkit-scrollbar-thumb { background: var(--blush); border-radius: 20px; }
  ::-webkit-scrollbar-thumb:hover { background: var(--brand); }
}

/* ----------------------------- type helpers --------------------- */
.eyebrow {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--brand);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.eyebrow::before {
  content: "";
  width: 22px; height: 1px;
  background: var(--accent);
  display: inline-block;
}
.eyebrow.center::before { display: none; }
.label {
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.ink-grad {
  background: linear-gradient(110deg, var(--brand-2), var(--brand) 60%, var(--accent));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}

/* ----------------------------- buttons -------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  font-weight: 700; font-size: 0.95rem; line-height: 1;
  padding: 0.95rem 1.5rem; border-radius: 999px;
  cursor: pointer; border: 1.5px solid transparent;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, color 0.18s ease;
  text-decoration: none; white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--brand); color: #fff; box-shadow: var(--shadow-soft, 0 18px 44px -20px rgba(233, 62, 139, 0.6)); }
.btn-primary:hover { background: var(--brand-2); transform: translateY(-2px); }
.btn-ghost { background: transparent; color: var(--brand-2); border-color: var(--blush); }
.btn-ghost:hover { border-color: var(--brand); background: var(--wash); }
.btn-gold { background: linear-gradient(120deg, #e7be72, var(--accent)); color: #4b2432; }
.btn-gold:hover { transform: translateY(-2px); }
.btn-block { width: 100%; }
.btn-sm { padding: 0.6rem 1rem; font-size: 0.85rem; }

/* ----------------------------- chips / badges ------------------- */
.chip {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.5rem 0.9rem; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line);
  font-size: 0.8rem; font-weight: 600; color: var(--text);
  box-shadow: 0 6px 16px -12px rgba(75, 36, 50, 0.4);
}
.badge {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.3rem 0.7rem; border-radius: 999px;
  background: var(--brand); color: #fff;
  font-size: 0.7rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase;
}
.badge-gold { background: linear-gradient(120deg, #e7be72, var(--accent)); color: #4b2432; }

/* ----------------------------- cards ---------------------------- */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: 0 14px 36px -22px rgba(75, 36, 50, 0.3);
}

/* product / menu card (shared name with harvested component) */
.product-card {
  position: relative; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 22px; overflow: hidden;
  box-shadow: 0 14px 36px -24px rgba(75, 36, 50, 0.4);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.product-card:hover { transform: translateY(-4px); box-shadow: 0 26px 50px -26px rgba(233, 62, 139, 0.45); }
.media-thumb { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: var(--wash); }
.media-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.5s ease; }
.product-card:hover .media-thumb img { transform: scale(1.05); }
.media-thumb.portrait { aspect-ratio: 3 / 4; }
.category-chip { font-size: 0.72rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--brand-2); }
.meta-line { display: flex; align-items: center; justify-content: space-between; padding-top: 0.75rem; margin-top: auto; border-top: 1px solid var(--line); font-weight: 700; }

/* round add-to-order button */
.add-btn {
  position: absolute; bottom: -18px; right: 16px;
  width: 44px; height: 44px; border-radius: 999px;
  background: var(--brand); color: #fff; border: 3px solid var(--surface);
  display: grid; place-items: center; cursor: pointer;
  box-shadow: 0 10px 22px -8px rgba(233, 62, 139, 0.7);
  transition: transform 0.15s ease, background 0.15s ease;
  font-size: 1.25rem; line-height: 1;
}
.add-btn:hover { background: var(--brand-2); transform: scale(1.08); }
.add-btn:active { transform: scale(0.9); }

/* dietary / tag pills */
.tag-pill {
  display: inline-flex; align-items: center;
  padding: 0.18rem 0.55rem; border-radius: 999px;
  background: var(--wash); color: var(--brand-2);
  font-size: 0.66rem; font-weight: 700; letter-spacing: 0.04em;
}

/* ----------------------------- sticky header -------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  transition: background 0.3s ease, box-shadow 0.3s ease, backdrop-filter 0.3s ease;
}
.site-header.scrolled {
  background: rgba(255, 248, 245, 0.82);
  backdrop-filter: saturate(140%) blur(14px);
  box-shadow: 0 10px 30px -22px rgba(75, 36, 50, 0.4);
}

/* ----------------------------- bottom tabbar -------------------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  height: calc(var(--tab-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(150%) blur(16px);
  border-top: 1px solid var(--line);
  box-shadow: 0 -10px 34px -16px rgba(75, 36, 50, 0.28);
  display: flex; align-items: stretch; justify-content: space-around;
}
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--quiet); font-size: 0.66rem; font-weight: 700; letter-spacing: 0.02em; text-decoration: none; transition: color 0.15s ease; }
.tabbar a svg { width: 22px; height: 22px; }
.tabbar a.active { color: var(--brand); }
.tabbar a:active { transform: scale(0.95); }
.tabbar .tab-order { position: relative; }
.tabbar .tab-order .order-fab {
  position: absolute; top: -22px; width: 56px; height: 56px; border-radius: 999px;
  background: var(--brand); color: #fff; display: grid; place-items: center;
  box-shadow: 0 12px 26px -8px rgba(233, 62, 139, 0.75); border: 4px solid var(--surface);
}
.tabbar .tab-order .order-fab svg { width: 24px; height: 24px; }
.tabbar .tab-order span { margin-top: 30px; }
.cart-count {
  position: absolute; top: -26px; right: 50%; transform: translateX(26px);
  min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px;
  background: var(--gold, #d4a24c); color: #4b2432; font-size: 0.66rem; font-weight: 900;
  display: none; align-items: center; justify-content: center; border: 2px solid #fff;
}
.cart-count.show { display: flex; }
/* push page content above the tabbar on mobile */
.has-tabbar { padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom, 0px) + 8px); }
@media (min-width: 1024px) { .tabbar { display: none; } .has-tabbar { padding-bottom: 0; } }

/* ----------------------------- cart drawer ---------------------- */
.overlay {
  position: fixed; inset: 0; z-index: 70;
  background: rgba(75, 36, 50, 0.45); backdrop-filter: blur(3px);
  opacity: 0; visibility: hidden; transition: opacity 0.25s ease, visibility 0.25s ease;
}
.overlay.open { opacity: 1; visibility: visible; }
.drawer {
  position: fixed; z-index: 80; right: 0; top: 0; bottom: 0;
  width: min(420px, 92vw); background: var(--surface);
  box-shadow: -30px 0 60px -30px rgba(75, 36, 50, 0.5);
  transform: translateX(100%); transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
  display: flex; flex-direction: column;
}
.drawer.open { transform: translateX(0); }
.drawer-head { padding: 1.25rem 1.25rem 1rem; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
/* push the drawer header below the iOS address bar (chrome height = large viewport - small viewport) */
.drawer-head { padding-top: max(1.25rem, calc(1.25rem + 100lvh - 100svh + env(safe-area-inset-top))); }
.drawer-body { flex: 1; overflow-y: auto; padding: 1rem 1.25rem; }
.drawer-foot { padding: 1.1rem 1.25rem calc(1.1rem + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); background: var(--surface-2); }
.cart-item { display: grid; grid-template-columns: 56px 1fr auto; gap: 0.85rem; align-items: center; padding: 0.75rem 0; border-bottom: 1px solid var(--line); }
.cart-item .thumb { width: 56px; height: 56px; border-radius: 14px; object-fit: cover; background: var(--wash); }
.qty { display: inline-flex; align-items: center; gap: 0.6rem; border: 1px solid var(--line); border-radius: 999px; padding: 0.2rem 0.5rem; }
.qty button { width: 24px; height: 24px; border-radius: 999px; background: var(--wash); color: var(--brand-2); font-weight: 900; display: grid; place-items: center; cursor: pointer; }
.qty button:active { transform: scale(0.9); }

/* ----------------------------- product modal -------------------- */
.modal { position: fixed; inset: 0; z-index: 90; display: grid; place-items: end center; pointer-events: none; }
@media (min-width: 768px) { .modal { place-items: center; } }
.modal .modal-card {
  pointer-events: auto; width: min(560px, 100%); overflow-y: auto;
  /* Cap to the small (bars-shown) viewport so the top + close button always clear the iOS address bar.
     Bottom-aligned, so the leftover height becomes a top gap = browser-chrome height + 28px. */
  max-height: 82vh;
  max-height: calc(100svh - 28px);
  background: var(--surface); border-radius: 26px 26px 0 0;
  padding-bottom: env(safe-area-inset-bottom);
  transform: translateY(100%); transition: transform 0.34s cubic-bezier(0.22, 1, 0.36, 1);
}
@media (min-width: 768px) { .modal .modal-card { max-height: 90vh; padding-bottom: 0; border-radius: 26px; transform: translateY(20px) scale(0.98); opacity: 0; transition: transform 0.3s ease, opacity 0.3s ease; } }
.modal.open .modal-card { transform: translateY(0) scale(1); opacity: 1; }
.opt-pill { cursor: pointer; }
.opt-pill input { position: absolute; opacity: 0; }
.opt-pill span {
  display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.55rem 0.95rem;
  border-radius: 999px; border: 1.5px solid var(--line); font-weight: 600; font-size: 0.85rem;
  transition: all 0.15s ease;
}
.opt-pill input:checked + span { border-color: var(--brand); background: var(--wash); color: var(--brand-2); }

/* ----------------------------- accordion (FAQ) ------------------ */
.acc-item { border-bottom: 1px solid var(--line); }
.acc-q { width: 100%; text-align: left; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.15rem 0; font-weight: 700; font-size: 1.05rem; cursor: pointer; color: var(--text); }
.acc-q .ico { flex: none; width: 28px; height: 28px; border-radius: 999px; background: var(--wash); color: var(--brand); display: grid; place-items: center; font-size: 1.2rem; transition: transform 0.25s ease, background 0.2s ease; }
.acc-item.open .acc-q .ico { transform: rotate(45deg); background: var(--brand); color: #fff; }
.acc-a { overflow: hidden; max-height: 0; transition: max-height 0.3s ease; }
.acc-a-inner { padding: 0 0 1.15rem; color: var(--muted); line-height: 1.7; }

/* ----------------------------- marquee -------------------------- */
.marquee { overflow: hidden; }
.marquee-track { display: inline-flex; gap: 2.5rem; white-space: nowrap; animation: marquee 32s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-item { display: inline-flex; align-items: center; gap: 2.5rem; font-family: var(--font-display); font-style: italic; font-size: 1.25rem; color: var(--brand-2); }
.marquee-item .dot { width: 6px; height: 6px; border-radius: 999px; background: var(--accent); }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ----------------------------- hero ken-burns ------------------- */
.kb { animation: kb 14s ease-in-out infinite alternate; }
@keyframes kb { from { transform: scale(1); } to { transform: scale(1.08); } }

/* ----------------------------- reveal --------------------------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1); }
.reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: 0.08s; } .reveal.d2 { transition-delay: 0.16s; } .reveal.d3 { transition-delay: 0.24s; } .reveal.d4 { transition-delay: 0.32s; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .kb, .marquee-track, .animate-floaty { animation: none !important; }
}

/* ----------------------------- decorative ----------------------- */
.sparkle-bg { background-image: radial-gradient(circle at 20% 20%, rgba(212, 162, 76, 0.10), transparent 40%), radial-gradient(circle at 80% 0%, rgba(233, 62, 139, 0.08), transparent 45%); }
.gold-rule { height: 1px; background: linear-gradient(90deg, transparent, var(--accent), transparent); border: 0; }
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tab-h) + 18px); transform: translateX(-50%) translateY(20px);
  z-index: 95; background: var(--brand-2); color: #fff; padding: 0.7rem 1.1rem; border-radius: 999px;
  font-weight: 700; font-size: 0.85rem; box-shadow: 0 14px 30px -12px rgba(179, 18, 85, 0.6);
  opacity: 0; visibility: hidden; transition: all 0.25s ease; display: inline-flex; align-items: center; gap: 0.5rem;
}
.toast.show { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
@media (min-width: 1024px) { .toast { bottom: 28px; } }

.no-scroll { overflow: hidden; }

/* ----------------------------- hero (bg image) ------------------ */
.hero { position: relative; isolation: isolate; }
.hero-bg { position: absolute; inset: 0; z-index: -2; overflow: hidden; }
.hero-bg .hero-slide { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 72% center; opacity: 0; transition: opacity 1.1s ease; }
.hero-bg .hero-slide.is-active { opacity: 1; }
.hero-scrim { position: absolute; inset: 0; z-index: -1; }
/* desktop: fade from solid ivory (left, behind text) to clear (right, food) */
.hero-scrim { background: linear-gradient(100deg, var(--bg) 0%, rgba(255,248,245,.92) 34%, rgba(255,248,245,.55) 52%, rgba(255,248,245,0) 74%); }
/* slide dots */
.hero-dots { position: absolute; left: 0; right: 0; bottom: 20px; z-index: 3; display: flex; gap: 7px; justify-content: center; }
.hero-dots button { width: 8px; height: 8px; border-radius: 999px; background: rgba(179,18,85,.30); border: 0; cursor: pointer; transition: all 0.3s ease; padding: 0; }
.hero-dots button.on { width: 22px; background: var(--brand); }
@media (min-width: 1024px) { .hero-dots { justify-content: flex-start; max-width: var(--maxw); margin: 0 auto; padding-left: 2rem; } }
@media (max-width: 1023px) {
  .hero-bg .hero-slide { object-position: 78% 28%; }
  /* mobile: a soft ivory veil so the left-aligned headline + copy stay clean over the food, fading to solid at the badges */
  .hero-scrim { background: linear-gradient(180deg, rgba(255,248,245,.58) 0%, rgba(255,248,245,.62) 38%, rgba(255,248,245,.86) 74%, var(--bg) 100%); }
}

/* location pill */
.loc-pill {
  display: inline-flex; align-items: center; gap: 0.45rem;
  padding: 0.5rem 1rem; border-radius: 999px;
  background: rgba(255,255,255,0.75); border: 1.5px solid var(--blush);
  color: var(--brand-2); font-size: 0.72rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase;
  backdrop-filter: blur(4px);
}

/* CTA with trailing circular arrow */
.btn .cta-arrow {
  width: 24px; height: 24px; border-radius: 999px; display: grid; place-items: center; margin-left: 0.2rem;
}
.btn-primary .cta-arrow { background: #fff; color: var(--brand); }
.btn-ghost .cta-arrow { background: var(--brand); color: #fff; }

/* value badges: one divided card */
.badges-card { display: flex; align-items: stretch; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: 0 14px 36px -24px rgba(75,36,50,.4); overflow: hidden; }
.badges-card .badge-cell { flex: 1; display: flex; align-items: center; gap: 0.6rem; padding: 0.9rem 0.85rem; border-left: 1px solid var(--line); }
.badges-card .badge-cell:first-child { border-left: 0; }
.badges-card .badge-ico { width: 38px; height: 38px; border-radius: 999px; display: grid; place-items: center; flex: none; border: 1.5px solid currentColor; }
@media (max-width: 639px) {
  .badges-card { flex-wrap: wrap; }
  .badges-card .badge-cell { flex: 1 1 50%; border-top: 1px solid var(--line); }
  .badges-card .badge-cell:nth-child(-n+2) { border-top: 0; }
  .badges-card .badge-cell:nth-child(odd) { border-left: 0; }
}

/* mood card: icon + title on top, photo below */
.mood-card { display: flex; flex-direction: column; gap: 0.4rem; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 0.5rem; text-decoration: none; color: var(--text); transition: transform 0.2s ease, box-shadow 0.2s ease; }
.mood-card:hover { transform: translateY(-3px); box-shadow: 0 18px 40px -24px rgba(233,62,139,.5); }
.mood-card .mood-ico { color: var(--brand); }
.mood-card .mood-photo { border-radius: 11px; overflow: hidden; aspect-ratio: 1/1; }
@media (min-width: 640px) { .mood-card { padding: 0.7rem; border-radius: 18px; } .mood-card .mood-photo { aspect-ratio: 16/11; } }
.mood-card .mood-photo img { width: 100%; height: 100%; object-fit: cover; }

/* wishlist heart on cards */
.wish { position: absolute; top: 12px; right: 12px; z-index: 2; width: 34px; height: 34px; border-radius: 999px; background: rgba(255,255,255,0.9); display: grid; place-items: center; color: var(--brand); box-shadow: 0 6px 16px -8px rgba(75,36,50,.5); cursor: pointer; transition: transform 0.15s ease; }
.wish:hover { transform: scale(1.1); }
.wish.on { background: var(--brand); color: #fff; }

/* neon "Boss Brunch Repeat" panel */
.neon-panel { background: radial-gradient(circle at 50% 40%, #ffd9ec 0%, #f7b7d6 60%, #f29ec8 100%); position: relative; overflow: hidden; }
.neon-text { font-family: var(--font-script); color: #fff; line-height: 1.05;
  text-shadow: 0 0 4px #fff, 0 0 12px var(--brand), 0 0 22px var(--brand), 0 0 36px rgba(233,62,139,.7); }
