/* ============================================================
   CRUNCHY BITES — Design Tokens & Signature System
   Palette: Black #0D0D0D / Deep Red #9B111E / Gold #D4AF37 / Off-white #F7F3EC
   Display face: Sora  |  Body face: Outfit
   Signature: the "bite" — circular mask cutouts + scalloped
   dividers echo a literal bite mark across buttons, badges,
   images and section seams.
   ============================================================ */

:root {
  --black: #0d0d0d;
  --black-2: #161010;
  --black-3: #1e1517;
  --red: #9b111e;
  --red-bright: #c9203a;
  --gold: #d4af37;
  --gold-soft: #f0d78c;
  --orange: #ff7a30;
  --off-white: #f7f3ec;
  --muted: #b8aca2;

  --font-display: "Sora", sans-serif;
  --font-body: "Outfit", sans-serif;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --radius-lg: 28px;
  --radius-md: 18px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--black);
  color: var(--off-white);
  font-family: var(--font-body);
  overflow-x: hidden;
}

h1, h2, h3, h4, .font-display {
  font-family: var(--font-display);
}

::selection { background: var(--red); color: var(--off-white); }

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--black); }
::-webkit-scrollbar-thumb { background: linear-gradient(var(--gold), var(--red)); border-radius: 10px; }

a:focus-visible, button:focus-visible, input:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

/* ----------------------------------------------------------
   Texture & atmosphere
   ---------------------------------------------------------- */
.grain::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
  z-index: 0;
}

/* ----------------------------------------------------------
   Glassmorphism
   ---------------------------------------------------------- */
.glass {
  background: rgba(23, 16, 16, 0.55);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border: 1px solid rgba(212, 175, 55, 0.14);
}

.glass-solid {
  background: rgba(13, 13, 13, 0.86);
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  border-bottom: 1px solid rgba(212, 175, 55, 0.16);
}

/* ----------------------------------------------------------
   SIGNATURE: the bite mark
   Used sparingly now — only on small tag badges and the
   scalloped section dividers, never on buttons or primary
   imagery, so the UI reads clean and modern throughout.
   ---------------------------------------------------------- */
