/* ========================================
   KahalEats — Global Premium Design System
   Inspired by Swiggy × Apple HIG × Jungle Luxury
   ======================================== */

/* Google Fonts: Fraunces (display serif) + Inter (UI) + Outfit (accent) */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Outfit:wght@400;500;600;700;800;900&family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600;9..144,700;9..144,800&display=swap');

/* ============================================
   DESIGN TOKENS — Premium Dark Jungle Theme
   ============================================ */
:root {
  /* ── Surface Colors (Premium dark with depth) ── */
  --bg-base: #0A0F1C;
  --bg-primary: #0F172A;
  --bg-elevated: #131C30;
  --bg-secondary: #1A2440;
  --bg-tertiary: #243151;
  --bg-card: rgba(26, 36, 64, 0.65);
  --bg-card-solid: #1A2440;
  --bg-card-hover: rgba(36, 49, 81, 0.80);
  --bg-glass: rgba(15, 23, 42, 0.55);
  --bg-glass-strong: rgba(10, 15, 28, 0.80);
  --bg-overlay: rgba(5, 8, 16, 0.80);
  --bg-sheet: #131C30;

  /* ── Accent — Tropical Emerald (signature) ── */
  --accent-primary: #10B981;
  --accent-primary-hover: #059669;
  --accent-primary-active: #047857;
  --accent-primary-soft: rgba(16, 185, 129, 0.12);
  --accent-primary-glow: rgba(16, 185, 129, 0.35);

  /* ── Accent — Saffron Gold (luxury accent) ── */
  --accent-gold: #F5B342;
  --accent-gold-soft: rgba(245, 179, 66, 0.12);
  --accent-gold-glow: rgba(245, 179, 66, 0.3);

  /* ── Accent — Coral (alerts / hot) ── */
  --accent-coral: #FB7185;
  --accent-coral-soft: rgba(251, 113, 133, 0.12);

  /* ── Accent — Sky (info) ── */
  --accent-sky: #38BDF8;
  --accent-sky-soft: rgba(56, 189, 248, 0.12);

  /* ── Text Colors (with premium contrast) ── */
  --text-primary: #F8FAFC;
  --text-secondary: #CBD5E1;
  --text-tertiary: #94A3B8;
  --text-muted: #64748B;
  --text-inverse: #0F172A;
  --text-on-accent: #052E1F;

  /* ── Status Colors ── */
  --status-new: #38BDF8;
  --status-preparing: #F5B342;
  --status-ready: #10B981;
  --status-delivered: #94A3B8;

  --success: #10B981;
  --success-soft: rgba(16, 185, 129, 0.14);
  --warning: #F5B342;
  --warning-soft: rgba(245, 179, 66, 0.14);
  --danger: #FB7185;
  --danger-soft: rgba(251, 113, 133, 0.14);

  /* ── Borders (subtle premium lines) ── */
  --border-subtle: rgba(148, 163, 184, 0.08);
  --border-soft: rgba(148, 163, 184, 0.14);
  --border-medium: rgba(148, 163, 184, 0.22);
  --border-strong: rgba(148, 163, 184, 0.32);
  --border-accent: rgba(16, 185, 129, 0.4);
  --border-gold: rgba(245, 179, 66, 0.4);

  /* ── Premium Shadows (with color glows) ── */
  --shadow-xs: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 24px 64px rgba(0, 0, 0, 0.6);
  --shadow-2xl: 0 32px 96px rgba(0, 0, 0, 0.7);
  --shadow-glow-emerald: 0 8px 32px rgba(16, 185, 129, 0.35);
  --shadow-glow-emerald-strong: 0 16px 48px rgba(16, 185, 129, 0.50);
  --shadow-glow-gold: 0 8px 32px rgba(245, 179, 66, 0.30);
  --shadow-inset: inset 0 1px 1px rgba(255, 255, 255, 0.12);

  /* ── Spacing scale (8pt grid) ── */
  --space-0: 0;
  --space-1: 2px;
  --space-2: 4px;
  --space-3: 6px;
  --space-4: 8px;
  --space-5: 10px;
  --space-6: 12px;
  --space-7: 14px;
  --space-8: 16px;
  --space-10: 20px;
  --space-12: 24px;
  --space-14: 28px;
  --space-16: 32px;
  --space-20: 40px;
  --space-24: 48px;
  --space-32: 64px;
  --space-40: 80px;

  /* ── Legacy aliases (for existing code) ── */
  --space-xs: var(--space-2);
  --space-sm: var(--space-4);
  --space-md: var(--space-8);
  --space-lg: var(--space-12);
  --space-xl: var(--space-16);
  --space-2xl: var(--space-24);

  /* ── Radius (extra-rounded for premium feel) ── */
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 22px;
  --radius-2xl: 28px;
  --radius-3xl: 36px;
  --radius-full: 9999px;

  /* ── Typography ── */
  --font-display: 'Fraunces', 'Times New Roman', serif;
  --font-heading: 'Outfit', -apple-system, system-ui, sans-serif;
  --font-body: 'Inter', -apple-system, system-ui, sans-serif;

  /* ── Motion (Apple spring + Material easing) ── */
  --ease-spring: cubic-bezier(0.32, 0.72, 0, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-smooth: cubic-bezier(0.25, 0.46, 0.45, 0.94);

  --duration-instant: 100ms;
  --duration-fast: 180ms;
  --duration-base: 280ms;
  --duration-slow: 420ms;
  --duration-slower: 600ms;

  --transition-fast: var(--duration-fast) var(--ease-out);
  --transition-base: var(--duration-base) var(--ease-spring);
  --transition-slow: var(--duration-slow) var(--ease-out);

  /* ── Z-Index Scale ── */
  --z-base: 1;
  --z-elevated: 10;
  --z-sticky: 100;
  --z-drawer: 200;
  --z-modal: 1000;
  --z-toast: 2000;
  --z-tooltip: 3000;

  /* ── Safe area (PWA) ── */
  --safe-top: env(safe-area-inset-top, 0);
  --safe-bottom: env(safe-area-inset-bottom, 0);
}

/* ============================================
   RESET & BASE
   ============================================ */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  overscroll-behavior-y: none;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-body);
  font-feature-settings: 'cv11', 'ss01', 'ss03';
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.55;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
  font-variant-numeric: tabular-nums;
}

