/* Fonts load via a preconnect'd <link> in each HTML <head> (parallel, non-blocking),
   not a render-blocking serial @import — see customer/admin HTML heads. */

:root {
  --bg-primary: #0a1128;
  --bg-secondary: #101f42;
  --bg-card: rgba(22, 38, 76, 0.45);
  --text-primary: #ffffff;
  --text-secondary: #a0aabf;
  --accent-gold: #f4a261;
  --accent-ocean: #2ec4b6;
  --accent-rose: #ff6b8a;
  --accent-gradient: linear-gradient(135deg, #e76f51 0%, #f4a261 100%);
  --border-glass: rgba(244, 162, 97, 0.18);
  --shadow-glow: 0 8px 32px rgba(46, 196, 182, 0.08);
  --border-radius-sm: 14px;
  --border-radius-md: 22px;
  --border-radius-lg: 32px;
  --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Theme Presets */
body.theme-sunset {
  --bg-primary: #080f25;
  --bg-secondary: #0f1a3a;
  --bg-card: rgba(22, 38, 76, 0.45);
  --text-primary: #ffffff;
  --text-secondary: #8e9bb3;
  --accent-gold: #f4a261;
  --accent-ocean: #2ec4b6;
  --accent-gradient: linear-gradient(135deg, #e76f51 0%, #f4a261 100%);
  --border-glass: rgba(244, 162, 97, 0.15);
  --shadow-glow: rgba(46, 196, 182, 0.08);
}

body.theme-emerald {
  --bg-primary: #081c15;
  --bg-secondary: #1b4332;
  --bg-card: rgba(45, 106, 79, 0.45);
  --text-primary: #ffffff;
  --text-secondary: #b7e4c7;
  --accent-gold: #d8f3dc;
  --accent-ocean: #52b788;
  --accent-gradient: linear-gradient(135deg, #40916c 0%, #74c69d 100%);
  --border-glass: rgba(82, 183, 136, 0.2);
  --shadow-glow: rgba(82, 183, 136, 0.08);
}

body.theme-rose {
  --bg-primary: #200f21;
  --bg-secondary: #351435;
  --bg-card: rgba(74, 20, 74, 0.45);
  --text-primary: #ffffff;
  --text-secondary: #f3c6f1;
  --accent-gold: #f9bec7;
  --accent-ocean: #e0b1cb;
  --accent-gradient: linear-gradient(135deg, #9b5de5 0%, #f15bb5 100%);
  --border-glass: rgba(241, 91, 181, 0.2);
  --shadow-glow: rgba(241, 91, 181, 0.08);
}

body.theme-luxury-gold {
  --bg-primary: #121212;
  --bg-secondary: #1a1a1a;
  --bg-card: rgba(26, 26, 26, 0.6);
  --text-primary: #f5f5f5;
  --text-secondary: #a0a0a0;
  --accent-gold: #d4af37;
  --accent-ocean: #aa7c11;
  --accent-gradient: linear-gradient(135deg, #d4af37 0%, #855800 100%);
  --border-glass: rgba(212, 175, 55, 0.25);
  --shadow-glow: rgba(212, 175, 55, 0.08);
}

body.theme-nordic-frost {
  --bg-primary: #1e293b;
  --bg-secondary: #0f172a;
  --bg-card: rgba(30, 41, 59, 0.5);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --accent-gold: #38bdf8;
  --accent-ocean: #34d399;
  --accent-gradient: linear-gradient(135deg, #0284c7 0%, #34d399 100%);
  --border-glass: rgba(56, 189, 248, 0.2);
  --shadow-glow: rgba(52, 211, 153, 0.08);
}

body.theme-lavender-haze {
  --bg-primary: #18142c;
  --bg-secondary: #272144;
  --bg-card: rgba(39, 33, 68, 0.5);
  --text-primary: #f1edf7;
  --text-secondary: #beb5d8;
  --accent-gold: #c084fc;
  --accent-ocean: #f43f5e;
  --accent-gradient: linear-gradient(135deg, #a855f7 0%, #f43f5e 100%);
  --border-glass: rgba(192, 132, 252, 0.2);
  --shadow-glow: rgba(244, 63, 94, 0.08);
}

body.theme-cyberpunk {
  --bg-primary: #13001f;
  --bg-secondary: #26003d;
  --bg-card: rgba(38, 0, 61, 0.5);
  --text-primary: #00ffcc;
  --text-secondary: #ff007f;
  --accent-gold: #f3e600;
  --accent-ocean: #00f0ff;
  --accent-gradient: linear-gradient(135deg, #ff007f 0%, #f3e600 100%);
  --border-glass: rgba(243, 230, 0, 0.3);
  --shadow-glow: rgba(0, 240, 255, 0.1);
}

body.theme-solar-flare {
  --bg-primary: #1c0a10;
  --bg-secondary: #30101b;
  --bg-card: rgba(48, 16, 27, 0.5);
  --text-primary: #ffe4e6;
  --text-secondary: #fda4af;
  --accent-gold: #f97316;
  --accent-ocean: #e11d48;
  --accent-gradient: linear-gradient(135deg, #e11d48 0%, #f97316 100%);
  --border-glass: rgba(249, 115, 22, 0.2);
  --shadow-glow: rgba(225, 29, 72, 0.08);
}

body.theme-aqua-deep {
  --bg-primary: #031525;
  --bg-secondary: #07243c;
  --bg-card: rgba(7, 36, 60, 0.5);
  --text-primary: #e0f2fe;
  --text-secondary: #7dd3fc;
  --accent-gold: #06b6d4;
  --accent-ocean: #0ea5e9;
  --accent-gradient: linear-gradient(135deg, #0284c7 0%, #06b6d4 100%);
  --border-glass: rgba(6, 182, 212, 0.2);
  --shadow-glow: rgba(14, 165, 233, 0.08);
}

body.theme-forest-canopy {
  --bg-primary: #051610;
  --bg-secondary: #0c281e;
  --bg-card: rgba(12, 40, 30, 0.5);
  --text-primary: #ecfdf5;
  --text-secondary: #6ee7b7;
  --accent-gold: #84cc16;
  --accent-ocean: #10b981;
  --accent-gradient: linear-gradient(135deg, #059669 0%, #84cc16 100%);
  --border-glass: rgba(132, 204, 22, 0.2);
  --shadow-glow: rgba(16, 185, 129, 0.08);
}

body.theme-sakura {
  --bg-primary: #140e12;
  --bg-secondary: #251b22;
  --bg-card: rgba(37, 27, 34, 0.5);
  --text-primary: #fff1f2;
  --text-secondary: #fecdd3;
  --accent-gold: #fb7185;
  --accent-ocean: #fda4af;
  --accent-gradient: linear-gradient(135deg, #db2777 0%, #fb7185 100%);
  --border-glass: rgba(251, 113, 133, 0.2);
  --shadow-glow: rgba(253, 164, 175, 0.08);
}

body.theme-retro-synth {
  --bg-primary: #110222;
  --bg-secondary: #22003c;
  --bg-card: rgba(34, 0, 60, 0.5);
  --text-primary: #00ffff;
  --text-secondary: #ff007f;
  --accent-gold: #ff007f;
  --accent-ocean: #bd00ff;
  --accent-gradient: linear-gradient(135deg, #ff007f 0%, #bd00ff 100%);
  --border-glass: rgba(255, 0, 127, 0.25);
  --shadow-glow: rgba(189, 0, 255, 0.1);
}

body.theme-coffee-latte {
  --bg-primary: #1d1613;
  --bg-secondary: #2c221e;
  --bg-card: rgba(44, 34, 30, 0.5);
  --text-primary: #fefdfb;
  --text-secondary: #e7dacf;
  --accent-gold: #d97706;
  --accent-ocean: #b45309;
  --accent-gradient: linear-gradient(135deg, #b45309 0%, #d97706 100%);
  --border-glass: rgba(217, 119, 6, 0.2);
  --shadow-glow: rgba(180, 83, 9, 0.08);
}

body.theme-dracula {
  --bg-primary: #282a36;
  --bg-secondary: #1e1f29;
  --bg-card: rgba(40, 42, 54, 0.5);
  --text-primary: #f8f8f2;
  --text-secondary: #6272a4;
  --accent-gold: #bd93f9;
  --accent-ocean: #ff79c6;
  --accent-gradient: linear-gradient(135deg, #bd93f9 0%, #ff79c6 100%);
  --border-glass: rgba(189, 147, 249, 0.2);
  --shadow-glow: rgba(255, 121, 198, 0.08);
}

body.theme-monochrome {
  --bg-primary: #121212;
  --bg-secondary: #242424;
  --bg-card: rgba(36, 36, 36, 0.5);
  --text-primary: #ffffff;
  --text-secondary: #a3a3a3;
  --accent-gold: #ffffff;
  --accent-ocean: #d4d4d4;
  --accent-gradient: linear-gradient(135deg, #525252 0%, #ffffff 100%);
  --border-glass: rgba(255, 255, 255, 0.15);
  --shadow-glow: rgba(212, 212, 212, 0.05);
}

body.theme-royal-amethyst {
  --bg-primary: #140b24;
  --bg-secondary: #21113c;
  --bg-card: rgba(33, 17, 60, 0.5);
  --text-primary: #f5f3ff;
  --text-secondary: #c7d2fe;
  --accent-gold: #818cf8;
  --accent-ocean: #a78bfa;
  --accent-gradient: linear-gradient(135deg, #6366f1 0%, #a78bfa 100%);
  --border-glass: rgba(167, 139, 250, 0.2);
  --shadow-glow: rgba(167, 139, 250, 0.08);
}

body.theme-desert-sand {
  --bg-primary: #1f1412;
  --bg-secondary: #301d1a;
  --bg-card: rgba(48, 29, 26, 0.5);
  --text-primary: #fafaf9;
  --text-secondary: #e7e5e4;
  --accent-gold: #ea580c;
  --accent-ocean: #ca8a04;
  --accent-gradient: linear-gradient(135deg, #c2410c 0%, #ca8a04 100%);
  --border-glass: rgba(234, 88, 12, 0.2);
  --shadow-glow: rgba(202, 138, 4, 0.08);
}

body.theme-space-cadet {
  --bg-primary: #0b0c16;
  --bg-secondary: #16182c;
  --bg-card: rgba(22, 24, 44, 0.5);
  --text-primary: #ffffff;
  --text-secondary: #b0b6cf;
  --accent-gold: #7b2cbf;
  --accent-ocean: #3f37c9;
  --accent-gradient: linear-gradient(135deg, #3f37c9 0%, #9d4edd 100%);
  --border-glass: rgba(123, 44, 191, 0.2);
  --shadow-glow: rgba(63, 55, 201, 0.08);
}

body.theme-carbon-fiber {
  --bg-primary: #0f0f11;
  --bg-secondary: #1b1b1f;
  --bg-card: rgba(27, 27, 31, 0.5);
  --text-primary: #ffffff;
  --text-secondary: #9e9e9e;
  --accent-gold: #dc2626;
  --accent-ocean: #ef4444;
  --accent-gradient: linear-gradient(135deg, #991b1b 0%, #ef4444 100%);
  --border-glass: rgba(239, 68, 68, 0.2);
  --shadow-glow: rgba(239, 68, 68, 0.08);
}

body.theme-blueberry {
  --bg-primary: #0c102b;
  --bg-secondary: #161b40;
  --bg-card: rgba(22, 27, 64, 0.5);
  --text-primary: #f0f3ff;
  --text-secondary: #aab2db;
  --accent-gold: #6366f1;
  --accent-ocean: #4f46e5;
  --accent-gradient: linear-gradient(135deg, #312e81 0%, #6366f1 100%);
  --border-glass: rgba(99, 102, 241, 0.2);
  --shadow-glow: rgba(79, 70, 229, 0.08);
}

body.theme-peach-sorbet {
  --bg-primary: #1f1012;
  --bg-secondary: #331a1e;
  --bg-card: rgba(51, 26, 30, 0.5);
  --text-primary: #fff7ed;
  --text-secondary: #fed7aa;
  --accent-gold: #f97316;
  --accent-ocean: #ffedd5;
  --accent-gradient: linear-gradient(135deg, #ea580c 0%, #ffedd5 100%);
  --border-glass: rgba(249, 115, 22, 0.2);
  --shadow-glow: rgba(234, 88, 12, 0.08);
}

body.theme-vampire {
  --bg-primary: #0b0202;
  --bg-secondary: #1a0505;
  --bg-card: rgba(26, 5, 5, 0.5);
  --text-primary: #ffffff;
  --text-secondary: #d69f9f;
  --accent-gold: #b91c1c;
  --accent-ocean: #991b1b;
  --accent-gradient: linear-gradient(135deg, #7f1d1d 0%, #b91c1c 100%);
  --border-glass: rgba(185, 28, 28, 0.25);
  --shadow-glow: rgba(185, 28, 28, 0.08);
}

body.theme-electric-violet {
  --bg-primary: #090214;
  --bg-secondary: #16072d;
  --bg-card: rgba(22, 7, 45, 0.5);
  --text-primary: #ffffff;
  --text-secondary: #caa6ff;
  --accent-gold: #a855f7;
  --accent-ocean: #d8b4fe;
  --accent-gradient: linear-gradient(135deg, #701a75 0%, #a855f7 100%);
  --border-glass: rgba(168, 85, 247, 0.25);
  --shadow-glow: rgba(168, 85, 247, 0.08);
}

body.theme-matcha {
  --bg-primary: #141711;
  --bg-secondary: #21271b;
  --bg-card: rgba(33, 39, 27, 0.5);
  --text-primary: #f4f6f0;
  --text-secondary: #cad1c0;
  --accent-gold: #65a30d;
  --accent-ocean: #84cc16;
  --accent-gradient: linear-gradient(135deg, #3f6212 0%, #84cc16 100%);
  --border-glass: rgba(101, 163, 13, 0.2);
  --shadow-glow: rgba(132, 204, 22, 0.08);
}

body.theme-nebula {
  --bg-primary: #080614;
  --bg-secondary: #110e28;
  --bg-card: rgba(17, 14, 40, 0.5);
  --text-primary: #e2f9ff;
  --text-secondary: #a5d8ff;
  --accent-gold: #00f5ff;
  --accent-ocean: #a78bfa;
  --accent-gradient: linear-gradient(135deg, #7c3aed 0%, #00f5ff 100%);
  --border-glass: rgba(0, 245, 255, 0.25);
  --shadow-glow: rgba(124, 58, 237, 0.08);
}

body.theme-glacier {
  --bg-primary: #05131f;
  --bg-secondary: #0c2336;
  --bg-card: rgba(12, 35, 54, 0.5);
  --text-primary: #f0fdfa;
  --text-secondary: #99f6e4;
  --accent-gold: #0ea5e9;
  --accent-ocean: #2dd4bf;
  --accent-gradient: linear-gradient(135deg, #0369a1 0%, #2dd4bf 100%);
  --border-glass: rgba(45, 212, 191, 0.2);
  --shadow-glow: rgba(14, 165, 233, 0.08);
}

body.theme-pumpkin {
  --bg-primary: #1b0f0a;
  --bg-secondary: #2c1a11;
  --bg-card: rgba(44, 26, 17, 0.5);
  --text-primary: #fff7ed;
  --text-secondary: #ffedd5;
  --accent-gold: #ea580c;
  --accent-ocean: #d97706;
  --accent-gradient: linear-gradient(135deg, #7c2d12 0%, #ea580c 100%);
  --border-glass: rgba(234, 88, 12, 0.2);
  --shadow-glow: rgba(217, 119, 6, 0.08);
}

body.theme-steel-tech {
  --bg-primary: #1e293b;
  --bg-secondary: #334155;
  --bg-card: rgba(51, 65, 85, 0.5);
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --accent-gold: #64748b;
  --accent-ocean: #38bdf8;
  --accent-gradient: linear-gradient(135deg, #475569 0%, #38bdf8 100%);
  --border-glass: rgba(56, 189, 248, 0.2);
  --shadow-glow: rgba(56, 189, 248, 0.08);
}

body.theme-classic-light {
  --bg-primary: #f8f9fa;
  --bg-secondary: #ffffff;
  --bg-card: rgba(233, 236, 239, 0.75);
  --text-primary: #212529;
  --text-secondary: #495057;
  --accent-gold: #fd7e14;
  --accent-ocean: #0d6efd;
  --accent-gradient: linear-gradient(135deg, #0d6efd 0%, #0dcaf0 100%);
  --border-glass: rgba(13, 110, 253, 0.15);
  --shadow-glow: rgba(13, 110, 253, 0.05);
}

/* Classic Light Custom Element Overrides */
body.theme-classic-light .search-input {
  color: #212529;
  background: rgba(0, 0, 0, 0.05);
}
body.theme-classic-light .categories-nav,
body.theme-classic-light header {
  background: rgba(248, 249, 250, 0.85);
}
body.theme-classic-light .category-tab {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.1);
  color: #495057;
}
body.theme-classic-light .category-tab.active {
  color: #ffffff;
}
body.theme-classic-light .menu-item-card {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}
body.theme-classic-light .add-btn-premium,
body.theme-classic-light .quantity-control.minified {
  background: #ffffff;
}
body.theme-classic-light .quantity-control.minified .qty-val {
  color: #212529;
}
body.theme-classic-light .input-field {
  background: #ffffff;
  color: #212529;
}
body.theme-classic-light .cart-drawer {
  background: radial-gradient(circle at bottom center, #ffffff 0%, #f8f9fa 100%);
}
body.theme-classic-light .cart-item-row {
  border-bottom-color: rgba(0, 0, 0, 0.08);
}

/* Welcome-page-derived themes */
body.theme-editorial {
  --bg-primary: #f6f1e7;
  --bg-secondary: #efe7d7;
  --bg-card: rgba(255, 255, 255, 0.6);
  --text-primary: #07070a;
  --text-secondary: #5b574e;
  --accent-gold: #ff7a18;
  --accent-ocean: #0f9b8e;
  --accent-gradient: linear-gradient(100deg, #ff7a18, #d6336c);
  --border-glass: rgba(255, 122, 24, 0.18);
  --shadow-glow: rgba(15, 155, 142, 0.08);
}

body.theme-keynote {
  --bg-primary: #06080f;
  --bg-secondary: #0a0e1d;
  --bg-card: rgba(255, 255, 255, 0.05);
  --text-primary: #eef2ff;
  --text-secondary: #9aa6c9;
  --accent-gold: #ff9f59;
  --accent-ocean: #1fd9c6;
  --accent-gradient: linear-gradient(118deg, #8b5cff, #1fd9c6);
  --border-glass: rgba(255, 255, 255, 0.10);
  --shadow-glow: rgba(31, 217, 198, 0.08);
}

body.theme-vibrant {
  --bg-primary: #fffdf8;
  --bg-secondary: #ffeed6;
  --bg-card: rgba(255, 255, 255, 0.6);
  --text-primary: #1c1407;
  --text-secondary: #5a4d39;
  --accent-gold: #ff9e1b;
  --accent-ocean: #0fb6a8;
  --accent-gradient: linear-gradient(100deg, #ff9e1b, #e23d6e);
  --border-glass: rgba(255, 158, 27, 0.18);
  --shadow-glow: rgba(15, 182, 168, 0.08);
}

/* Editorial (light) Custom Element Overrides */
body.theme-editorial .search-input {
  color: #07070a;
  background: rgba(0, 0, 0, 0.05);
}
body.theme-editorial .categories-nav,
body.theme-editorial header {
  background: rgba(246, 241, 231, 0.85);
}
body.theme-editorial .category-tab {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.1);
  color: #5b574e;
}
body.theme-editorial .category-tab.active {
  color: #ffffff;
}
body.theme-editorial .menu-item-card {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}
body.theme-editorial .add-btn-premium,
body.theme-editorial .quantity-control.minified {
  background: #ffffff;
}
body.theme-editorial .quantity-control.minified .qty-val {
  color: #07070a;
}
body.theme-editorial .input-field {
  background: #ffffff;
  color: #07070a;
}
body.theme-editorial .cart-drawer {
  background: radial-gradient(circle at bottom center, #ffffff 0%, #f6f1e7 100%);
}
body.theme-editorial .cart-item-row {
  border-bottom-color: rgba(0, 0, 0, 0.08);
}

/* Vibrant (light) Custom Element Overrides */
body.theme-vibrant .search-input {
  color: #1c1407;
  background: rgba(0, 0, 0, 0.05);
}
body.theme-vibrant .categories-nav,
body.theme-vibrant header {
  background: rgba(255, 253, 248, 0.85);
}
body.theme-vibrant .category-tab {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.1);
  color: #5a4d39;
}
body.theme-vibrant .category-tab.active {
  color: #ffffff;
}
body.theme-vibrant .menu-item-card {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}
body.theme-vibrant .add-btn-premium,
body.theme-vibrant .quantity-control.minified {
  background: #ffffff;
}
body.theme-vibrant .quantity-control.minified .qty-val {
  color: #1c1407;
}
body.theme-vibrant .input-field {
  background: #ffffff;
  color: #1c1407;
}
body.theme-vibrant .cart-drawer {
  background: radial-gradient(circle at bottom center, #ffffff 0%, #fffdf8 100%);
}
body.theme-vibrant .cart-item-row {
  border-bottom-color: rgba(0, 0, 0, 0.08);
}

/* Light-theme logo legibility: the base .login-logo/.restaurant-title use a
   white->gold gradient clipped to text, which is invisible on a cream
   background. Override the gradient to dark->accent so the brand name reads. */
body.theme-editorial .login-logo,
body.theme-editorial .restaurant-title {
  background-image: linear-gradient(135deg, #07070a 30%, #e8590c 100%);
  -webkit-background-clip: text;
  background-clip: text;
}
body.theme-vibrant .login-logo,
body.theme-vibrant .restaurant-title {
  background-image: linear-gradient(135deg, #1c1407 30%, #e23d6e 100%);
  -webkit-background-clip: text;
  background-clip: text;
}
body.theme-classic-light .login-logo,
body.theme-classic-light .restaurant-title {
  background-image: linear-gradient(135deg, #212529 30%, #0d6efd 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  letter-spacing: -0.5px;
}

/* Visually-hidden text that remains available to screen readers. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Visible keyboard-focus indicator for buttons and custom role="button" elements. */
button:focus-visible,
[role="button"]:focus-visible {
  outline: 2px solid var(--accent-ocean);
  outline-offset: 2px;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 4px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border-glass);
  border-radius: 10px;
}

/* App Container */
.app-container {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-primary);
  position: relative;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.6);
  border-left: 1px solid rgba(255, 255, 255, 0.03);
  border-right: 1px solid rgba(255, 255, 255, 0.03);
}

/* --- LOGIN SCREEN --- */
.login-screen {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(circle at top left, var(--bg-secondary) 0%, var(--bg-primary) 100%);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  /* "safe center" keeps the card vertically centred when it fits, but falls back to
     top-aligned (scrollable from the top) when content is taller than the viewport —
     landscape phones, short screens, or the OTP / inline-Terms sub-views. Without this
     the fixed, centred container clipped the top of the card with no way to scroll to it. */
  justify-content: safe center;
  align-items: center;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  /* Responsive horizontal padding: 16px on the narrowest phones (320px), 30px on wider ones.
     This keeps the login card usable on iPhone SE 1st gen without cramping wider screens. */
  padding: 30px max(16px, env(safe-area-inset-left)) 30px max(16px, env(safe-area-inset-left));
  padding-top: max(30px, env(safe-area-inset-top));
  padding-bottom: max(30px, env(safe-area-inset-bottom));
  text-align: center;
  max-width: 480px;
  margin: 0 auto;
}

.login-logo {
  font-family: 'Cinzel', serif;
  /* Scale down gracefully on very narrow phones (320px) — 3rem = 48px is fine on 375px+
     but a very long restaurant name at 48px can break the layout on 320px. */
  font-size: clamp(2rem, 8vw, 3rem);
  font-weight: 700;
  letter-spacing: 1px;
  line-height: 1.2;
  background: linear-gradient(135deg, #ffffff 30%, #d4af37 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 8px;
  text-shadow: 0 10px 20px rgba(212, 175, 55, 0.15);
  word-break: break-word;
  overflow-wrap: break-word;
  max-width: 100%;
}

.login-subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 40px;
}

.login-card {
  width: 100%;
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-glass);
  border-radius: var(--border-radius-md);
  /* clamp ensures usable padding on 320px (iPhone SE) without compressing wider layouts. */
  padding: 24px clamp(16px, 6vw, 24px);
  box-shadow: var(--shadow-glow);
}

.table-badge {
  display: inline-block;
  background: rgba(244, 162, 97, 0.12);
  color: var(--accent-gold);
  border: 1px solid rgba(244, 162, 97, 0.25);
  padding: 6px 16px;
  border-radius: 50px;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 24px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.input-group {
  margin-bottom: 24px;
  text-align: left;
}

.input-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.input-field {
  width: 100%;
  padding: 16px 20px;
  border-radius: var(--border-radius-sm);
  border: 1px solid var(--border-glass);
  background: rgba(10, 17, 40, 0.5);
  font-family: inherit;
  /* Explicit 16px prevents iOS Safari from auto-zooming when any .input-field is focused. */
  font-size: 16px;
  color: var(--text-primary);
  outline: none;
  transition: var(--transition);
}

.input-field:focus {
  border-color: var(--accent-ocean);
  box-shadow: 0 0 15px rgba(46, 196, 182, 0.2);
}

.btn-primary {
  width: 100%;
  padding: 16px;
  border: none;
  border-radius: var(--border-radius-sm);
  background: var(--accent-gradient);
  color: #ffffff;
  font-family: 'Outfit', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(231, 111, 81, 0.3);
  transition: var(--transition);
}

.btn-primary:active {
  transform: scale(0.98);
}

/* --- MAIN APP LAYOUT --- */
header {
  padding: 24px 20px 16px 20px;
  /* Keep the title/search clear of the notch / Dynamic Island under viewport-fit=cover.
     syncCategoriesNavTop() re-measures header height at runtime so the sticky nav stays docked. */
  padding-top: max(24px, env(safe-area-inset-top));
  background: rgba(10, 17, 40, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 90;
  border-bottom: 1px solid var(--border-glass);
}

.header-top {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.restaurant-title {
  font-family: 'Cinzel', serif;
  /* Scale down on 320px phones so a long name doesn't overflow the header row. */
  font-size: clamp(1.2rem, 5vw, 1.8rem);
  font-weight: 700;
  letter-spacing: 1px;
  background: linear-gradient(135deg, #ffffff 30%, #d4af37 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  min-width: 0;
  flex: 1 1 auto;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.active-table-indicator {
  background: rgba(46, 196, 182, 0.12);
  color: var(--accent-ocean);
  border: 1px solid rgba(46, 196, 182, 0.25);
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  padding: 6px 14px;
  border-radius: 50px;
  font-size: 0.8rem;
  text-transform: uppercase;
}

.search-container {
  position: relative;
  width: 100%;
}

.search-input {
  width: 100%;
  padding: 14px 16px 14px 46px;
  border-radius: var(--border-radius-sm);
  border: 1px solid var(--border-glass);
  background: rgba(0, 0, 0, 0.25);
  font-family: inherit;
  /* >=16px so iOS Safari does not auto-zoom the page when this sticky field is focused. */
  font-size: 16px;
  color: white;
  outline: none;
  transition: var(--transition);
}

.search-input:focus {
  border-color: var(--accent-gold);
  background: rgba(0, 0, 0, 0.4);
}

.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
}

/* Category Navigation (Horizontal Slide) */
.categories-nav {
  display: flex;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  padding: 12px 20px;
  gap: 12px;
  background: rgba(10, 17, 40, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-glass);
  position: -webkit-sticky;
  position: sticky;
  top: 135px;
  z-index: 85;
}

.categories-nav::-webkit-scrollbar {
  display: none;
}

.category-tab {
  flex-shrink: 0;
  padding: 8px 18px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
}

.category-tab.active {
  background: linear-gradient(135deg, #f4a261 0%, #e76f51 100%);
  border-color: #f4a261;
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(231, 111, 81, 0.35);
}

/* --- MENU ITEMS --- */
.menu-container {
  flex: 1;
  /* Bottom padding clears the fixed inside-footer dev badge. */
  padding: 20px 16px 80px 16px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

body.cart-bar-visible .menu-container {
  /* Extra clearance for the floating cart bar (bar height ~56px + 16px gap + safe-area). */
  padding-bottom: calc(160px + env(safe-area-inset-bottom));
}

.menu-category-title {
  font-size: 1.25rem;
  color: var(--text-primary);
  margin-bottom: 12px;
  border-left: 4px solid var(--accent-gold);
  padding-left: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  /* Prevent long category names from overflowing on narrow screens. */
  overflow-wrap: break-word;
  word-break: break-word;
  min-width: 0;
}

.menu-items-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.menu-item-card {
  display: flex;
  background: rgba(22, 38, 76, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 20px;
  padding: 16px;
  gap: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  transition: var(--transition);
  position: relative;
}

@media (hover: hover) and (pointer: fine) {
  .menu-item-card:hover {
    transform: translateY(-2px);
    border-color: rgba(244, 162, 97, 0.35);
  }
}

.menu-item-left {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
}

.veg-badge-container {
  margin-bottom: 8px;
}

.veg-badge {
  width: 16px;
  height: 16px;
  border: 1.5px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  padding: 1px;
}

.veg-badge.veg {
  border-color: #00b138 !important;
}

.veg-badge.non-veg {
  border-color: #da1c1c !important;
}

.veg-badge .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: block;
}

.veg-badge.veg .dot {
  background-color: #00b138 !important;
}

.veg-badge.non-veg .dot {
  background-color: #da1c1c !important;
}

.menu-item-name {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
  letter-spacing: -0.2px;
  overflow-wrap: anywhere;
}

.menu-item-price-container {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-family: 'Outfit', sans-serif;
}

.price-discounted {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--accent-gold);
}

.price-original {
  font-size: 0.85rem;
  text-decoration: line-through;
  opacity: 0.5;
  font-weight: 500;
}

.discount-badge {
  font-size: 0.65rem;
  background: rgba(46, 196, 182, 0.15);
  color: #2ec4b6;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
}

.menu-item-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.menu-item-right {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.menu-item-image-wrapper {
  position: relative;
  width: 110px;
  height: 110px;
}

.menu-item-image {
  width: 110px;
  height: 110px;
  object-fit: cover;
  border-radius: 16px;
  border: 1px solid var(--border-glass);
}

.menu-item-action-overlay {
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  width: 85%;
  display: flex;
  justify-content: center;
}

.add-btn-premium {
  width: 100%;
  padding: 6px 14px;
  background: #ffffff;
  border: 1.5px solid var(--accent-gold);
  color: #e76f51;
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 0.85rem;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  transition: var(--transition);
  text-align: center;
  letter-spacing: 0.5px;
}

@media (hover: hover) and (pointer: fine) {
  .add-btn-premium:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 14px rgba(244, 162, 97, 0.4);
  }
}

.add-btn-premium:active {
  transform: scale(0.95);
}

/* Quantity Control Buttons */
.quantity-control {
  display: flex;
  align-items: center;
  background: rgba(10, 17, 40, 0.8);
  border: 1px solid var(--border-glass);
  border-radius: 50px;
  padding: 4px;
}

.quantity-control.minified {
  background: #ffffff;
  border: 1.5px solid var(--accent-gold);
  border-radius: 8px;
  padding: 2px;
  width: 100%;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  justify-content: space-between;
}

.quantity-control.minified .qty-btn {
  /* Larger touch target — 24px was far below the ~44px guidance for these primary
     add/remove controls. 36px is the practical max inside the width-constrained overlay. */
  width: 36px;
  height: 36px;
  background: transparent;
  color: #e76f51;
  font-size: 1rem;
  touch-action: manipulation;
}

.quantity-control.minified .qty-val {
  color: #0a1128;
  font-size: 0.85rem;
  width: 20px;
}

.qty-btn {
  width: 40px;
  height: 40px;
  border: none;
  background: var(--bg-secondary);
  border-radius: 50%;
  color: white;
  font-size: 1.2rem;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  touch-action: manipulation;
}

.qty-btn:active {
  transform: scale(0.9);
}

.qty-val {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  width: 30px;
  text-align: center;
  font-size: 0.95rem;
}

.add-btn {
  padding: 10px 24px;
  border: 1px solid var(--accent-gold);
  background: transparent;
  color: var(--accent-gold);
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 0.85rem;
  border-radius: 50px;
  cursor: pointer;
  transition: var(--transition);
}

@media (hover: hover) and (pointer: fine) {
  .add-btn:hover {
    background: rgba(244, 162, 97, 0.1);
  }
}

/* --- DUAL FLOAT BUTTONS: WAITER CALL & ACTIVE TRACKING --- */
.waiter-call-float {
  position: fixed;
  /* Sits above the cart bar: cart bar is at 16px + safe-area-inset-bottom + ~56px height + 8px gap. */
  bottom: calc(96px + env(safe-area-inset-bottom) + var(--kb-inset, 0px));
  right: 20px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2ec4b6 0%, #0f4c5c 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(46, 196, 182, 0.3);
  z-index: 94;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: var(--transition);
}

.waiter-call-float:active {
  transform: scale(0.9);
}

.waiter-call-float svg {
  width: 24px;
  height: 24px;
  fill: white;
}

/* --- BOTTOM CART FLOAT BAR --- */
.cart-float-bar {
  position: fixed;
  /* Sit above the home indicator: 16px clearance + whatever the safe-area inset is. */
  bottom: calc(16px + env(safe-area-inset-bottom));
  left: 50%;
  /* --kb-inset is set by setupKeyboardInsetHandling() so the bar lifts above the iOS keyboard. */
  transform: translate(-50%, calc(-1 * var(--kb-inset, 0px)));
  width: calc(100% - 40px);
  max-width: 440px;
  background: var(--accent-gradient);
  border-radius: var(--border-radius-sm);
  padding: 16px 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: white;
  box-shadow: 0 10px 30px rgba(231, 111, 81, 0.4);
  z-index: 95;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.cart-float-info {
  display: flex;
  flex-direction: column;
}

.cart-float-count {
  font-size: 0.75rem;
  font-weight: 700;
  opacity: 0.9;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.cart-float-total {
  font-family: 'Outfit', sans-serif;
  font-size: 1.3rem;
  font-weight: 800;
}

.cart-float-action {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 8px;
}


/* --- CLIENT TRACKING MODAL --- */
.active-orders-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-glass);
  padding: 8px 14px;
  /* Ensure tappable area meets the 44px touch-target minimum on mobile. */
  min-height: 44px;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  color: white;
  transition: var(--transition);
}

@media (hover: hover) and (pointer: fine) {
  .active-orders-btn:hover {
    border-color: var(--accent-gold);
  }
}

.order-tracker-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--border-radius-sm);
  padding: 16px;
  margin-bottom: 16px;
}

.tracker-id-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
}

/* Progress bar container */
.progress-bar-container {
  display: flex;
  justify-content: space-between;
  position: relative;
  margin: 20px 0 10px 0;
}

.progress-line {
  position: absolute;
  top: 10px; left: 0; right: 0;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  z-index: 1;
}

.progress-fill {
  position: absolute;
  top: 10px; left: 0;
  height: 4px;
  background: var(--accent-ocean);
  z-index: 2;
  transition: width 0.4s ease;
}

.progress-step {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--bg-secondary);
  border: 3px solid rgba(255, 255, 255, 0.1);
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.progress-step.active {
  background: var(--accent-ocean);
  border-color: var(--bg-primary);
  box-shadow: 0 0 10px var(--accent-ocean);
}

.progress-step.completed {
  background: var(--accent-gold);
  border-color: var(--bg-primary);
}

.progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--text-secondary);
  margin-top: 6px;
}


/* --- DRAWER MODALS --- */
.drawer-backdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(10, 17, 40, 0.8);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  overscroll-behavior: none;
  z-index: 150;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.drawer-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.cart-drawer {
  position: fixed;
  bottom: 0; left: 50%;
  transform: translate(-50%, 100%);
  width: 100%;
  max-width: 480px;
  background: radial-gradient(circle at bottom center, var(--bg-secondary) 0%, var(--bg-primary) 100%);
  border-top-left-radius: var(--border-radius-lg);
  border-top-right-radius: var(--border-radius-lg);
  border-top: 1px solid var(--border-glass);
  padding: 30px 24px calc(20px + env(safe-area-inset-bottom)) 24px;
  max-height: 85vh;
  max-height: 85dvh;
  display: flex;
  flex-direction: column;
  z-index: 200;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.05);
}

.cart-drawer.active {
  transform: translate(-50%, 0);
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.drawer-title {
  font-size: 1.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, white 0%, var(--accent-gold) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.drawer-close {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  color: white;
  /* 44px meets the minimum touch target size for iOS/Android. */
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.drawer-content {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  margin-bottom: 20px;
}

.cart-items-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
}

.cart-item-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-glass);
  gap: 12px;
}

.cart-item-name {
  font-size: 0.95rem;
  font-weight: 700;
  /* Prevent long item names from overflowing the cart row on narrow screens. */
  min-width: 0;
  overflow-wrap: break-word;
  word-break: break-word;
  flex: 1 1 auto;
}

.cart-item-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.cart-item-price {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--accent-gold);
}

/* Payment Mode Select */
.payment-section {
  margin-top: 24px;
}

.payment-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 14px;
  color: var(--text-primary);
}

.payment-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.payment-card {
  border: 2px solid var(--border-glass);
  background: rgba(0, 0, 0, 0.15);
  border-radius: var(--border-radius-sm);
  padding: 16px;
  cursor: pointer;
  text-align: center;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.payment-card svg {
  width: 32px;
  height: 32px;
  fill: var(--text-secondary);
  transition: var(--transition);
}

.payment-card span {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-secondary);
  word-break: break-word;
}

.payment-card.active {
  border-color: var(--accent-gold);
  background: rgba(244, 162, 97, 0.1);
}

.payment-card.active svg {
  fill: var(--accent-gold);
}

.payment-card.active span {
  color: var(--accent-gold);
}

.drawer-footer {
  border-top: 1px solid var(--border-glass);
  padding-top: 20px;
}

.bill-details {
  display: flex;
  justify-content: space-between;
  margin-bottom: 20px;
}

.bill-label {
  font-weight: 700;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.bill-val {
  font-family: 'Outfit', sans-serif;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--accent-gold);
}


/* --- UPI PAYMENT MODAL --- */
.upi-modal-backdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(10, 17, 40, 0.9);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  overscroll-behavior: none;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Safe-area insets keep modal cards away from notch/home-indicator edges. */
  padding: max(20px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.upi-modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.upi-modal-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  border-radius: var(--border-radius-md);
  padding: 30px 24px;
  width: calc(100% - 40px);
  max-width: 400px;
  max-height: 90vh;
  max-height: 90dvh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  text-align: center;
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.5);
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.upi-modal-backdrop.active .upi-modal-card {
  transform: scale(1);
}

.upi-header {
  font-size: 1.35rem;
  margin-bottom: 8px;
  color: white;
}

.upi-amount {
  font-family: 'Outfit', sans-serif;
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--accent-gold);
  margin-bottom: 24px;
}

.qrcode-wrapper {
  background: #ffffff;
  padding: 16px;
  border-radius: var(--border-radius-sm);
  display: inline-block;
  margin-bottom: 24px;
}

.upi-instructions {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 28px;
}

.btn-secondary {
  width: 100%;
  padding: 14px;
  border: 1px solid var(--border-glass);
  background: rgba(255, 255, 255, 0.05);
  color: white;
  border-radius: var(--border-radius-sm);
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
}


/* --- SUCCESS CONFIRMATION SCREEN --- */
.success-screen {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(circle at center, #101f42 0%, #0a1128 100%);
  z-index: 300;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 30px;
  text-align: center;
  max-width: 480px;
  margin: 0 auto;
}

.success-icon-wrapper {
  width: 90px;
  height: 90px;
  background: rgba(46, 196, 182, 0.15);
  color: var(--accent-ocean);
  border: 2px solid var(--accent-ocean);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  margin-bottom: 30px;
  animation: float 2s infinite ease-in-out;
}

@keyframes float {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
  100% { transform: translateY(0px); }
}

.success-title {
  font-size: 2rem;
  margin-bottom: 12px;
  color: white;
}

.success-desc {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 36px;
  line-height: 1.6;
}

/* --- CUSTOMER FEEDBACK & ORDER HISTORY STYLES --- */
.history-order-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--border-radius-sm);
  padding: 16px;
  margin-bottom: 16px;
}
.history-order-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 8px;
  font-weight: 700;
  font-size: 0.9rem;
  min-width: 0;
}
.history-order-id {
  color: white;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.history-order-date {
  color: var(--text-secondary);
  font-size: 0.8rem;
}
.history-order-items {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
  line-height: 1.4;
}
.history-order-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px dashed var(--border-glass);
  padding-top: 10px;
}
.history-order-total {
  font-size: 0.9rem;
  font-weight: 700;
  color: white;
}
.reorder-btn {
  background: var(--accent-gradient);
  border: none;
  color: white;
  padding: 8px 16px;
  font-size: 0.8rem;
  font-weight: 700;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(231, 111, 81, 0.2);
  transition: var(--transition);
}
@media (hover: hover) and (pointer: fine) {
  .reorder-btn:hover {
    transform: scale(1.05);
  }
}
.star-rating span {
  transition: transform 0.2s ease;
  user-select: none;
}
@media (hover: hover) and (pointer: fine) {
  .star-rating span:hover {
    transform: scale(1.25);
  }
}

/* --- DEVELOPER FOOTER STYLES --- */
.login-social-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 24px;
  margin-bottom: 40px;
}

/* Compact social icons shown in the storefront header (replaces the table chip). */
.header-social-links {
  display: flex;
  align-items: center;
  gap: 6px;
}
.header-social-links .social-btn {
  width: 34px;
  height: 34px;
  position: relative;
}
/* Keep the 34px visual circle but expand the touchable area to ~44px to prevent mis-taps. */
.header-social-links .social-btn::after {
  content: "";
  position: absolute;
  inset: -5px;
}
.header-social-links .social-btn svg {
  width: 16px;
  height: 16px;
}

.social-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: var(--transition);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.social-btn svg {
  width: 20px;
  height: 20px;
  transition: transform 0.3s ease;
}

@media (hover: hover) and (pointer: fine) {
  .social-btn:hover {
    transform: translateY(-3px);
    color: #ffffff;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.35);
  }

  .social-btn.instagram:hover {
    background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285aeb 90%);
    border-color: transparent;
  }

  .social-btn.maps:hover {
    background: linear-gradient(135deg, #4285F4 0%, #34A853 30%, #FBBC05 70%, #EA4335 100%);
    border-color: transparent;
  }

  .social-btn:hover svg {
    transform: scale(1.1);
  }
}

.login-footer {
  /* Normal flow so the badge never overlaps the card on short screens or when
     the OTP / terms sub-view is taller. The login-screen already scrolls. */
  display: flex;
  justify-content: center;
  padding: 0 20px;
  margin-top: 24px;
  pointer-events: none;
}

.inside-footer {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  display: flex;
  justify-content: center;
  padding: 5px 10px calc(5px + env(safe-area-inset-bottom));
  box-sizing: border-box;
  /* Subtle fade so menu content scrolling under the pinned badge stays legible. */
  background: linear-gradient(to top, var(--bg-primary) 62%, transparent);
  z-index: 40;
  pointer-events: none; /* only the badge itself is interactive */
}

.dev-badge {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-glass);
  padding: 2px 9px;
  border-radius: 16px;
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 0.58rem;
  letter-spacing: 0.3px;
  color: var(--text-secondary);
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.1);
  opacity: 0.85;
  transition: var(--transition);
}

@media (hover: hover) and (pointer: fine) {
  .dev-badge:hover {
    border-color: var(--accent-gold);
    box-shadow: 0 4px 20px rgba(212, 175, 55, 0.15);
    transform: translateY(-1px);
  }
}

.dev-tag {
  color: var(--accent-gold);
  font-weight: 700;
}

.dev-highlight {
  color: var(--text-primary);
  font-weight: 700;
}

.dev-divider {
  width: 1px;
  height: 12px;
  background: var(--border-glass);
}

.dev-terminal-btn {
  color: var(--accent-ocean);
  text-decoration: none;
  display: flex;
  align-items: center;
  background: rgba(46, 196, 182, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(46, 196, 182, 0.2);
  font-weight: bold;
  transition: var(--transition);
}

@media (hover: hover) and (pointer: fine) {
  .dev-terminal-btn:hover {
    background: var(--accent-ocean);
    color: #000;
  }
}

.upi-pay-link {
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: var(--transition);
  margin-bottom: 15px;
}

@media (hover: hover) and (pointer: fine) {
  .upi-pay-link:hover {
    transform: scale(1.03);
  }
}

.pay-app-btn {
  background: var(--accent-gradient);
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 30px;
  font-size: 0.85rem;
  font-weight: 700;
  font-family: 'Outfit', sans-serif;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 15px rgba(231, 111, 81, 0.25);
  margin-top: 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
}

@media (hover: hover) and (pointer: fine) {
  .pay-app-btn:hover {
    filter: brightness(1.1);
    box-shadow: 0 6px 20px rgba(231, 111, 81, 0.4);
  }
}

/* Inline-styled scrollers (terms/privacy bodies) — momentum + no scroll-chaining on touch. */
#termsInputBody,
#termsModalBody {
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

/* Respect the user's OS "reduce motion" setting (WCAG 2.3.3 / vestibular safety). */
@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;
  }
}

/* ============================================================================
   MOBILE COMPACT PASS + ZOMATO-STYLE NAV  (2026-07 storefront rework)
   The base styles above were tuned large; on a phone the whole storefront read
   as "zoomed in". This block tightens the vertical rhythm, type scale, images,
   and the cart bar, and adds a Zomato-style category-jump (MENU) button, veg
   filter chips, and scroll-spy. Appended last so it wins on source order; it
   only touches sizing/spacing, never the per-theme colour overrides above.
   ============================================================================ */
html { scroll-behavior: smooth; }

/* --- Header: tighter, less vertical bulk --- */
#mainApp header { padding: 12px 14px 10px; padding-top: max(12px, env(safe-area-inset-top)); }
.header-top { margin-bottom: 10px; gap: 6px; }
.restaurant-title { font-size: clamp(1.05rem, 4.6vw, 1.4rem); letter-spacing: 0.3px; }
.active-orders-btn { padding: 7px 11px; min-height: 38px; font-size: 0.75rem; gap: 5px; border-radius: 40px; }
.active-table-indicator { padding: 5px 11px; font-size: 0.72rem; }
.search-input { padding: 10px 14px 10px 40px; border-radius: 12px; }
.search-icon { left: 13px; width: 16px; height: 16px; }

/* --- Veg / non-veg filter chips (new) — sits under the search inside the header --- */
.filter-bar { display: flex; align-items: center; gap: 8px; margin-top: 9px; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.filter-bar::-webkit-scrollbar { display: none; }
.filter-chip {
  flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 40px; cursor: pointer;
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.12);
  color: var(--text-secondary); font-family: 'Outfit', sans-serif; font-weight: 600; font-size: 0.78rem;
  transition: var(--transition); white-space: nowrap; -webkit-tap-highlight-color: transparent;
}
.filter-chip .dot-ind { width: 12px; height: 12px; border-radius: 4px; border: 1.5px solid currentColor; display: inline-flex; align-items: center; justify-content: center; }
.filter-chip .dot-ind::after { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.filter-chip.veg { color: #2ea043; }
.filter-chip.nonveg { color: #e5484d; }
.filter-chip.active { background: currentColor; border-color: currentColor; }
.filter-chip.veg.active, .filter-chip.nonveg.active { color: #fff; }
.filter-chip.veg.active { background: #2ea043; border-color: #2ea043; }
.filter-chip.nonveg.active { background: #e5484d; border-color: #e5484d; }
.filter-chip.active .dot-ind { color: #fff; }

/* --- Category nav: tighter --- */
.categories-nav { padding: 8px 14px; gap: 7px; top: 112px; }
.category-tab { padding: 6px 13px; border-radius: 10px; font-size: 0.8rem; }

/* --- Menu list: less air, smaller type, smaller images (Zomato density) --- */
.menu-container { padding: 12px 12px 90px; gap: 16px; scroll-behavior: smooth; }
body.cart-bar-visible .menu-container { padding-bottom: calc(150px + env(safe-area-inset-bottom)); }
.menu-category-section { scroll-margin-top: 150px; }
.menu-category-title { font-size: 1.02rem; margin-bottom: 9px; }
.menu-items-grid { gap: 10px; }
.menu-item-card { padding: 11px; gap: 11px; border-radius: 15px; box-shadow: 0 4px 14px rgba(0,0,0,0.18); }
.menu-item-name { font-size: 0.97rem; margin-bottom: 3px; }
.menu-item-price-container { margin-bottom: 5px; gap: 6px; }
.price-discounted { font-size: 1rem; }
.menu-item-desc { font-size: 0.76rem; line-height: 1.35; }
.veg-badge-container { margin-bottom: 5px; }
.menu-item-image-wrapper, .menu-item-image { width: 92px; height: 92px; }
.menu-item-image { border-radius: 13px; }
.add-btn-premium { padding: 6px 12px; font-size: 0.82rem; border-radius: 9px; }

/* --- Floating cart bar: compact, cleaner "View Cart" --- */
.cart-float-bar { padding: 10px 16px; border-radius: 14px; box-shadow: 0 8px 24px rgba(231,111,81,0.38); }
.cart-float-count { font-size: 0.68rem; letter-spacing: 0.6px; }
.cart-float-total { font-size: 1.08rem; }
.cart-float-action { font-size: 0.88rem; gap: 6px; }
.cart-float-action svg { width: 17px; height: 17px; }

/* --- Floating MENU category-jump button (Zomato-style, bottom centre) --- */
.menu-fab {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(18px + env(safe-area-inset-bottom));
  display: none; align-items: center; gap: 8px;
  padding: 11px 20px; border-radius: 40px; cursor: pointer; border: none;
  background: #14181f; color: #fff; font-family: 'Outfit', sans-serif; font-weight: 800;
  font-size: 0.82rem; letter-spacing: 1px; text-transform: uppercase;
  box-shadow: 0 10px 26px rgba(0,0,0,0.5); z-index: 96;
  -webkit-tap-highlight-color: transparent; transition: bottom 0.25s ease, transform 0.1s ease;
}
.menu-fab:active { transform: translateX(-50%) scale(0.96); }
.menu-fab svg { width: 16px; height: 16px; }
#mainApp.menu-ready .menu-fab { display: inline-flex; }
/* Lift the MENU button above the cart bar when the cart has items. */
body.cart-bar-visible .menu-fab { bottom: calc(84px + env(safe-area-inset-bottom)); }

/* --- Category index bottom sheet (opened by the MENU button) --- */
.cat-sheet-backdrop {
  position: fixed; inset: 0; background: rgba(5,9,20,0.6); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  z-index: 210; opacity: 0; pointer-events: none; transition: opacity 0.25s ease;
}
.cat-sheet-backdrop.active { opacity: 1; pointer-events: auto; }
.cat-sheet {
  position: fixed; left: 50%; bottom: 0; transform: translate(-50%, 100%);
  width: 100%; max-width: 480px; max-height: 70dvh; overflow-y: auto; -webkit-overflow-scrolling: touch;
  background: radial-gradient(circle at bottom center, var(--bg-secondary) 0%, var(--bg-primary) 100%);
  border-top-left-radius: 24px; border-top-right-radius: 24px; border-top: 1px solid var(--border-glass);
  padding: 10px 18px calc(18px + env(safe-area-inset-bottom));
  z-index: 220; transition: transform 0.32s cubic-bezier(0.175,0.885,0.32,1.05);
}
.cat-sheet.active { transform: translate(-50%, 0); }
.cat-sheet-title { font-family: 'Outfit', sans-serif; font-weight: 800; font-size: 0.72rem; letter-spacing: 1.5px; text-transform: uppercase; color: var(--text-secondary); text-align: center; padding: 8px 0 12px; }
.cat-sheet-row {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 13px 4px; border-bottom: 1px solid var(--border-glass); cursor: pointer; color: var(--text-primary);
  font-family: 'Outfit', sans-serif; font-weight: 600; font-size: 0.95rem; -webkit-tap-highlight-color: transparent;
}
.cat-sheet-row:last-child { border-bottom: none; }
.cat-sheet-row .cat-count { color: var(--text-secondary); font-size: 0.85rem; font-weight: 500; }
.cat-sheet-row:active { opacity: 0.6; }

/* --- Slightly tighter cart drawer + a right-sized Place Order button --- */
.cart-drawer { padding: 20px 18px calc(16px + env(safe-area-inset-bottom)); }
.drawer-header { margin-bottom: 16px; }
.drawer-title { font-size: 1.25rem; }
.drawer-content { margin-bottom: 14px; }
.drawer-footer { padding-top: 14px; }
.bill-details { margin-bottom: 14px; }
.bill-val { font-size: 1.2rem; }
.drawer-footer #placeOrderBtn { padding: 13px; font-size: 0.98rem; border-radius: 12px; }

/* On genuinely small phones, shave a little more. */
@media (max-width: 360px) {
  .menu-item-image-wrapper, .menu-item-image { width: 82px; height: 82px; }
  .menu-item-name { font-size: 0.92rem; }
  .category-tab { padding: 6px 11px; font-size: 0.76rem; }
}

/* ============================================================================
   DOORDASH-STYLE RESTYLE (2026-07 storefront) — DoorDash layout, typography,
   prominent rounded food imagery + a circular add button, rendered through the
   tenant's THEME variables so it adapts to any theme while keeping brand colours.
   Appended last so it wins on source order; card-level rules use a two-class
   selector (.menu-container .menu-item-card) to beat per-theme .menu-item-card
   colour overrides.
   ============================================================================ */

/* Clean modern store title — drop the ornate serif + gradient for a DoorDash sans. */
.restaurant-title {
  font-family: 'Outfit', sans-serif !important;
  font-weight: 800;
  font-size: clamp(1.2rem, 5.2vw, 1.55rem) !important;
  letter-spacing: -0.3px;
  background: none !important;
  -webkit-text-fill-color: currentColor !important;
  color: var(--text-primary) !important;
  text-shadow: none !important;
}

/* Header + search: a little more breathing room, clean radius. */
#mainApp header { padding: 14px 16px 12px; padding-top: max(14px, env(safe-area-inset-top)); }
.search-input { padding: 12px 14px 12px 42px; border-radius: 14px; }

/* Bigger, bolder section headers (DoorDash uses large category titles). */
.menu-category-title { font-size: 1.3rem; font-weight: 800; letter-spacing: -0.3px; margin-bottom: 12px; }
.menu-category-section { scroll-margin-top: 156px; }
.menu-container { gap: 22px; padding: 14px 14px 96px; }
body.cart-bar-visible .menu-container { padding-bottom: calc(150px + env(safe-area-inset-bottom)); }

/* Item rows: clean, generous, divider-separated (DoorDash list feel). Colours come
   from theme vars; the two-class selector beats per-theme card colour overrides. */
.menu-items-grid { gap: 0; }
.menu-container .menu-item-card {
  background: transparent !important;
  border: none !important;
  border-bottom: 1px solid var(--border-glass) !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 16px 2px;
  gap: 14px;
  align-items: flex-start;
}
.menu-items-grid .menu-item-card:last-child { border-bottom: none !important; }

/* Name / description / price — DoorDash typographic scale. */
.menu-item-left { gap: 0; }
.veg-badge-container { margin-bottom: 7px; }
.menu-item-name { font-size: 1.06rem; font-weight: 700; letter-spacing: -0.2px; margin-bottom: 5px; line-height: 1.25; }
.menu-item-desc { font-size: 0.86rem; line-height: 1.4; color: var(--text-secondary); margin-bottom: 9px; }
.menu-item-price-container { margin-bottom: 0; gap: 8px; }
.price-discounted { font-size: 1rem; font-weight: 700; color: var(--text-primary); }
.price-original { font-size: 0.85rem; }
.discount-badge { font-size: 0.68rem; }

/* Prominent rounded food image with an overlapping circular add button. */
.menu-item-right { align-items: flex-start; }
.menu-item-image-wrapper, .menu-item-image { width: 116px; height: 116px; }
.menu-item-image { border-radius: 16px; border: 1px solid var(--border-glass); }
.menu-item-action-overlay {
  position: absolute; bottom: -12px; right: 8px; left: auto; top: auto;
  transform: none; width: auto; display: flex; justify-content: flex-end;
}
.add-btn-circle {
  width: 38px; height: 38px; border-radius: 50%;
  background: #ffffff; border: 1px solid rgba(0,0,0,0.06);
  color: var(--accent-gold);
  font-size: 1.7rem; font-weight: 500; line-height: 1; padding: 0 0 3px 0;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.30); cursor: pointer;
  font-family: 'Outfit', sans-serif; -webkit-tap-highlight-color: transparent;
  transition: transform 0.12s ease;
}
.add-btn-circle:active { transform: scale(0.9); }
.opt-item-qty-badge {
  position: absolute; top: -10px; right: 2px;
  min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px;
  background: var(--accent-gold); color: #fff;
  font-family: 'Outfit', sans-serif; font-weight: 800; font-size: 0.72rem;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

/* Compact +/- stepper (once an item is in the cart) — white pill, DoorDash-like. */
.menu-item-action-overlay .quantity-control.minified {
  width: auto; min-width: 104px; background: #ffffff; border: 1px solid rgba(0,0,0,0.06);
  border-radius: 20px; padding: 2px; box-shadow: 0 4px 12px rgba(0,0,0,0.30); justify-content: space-between; gap: 2px;
}
.menu-item-action-overlay .quantity-control.minified .qty-btn { width: 34px; height: 34px; color: var(--accent-gold); font-size: 1.25rem; }
.menu-item-action-overlay .quantity-control.minified .qty-val { color: #14181f; font-weight: 800; font-size: 0.95rem; min-width: 22px; }

/* Category tabs a touch larger for DoorDash readability. */
.category-tab { font-size: 0.88rem; padding: 7px 15px; }

@media (max-width: 360px) {
  .menu-item-image-wrapper, .menu-item-image { width: 100px; height: 100px; }
  .menu-item-name { font-size: 1rem; }
}

/* ============================================================================
   DOORDASH FLOW REDESIGN — the whole ordering flow: cart drawer ("My Cart"),
   checkout (payment + bill + place order), the customise/variant sheet, the
   UPI modal, success screen and inputs. Clean bottom sheets with a grab handle,
   divider-separated cart rows with accent steppers, selectable option/payment
   rows with radio/check marks, and a prominent CTA. All colours from theme vars.
   ============================================================================ */

/* --- Bottom sheets (cart + customise): rounded top, grab handle, roomy --- */
.cart-drawer {
  border-top-left-radius: 22px !important;
  border-top-right-radius: 22px !important;
  padding: 24px 18px calc(16px + env(safe-area-inset-bottom)) !important;
}
.cart-drawer::before {
  content: ''; position: absolute; top: 9px; left: 50%; transform: translateX(-50%);
  width: 40px; height: 4px; border-radius: 3px; background: var(--text-secondary); opacity: 0.4;
}
.drawer-header { margin-bottom: 14px; align-items: center; }
.drawer-title {
  font-family: 'Outfit', sans-serif !important; font-weight: 800 !important; font-size: 1.3rem !important;
  background: none !important; -webkit-text-fill-color: currentColor !important; color: var(--text-primary) !important;
}
.drawer-close { width: 36px; height: 36px; font-size: 1rem; background: rgba(255,255,255,0.06); }

/* --- Cart item rows: name/options left, stepper + line price right --- */
.cart-items-list { gap: 0; margin-bottom: 6px; }
.cart-item-row { padding: 15px 0; border-bottom: 1px solid var(--border-glass); align-items: flex-start; gap: 12px; }
.cart-item-row:last-child { border-bottom: none; }
.cart-item-name { font-size: 0.98rem; font-weight: 700; }
.cart-item-opts { font-size: 0.8rem; color: var(--text-secondary); margin-top: 3px; line-height: 1.35; }
.cart-item-meta { flex-direction: column; align-items: flex-end; gap: 9px; }
.cart-item-price { font-size: 0.98rem; font-weight: 800; font-family: 'Outfit', sans-serif; color: var(--text-primary); }
.cart-item-meta .quantity-control { background: transparent; border: 1.5px solid var(--border-glass); border-radius: 22px; padding: 2px; }
.cart-item-meta .quantity-control .qty-btn { width: 30px; height: 30px; background: transparent; color: var(--accent-gold); font-size: 1.15rem; }
.cart-item-meta .quantity-control .qty-val { min-width: 22px; font-size: 0.9rem; color: var(--text-primary); }

/* --- Bill breakdown + grand total --- */
#billBreakdown { font-size: 0.84rem !important; }
.bill-details { align-items: baseline; margin-bottom: 14px; }
.bill-label { font-size: 1rem; font-weight: 700; color: var(--text-primary); }
.bill-val { font-size: 1.35rem; font-weight: 800; color: var(--text-primary); }

/* --- Payment method cards: clean, clearly selectable --- */
.payment-title { font-size: 0.72rem !important; text-transform: uppercase; letter-spacing: 1px; color: var(--text-secondary); margin-bottom: 10px; font-weight: 800; }
.payment-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.payment-card { border-radius: 14px; border: 1.5px solid var(--border-glass); background: rgba(255,255,255,0.03); padding: 14px 10px; gap: 7px; }
.payment-card svg { width: 26px; height: 26px; }
.payment-card span { font-size: 0.84rem; font-weight: 600; }
.payment-card.active { border-color: var(--accent-gold); background: rgba(255,255,255,0.06); box-shadow: inset 0 0 0 1px var(--accent-gold); }

/* --- Place Order CTA --- */
.drawer-footer #placeOrderBtn { padding: 15px; font-size: 1.05rem; font-weight: 800; border-radius: 14px; letter-spacing: 0.2px; box-shadow: 0 8px 22px rgba(0,0,0,0.3); }

/* --- Customise (variant) sheet --- */
.sheet-item-head { margin-bottom: 4px; }
.sheet-item-name { font-family: 'Outfit', sans-serif; font-weight: 800; font-size: 1.2rem; color: var(--text-primary); }
.sheet-item-desc { font-size: 0.86rem; color: var(--text-secondary); margin-top: 4px; line-height: 1.4; }
.opt-group { margin-top: 18px; }
.opt-group-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.opt-group-name { font-family: 'Outfit', sans-serif; font-weight: 800; font-size: 1rem; color: var(--text-primary); }
.opt-group-rule { font-size: 0.66rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px; color: var(--accent-gold); background: rgba(255,255,255,0.08); padding: 3px 9px; border-radius: 20px; }
.opt-group-body { display: flex; flex-direction: column; }
.opt-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 13px 2px; background: transparent; border: none; border-bottom: 1px solid var(--border-glass); cursor: pointer; text-align: left; color: var(--text-primary); font-family: inherit; }
.opt-row:last-child { border-bottom: none; }
.opt-row.disabled { opacity: 0.45; }
.opt-label { flex: 1; font-size: 0.94rem; }
.opt-delta { font-size: 0.86rem; color: var(--text-secondary); font-weight: 700; }
.opt-mark { width: 22px; height: 22px; border: 2px solid var(--border-glass); flex: none; display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; }
.opt-mark.radio { border-radius: 50%; }
.opt-mark.check { border-radius: 6px; }
.opt-mark.on { border-color: var(--accent-gold); background: var(--accent-gold); }
.opt-mark.radio.on::after { content: ''; width: 9px; height: 9px; border-radius: 50%; background: #fff; }
.opt-mark.check.on::after { content: ''; width: 5px; height: 9px; background: transparent; border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg) translateY(-1px); }
.sheet-qty-row { display: flex; align-items: center; gap: 12px; }
.sheet-qty-row .quantity-control { border: 1.5px solid var(--border-glass); border-radius: 24px; }
.sheet-qty-row .quantity-control .qty-btn { color: var(--accent-gold); }
.sheet-qty-row #sheetAddBtn { flex: 1; border-radius: 14px; font-weight: 800; }

/* --- UPI modal + success + inputs polish --- */
.upi-modal-card { border-radius: 22px; }
.upi-header { font-family: 'Outfit', sans-serif; font-weight: 800; }
.upi-amount { font-family: 'Outfit', sans-serif; font-weight: 800; }
.success-title { font-family: 'Outfit', sans-serif; }
.login-card { border-radius: 20px; }
.input-field { border-radius: 12px; }
.btn-primary { border-radius: 12px; }
.btn-secondary { border-radius: 12px; }

/* ============================================================================
   MOBILE HARDENING (2026-07 storefront) — real-phone widths 320-430px and real
   devices (notch / home-indicator safe areas, iOS soft keyboard). Appended LAST
   so it wins on source order. This block is deliberately ADDITIVE: it does not
   touch the desktop / >=480px look, which is already good. It only (a) tightens
   the DoorDash card + checkout layout on narrow phones, (b) adds structural
   robustness (min-width:0, overflow guards, safe-area insets, keyboard lift),
   and (c) keeps every touch control tappable. Money/behaviour untouched.
   ============================================================================ */

/* --- Structural robustness (all widths) --------------------------------- */

/* Never let the storefront body scroll sideways on a phone. */
html, body { overflow-x: hidden; }

/* The bottom sheets must never exceed the viewport once safe-area insets on a
   notched phone eat into the sides. min() keeps the 480px desktop cap intact. */
.cart-drawer, .cat-sheet {
  max-width: min(480px, calc(100vw - env(safe-area-inset-left) - env(safe-area-inset-right))) !important;
}

/* cart-item-name-wrap was rendered in JS with NO css — without flex:1/min-width:0
   the left column can't shrink and the row overflows. Give it a real flex column. */
.cart-item-name-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.cart-item-name-wrap .cart-item-name { overflow-wrap: anywhere; }

/* Let long option / cart / payment text wrap inside its own box instead of
   forcing the row wider than 100%. */
.opt-label, .payment-card span { min-width: 0; overflow-wrap: break-word; }
.opt-label { flex: 1 1 auto; }

/* The circular add button sits at bottom:-12px (outside the image). The image
   wrapper must therefore NOT clip (overflow:hidden would hide the button), but
   the card should let it spill without triggering page-level horizontal scroll. */
.menu-container .menu-item-card { overflow: visible; }
/* Nudge the overlay in a hair so the button can't touch the screen edge / a
   notch inset on the right, and give it room within the card. */
.menu-item-action-overlay { right: 6px; padding-right: 2px; }
@supports (right: max(0px)) {
  .menu-item-action-overlay { right: max(6px, env(safe-area-inset-right)); }
}

/* Keep the menu list clear of a right-side notch inset in landscape. */
.menu-container {
  padding-left: max(14px, env(safe-area-inset-left));
  padding-right: max(14px, env(safe-area-inset-right));
}

/* The drawer must open reliably. The earlier keyboard-lift used
   calc(-1 * var(--kb-inset)) which becomes INVALID when --kb-inset is empty,
   breaking the open transform and leaving the drawer stuck off-screen.
   Force the open position; the item list now scrolls, so the keyboard covering
   the bottom while typing is fine. ponytail: kb-lift dropped, drawer opening wins. */
.cart-drawer.active { transform: translate(-50%, 0) !important; }

/* ======================= <= 430px : phones ============================== */
@media (max-width: 430px) {
  /* Keep the floating cart bar symmetric and off the screen edges. */
  .cart-float-bar { width: min(calc(100% - 32px), 460px); }
}

/* ======================= <= 390px : narrow phones ====================== */
@media (max-width: 390px) {
  /* DoorDash card: reclaim ~20px for the text column by shrinking the image,
     and ease the type down so names/descriptions stop wrapping raggedly. */
  .menu-item-image-wrapper, .menu-item-image { width: 96px; height: 96px; }
  .menu-item-name { font-size: 0.98rem; }
  .menu-item-desc { font-size: 0.80rem; }
  /* Smaller circular add button so it can't overhang the card's right edge. */
  .add-btn-circle { width: 34px; height: 34px; font-size: 1.5rem; }
  /* Compact in-cart stepper on the card overlay stays tappable but narrower. */
  .menu-item-action-overlay .quantity-control.minified { min-width: 96px; }
}

/* ======================= <= 360px : SE-class phones ==================== */
@media (max-width: 360px) {
  /* Header: shrink the title + tighten the button row so it stops wrapping to
     two/three rows (which pushed the search + categories nav down). */
  .restaurant-title { font-size: clamp(1rem, 4.4vw, 1.2rem) !important; }
  .header-top { gap: 4px; }
  .active-orders-btn { padding: 5px 8px; min-height: 36px; font-size: 0.7rem; gap: 4px; }

  /* DoorDash card: one more step down on the image + gaps at SE width. */
  .menu-container .menu-item-card { gap: 11px; }
  .menu-item-image-wrapper, .menu-item-image { width: 88px; height: 88px; }
  .menu-category-title { font-size: 1.12rem; letter-spacing: -0.1px; }

  /* Cart rows: shrink the vertical stepper so a long item name keeps room,
     while KEEPING the +/- buttons at a comfortable 34px touch target. */
  .cart-item-meta .quantity-control .qty-btn { width: 34px; height: 34px; }
  .cart-item-meta { gap: 8px; }
  .menu-item-action-overlay .quantity-control.minified { min-width: 92px; }

  /* Payment cards: stack full-width so 'Pay Online (UPI)' stops wrapping to
     three cramped lines and each card is an easy, unambiguous tap target. */
  .payment-options { grid-template-columns: 1fr; gap: 8px; }
  .payment-card { padding: 12px 12px; flex-direction: row; justify-content: center; }

  /* Tip chips: 3 per row grid instead of a flex row that overflows the drawer. */
  #tipChips { display: grid !important; grid-template-columns: repeat(3, 1fr); gap: 6px; }
  #tipChips .tip-chip { min-width: 0 !important; flex: none !important; }

  /* Customise sheet: tighten option rows + let long labels wrap. */
  .opt-row { gap: 10px; padding: 11px 0; }
  .opt-label { font-size: 0.9rem; }
  .opt-delta { font-size: 0.82rem; }

  /* Slightly smaller drawer title so it can't collide with the close button. */
  .drawer-title { font-size: 1.15rem !important; }

  /* UPI modal: tighten the QR padding + instructions at SE width. */
  .qrcode-wrapper { padding: 12px; }
  .upi-instructions { font-size: 0.78rem; line-height: 1.5; }
}

/* ======================= <= 340px : iPhone SE 1st-gen ================== */
@media (max-width: 340px) {
  /* Deepest squeeze: keep the image small enough that the text column can't
     collapse below a readable width, and keep the add button honest. */
  .menu-item-image-wrapper, .menu-item-image { width: 82px; height: 82px; }
  .menu-item-name { font-size: 0.94rem; }
  .filter-chip { padding: 5px 10px; font-size: 0.74rem; gap: 4px; }
  .filter-chip .dot-ind { width: 10px; height: 10px; }
  .category-tab { padding: 6px 11px; font-size: 0.82rem; }
}

/* ============================================================================
   PHONE-SCREENSHOT FIXES (2026-07) — issues seen on a real device:
   (1) the floating MENU pill + call-waiter bell overlapped menu items and
       crowded the cart bar. The MENU button duplicated the sticky category
       tabs (which already scroll-jump to any section), so remove it entirely.
   (2) the kitchen-note textarea clipped its text (no explicit line-height).
   ============================================================================ */
.menu-fab, #mainApp.menu-ready .menu-fab { display: none !important; }

#orderNote {
  min-height: 60px !important;
  line-height: 1.5 !important;
  padding: 12px 14px !important;
}

/* Keep the call-waiter bell clearly clear of the cart bar + a touch smaller so
   it reads as a floating action button, not clutter on top of an item. */
.waiter-call-float { width: 46px; height: 46px; }
.waiter-call-float svg { width: 22px; height: 22px; }

/* --- Phone feedback round 2 --- */
/* (1) less zoomed -> more items on screen */
@media (max-width: 460px) {
  .menu-item-image-wrapper, .menu-item-image { width: 84px !important; height: 84px !important; }
  .menu-container .menu-item-card { padding: 12px 2px; }
  .menu-container { gap: 15px; }
  .menu-category-title { font-size: 1.12rem; }
  .menu-item-name { font-size: 0.95rem; }
  .add-btn-circle { width: 32px !important; height: 32px !important; }
}
/* (2) keep the FSSAI / "Engineered by Logicues" footer visible above the cart bar */
body.cart-bar-visible .inside-footer { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
/* (3) many items: the item list flexes + scrolls INSIDE its own box so payment
   mode + kitchen note + total stay on screen regardless of item count. Every
   ancestor needs min-height:0 or the scroll container never bounds. */
.cart-drawer .drawer-content { display: flex; flex-direction: column; min-height: 0; }
#cartViewContainer { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
#cartItemsList { flex: 0 1 auto; min-height: 0; max-height: none; overflow-y: auto; -webkit-overflow-scrolling: touch; }
#paymentSection, #orderNoteSection { flex: none; }
/* (5) MENU button pinned in the left corner of the category row (opens the category sheet) */
.cat-menu-btn {
  position: sticky; left: 0; z-index: 2; flex-shrink: 0;
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px;
  border-radius: 10px; border: none; cursor: pointer; background: var(--accent-gradient);
  color: #fff; font-family: 'Outfit', sans-serif; font-weight: 800; font-size: 0.82rem;
  box-shadow: 8px 0 10px 3px var(--bg-primary); -webkit-tap-highlight-color: transparent;
}


/* ============================================================================
   DOORDASH PREMIUM UI COSMETIC OVERRIDES
   ============================================================================ */

/* Force global light-mode DoorDash variables across all themes */
body {
  --bg-primary: #ffffff !important;
  --bg-secondary: #f7f7f7 !important;
  --bg-card: #ffffff !important;
  --text-primary: #191919 !important;
  --text-secondary: #767676 !important;
  --accent-gold: #FF3008 !important; /* DoorDash Red */
  --accent-ocean: #34a853 !important; /* Green */
  --accent-rose: #eb1700 !important;
  --accent-gradient: linear-gradient(135deg, #FF3008 0%, #eb1700 100%) !important;
  --border-glass: #e8e8e8 !important;
  --shadow-glow: rgba(0, 0, 0, 0.04) !important;
  background-color: #f7f7f7 !important;
  color: #191919 !important;
}

/* App layout wrapper */
.app-container {
  background-color: #ffffff !important;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.05) !important;
  border-left: 1px solid #e8e8e8 !important;
  border-right: 1px solid #e8e8e8 !important;
}

/* Hero Banner */
.store-banner-wrapper {
  width: 100%;
  height: 140px;
  overflow: hidden;
  position: relative;
}
.store-banner-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Header UI */
header {
  background: #ffffff !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border-bottom: none !important;
  box-shadow: none !important;
}
.restaurant-title {
  font-family: 'Outfit', 'Inter', sans-serif !important;
  color: #191919 !important;
  -webkit-text-fill-color: initial !important;
  background: none !important;
  font-weight: 800 !important;
  text-shadow: none !important;
}
.active-orders-btn, .active-table-indicator {
  background: #f6f6f6 !important;
  color: #191919 !important;
  border: 1px solid #e8e8e8 !important;
  border-radius: 8px !important;
  font-family: inherit !important;
  font-weight: 600 !important;
}

/* Search input */
.search-input {
  background: #f6f6f6 !important;
  border: 1px solid #e8e8e8 !important;
  color: #191919 !important;
}
.search-input:focus {
  background: #ffffff !important;
  border-color: #FF3008 !important;
}
.search-icon {
  color: #767676 !important;
}

/* Category Navigation */
.categories-nav {
  background: #ffffff !important;
  border-bottom: 1px solid #e8e8e8 !important;
}
.category-tab {
  background: transparent !important;
  border: none !important;
  color: #767676 !important;
  border-radius: 0 !important;
  padding: 8px 12px !important;
  position: relative;
  font-weight: 600;
  box-shadow: none !important;
}
.category-tab.active {
  color: #191919 !important;
  box-shadow: none !important;
  font-weight: 800;
  border-bottom: 3px solid #FF3008 !important;
  background: transparent !important;
}

/* Menu Items Grid & Cards */
.menu-container .menu-item-card {
  background: transparent !important;
  border: none !important;
  border-bottom: 1px solid #e8e8e8 !important;
  box-shadow: none !important;
}
.menu-item-name {
  color: #191919 !important;
}
.menu-item-desc {
  color: #767676 !important;
}
.price-discounted {
  color: #191919 !important;
}
.price-original {
  color: #767676 !important;
}
.discount-badge {
  background: rgba(255, 48, 8, 0.1) !important;
  color: #FF3008 !important;
}

/* Circle Add Button */
.add-btn-circle {
  background: #ffffff !important;
  border: 1px solid #FF3008 !important;
  color: #FF3008 !important;
  box-shadow: 0 2px 8px rgba(255, 48, 8, 0.15) !important;
}
.opt-item-qty-badge {
  background: #FF3008 !important;
  color: #ffffff !important;
  box-shadow: 0 2px 6px rgba(255, 48, 8, 0.2) !important;
}

/* Buttons */
.btn-primary {
  background: #FF3008 !important;
  color: #ffffff !important;
  box-shadow: none !important;
  border-radius: 8px !important;
  font-family: inherit !important;
  font-weight: 700 !important;
}
.btn-primary:hover {
  background: #eb1700 !important;
}
.btn-secondary {
  background: #f6f6f6 !important;
  border: 1px solid #e8e8e8 !important;
  color: #191919 !important;
  border-radius: 8px !important;
  font-family: inherit !important;
}
.btn-secondary:hover {
  background: #ececec !important;
}

/* Bottom sheets / Drawers */
.cart-drawer {
  background: #ffffff !important;
  border-top: 1px solid #e8e8e8 !important;
}
.drawer-title {
  color: #191919 !important;
}
.drawer-close {
  background: #f6f6f6 !important;
  color: #191919 !important;
  border: 1px solid #e8e8e8 !important;
}
.cart-item-row {
  border-bottom-color: #e8e8e8 !important;
}
.cart-item-name {
  color: #191919 !important;
}
.cart-item-opts {
  color: #767676 !important;
}
.cart-item-price {
  color: #191919 !important;
}

/* Stepper inside cart list */
.cart-item-meta .quantity-control {
  background: #f6f6f6 !important;
  border: 1px solid #e8e8e8 !important;
  border-radius: 22px !important;
}
.cart-item-meta .quantity-control .qty-btn {
  color: #FF3008 !important;
  background: transparent !important;
}
.cart-item-meta .quantity-control .qty-val {
  color: #191919 !important;
}

/* DoorDash reskin cosmetics only — layout (flex/min-height) stays owned by the
   rules at ~line 2507-2509 so customer.js openDrawer()'s CART/TRACKER/HISTORY
   mode toggling and the shrink-to-fit item list keep working. */
#cartItemsList {
  max-height: 320px !important;
  border-bottom: 1px solid #e8e8e8 !important;
  margin-bottom: 16px !important;
}

/* Payment Mode Select */
.payment-card {
  background: #f6f6f6 !important;
  border: 1.5px solid #e8e8e8 !important;
  color: #191919 !important;
}
.payment-card svg {
  fill: #767676 !important;
}
.payment-card.active {
  border-color: #FF3008 !important;
  background: rgba(255, 48, 8, 0.05) !important;
  box-shadow: inset 0 0 0 1px #FF3008 !important;
}
.payment-card.active svg {
  fill: #FF3008 !important;
}
.payment-card.active span {
  color: #FF3008 !important;
}

/* Option customisation sheet details */
.sheet-item-name {
  color: #191919 !important;
}
.sheet-item-desc {
  color: #767676 !important;
}
.opt-group-name {
  color: #191919 !important;
}
.opt-group-rule {
  font-size: 0.66rem !important;
  font-weight: 800 !important;
  text-transform: uppercase !important;
  color: #767676 !important;
  background: #f6f6f6 !important;
  padding: 3px 9px !important;
  border-radius: 20px !important;
}
.opt-row {
  border-bottom-color: #e8e8e8 !important;
  color: #191919 !important;
}
.opt-mark {
  border-color: #e8e8e8 !important;
}
.opt-mark.on {
  border-color: #FF3008 !important;
  background: #FF3008 !important;
}
.sheet-qty-row .quantity-control {
  border: 1.5px solid #e8e8e8 !important;
  background: #f6f6f6 !important;
}
.sheet-qty-row .quantity-control .qty-btn {
  color: #FF3008 !important;
  background: transparent !important;
}
.sheet-qty-row .quantity-control .qty-val {
  color: #191919 !important;
}

/* Modals overlays & popups */
.upi-modal-backdrop {
  background: rgba(0, 0, 0, 0.6) !important;
}
.upi-modal-card {
  background: #ffffff !important;
  color: #191919 !important;
  border: 1px solid #e8e8e8 !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15) !important;
}
.upi-header {
  color: #191919 !important;
}
.upi-amount {
  color: #FF3008 !important;
}
.upi-instructions {
  color: #767676 !important;
}

/* Success screen */
.success-screen {
  background: #ffffff !important;
}
.success-title {
  color: #191919 !important;
  font-weight: 800 !important;
}
.success-desc {
  color: #767676 !important;
}
.success-icon-wrapper {
  background: #34a853 !important;
  color: #ffffff !important;
}

/* Floating Cart bar button */
.cart-float-bar {
  background: #FF3008 !important;
  border-radius: 8px !important;
  box-shadow: 0 4px 16px rgba(255, 48, 8, 0.25) !important;
  border: none !important;
}

/* Floating Menu button */
.menu-fab {
  background: #191919 !important;
  color: #ffffff !important;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15) !important;
  font-family: inherit !important;
  font-weight: 700 !important;
}

/* Floating Waiter call */
.waiter-call-float {
  background: #ffffff !important;
  border: 1px solid #e8e8e8 !important;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12) !important;
}
.waiter-call-float svg {
  fill: #191919 !important;
}

/* Compliance links and details text */
#termsLink, #privacyLink {
  color: #FF3008 !important;
}


