:root {
  --brand: #ff5e3a;
  --brand-dark: #e6431f;
  --brand-light: #ff9269;
  --brand-50: #fff2ec;
  --brand-100: #ffe1d0;
  --gold: #f2a922;
  --bg: #fdf5ee;
  --card: #ffffff;
  --surface-2: #fffaf5;
  --text: #221812;
  --muted: #8a7b71;
  --border: #f1e3d6;
  --veg: #2e9142;
  --nonveg: #d8402e;
  --radius: 16px;
  --radius-sm: 11px;
  --radius-lg: 24px;
  --radius-pill: 999px;
  --shadow-xs: 0 1px 2px rgba(34,24,18,0.05);
  --shadow-sm: 0 3px 12px rgba(34,24,18,0.07);
  --shadow-md: 0 10px 26px rgba(34,24,18,0.10);
  --shadow-lg: 0 22px 50px rgba(34,24,18,0.16);
  --shadow-brand: 0 10px 24px rgba(255,94,58,0.30);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
  --font: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  /* Subtle secondary accent that shifts per browsed country (JS sets this per
     COUNTRY_META) — never used for the core brand button/logo color. */
  --country-accent: #ff5e3a;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background-image: radial-gradient(circle at 12% 0%, rgba(255,146,105,0.14), transparent 55%),
    radial-gradient(circle at 100% 12%, rgba(242,169,34,0.10), transparent 45%);
  background-attachment: fixed;
}

h1, h2, h3, h4 { font-family: var(--font); letter-spacing: -0.01em; }

button { font-family: inherit; cursor: pointer; }
input { font-family: inherit; }

.hidden { display: none !important; }

/* ---------- Topbar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(10px);
  box-shadow: 0 1px 0 var(--border), 0 6px 20px rgba(34,24,18,0.05);
  padding-top: var(--safe-top); /* clears notch / status bar on iOS & Android */
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 16px 8px;
  gap: 10px;
}

/* Stacks brand row + tagline into two lines, left-aligned as one block */
.brand-block {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  flex: 1;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
}
.brand-word { display: inline-block; }
.brand-word span { color: var(--brand); }
.brand-mark {
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 9px;
  object-fit: cover;
  box-shadow: 0 3px 8px rgba(255,94,58,0.35);
}

.location {
  font-size: 11px;
  color: var(--muted);
  text-align: left;
  line-height: 1.35;
  margin: 0;
}
.location span { font-size: 10px; }

.cart-btn {
  position: relative;
  flex: none;
  background: linear-gradient(155deg, var(--brand), var(--brand-dark));
  color: #fff;
  border: none;
  border-radius: var(--radius-pill);
  padding: 9px 14px;
  font-size: 16px;
  box-shadow: var(--shadow-brand);
  transition: transform 0.15s ease;
}
.cart-btn:hover { transform: translateY(-1px); }
.cart-btn:active { transform: scale(0.95); }

.cart-count {
  background: #fff;
  color: var(--brand-dark);
  border-radius: 50%;
  font-size: 11px;
  font-weight: 800;
  padding: 1px 6px;
  margin-left: 3px;
}

.search-row {
  padding: 9px 16px 13px;
}

.search-row input {
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--surface-2);
  font-size: 14px;
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.search-row input::placeholder { color: var(--muted); }
.search-row input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(255,94,58,0.12);
}