/* Premium ambient background — subtle radial gradients */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background:
    radial-gradient(circle at 15% 10%, rgba(16, 185, 129, 0.08) 0%, transparent 45%),
    radial-gradient(circle at 85% 90%, rgba(245, 179, 66, 0.06) 0%, transparent 45%),
    radial-gradient(circle at 50% 50%, rgba(56, 189, 248, 0.03) 0%, transparent 60%);
  opacity: 0.8;
}

/* Prevent text selection on interactive elements */
button, .btn, .menu-item-card, .category-tab,
.qty-selector, .room-pill, .floating-cart, .nav-tab {
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

/* Premium scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.2);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.4);
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.15;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

h1 { font-size: 2.25rem; letter-spacing: -0.03em; }
h2 { font-size: 1.75rem; letter-spacing: -0.025em; }
h3 { font-size: 1.375rem; }
h4 { font-size: 1.125rem; }

.display {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.05;
}

p {
  color: var(--text-secondary);
  line-height: 1.6;
}

.text-eyebrow {
  font-family: var(--font-heading);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent-primary);
}

.text-gradient-emerald {
  background: linear-gradient(135deg, #34D399 0%, #10B981 50%, #059669 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-gradient-gold {
  background: linear-gradient(135deg, #FCD34D 0%, #F5B342 50%, #D97706 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

a {
  color: var(--accent-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}
a:hover { color: var(--accent-primary-hover); }

/* ============================================
   BUTTONS (Premium)
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 14px 24px;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: transform var(--transition-fast), background var(--transition-fast), box-shadow var(--transition-base);
  position: relative;
  overflow: hidden;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.12) 0%, transparent 50%);
  pointer-events: none;
  opacity: 0.6;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  color: white;
  box-shadow: var(--shadow-glow-emerald), var(--shadow-inset);
}
.btn-primary:hover {
  box-shadow: var(--shadow-glow-emerald-strong), var(--shadow-inset);
  transform: translateY(-1px);
}
.btn-primary:active { transform: scale(0.97); }
.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none;
}

.btn-gold {
  background: linear-gradient(135deg, #F5B342 0%, #D97706 100%);
  color: #1F1306;
  box-shadow: var(--shadow-glow-gold), var(--shadow-inset);
}
.btn-gold:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 32px rgba(245, 179, 66, 0.45);
}

.btn-secondary {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-inset);
}
.btn-secondary:hover {
  background: var(--bg-tertiary);
  border-color: var(--border-medium);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 10px 16px;
}
.btn-ghost:hover {
  color: var(--text-primary);
  background: var(--bg-card);
}

.btn-outline {
  background: transparent;
  color: var(--accent-primary);
  border: 1.5px solid var(--border-accent);
}
.btn-outline:hover {
  background: var(--accent-primary-soft);
  border-color: var(--accent-primary);
}

.btn-sm {
  padding: 9px 16px;
  font-size: 0.825rem;
  border-radius: var(--radius-md);
}
.btn-lg {
  padding: 18px 32px;
  font-size: 1.05rem;
  border-radius: var(--radius-xl);
}
.btn-block { width: 100%; }

.btn-icon {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: var(--radius-md);
  font-size: 1.2rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
}
.btn-icon:hover { background: var(--bg-tertiary); }

.btn.is-loading {
  pointer-events: none;
  color: transparent !important;
}
.btn.is-loading::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  z-index: 1;
}

/* ============================================
   CARDS (Glassmorphism + depth)
   ============================================ */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-2xl);
  padding: var(--space-lg);
  transition: all var(--transition-base);
  position: relative;
  box-shadow: var(--shadow-md), var(--shadow-inset);
}