.bite-badge {
  -webkit-mask-image: radial-gradient(circle 9px at 6px 6px, transparent 98%, #000 100%);
          mask-image: radial-gradient(circle 9px at 6px 6px, transparent 98%, #000 100%);
}

/* Scalloped "crunch" divider — a strip of repeating bite marks
   used to seam sections together instead of a plain hairline. */
.crunch-divider {
  height: 34px;
  width: 100%;
  background: var(--black);
  -webkit-mask-image: radial-gradient(circle at 17px 0, transparent 15px, #000 15.5px);
          mask-image: radial-gradient(circle at 17px 0, transparent 15px, #000 15.5px);
  -webkit-mask-size: 34px 34px;
          mask-size: 34px 34px;
  -webkit-mask-repeat: repeat-x;
          mask-repeat: repeat-x;
}
.crunch-divider.flip {
  transform: scaleY(-1);
}

/* ----------------------------------------------------------
   Buttons
   ---------------------------------------------------------- */
.btn {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.95rem 2.1rem;
  border-radius: 999px;
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out), background 0.3s, filter 0.3s;
  position: relative;
  isolation: isolate;
  cursor: pointer;
  border: none;
}
.btn:active { transform: translateY(0) scale(0.98); }
.btn-primary {
  background: linear-gradient(135deg, var(--red-bright), var(--red) 55%, #6b0c14);
  color: var(--off-white);
  box-shadow: 0 10px 28px -10px rgba(155, 17, 30, 0.65), inset 0 1px 0 rgba(255,255,255,0.08);
}
.btn-primary:hover {
  transform: translateY(-3px);
  filter: brightness(1.08);
  box-shadow: 0 16px 36px -10px rgba(255, 122, 48, 0.5), inset 0 1px 0 rgba(255,255,255,0.12);
}
.btn-gold {
  background: linear-gradient(135deg, var(--gold-soft), var(--gold) 55%, #a8801f);
  color: var(--black);
  box-shadow: 0 10px 28px -10px rgba(212, 175, 55, 0.5), inset 0 1px 0 rgba(255,255,255,0.25);
}
.btn-gold:hover {
  transform: translateY(-3px);
  filter: brightness(1.05);
  box-shadow: 0 16px 36px -10px rgba(212, 175, 55, 0.7), inset 0 1px 0 rgba(255,255,255,0.3);
}
.btn-ghost {
  border: 1.5px solid rgba(247, 243, 236, 0.28);
  color: var(--off-white);
  background: rgba(247, 243, 236, 0.03);
}
.btn-ghost:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(212, 175, 55, 0.06);
  transform: translateY(-2px);
}
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none !important; filter: none !important; }

/* ----------------------------------------------------------
   Nav
   ---------------------------------------------------------- */
#site-nav {
  transition: background 0.4s var(--ease-out), border-color 0.4s, padding 0.4s;
}
.nav-link {
  position: relative;
  font-weight: 500;
  color: var(--muted);
  transition: color 0.25s;
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 0; bottom: -6px;
  width: 0; height: 2px;
  background: linear-gradient(90deg, var(--gold), var(--orange));
  transition: width 0.3s var(--ease-out);
}
.nav-link:hover { color: var(--off-white); }
.nav-link:hover::after, .nav-link.active::after { width: 100%; }
.nav-link.active { color: var(--gold); }

/* ----------------------------------------------------------
   Cards
   ---------------------------------------------------------- */
.food-card {
  background: linear-gradient(180deg, var(--black-3), var(--black-2));
  border: 1px solid rgba(212, 175, 55, 0.12);
  border-radius: var(--radius-md);
  transition: transform 0.45s var(--ease-out), box-shadow 0.45s var(--ease-out), border-color 0.45s;
}
.food-card:hover {
  transform: translateY(-8px);
  border-color: rgba(212, 175, 55, 0.45);
  box-shadow: 0 24px 50px -20px rgba(0,0,0,0.7), 0 0 0 1px rgba(212,175,55,0.08);
}
.food-card .food-img-wrap { overflow: hidden; }
.food-card img { transition: transform 0.6s var(--ease-out), filter 0.6s; }
.food-card:hover img { transform: scale(1.1); filter: saturate(1.15); }

/* Floating idle animation for hero food props */
@keyframes float-1 { 0%,100% { transform: translateY(0) rotate(-4deg);} 50% { transform: translateY(-22px) rotate(2deg);} }
@keyframes float-2 { 0%,100% { transform: translateY(0) rotate(3deg);} 50% { transform: translateY(-16px) rotate(-3deg);} }
@keyframes float-3 { 0%,100% { transform: translateY(0) rotate(0deg);} 50% { transform: translateY(-28px) rotate(5deg);} }
.float-1 { animation: float-1 6s ease-in-out infinite; }
.float-2 { animation: float-2 7.5s ease-in-out infinite; }
.float-3 { animation: float-3 5.2s ease-in-out infinite; }

@keyframes particle-rise {
  0% { transform: translateY(0) translateX(0); opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 0.8; }
  100% { transform: translateY(-120vh) translateX(var(--drift, 40px)); opacity: 0; }
}
.particle {
  position: absolute;
  bottom: -10%;
  border-radius: 50%;
  background: radial-gradient(circle, var(--orange), transparent 70%);
  animation: particle-rise linear infinite;
  pointer-events: none;
}

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(36px);
  transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
}
.reveal.in-view { opacity: 1; transform: translateY(0); }
.reveal-scale { opacity: 0; transform: scale(0.92); transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out); }
.reveal-scale.in-view { opacity: 1; transform: scale(1); }

/* Hero heading fade/rise */
@keyframes hero-fade {
  from { opacity: 0; transform: translateY(40px); }
  to { opacity: 1; transform: translateY(0); }
}
.hero-fade { animation: hero-fade 1.1s var(--ease-out) both; }

/* Glow pulse for CTA halo */
@keyframes pulse-glow {
  0%,100% { opacity: 0.55; transform: scale(1); }
  50% { opacity: 0.9; transform: scale(1.08); }
}
.pulse-glow { animation: pulse-glow 3.2s ease-in-out infinite; }

/* Marquee for the "More Crunch, More Smiles" ticker */
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.marquee-track { animation: marquee 22s linear infinite; }

/* Gold shimmer text */
.shimmer-text {
  background: linear-gradient(100deg, var(--gold-soft) 20%, var(--gold) 40%, var(--orange) 50%, var(--gold) 60%, var(--gold-soft) 80%);
  background-size: 250% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shimmer 5s linear infinite;
}
@keyframes shimmer { to { background-position: -250% center; } }

/* Loading screen */
#loader {
  position: fixed; inset: 0; z-index: 100;
  background: var(--black);
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.6s var(--ease-out), visibility 0.6s;
}
#loader.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.loader-bite {
  width: 64px; height: 64px; border-radius: 50%;
  border: 4px solid rgba(212,175,55,0.25);
  border-top-color: var(--gold);
  border-right-color: var(--red-bright);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Skeleton loading */