/* ---------- Streak / BhookCoins widget ---------- */
.streak-widget {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  max-width: 420px;
  margin: 12px auto 0;
  padding: 8px 18px;
  border: 1.5px solid var(--brand-100);
  background: linear-gradient(180deg, var(--brand-50), #fff);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-xs);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--brand-dark);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.streak-widget:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.streak-widget:active { transform: scale(0.97); }
.streak-widget-flame { font-size: 15px; }
.streak-widget-divider {
  width: 1px;
  height: 14px;
  background: var(--brand-100);
}
.streak-widget-coins { color: var(--text); font-weight: 700; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 30px 16px 16px;
  text-align: center;
  overflow: hidden;
}
/* Soft brand-colored glow blobs behind the headline — same palette as the
   Dish-of-the-Day card's ::after treatment, so it reads as one system rather
   than a bolted-on new style. Purely decorative, sits behind .hero-inner. */
.hero::before {
  content: "";
  position: absolute;
  inset: -25% -8%;
  background:
    radial-gradient(circle at 16% 20%, rgba(255,146,105,0.30), transparent 55%),
    radial-gradient(circle at 84% 10%, rgba(242,169,34,0.22), transparent 50%),
    radial-gradient(circle at 50% 105%, rgba(255,94,58,0.12), transparent 60%);
  pointer-events: none;
  z-index: 0;
}
.hero-inner { position: relative; z-index: 2; }

/* Floating food-emoji accents — low-opacity, off to the sides, so the
   headline/subtext stay the clear focal point. */
.hero-deco {
  position: absolute;
  z-index: 1;
  opacity: 0.16;
  font-size: 28px;
  pointer-events: none;
  animation: heroFloat 6.5s ease-in-out infinite;
}
.hero-deco-1 { top: 8%;  left: 6%;  font-size: 32px; animation-delay: 0s; }
.hero-deco-2 { top: 14%; right: 7%; font-size: 24px; animation-delay: 1.6s; }
.hero-deco-3 { bottom: 14%; left: 11%; font-size: 22px; animation-delay: 0.8s; }
.hero-deco-4 { bottom: 8%;  right: 13%; font-size: 27px; animation-delay: 2.3s; }
@keyframes heroFloat {
  0%, 100% { transform: translateY(0) rotate(-5deg); }
  50% { transform: translateY(-9px) rotate(5deg); }
}
@media (max-width: 480px) {
  .hero-deco { opacity: 0.11; }
  .hero-deco-1, .hero-deco-4 { font-size: 22px; }
  .hero-deco-2, .hero-deco-3 { font-size: 18px; }
}

.hero h1 {
  font-size: 22px;
  font-weight: 800;
  margin: 0 0 8px;
  letter-spacing: -0.02em;
  background: linear-gradient(120deg, var(--text) 35%, var(--brand-dark));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p {
  font-size: 13.5px;
  color: var(--muted);
  margin: 0 auto;
  max-width: 480px;
  line-height: 1.55;
}

.hero-link {
  display: inline-block;
  margin-top: 12px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--brand-dark);
  text-decoration: none;
  border-bottom: 1.5px solid var(--brand-100);
  padding-bottom: 1px;
}
.hero-link:hover { border-color: var(--brand-dark); }

/* ---------- Dish of the Day ---------- */
.dotd-section {
  max-width: 900px;
  margin: 18px auto 4px;
  padding: 0 16px;
}

.dotd-card {
  display: flex;
  gap: 16px;
  background: linear-gradient(155deg, #2a1c14, #1c130e);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  position: relative;
}
.dotd-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 85% 15%, rgba(255,146,105,0.25), transparent 55%);
  pointer-events: none;
}

.dotd-photo-wrap {
  position: relative;
  flex: 0 0 128px;
  aspect-ratio: 1 / 1;
  background: #3a281d;
}
.dotd-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.dotd-ribbon {
  position: absolute;
  top: 8px;
  left: 8px;
  background: linear-gradient(135deg, var(--gold), #d98c12);
  color: #2a1c14;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.02em;
  padding: 4px 8px;
  border-radius: var(--radius-pill);
  box-shadow: 0 3px 8px rgba(0,0,0,0.3);
  white-space: nowrap;
}

.dotd-body {
  flex: 1;
  min-width: 0;
  padding: 14px 16px 14px 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  position: relative;
  z-index: 1;
}
.dotd-restaurant {
  font-size: 11px;
  color: #ffcbb0;
  font-weight: 600;
}
.dotd-name {
  font-size: 17px;
  font-weight: 800;
  color: #fff;
  line-height: 1.25;
  margin-bottom: 2px;
}
.dotd-body .dish-price,
.dotd-body .dish-price-strike { color: #fff; }
.dotd-body .dish-price::before { color: var(--brand-light); }
.dotd-body .dish-price-strike { color: #c9a998; }

.dotd-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}
.dotd-add-btn {
  background: linear-gradient(155deg, var(--brand), var(--brand-dark));
  color: #fff;
  border-color: transparent;
  box-shadow: var(--shadow-brand);
  padding: 8px 16px;
}
.dotd-add-btn.added { background: #3a281d; box-shadow: none; }
.dotd-recipe-btn { background: rgba(255,94,58,0.22); border-color: rgba(255,94,58,0.55); color: #fff; }
.dotd-recipe-btn:hover { background: rgba(255,94,58,0.32); border-color: var(--brand-light); color: #fff; }

/* ---------- Coupon banner ---------- */
.coupon-banner {
  max-width: 900px;
  margin: 14px auto 0;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  background: var(--brand-50);
  border: 1.5px dashed var(--brand-100);
  border-radius: var(--radius-sm);
  margin-left: 16px;
  margin-right: 16px;
}
.coupon-code {
  font-family: "Courier New", monospace;
  font-weight: 800;
  font-size: 12.5px;
  letter-spacing: 0.04em;
  background: var(--brand);
  color: #fff;
  padding: 5px 10px;
  border-radius: 7px;
  flex: none;
}
.coupon-copy {
  font-size: 12px;
  color: var(--brand-dark);
  line-height: 1.4;
  flex: 1 1 200px;
}

/* ---------- Location consent banner ---------- */
.location-banner {
  max-width: 560px;
  margin: 12px auto 4px;
  padding: 13px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
}
.location-banner-text {
  font-size: 12.5px;
  color: var(--text);
  line-height: 1.4;
  flex: 1 1 240px;
}
.location-banner-actions {
  display: flex;
  gap: 8px;
  flex: none;
}
.chip-btn {
  border: none;
  border-radius: var(--radius-sm);
  padding: 8px 15px;
  font-size: 12.5px;
  font-weight: 700;
  background: var(--brand);
  color: #fff;
  transition: transform 0.12s ease, background 0.15s;
}
.chip-btn:hover { background: var(--brand-dark); }
.chip-btn:active { transform: scale(0.95); }
.chip-btn.ghost {
  background: none;
  border: 1.5px solid var(--border);
  color: var(--muted);
}
.chip-btn.ghost:hover { border-color: var(--muted); }
.location-status-note {
  max-width: 560px;
  margin: 8px auto 4px;
  padding: 0 16px;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

/* ---------- Install (PWA) banner ---------- */
.install-banner {
  max-width: 560px;
  margin: 12px auto 4px;
  padding: 13px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
}
.install-banner-text {
  font-size: 12.5px;
  color: var(--text);
  line-height: 1.4;
  flex: 1 1 240px;
}
.install-banner-actions {
  display: flex;
  gap: 8px;
  flex: none;
}
.install-ios-hint {
  max-width: 560px;
  margin: 8px auto 4px;
  padding: 0 16px;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

/* ---------- Country switcher ---------- */
.country-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 18px 16px 4px;
  -webkit-overflow-scrolling: touch;
}
.country-chips::-webkit-scrollbar { display: none; }
.chip.country-chip.active {
  background: color-mix(in srgb, var(--country-accent) 16%, white);
  border-color: var(--country-accent);
  color: var(--text);
  box-shadow: none;
}

.country-detect-note {
  max-width: 640px;
  margin: 8px auto 0;
  padding: 8px 14px;
  font-size: 12px;
  color: var(--muted);
  text-align: left;
  border-left: 3px solid var(--country-accent);
  background: var(--surface-2);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-left: 16px;
  margin-right: 16px;
}

/* ---------- Cuisine chips ---------- */
.cuisine-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px 16px 14px;
  -webkit-overflow-scrolling: touch;
}
.cuisine-chips::-webkit-scrollbar { display: none; }

.chip {
  flex: 0 0 auto;
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 8px 15px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  transition: transform 0.12s ease, border-color 0.15s, background 0.15s, color 0.15s;
}
.chip:hover { border-color: var(--brand-light); }
.chip:active { transform: scale(0.95); }
.chip.active {
  background: linear-gradient(155deg, var(--brand), var(--brand-dark));
  border-color: transparent;
  color: #fff;
  font-weight: 700;
  box-shadow: var(--shadow-brand);
}

/* ---------- Global search scope note ---------- */
.search-scope-note {
  max-width: 640px;
  margin: 4px auto 0;
  padding: 8px 14px;
  font-size: 12px;
  color: var(--brand-dark);
  text-align: left;
  border-left: 3px solid var(--brand);
  background: var(--brand-50);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-left: 16px;
  margin-right: 16px;
}

.restaurant-country-tag {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  margin-left: 6px;
}

/* ---------- Restaurant list ---------- */
.restaurant-list {
  padding: 6px 16px 100px;
  max-width: 900px;
  margin: 0 auto;
}

.app-footer {
  text-align: center;
  padding: 12px 0 24px;
}
.app-footer a {
  font-size: 11px;
  color: var(--muted);
  text-decoration: underline;
}

/* Personal book plug, styled as a genuine callout card (not a bolted-on
   banner) — reuses the same gold-badge treatment as .dotd-ribbon /
   .discount-ribbon so it reads as an intentional part of the system. */
.footer-book {
  max-width: 480px;
  margin: 20px auto 0;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  text-align: center;
  background: linear-gradient(180deg, #fffaf0, var(--card));
  border: 1.5px solid var(--gold);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.footer-book-badge {
  display: inline-block;
  background: linear-gradient(135deg, var(--gold), #d98c12);
  color: #2a1c14;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.02em;
  padding: 4px 11px;
  border-radius: var(--radius-pill);
  box-shadow: 0 3px 8px rgba(0,0,0,0.15);
}
.footer-book-line {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.55;
}
.footer-book-line em { font-style: italic; font-weight: 700; color: var(--brand-dark); }
.footer-book-line a {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--brand-dark);
  text-decoration: underline;
}

.restaurant-block {
  margin-bottom: 30px;
}

.restaurant-head {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 12px;
}

.restaurant-banner {
  font-size: 27px;
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--country-accent) 14%, var(--card));
  border-radius: 13px;
  box-shadow: var(--shadow-xs);
  flex: none;
}

.restaurant-name {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.restaurant-meta {
  font-size: 12px;
  color: var(--muted);
}

.dish-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}

.dish-card {
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.dish-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.dish-photo-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: var(--surface-2);
  overflow: hidden;
}

.dish-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}
.dish-card:hover .dish-photo { transform: scale(1.05); }

.dish-photo-wrap .veg-dot {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(255,255,255,0.92);
  padding: 2px;
  box-shadow: var(--shadow-xs);
}

.discount-ribbon {
  position: absolute;
  top: 8px;
  right: 8px;
  background: linear-gradient(135deg, var(--gold), #d98c12);
  color: #2a1c14;
  font-size: 9.5px;
  font-weight: 800;
  padding: 3px 7px;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.22);
  letter-spacing: 0.01em;
}

.dish-emoji-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 42px;
  background: var(--surface-2);
}

.dish-body {
  padding: 11px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.dish-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.dish-emoji { font-size: 26px; }

.veg-dot {
  width: 13px; height: 13px;
  border: 1.5px solid var(--veg);
  border-radius: 3px;
  display: flex; align-items: center; justify-content: center;
  flex: none;
}
.veg-dot.nonveg { border-color: var(--nonveg); }
.veg-dot::after {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--veg);
}
.veg-dot.nonveg::after { background: var(--nonveg); }

.dish-name {
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.3;
  min-height: 34px;
  letter-spacing: -0.005em;
}

.dish-cal {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--muted);
}

.dish-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  gap: 6px;
}

.dish-price {
  font-size: 13.5px;
  font-weight: 800;
}
.dish-price::before { content: "₹"; color: var(--brand); }

.dish-price-row {
  display: flex;
  flex-direction: column;
  gap: 0;
  line-height: 1.15;
}
.dish-price-strike {
  font-size: 10.5px;
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-color: var(--nonveg);
}
.dish-price.discounted::before { color: var(--brand-dark); }

.add-btn {
  background: var(--card);
  border: 1.5px solid var(--brand);
  color: var(--brand-dark);
  border-radius: var(--radius-sm);
  padding: 6px 13px;
  font-size: 12px;
  font-weight: 700;
  transition: transform 0.12s ease, background 0.15s, color 0.15s, box-shadow 0.15s;
}
.add-btn:hover { box-shadow: 0 0 0 3px rgba(255,94,58,0.12); }
.add-btn:active { transform: scale(0.94); }
.add-btn.added {
  background: linear-gradient(155deg, var(--brand), var(--brand-dark));
  color: #fff;
  border-color: transparent;
}

.dish-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.recipe-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 29px;
  height: 29px;
  padding: 0;
  background: var(--brand-50);
  border: 1.5px solid var(--brand-100);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  line-height: 1;
  color: var(--brand-dark);
  flex-shrink: 0;
  transition: border-color 0.15s, transform 0.1s, color 0.15s, background 0.15s;
}
.recipe-btn:active { transform: scale(0.92); }
.recipe-btn:hover { border-color: var(--brand); background: var(--brand-100); color: var(--brand-dark); }

/* ---------- Overlay / Drawer ---------- */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(20,13,9,0.45);
  backdrop-filter: blur(2px);
  z-index: 50;
  display: flex;
  justify-content: flex-end;
  animation: overlayFade 0.2s ease-out;
}