.card-elevated { box-shadow: var(--shadow-lg), var(--shadow-inset); }
.card-interactive {
  cursor: pointer;
}
.card-interactive:hover {
  transform: translateY(-2px);
  border-color: var(--border-medium);
  box-shadow: var(--shadow-xl), var(--shadow-inset);
}
.card-interactive:active { transform: translateY(0); }

/* ============================================
   FORM ELEMENTS
   ============================================ */
.input-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.input-group label {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.input,
.textarea,
.select {
  width: 100%;
  padding: 14px 16px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--text-primary);
  background: var(--bg-secondary);
  border: 1.5px solid var(--border-soft);
  border-radius: var(--radius-md);
  outline: none;
  transition: all var(--transition-base);
}

.input:focus,
.textarea:focus,
.select:focus {
  border-color: var(--accent-primary);
  background: var(--bg-elevated);
  box-shadow: 0 0 0 4px var(--accent-primary-soft);
}

.input::placeholder,
.textarea::placeholder {
  color: var(--text-muted);
}

.textarea {
  resize: vertical;
  min-height: 88px;
  line-height: 1.5;
}

.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 18px;
  padding-right: 44px;
}

.input-icon-wrapper {
  position: relative;
}
.input-icon-wrapper .input {
  padding-left: 46px;
}
.input-icon-wrapper .icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.1rem;
  color: var(--text-muted);
  pointer-events: none;
  transition: color var(--transition-fast);
}
.input-icon-wrapper .input:focus + .icon,
.input-icon-wrapper:focus-within .icon {
  color: var(--accent-primary);
}

/* ============================================
   BADGES
   ============================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 4px 10px;
  font-family: var(--font-heading);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-radius: var(--radius-full);
  line-height: 1;
  white-space: nowrap;
}

.badge-new {
  background: var(--accent-sky-soft);
  color: var(--accent-sky);
  border: 1px solid rgba(56, 189, 248, 0.3);
}
.badge-preparing {
  background: var(--warning-soft);
  color: var(--warning);
  border: 1px solid rgba(245, 179, 66, 0.3);
}
.badge-ready {
  background: var(--success-soft);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.badge-delivered {
  background: rgba(148, 163, 184, 0.1);
  color: var(--text-tertiary);
  border: 1px solid rgba(148, 163, 184, 0.2);
}
.badge-bestseller {
  background: var(--accent-gold-soft);
  color: var(--accent-gold);
  border: 1px solid var(--border-gold);
}
.badge-chef {
  background: linear-gradient(135deg, rgba(245, 179, 66, 0.15), rgba(251, 113, 133, 0.15));
  color: var(--accent-gold);
  border: 1px solid var(--border-gold);
}

/* ============================================
   LAYOUT UTILITIES
   ============================================ */