.skeleton {
  background: linear-gradient(90deg, var(--black-2) 25%, var(--black-3) 37%, var(--black-2) 63%);
  background-size: 400% 100%;
  animation: skeleton-loading 1.4s ease infinite;
  border-radius: var(--radius-md);
}
@keyframes skeleton-loading { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* Cursor glow */
#cursor-glow {
  position: fixed;
  width: 380px; height: 380px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,122,48,0.10), transparent 70%);
  pointer-events: none;
  z-index: 1;
  transform: translate(-50%, -50%);
  transition: opacity 0.3s;
}

/* Scroll progress bar */
#scroll-progress {
  position: fixed; top: 0; left: 0; height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--orange), var(--red-bright));
  z-index: 90; width: 0%;
  transition: width 0.1s linear;
}

/* Back to top / floating buttons */
.fab {
  position: fixed;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 30px -8px rgba(0,0,0,0.6);
  transition: transform 0.3s var(--ease-out), opacity 0.3s;
  z-index: 60;
}
.fab:hover { transform: translateY(-4px) scale(1.06); }

/* Category tabs */
.cat-tab {
  white-space: nowrap;
  font-family: var(--font-display);
  font-weight: 600;
  transition: all 0.3s var(--ease-out);
  border: 1px solid rgba(247,243,236,0.14);
  color: var(--muted);
}
.cat-tab.active {
  background: linear-gradient(135deg, var(--red-bright), var(--red));
  color: var(--off-white);
  border-color: transparent;
  box-shadow: 0 8px 22px -8px rgba(155,17,30,0.7);
}
.cat-tab:not(.active):hover { border-color: var(--gold); color: var(--gold); }

/* Filter chip toggle */
.chip {
  transition: all 0.25s var(--ease-out);
  border: 1px solid rgba(247,243,236,0.14);
  color: var(--muted);
}
.chip.on {
  background: rgba(212,175,55,0.15);
  border-color: var(--gold);
  color: var(--gold-soft);
}

/* Cart drawer */
#cart-drawer {
  transition: transform 0.5s var(--ease-out);
  transform: translateX(100%);
}
#cart-drawer.open { transform: translateX(0); }
#cart-backdrop {
  transition: opacity 0.4s var(--ease-out);
  opacity: 0; pointer-events: none;
}
#cart-backdrop.open { opacity: 1; pointer-events: auto; }

/* Combo glow border */
.combo-glow {
  position: relative;
}
.combo-glow::before {
  content: "";
  position: absolute; inset: -2px;
  border-radius: inherit;
  padding: 2px;
  background: linear-gradient(120deg, var(--gold), var(--red-bright), var(--orange), var(--gold));
  background-size: 300% 300%;
  animation: border-flow 6s linear infinite;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  z-index: -1;
}
@keyframes border-flow { to { background-position: 300% 0; } }

/* Masonry gallery */
.masonry {
  columns: 1;
  gap: 1rem;
}
@media (min-width: 640px) { .masonry { columns: 2; } }
@media (min-width: 1024px) { .masonry { columns: 3; } }
.masonry-item {
  break-inside: avoid;
  margin-bottom: 1rem;
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
}

/* Star rating */
.stars { color: var(--gold); letter-spacing: 2px; }

/* Reviews slider */
#reviews-track { transition: transform 0.6s var(--ease-out); }