@keyframes overlayFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.drawer {
  background: var(--bg);
  width: min(420px, 100%);
  height: 100%;
  display: flex;
  flex-direction: column;
  box-shadow: -18px 0 40px rgba(20,13,9,0.18);
  animation: slideIn 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideIn {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 16px;
  background: var(--card);
  box-shadow: 0 1px 0 var(--border);
}
.drawer-header h2 { font-size: 17px; margin: 0; font-weight: 800; }

.icon-btn {
  background: var(--surface-2);
  border: none;
  border-radius: var(--radius-pill);
  width: 32px;
  height: 32px;
  font-size: 15px;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.15s, transform 0.12s;
}
.icon-btn:hover { background: var(--brand-50); color: var(--brand-dark); }
.icon-btn:active { transform: scale(0.92); }

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
}

.recipe-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 16px calc(20px + var(--safe-bottom));
}
.recipe-modal-body .recipe-card { margin-top: 0; }

/* ---------- Rewards / loyalty overlay (streak feature) ---------- */
.rewards-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 16px calc(20px + var(--safe-bottom));
}

.rewards-summary { display: flex; gap: 10px; margin-bottom: 14px; }
.rewards-stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: linear-gradient(180deg, var(--brand-50), #fff);
  border: 1.5px solid var(--brand-100);
  border-radius: var(--radius);
  padding: 14px 10px;
}
.rewards-stat-num { font-size: 18px; font-weight: 800; color: var(--brand-dark); }
.rewards-stat-label { font-size: 11px; color: var(--muted); font-weight: 600; }