.container {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}
.container-wide { max-width: 960px; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }

.gap-1 { gap: var(--space-2); }
.gap-2 { gap: var(--space-4); }
.gap-3 { gap: var(--space-6); }
.gap-4 { gap: var(--space-8); }
.gap-5 { gap: var(--space-12); }

.text-center { text-align: center; }
.text-right { text-align: right; }

.mt-1 { margin-top: var(--space-2); }
.mt-2 { margin-top: var(--space-4); }
.mt-3 { margin-top: var(--space-6); }
.mt-4 { margin-top: var(--space-8); }
.mt-5 { margin-top: var(--space-12); }
.mt-6 { margin-top: var(--space-16); }

.mb-1 { margin-bottom: var(--space-2); }
.mb-2 { margin-bottom: var(--space-4); }
.mb-3 { margin-bottom: var(--space-6); }
.mb-4 { margin-bottom: var(--space-8); }
.mb-5 { margin-bottom: var(--space-12); }

/* Legacy aliases */
.gap-xs { gap: var(--space-2); }
.gap-sm { gap: var(--space-4); }
.gap-md { gap: var(--space-8); }
.gap-lg { gap: var(--space-12); }
.gap-xl { gap: var(--space-16); }
.mt-sm { margin-top: var(--space-4); }
.mt-md { margin-top: var(--space-8); }
.mt-lg { margin-top: var(--space-12); }
.mt-xl { margin-top: var(--space-16); }
.mb-sm { margin-bottom: var(--space-4); }
.mb-md { margin-bottom: var(--space-8); }
.mb-lg { margin-bottom: var(--space-12); }