/* Utility */
.text-gradient-gold { background: linear-gradient(135deg, var(--gold-soft), var(--gold)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.section-eyebrow { letter-spacing: 0.35em; font-size: 0.75rem; font-weight: 600; color: var(--gold); text-transform: uppercase; }

/* ============================================================
   Auth panel (Login / Sign Up / Forgot Password)
   ============================================================ */
#auth-modal { transition: opacity 0.35s var(--ease-out); }
.auth-card {
  background: linear-gradient(180deg, rgba(30,21,23,0.92), rgba(13,13,13,0.96));
  backdrop-filter: blur(24px) saturate(150%);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
  border: 1px solid rgba(212,175,55,0.18);
  box-shadow: 0 30px 80px -20px rgba(0,0,0,0.8), 0 0 0 1px rgba(212,175,55,0.06);
}
.auth-tab {
  flex: 1;
  text-align: center;
  padding: 0.7rem 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  transition: all 0.3s var(--ease-out);
  cursor: pointer;
}
.auth-tab.active { color: var(--gold); border-color: var(--gold); }
.auth-panel { display: none; animation: auth-fade-in 0.4s var(--ease-out); }
.auth-panel.active { display: block; }
@keyframes auth-fade-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.auth-input-wrap { position: relative; }
.auth-input {
  width: 100%;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  color: var(--off-white);
  transition: border-color 0.25s, background 0.25s;
}
.auth-input:focus { outline: none; border-color: var(--gold); background: rgba(212,175,55,0.05); }
.auth-input::placeholder { color: var(--muted); }
.auth-toggle-pw {
  position: absolute; right: 0.9rem; top: 50%; transform: translateY(-50%);
  color: var(--muted); cursor: pointer; font-size: 0.85rem; user-select: none;
  transition: color 0.2s;
}
.auth-toggle-pw:hover { color: var(--gold); }
.auth-strength-bar { height: 3px; border-radius: 2px; background: rgba(255,255,255,0.08); overflow: hidden; margin-top: 6px; }
.auth-strength-fill { height: 100%; width: 0%; transition: width 0.3s var(--ease-out), background 0.3s; }

/* ============================================================
   Payment card, QR, and order confirmation
   ============================================================ */
.payment-card {
  background: linear-gradient(160deg, rgba(30,21,23,0.95), rgba(13,13,13,0.98));
  border: 1px solid rgba(212,175,55,0.2);
  box-shadow: 0 20px 60px -20px rgba(0,0,0,0.7);
}
.qr-frame {
  background: #fff;
  border-radius: 20px;
  padding: 14px;
  box-shadow: 0 0 0 3px var(--gold), 0 15px 40px -10px rgba(212,175,55,0.4);
}
.upi-method-icon {
  width: 40px; height: 40px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.06);
  font-size: 1.2rem;
}
.pay-btn-gpay {
  background: #fff;
  color: #1f1f1f;
  font-family: var(--font-display);
  font-weight: 700;
  border-radius: 999px;
  padding: 1rem 1.5rem;
  display: flex; align-items: center; justify-content: center; gap: 0.6rem;
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s;
  box-shadow: 0 10px 26px -8px rgba(255,255,255,0.25);
}
.pay-btn-gpay:hover { transform: translateY(-3px); box-shadow: 0 16px 34px -8px rgba(255,255,255,0.35); }

@keyframes verify-spin { to { transform: rotate(360deg); } }
.verify-ring {
  width: 74px; height: 74px; border-radius: 50%;
  border: 4px solid rgba(212,175,55,0.2);
  border-top-color: var(--gold);
  border-right-color: var(--red-bright);
  animation: verify-spin 0.9s linear infinite;
  margin: 0 auto;
}
@keyframes check-pop {
  0% { transform: scale(0); opacity: 0; }
  60% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); }
}
.confirm-check { animation: check-pop 0.5s var(--ease-out) both; }

.step-dot { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,0.15); transition: all 0.3s; }
.step-dot.active { background: var(--gold); width: 22px; border-radius: 4px; }

/* ============================================================
   MOBILE RESPONSIVENESS FIXES
   Additive, mobile-only patches. Nothing here changes colors,
   fonts, animations, spacing, or layout on desktop — every rule
   is scoped inside a max-width media query and only reflows
   elements that were overflowing/clipping on small phone
   screens. The visual design (the existing UI) is unchanged.
   ============================================================ */

/* Safety net: guarantee no element can force page-level
   horizontal scrolling or push content past the viewport edge,
   on any screen size. */
html { overflow-x: hidden; max-width: 100%; }
img, iframe, svg { max-width: 100%; }

@media (max-width: 639px) {
  /* The featured/menu food-card grids were hard-set to 2 fixed
     columns at every mobile width. On narrow phones this left too
     little width inside each card for its price + quantity
     stepper + Add button row, pushing the Add button off-screen /
     partially off the card. One card per row on phones gives the
     existing card exactly the width its existing controls need —
     the card itself, its image, colors and styling are untouched. */
  #featured-grid,
  #menu-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 479px) {
  /* The checkout "← Back" / "Continue to WhatsApp →" buttons sit
     side-by-side (flex-1 each). On phones under ~480px there isn't
     enough width for both buttons to fit their existing label text,
     which cut the text off / pushed the second button off-screen.
     Stacking them full-width keeps both labels fully visible. */
  .checkout-actions {
    flex-direction: column;
  }
  .checkout-actions .btn {
    width: 100%;
  }

  /* Guards against the login/signup panel being taller than short
     phone viewports (e.g. landscape) by making it scroll internally
     instead of clipping the bottom fields off-screen. */
  .auth-card {
    max-height: 90vh;
    overflow-y: auto;
  }
}