.rewards-next {
  background: var(--brand-50);
  border: 1.5px dashed var(--brand-100);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 12.5px;
  color: var(--brand-dark);
  margin-bottom: 10px;
  text-align: center;
}
.rewards-next strong { color: var(--text); }

.rewards-disclaimer {
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.5;
  text-align: center;
  margin: 0 0 16px;
}

.tier-ladder {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tier-row {
  display: flex;
  align-items: center;
  gap: 11px;
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  opacity: 0.55;
}
.tier-row.unlocked {
  opacity: 1;
  border-color: var(--gold);
  background: linear-gradient(180deg, #fffaf0, var(--card));
}
.tier-row.current {
  opacity: 1;
  border-color: var(--brand);
  box-shadow: var(--shadow-xs);
}
.tier-badge { font-size: 22px; flex: none; width: 30px; text-align: center; }
.tier-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.tier-name { font-size: 13px; font-weight: 700; }
.tier-meta { font-size: 11px; color: var(--muted); }
.tier-state { font-size: 14px; flex: none; }

.cart-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  margin-bottom: 9px;
  box-shadow: var(--shadow-xs);
}

.cart-item-name { font-size: 13px; font-weight: 700; flex: 1; min-width: 0; }
.cart-item-restaurant { font-size: 11px; color: var(--muted); display: block; margin-top: 2px; }
/* The price div in checkout summary rows shares .cart-item-name but is a
   direct flex child (not nested like the name+restaurant block) — pin it to
   its own content width instead of also growing/overlapping the name. */
.cart-item > .cart-item-name { flex: 0 0 auto; text-align: right; white-space: nowrap; }

.qty-controls {
  display: flex;
  align-items: center;
  gap: 9px;
}
.qty-btn {
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  width: 27px; height: 27px;
  font-size: 14px;
  font-weight: 700;
  color: var(--brand-dark);
  transition: transform 0.1s ease, border-color 0.15s;
}
.qty-btn:hover { border-color: var(--brand); }
.qty-btn:active { transform: scale(0.9); }
.qty-val { font-size: 13px; font-weight: 800; min-width: 14px; text-align: center; }

.cart-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--muted);
  font-size: 14px;
}