/* ============================================
   ANIMATIONS (Premium easing)
   ============================================ */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-16px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(24px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-24px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInUp {
  from { opacity: 0; transform: translateY(40px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes scalePop {
  0% { transform: scale(1); }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

@keyframes bounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-4px); }
  40% { transform: translateX(4px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(3px); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

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

@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 0 0 var(--accent-primary-glow); }
  50% { box-shadow: 0 0 0 12px transparent; }
}

@keyframes radarPulse {
  0% { transform: scale(0.6); opacity: 0.8; }
  100% { transform: scale(2.2); opacity: 0; }
}

@keyframes ringPulse {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5); }
  70% { box-shadow: 0 0 0 14px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

@keyframes drift {
  0% { transform: translate(0, 0) rotate(0deg); }
  33% { transform: translate(30px, -30px) rotate(120deg); }
  66% { transform: translate(-20px, 20px) rotate(240deg); }
  100% { transform: translate(0, 0) rotate(360deg); }
}

@keyframes toastProgress {
  from { width: 100%; }
  to { width: 0%; }
}

@keyframes successPop {
  0% { transform: scale(0); opacity: 0; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes cartBump {
  0% { transform: scale(1); }
  40% { transform: scale(1.18); }
  100% { transform: scale(1); }
}

@keyframes slideUpSheet {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

@keyframes fadeInScale {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes countUp {
  from { transform: translateY(8px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.animate-fade-in { animation: fadeIn 0.4s var(--ease-out) both; }
.animate-fade-in-up { animation: fadeInUp 0.5s var(--ease-out) both; }
.animate-fade-in-down { animation: fadeInDown 0.5s var(--ease-out) both; }
.animate-scale-in { animation: scaleIn 0.35s var(--ease-spring) both; }
.animate-slide-up { animation: slideInUp 0.5s var(--ease-spring) both; }
.animate-pop { animation: scalePop 0.3s var(--ease-bounce); }
.animate-bounce { animation: bounce 0.4s var(--ease-bounce); }
.animate-float { animation: float 3s var(--ease-in-out) infinite; }
.animate-pulse { animation: pulse 2s var(--ease-in-out) infinite; }
.animate-glow { animation: ringPulse 2s var(--ease-out) infinite; }

/* Stagger children — premium cascade */
.stagger-children > * {
  opacity: 0;
  animation: fadeInUp 0.5s var(--ease-out) forwards;
}
.stagger-children > *:nth-child(1) { animation-delay: 0.04s; }
.stagger-children > *:nth-child(2) { animation-delay: 0.08s; }
.stagger-children > *:nth-child(3) { animation-delay: 0.12s; }
.stagger-children > *:nth-child(4) { animation-delay: 0.16s; }
.stagger-children > *:nth-child(5) { animation-delay: 0.2s; }
.stagger-children > *:nth-child(6) { animation-delay: 0.24s; }
.stagger-children > *:nth-child(7) { animation-delay: 0.28s; }
.stagger-children > *:nth-child(8) { animation-delay: 0.32s; }
.stagger-children > *:nth-child(9) { animation-delay: 0.36s; }
.stagger-children > *:nth-child(10) { animation-delay: 0.4s; }
.stagger-children > *:nth-child(n+11) {
  opacity: 1;
  animation: none;
}

/* ============================================
   LOADING (Spinner + Skeleton)
   ============================================ */
.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--border-soft);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.spinner-lg {
  width: 44px;
  height: 44px;
  border-width: 4px;
}

.skeleton {
  background: linear-gradient(
    90deg,
    rgba(36, 49, 81, 0.4) 0%,
    rgba(56, 75, 117, 0.6) 50%,
    rgba(36, 49, 81, 0.4) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s var(--ease-in-out) infinite;
  border-radius: var(--radius-md);
}

.skeleton-text {
  height: 14px;
  border-radius: 4px;
  margin-bottom: var(--space-2);
}
.skeleton-text-sm {
  height: 10px;
  width: 60%;
  border-radius: 3px;
}
.skeleton-card {
  height: 96px;
  border-radius: var(--radius-xl);
  margin-bottom: var(--space-3);
}

/* ============================================
   TOAST NOTIFICATIONS (Premium)
   ============================================ */
.toast-container {
  position: fixed;
  top: calc(var(--space-12) + var(--safe-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  width: calc(100% - 32px);
  max-width: 420px;
  pointer-events: none;
}

.toast {
  background: var(--bg-glass-strong);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-lg);
  animation: slideInRight 0.4s var(--ease-spring);
  pointer-events: all;
  position: relative;
  overflow: hidden;
}

.toast::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  background: var(--accent-primary);
  animation: toastProgress 3.5s linear forwards;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.toast-success { border-color: rgba(16, 185, 129, 0.3); }
.toast-success::before { background: var(--accent-primary); }
.toast-success .toast-icon { color: var(--accent-primary); }

.toast-error { border-color: rgba(251, 113, 133, 0.3); }
.toast-error::before { background: var(--accent-coral); }
.toast-error .toast-icon { color: var(--accent-coral); }

.toast-info::before { background: var(--accent-sky); }
.toast-info .toast-icon { color: var(--accent-sky); }

.toast-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 50%;
}

.toast-message {
  font-size: 0.875rem;
  color: var(--text-primary);
  font-weight: 500;
  flex: 1;
  line-height: 1.4;
}

.toast.toast-exit {
  animation: slideOutRight 0.3s var(--ease-in-out) forwards;
}

@keyframes slideOutRight {
  to { opacity: 0; transform: translateX(110%); }
}

/* ============================================
   EMPTY STATES
   ============================================ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-24) var(--space-8);
  text-align: center;
  gap: var(--space-3);
}
.empty-state .emoji {
  font-size: 3.5rem;
  filter: grayscale(20%);
  animation: float 3s var(--ease-in-out) infinite;
}
.empty-state h3 {
  color: var(--text-secondary);
  font-weight: 700;
  font-size: 1.125rem;
}
.empty-state p {
  color: var(--text-tertiary);
  font-size: 0.9rem;
  max-width: 280px;
}

/* ============================================
   SCREENS (SPA transition)
   ============================================ */
.screen {
  display: none;
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
}
.screen.active {
  display: flex;
  flex-direction: column;
  animation: fadeIn 0.4s var(--ease-out);
}

/* ============================================
   TOGGLE SWITCH
   ============================================ */
.toggle {
  position: relative;
  width: 48px;
  height: 28px;
  flex-shrink: 0;
}
.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  transition: all var(--transition-base);
  box-shadow: var(--shadow-inset);
}
.toggle-slider::before {
  content: '';
  position: absolute;
  height: 22px;
  width: 22px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: all var(--transition-base);
  box-shadow: var(--shadow-sm);
}
.toggle input:checked + .toggle-slider {
  background: var(--accent-primary);
}
.toggle input:checked + .toggle-slider::before {
  transform: translateX(20px);
}

/* ============================================
   MODAL (Premium)
   ============================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-overlay);
  backdrop-filter: blur(12px) saturate(150%);
  -webkit-backdrop-filter: blur(12px) saturate(150%);
  z-index: var(--z-modal);
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
}
.modal-overlay.active {
  display: flex;
  animation: fadeIn 0.25s var(--ease-out);
}
.modal {
  background: var(--bg-elevated);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-2xl);
  width: 100%;
  max-width: 440px;
  max-height: 90vh;
  overflow: hidden;
  animation: fadeInScale 0.35s var(--ease-spring);
  box-shadow: var(--shadow-2xl);
  display: flex;
  flex-direction: column;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}
.modal-body {
  padding: var(--space-6);
  overflow-y: auto;
  flex: 1;
}
.modal-footer {
  display: flex;
  gap: var(--space-2);
  padding: var(--space-5) var(--space-6);
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-secondary);
  flex-shrink: 0;
}

/* ============================================
   QUANTITY SELECTOR (Premium stepper)
   ============================================ */
.qty-selector {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: var(--bg-secondary);
  border: 1.5px solid var(--border-soft);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-inset);
  transition: all var(--transition-fast);
}
.qty-selector:hover {
  border-color: var(--border-medium);
}
.qty-btn {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--accent-primary);
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
}
.qty-btn:hover {
  background: var(--accent-primary-soft);
}
.qty-btn:active {
  background: var(--accent-primary-soft);
  transform: scale(0.92);
}
.qty-value {
  min-width: 32px;
  text-align: center;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
}

/* ============================================
   VEG / NON-VEG / EGG INDICATOR
   ============================================ */
.food-type-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  line-height: 1;
}
.food-type-indicator .dot {
  width: 14px;
  height: 14px;
  border: 1.5px solid currentColor;
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
}
.food-type-indicator .dot::after {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}
.food-type-indicator.veg { color: var(--accent-primary); }
.food-type-indicator.nonveg { color: var(--accent-coral); }

/* ============================================
   DIVIDER
   ============================================ */
.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-soft), transparent);
  margin: var(--space-6) 0;
  border: none;
}

/* ============================================
   OFFLINE BANNER
   ============================================ */
.offline-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: calc(var(--z-toast) + 1);
  background: linear-gradient(135deg, #F5B342, #D97706);
  color: #1F1306;
  text-align: center;
  padding: 10px var(--space-4);
  font-size: 0.85rem;
  font-weight: 600;
  transform: translateY(-100%);
  transition: transform 0.4s var(--ease-spring);
  box-shadow: var(--shadow-md);
}
.offline-banner.visible {
  transform: translateY(0);
}

/* ============================================
   CONFIRM MODAL
   ============================================ */
.confirm-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 16, 0.7);
  backdrop-filter: blur(12px);
  z-index: calc(var(--z-modal) + 10);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  animation: fadeIn 0.25s var(--ease-out);
}
.confirm-modal {
  background: var(--bg-elevated);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-2xl);
  width: 100%;
  max-width: 360px;
  padding: var(--space-8) var(--space-6);
  text-align: center;
  animation: fadeInScale 0.35s var(--ease-spring);
  box-shadow: var(--shadow-2xl);
}
.confirm-modal-emoji {
  font-size: 3rem;
  margin-bottom: var(--space-4);
  display: inline-block;
  animation: float 2s var(--ease-in-out) infinite;
}
.confirm-modal-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: var(--space-2);
  color: var(--text-primary);
}
.confirm-modal-message {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: var(--space-6);
  line-height: 1.5;
}
.confirm-modal-actions {
  display: flex;
  gap: var(--space-2);
}
.confirm-modal-actions .btn { flex: 1; }