.cart-footer {
  padding: 16px 16px calc(16px + var(--safe-bottom));
  background: var(--card);
  box-shadow: 0 -1px 0 var(--border), 0 -8px 24px rgba(34,24,18,0.06);
}

.cart-total-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  margin-bottom: 12px;
  font-weight: 600;
}
.cart-total-row strong::before { content: "₹"; color: var(--brand); }

.primary-btn {
  width: 100%;
  background: linear-gradient(155deg, var(--brand), var(--brand-dark));
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 14px;
  font-size: 14px;
  font-weight: 700;
  box-shadow: var(--shadow-brand);
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}
.primary-btn:hover { transform: translateY(-1px); }
.primary-btn:active { transform: scale(0.98); }
.primary-btn.big { font-size: 15px; padding: 16px; margin-top: 22px; }

/* ---------- Views (full-screen) ---------- */
.view {
  min-height: 100vh;
  background: var(--bg);
}

.subbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 15px 12px;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 5;
  box-shadow: 0 1px 0 var(--border);
}
.subbar h2 { font-size: 16px; margin: 0; font-weight: 800; }

.checkout-main {
  max-width: 520px;
  margin: 0 auto;
  padding: 18px 16px 60px;
}

.disclaimer {
  background: var(--brand-50);
  border: 1px solid var(--brand-100);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  font-size: 12px;
  color: var(--brand-dark);
  margin-bottom: 20px;
}

.card-block { margin-bottom: 24px; }
.card-block h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 0 0 9px; font-weight: 700; }
.card-block input {
  width: 100%;
  padding: 13px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--surface-2);
  font-size: 14px;
  color: var(--muted);
}

.fake-card {
  background: linear-gradient(135deg, #2b2622, #4a3f36);
  color: #fff;
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}
.fake-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 90% -10%, rgba(255,146,105,0.25), transparent 55%);
}
.fake-card-chip { font-size: 22px; margin-bottom: 20px; position: relative; }
.fake-card-number { font-size: 16px; letter-spacing: 2px; margin-bottom: 15px; position: relative; }
.fake-card-row { display: flex; justify-content: space-between; font-size: 10px; opacity: .8; letter-spacing: .05em; position: relative; }

#checkout-items .cart-item { background: var(--card); }

/* ---------- Tracking view ---------- */
.tracking-wrap {
  max-width: 480px;
  margin: 0 auto;
  padding: 32px 20px 60px;
  text-align: center;
}
.tracking-wrap h2 { font-size: 20px; margin-bottom: 4px; font-weight: 800; }
.muted { color: var(--muted); font-size: 13px; }

/* Wraps whichever map (#live-map or #fake-map) is currently visible plus the
   floating status card / layer toggle, so those can overlay a map-corner the
   way real ride-hailing apps do, without fighting Leaflet's own DOM. */
.map-stage {
  position: relative;
  margin: 28px 0;
}