/* ============================================
   BACK TO TOP
   ============================================ */
.back-to-top {
  position: fixed;
  bottom: 100px;
  right: 16px;
  z-index: var(--z-sticky);
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 1px solid var(--border-soft);
  color: var(--text-primary);
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transform: scale(0.7) translateY(10px);
  pointer-events: none;
  transition: all var(--transition-base);
  -webkit-tap-highlight-color: transparent;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(20px);
}
.back-to-top.visible {
  opacity: 1;
  transform: scale(1) translateY(0);
  pointer-events: all;
}
.back-to-top:hover {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  transform: translateY(-2px);
}
.back-to-top:active { transform: scale(0.95); }

/* ============================================
   BOTTOM SHEET (Premium)
   ============================================ */
.bottom-sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 16, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: var(--z-drawer);
  display: none;
  align-items: flex-end;
  justify-content: center;
  animation: fadeIn 0.3s var(--ease-out);
}
.bottom-sheet-backdrop.active {
  display: flex;
}

.bottom-sheet {
  width: 100%;
  max-width: 520px;
  max-height: 92vh;
  background: var(--bg-elevated);
  border-top-left-radius: var(--radius-3xl);
  border-top-right-radius: var(--radius-3xl);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: slideUpSheet 0.45s var(--ease-spring);
  position: relative;
  box-shadow: 0 -16px 48px rgba(0, 0, 0, 0.4);
  border-top: 1px solid var(--border-soft);
}