.map {
  position: relative;
  height: 230px;
  background:
    /* stylized illustrated road network — no real tiles needed since there's
       no real location to show on the fallback path, just a believable map look */
    linear-gradient(90deg, transparent 21%, #fff 21% 23.4%, transparent 23.4%),
    linear-gradient(90deg, transparent 60%, #fff 60% 62.2%, transparent 62.2%),
    linear-gradient(0deg, transparent 29%, #fff 29% 31.2%, transparent 31.2%),
    linear-gradient(0deg, transparent 70%, #fff 70% 72%, transparent 72%),
    linear-gradient(34deg, transparent 46.5%, #fff 46.5% 48%, transparent 48%),
    radial-gradient(ellipse 100px 65px at 80% 22%, rgba(163,201,168,0.55), transparent 72%),
    radial-gradient(ellipse 75px 55px at 16% 80%, rgba(163,201,168,0.45), transparent 72%),
    linear-gradient(180deg, #f3ede1, #ece1d2);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
/* Subtle building-block texture + inset vignette for depth, both purely
   decorative and behind the rider/trail layers (z-index below them). */
.map::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(45deg, rgba(255,255,255,0.55) 0 2px, transparent 2px 15px),
    repeating-linear-gradient(-45deg, rgba(150,125,100,0.10) 0 9px, transparent 9px 19px);
  opacity: 0.6;
  pointer-events: none;
  z-index: 0;
}
.map::after {
  content: "";
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 44px rgba(60,40,20,0.16);
  pointer-events: none;
  z-index: 0;
}

.fake-map-trail {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}
.trail-dot {
  position: absolute;
  width: 6px;
  height: 6px;
  margin: -3px 0 0 -3px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 5px rgba(255,94,58,0.65);
  opacity: 1;
  transition: opacity 2.4s linear;
}

.rider {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  transition: left 1.1s ease, top 1.1s ease;
}

.live-map {
  height: 320px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  z-index: 1;
  box-shadow: var(--shadow-sm);
}

.live-map .map-emoji-icon {
  font-size: 22px;
  line-height: 1;
  text-align: center;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.35));
}

/* Soft halo + crisp core line, drawn as two stacked Leaflet polylines
   (see drawRouteLine in app.js) — the CSS glow on the top line is the extra
   polish layer, applied once per leg (not per animation frame) so it's cheap. */
.route-line-glow {
  filter: drop-shadow(0 0 4px rgba(255,94,58,0.65));
}

/* rider-wrap sizes/centers the pulse ring behind the badge; shared verbatim
   HTML between the Leaflet marker icon and the fallback #rider div. */
.rider-wrap {
  position: relative;
  width: 44px;
  height: 44px;
}
.rider-pulse {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 34px;
  height: 34px;
  margin: -17px 0 0 -17px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,94,58,0.38), transparent 72%);
  animation: riderPulse 2.2s ease-out infinite;
  z-index: 0;
}
@keyframes riderPulse {
  0%   { transform: scale(0.55); opacity: 0.9; }
  100% { transform: scale(1.9); opacity: 0; }
}

/* Position is driven by per-frame requestAnimationFrame updates (both on the
   Leaflet marker and the fallback #rider div), not CSS — a position transition
   here would fight the per-frame updates and make it lag. Only rotation animates. */
.rider-badge {
  position: relative;
  z-index: 1;
  display: block;
  transition: transform 0.25s ease-out;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4));
}

/* ---------- Floating map-corner status card + layer toggle ---------- */
.map-status-card {
  position: absolute;
  left: 10px;
  top: 10px;
  z-index: 20;
  max-width: calc(100% - 76px);
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(8px);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  padding: 9px 12px;
  text-align: left;
}
.map-status-row {
  display: flex;
  align-items: center;
  gap: 9px;
}
.map-status-icon {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--brand-50);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}
.map-status-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.map-status-title {
  font-size: 12px;
  font-weight: 800;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.map-status-sub {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
}
.map-recalc-note {
  margin-top: 6px;
  font-size: 10px;
  font-weight: 700;
  color: var(--brand-dark);
  display: flex;
  align-items: center;
  gap: 5px;
}
.map-recalc-note::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand);
  animation: recalcPulse 1s ease-in-out infinite;
}
@keyframes recalcPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}

.map-layer-toggle {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 20;
  border: none;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(8px);
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
  padding: 7px 12px;
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-md);
  transition: transform 0.12s ease, background 0.15s;
}
.map-layer-toggle:hover { background: #fff; }
.map-layer-toggle:active { transform: scale(0.95); }

.map-note {
  font-size: 12px;
  color: var(--muted);
  margin: -16px 0 22px;
}

.eta-block { margin-bottom: 26px; }
.eta-label { display: block; font-size: 12px; color: var(--muted); font-weight: 600; }
.eta-timer { font-size: 36px; font-weight: 800; color: var(--brand-dark); letter-spacing: -0.02em; }

.status-steps {
  list-style: none;
  padding: 18px 16px;
  margin: 0;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
}
.status-steps li {
  font-size: 13px;
  color: var(--muted);
  padding-left: 24px;
  position: relative;
}
.status-steps li::before {
  content: "○";
  position: absolute;
  left: 0;
}
.status-steps li.active {
  color: var(--text);
  font-weight: 700;
}
.status-steps li.active::before {
  content: "●";
  color: var(--brand);
}

.cancel-btn {
  margin-top: 28px;
  width: 100%;
  background: var(--card);
  border: 1.5px solid var(--border);
  color: var(--muted);
  border-radius: var(--radius-sm);
  padding: 13px;
  font-size: 13.5px;
  font-weight: 700;
  transition: border-color 0.15s, color 0.15s;
}
.cancel-btn:hover { border-color: var(--brand); color: var(--brand-dark); }

/* ---------- Ending view ---------- */
.ending-wrap {
  max-width: 500px;
  margin: 0 auto;
  padding: 42px 20px 60px;
  text-align: center;
}
.ending-emoji { font-size: 38px; margin-bottom: 16px; letter-spacing: 6px; }
.ending-wrap h2 { font-size: 19px; margin-bottom: 14px; line-height: 1.4; font-weight: 800; }
.ending-copy { font-size: 13.5px; color: var(--muted); line-height: 1.65; margin-bottom: 28px; }

.calories-saved-stat {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  background: linear-gradient(180deg, var(--brand-50), #fff);
  border: 1.5px solid var(--brand-100);
  border-radius: var(--radius-pill);
  padding: 10px 20px;
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 700;
  color: var(--brand-dark);
}
.calories-saved-stat strong { font-size: 20px; font-weight: 800; }
.calories-saved-note { font-size: 11.5px; color: var(--muted); margin: 0 0 24px; }

.ending-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px;
  text-align: left;
  margin-bottom: 28px;
  box-shadow: var(--shadow-sm);
}
.ending-card h3 { font-size: 14px; margin: 0 0 4px; font-weight: 800; }

.ending-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- Recipe card (ending screen + recipes.html) ---------- */
.recipe-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 15px;
  margin-top: 14px;
  background: var(--surface-2);
}
.recipe-card + .recipe-card { margin-top: 12px; }

.recipe-card-top {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 11px;
}
.recipe-card-img {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  object-fit: cover;
  flex: none;
  background: var(--surface-2);
  box-shadow: var(--shadow-xs);
}
.recipe-card-title {
  font-size: 14.5px;
  font-weight: 800;
  line-height: 1.3;
}
.recipe-card-meta {
  display: flex;
  gap: 10px;
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 2px;
}

.recipe-card-section { margin-top: 11px; }
.recipe-card-section h4 {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--brand-dark);
  margin: 0 0 7px;
  font-weight: 800;
}

.recipe-ingredients {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.recipe-ingredients li {
  font-size: 11.5px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 4px 11px;
  color: var(--text);
}

.recipe-steps-list {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: recipe-step;
}
.recipe-steps-list li {
  counter-increment: recipe-step;
  font-size: 12.5px;
  line-height: 1.6;
  padding-left: 27px;
  position: relative;
  margin-bottom: 9px;
}
.recipe-steps-list li:last-child { margin-bottom: 0; }
.recipe-steps-list li::before {
  content: counter(recipe-step);
  position: absolute;
  left: 0;
  top: 0;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(155deg, var(--brand), var(--brand-dark));
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---------- Toasts & coin burst (streak feature) ---------- */
.toast-container {
  position: fixed;
  left: 50%;
  bottom: calc(20px + var(--safe-bottom));
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}

.toast {
  background: #241a13;
  color: #fff;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.4;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(10px) scale(0.97);
  transition: opacity 0.25s ease, transform 0.25s ease;
  text-align: center;
}
.toast.show { opacity: 1; transform: translateY(0) scale(1); }

.coin-particle {
  position: fixed;
  z-index: 210;
  font-size: 20px;
  pointer-events: none;
  animation: coinPop 0.9s ease-out forwards;
}
@keyframes coinPop {
  0% { opacity: 1; transform: translate(0, 0) rotate(0deg) scale(1); }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) rotate(var(--rot)) scale(0.6); }
}

@media (min-width: 640px) {
  .hero h1 { font-size: 28px; }
  .dotd-photo-wrap { flex-basis: 180px; }
  .dotd-name { font-size: 20px; }
}

/* ---------- Wide desktop: let content actually use the viewport ---------- */
@media (min-width: 1200px) {
  .topbar-inner,
  .search-row,
  .dotd-section,
  .coupon-banner,
  .restaurant-list {
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
  }
  .hero p { max-width: 640px; }
  .dish-grid {
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 18px;
  }
  .dotd-photo-wrap { flex-basis: 220px; }
}

@media (max-width: 380px) {
  .dotd-card { flex-direction: column; }
  .dotd-photo-wrap { flex-basis: auto; aspect-ratio: 16 / 9; }
  .dotd-body { padding: 14px 16px; }
}