.bottom-sheet-handle {
  width: 40px;
  height: 4px;
  background: var(--text-muted);
  border-radius: 2px;
  margin: 10px auto 4px;
  opacity: 0.5;
}

.bottom-sheet-header {
  padding: var(--space-3) var(--space-6) var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.bottom-sheet-content {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-5) var(--space-6);
  overscroll-behavior: contain;
}

.bottom-sheet-footer {
  padding: var(--space-4) var(--space-6) calc(var(--space-4) + var(--safe-bottom));
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-secondary);
  flex-shrink: 0;
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.2);
}

/* ============================================
   CONFETTI / SUCCESS BURST
   ============================================ */
.success-burst {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: var(--z-modal);
  pointer-events: none;
  transform: translate(-50%, -50%);
}
.success-burst span {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  animation: burst 1.2s var(--ease-out) forwards;
}
@keyframes burst {
  0% { transform: translate(0, 0) scale(1); opacity: 1; }
  100% { transform: translate(var(--x, 0), var(--y, 0)) scale(0); opacity: 0; }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (min-width: 768px) {
  h1 { font-size: 2.75rem; }
  h2 { font-size: 2rem; }
  .container { max-width: 560px; }
}

@media (min-width: 1024px) {
  .container { max-width: 640px; }
}

/* ============================================
   PRINT
   ============================================ */
@media print {
  body { background: white; color: black; }
  .no-print { display: none !important; }
}

/* ============================================
   REDUCED MOTION (Accessibility)
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .stagger-children > * { opacity: 1 !important; animation: none !important; }
  html { scroll-behavior: auto; }
}

/* ============================================
   SAFE AREA (PWA)
   ============================================ */
@supports (padding: env(safe-area-inset-bottom)) {
  .safe-bottom { padding-bottom: env(safe-area-inset-bottom); }
}

/* ============================================
   FOCUS STATES
   ============================================ */
:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

button:focus:not(:focus-visible),
a:focus:not(:focus-visible),
input:focus:not(:focus-visible),
select:focus:not(:focus-visible),
textarea:focus:not(:focus-visible) {
  outline: none;
}

/* ============================================
   UTILITY ANIMATIONS
   ============================================ */
.shake { animation: shake 0.4s var(--ease-in-out); }
.fade-in { animation: fadeIn 0.4s var(--ease-out); }
.scale-in { animation: scaleIn 0.3s var(--ease-spring); }

/* Focus ring utility */
.focus-ring:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

/* Glass surface utility */
.glass {
  background: var(--bg-glass);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--border-subtle);
}
.glass-strong {
  background: var(--bg-glass-strong);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--border-soft);
}
