/* ============================================
   Foodie - Zomato-like Food Ordering App
   Mobile-first Design System
   ============================================ */

:root {
  --primary: #e23744;
  --primary-dark: #c62828;
  --primary-light: #ff6b6b;
  --primary-bg: #fff5f5;
  --secondary: #2d3436;
  --accent: #f59e0b;
  --accent-light: #fef3c7;
  --success: #10b981;
  --success-bg: #d1fae5;
  --warning: #f59e0b;
  --error: #ef4444;
  --text-primary: #1a1a2e;
  --text-secondary: #636e72;
  --text-muted: #b2bec3;
  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fa;
  --bg-tertiary: #f1f3f5;
  --border: #e9ecef;
  --border-light: #f1f3f5;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 50%;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --nav-height: 64px;
  --header-height: 120px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg-secondary);
  color: var(--text-primary);
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 0;
  height: 0;
}

/* ============================================
   Splash Screen
   ============================================ */
.splash-screen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.splash-screen.hidden {
  opacity: 0;
  transform: scale(1.1);
  pointer-events: none;
  display: none;
}

.splash-content {
  text-align: center;
  color: white;
  animation: splashFadeIn 0.6s ease;
}

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

.splash-logo {
  width: 80px;
  height: 80px;
  margin-bottom: 16px;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.2));
}

.splash-title {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 4px;
}

.splash-subtitle {
  font-size: 0.95rem;
  opacity: 0.85;
  margin-bottom: 32px;
}

.splash-loader {
  width: 160px;
  height: 3px;
  background: rgba(255,255,255,0.3);
  border-radius: 3px;
  margin: 0 auto;
  overflow: hidden;
}

.splash-loader-bar {
  height: 100%;
  width: 0;
  background: white;
  border-radius: 3px;
  animation: splashLoad 1.8s ease-in-out forwards;
}

@keyframes splashLoad {
  0% { width: 0; }
  50% { width: 60%; }
  100% { width: 100%; }
}

/* ============================================
   Auth Screen
   ============================================ */
.auth-screen {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(135deg, var(--primary) 0%, #ff6b6b 100%);
}

.auth-container {
  background: white;
  border-radius: var(--radius-xl);
  padding: 32px 24px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.4s ease;
}

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

.auth-header {
  text-align: center;
  margin-bottom: 24px;
}

.auth-logo {
  width: 56px;
  height: 56px;
  margin-bottom: 12px;
}

.auth-header h1 {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
}

.auth-header p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 4px;
}

.auth-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 24px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  padding: 3px;
}

.auth-tab {
  flex: 1;
  padding: 10px;
  border: none;
  background: transparent;
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.auth-tab.active {
  background: white;
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.auth-form {
  display: none;
}

.auth-form.active {
  display: block;
}

.input-group {
  margin-bottom: 16px;
}

.input-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.input-group input {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.95rem;
  transition: border-color 0.2s;
  background: var(--bg-secondary);
}

.input-group input:focus {
  outline: none;
  border-color: var(--primary);
  background: white;
}

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

.auth-alt {
  text-align: center;
  margin-top: 16px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.auth-alt a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}

/* ============================================
   Buttons
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  white-space: nowrap;
}

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

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 2px solid var(--border);
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-full {
  width: 100%;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.85rem;
}

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--radius-full);
  background: var(--bg-secondary);
  color: var(--text-secondary);
}

/* ============================================
   App Layout
   ============================================ */
.screen {
  display: none;
}

.screen.active {
  display: block;
}

.screen.hidden {
  display: none;
}

#main-app {
  min-height: 100vh;
  min-height: 100dvh;
  padding-bottom: calc(var(--nav-height) + var(--safe-bottom));
  background: var(--bg-secondary);
}

/* ============================================
   App Header
   ============================================ */
.app-header {
  background: white;
  padding: 12px 16px 8px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 0 var(--border);
}

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

.header-location {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  flex: 1;
  min-width: 0;
}

.location-text {
  flex: 1;
  min-width: 0;
}

.location-label {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.location-value {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-profile-btn {
  width: 40px;
  height: 40px;
  border: none;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  border: 2px solid transparent;
  transition: border-color 0.2s;
}

.search-bar:focus-within {
  border-color: var(--primary);
  background: white;
}

.search-bar svg {
  color: var(--text-muted);
  flex-shrink: 0;
}

.search-bar input {
  flex: 1;
  border: none;
  background: transparent;
  font-family: var(--font);
  font-size: 0.9rem;
  color: var(--text-primary);
  outline: none;
}

.search-bar input::placeholder {
  color: var(--text-muted);
}

/* ============================================
   Quick Filters
   ============================================ */
.quick-filters {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.filter-chip {
  flex-shrink: 0;
  padding: 8px 18px;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  background: white;
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.filter-chip.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.filter-chip:active {
  transform: scale(0.95);
}

/* ============================================
   Banner Carousel
   ============================================ */
.banner-carousel {
  padding: 0 16px;
  margin-bottom: 8px;
  position: relative;
  overflow: hidden;
}

.banner-track {
  display: flex;
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.banner-slide {
  min-width: 100%;
  padding: 24px;
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
  min-height: 140px;
  display: flex;
  align-items: center;
}

.banner-content {
  position: relative;
  z-index: 1;
  color: white;
}

.banner-content h3 {
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 4px;
  letter-spacing: -0.5px;
}

.banner-content p {
  font-size: 0.9rem;
  opacity: 0.9;
  margin-bottom: 8px;
}

.banner-code {
  display: inline-block;
  padding: 4px 12px;
  background: rgba(255,255,255,0.2);
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  backdrop-filter: blur(4px);
}

.banner-icon {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 100px;
  height: 100px;
  opacity: 0.6;
}

.banner-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 10px;
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 3px;
  background: var(--border);
  transition: all 0.3s;
  cursor: pointer;
}

.dot.active {
  width: 20px;
  background: var(--primary);
}

/* ============================================
   Sections
   ============================================ */
.section {
  padding: 16px;
}

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

.section-header h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.section-link {
  background: none;
  border: none;
  color: var(--primary);
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

/* ============================================
   Categories
   ============================================ */
.categories-scroll {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 4px;
}

.category-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.2s;
}

.category-item:active {
  transform: scale(0.92);
}

.category-icon {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
}

.category-icon svg {
  width: 32px;
  height: 32px;
}

.category-item span {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
}

/* ============================================
   Restaurant Grid
   ============================================ */
.restaurant-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.restaurant-card {
  background: white;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.restaurant-card:active {
  transform: scale(0.98);
}

.restaurant-card-img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  display: block;
  background: var(--bg-tertiary);
}

.restaurant-card-img-placeholder {
  width: 100%;
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  font-weight: 800;
  color: white;
}

.restaurant-card-body {
  padding: 12px 14px;
}

.restaurant-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 4px;
}

.restaurant-card-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  flex: 1;
  margin-right: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.restaurant-card-rating {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  background: var(--success);
  color: white;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
}

.restaurant-card-rating svg {
  width: 12px;
  height: 12px;
}

.restaurant-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.restaurant-card-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.restaurant-card-cuisines {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.restaurant-card-offer {
  margin-top: 8px;
  padding: 6px 10px;
  background: var(--accent-light);
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #92400e;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ============================================
   Dishes Scroll
   ============================================ */
.dishes-scroll {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 4px;
}

.dish-card {
  min-width: 160px;
  background: white;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.dish-card-img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  display: block;
  background: var(--bg-tertiary);
}

.dish-card-body {
  padding: 10px 12px;
}

.dish-card-name {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dish-card-restaurant {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dish-card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dish-card-price {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--primary);
}

.dish-card-add {
  width: 32px;
  height: 32px;
  border: none;
  background: var(--primary);
  color: white;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.2rem;
  font-weight: 600;
  transition: transform 0.2s;
}

.dish-card-add:active {
  transform: scale(0.9);
}

/* ============================================
   Restaurant Panel (Bottom Sheet)
   ============================================ */
.restaurant-panel {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  pointer-events: none;
}

.restaurant-panel.active {
  pointer-events: auto;
}

.panel-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
  opacity: 0;
  transition: opacity 0.3s;
}

.restaurant-panel.active .panel-backdrop {
  opacity: 1;
}

.panel-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  max-height: 85vh;
  background: white;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.restaurant-panel.active .panel-content {
  transform: translateY(0);
}

.panel-handle {
  width: 36px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: 8px auto;
  flex-shrink: 0;
}

.panel-header {
  display: flex;
  justify-content: flex-end;
  padding: 0 12px 8px;
  flex-shrink: 0;
}

.panel-close {
  width: 36px;
  height: 36px;
  border: none;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
}

.panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 0 16px 24px;
  -webkit-overflow-scrolling: touch;
}

/* Restaurant Detail */
.restaurant-detail-header {
  text-align: center;
  margin-bottom: 20px;
}

.restaurant-detail-name {
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.restaurant-detail-meta {
  display: flex;
  justify-content: center;
  gap: 16px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.restaurant-detail-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.restaurant-detail-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.restaurant-detail-offer {
  padding: 10px 14px;
  background: var(--accent-light);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  color: #92400e;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
}

/* Menu Section */
.menu-section {
  margin-bottom: 20px;
}

.menu-section-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border-light);
}

.menu-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-light);
}

.menu-item:last-child {
  border-bottom: none;
}

.menu-item-info {
  flex: 1;
  min-width: 0;
}

.menu-item-name {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 2px;
}

.menu-item-price {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 4px;
}

.menu-item-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.menu-item-img {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg-tertiary);
}

.menu-item-add {
  width: 36px;
  height: 36px;
  border: none;
  background: var(--primary);
  color: white;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  font-weight: 600;
  flex-shrink: 0;
  transition: transform 0.2s;
}

.menu-item-add:active {
  transform: scale(0.9);
}

.menu-item-qty {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.menu-item-qty button {
  width: 30px;
  height: 30px;
  border: 2px solid var(--primary);
  background: white;
  color: var(--primary);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 700;
}

.menu-item-qty span {
  font-size: 0.95rem;
  font-weight: 700;
  min-width: 20px;
  text-align: center;
}

/* ============================================
   Cart Bar
   ============================================ */
.cart-bar {
  position: fixed;
  bottom: calc(var(--nav-height) + var(--safe-bottom));
  left: 0;
  right: 0;
  background: var(--secondary);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 150;
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

.cart-bar.visible {
  transform: translateY(0);
}

.cart-bar-info {
  color: white;
}

.cart-bar-count {
  display: block;
  font-size: 0.8rem;
  opacity: 0.8;
}

.cart-bar-total {
  display: block;
  font-size: 1.1rem;
  font-weight: 700;
}

.cart-bar .btn {
  background: white;
  color: var(--secondary);
  font-weight: 700;
}

/* ============================================
   Cart View
   ============================================ */
.cart-content {
  padding: 16px;
}

.cart-empty {
  text-align: center;
  padding: 60px 20px;
}

.cart-empty svg {
  margin-bottom: 16px;
}

.cart-empty h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.cart-empty p {
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.cart-restaurant {
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.cart-restaurant-name {
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}

.cart-items {
  margin-bottom: 16px;
}

.cart-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
}

.cart-item-info {
  flex: 1;
  min-width: 0;
}

.cart-item-name {
  font-size: 0.9rem;
  font-weight: 600;
}

.cart-item-price {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.cart-item-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cart-item-controls button {
  width: 28px;
  height: 28px;
  border: 2px solid var(--primary);
  background: white;
  color: var(--primary);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 700;
}

.cart-item-controls span {
  font-size: 0.9rem;
  font-weight: 700;
  min-width: 20px;
  text-align: center;
}

.cart-item-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
}

.cart-summary {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 16px;
}

.cart-summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  padding: 6px 0;
  color: var(--text-secondary);
}

.cart-summary-row.total {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  border-top: 1px solid var(--border);
  padding-top: 10px;
  margin-top: 6px;
}

.cart-checkout-btn {
  width: 100%;
  padding: 14px;
  font-size: 1rem;
}

/* ============================================
   Orders View
   ============================================ */
.orders-content {
  padding: 16px;
}

.orders-empty {
  text-align: center;
  padding: 60px 20px;
}

.orders-empty svg {
  margin-bottom: 16px;
}

.orders-empty h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.orders-empty p {
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.order-card {
  background: white;
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}

.order-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.order-card-restaurant {
  font-size: 1rem;
  font-weight: 700;
}

.order-card-status {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
}

.order-card-status.delivered {
  background: var(--success-bg);
  color: #065f46;
}

.order-card-status.preparing {
  background: var(--accent-light);
  color: #92400e;
}

.order-card-status.on-the-way {
  background: #dbeafe;
  color: #1e40af;
}

.order-card-items {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.order-card-total {
  font-size: 0.9rem;
  font-weight: 700;
}

.order-card-date {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ============================================
   Search View
   ============================================ */
.search-results {
  padding: 16px;
}

.search-empty {
  text-align: center;
  padding: 60px 20px;
}

.search-empty p {
  color: var(--text-secondary);
  margin-top: 12px;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
}

.search-result-item:active {
  opacity: 0.7;
}

.search-result-img {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg-tertiary);
}

.search-result-info {
  flex: 1;
  min-width: 0;
}

.search-result-name {
  font-size: 0.9rem;
  font-weight: 600;
}

.search-result-type {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ============================================
   Profile View
   ============================================ */
.profile-content {
  padding: 16px;
}

.profile-card {
  text-align: center;
  padding: 24px;
  background: white;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.profile-avatar {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-full);
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
}

.profile-avatar span {
  font-size: 1.5rem;
  font-weight: 700;
  color: white;
}

.profile-card h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 2px;
}

.profile-card p {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.profile-stats {
  display: flex;
  gap: 0;
  background: white;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.stat-item {
  flex: 1;
  text-align: center;
  padding: 16px 8px;
  border-right: 1px solid var(--border-light);
}

.stat-item:last-child {
  border-right: none;
}

.stat-value {
  display: block;
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--primary);
}

.stat-label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.profile-menu {
  background: white;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.profile-menu-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: none;
  background: none;
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  border-bottom: 1px solid var(--border-light);
  text-align: left;
}

.profile-menu-item:last-child {
  border-bottom: none;
}

.profile-menu-item svg:last-child {
  margin-left: auto;
  color: var(--text-muted);
}

.logout-btn {
  margin-top: 8px;
  color: var(--error) !important;
  border-color: var(--error) !important;
}

.logout-btn:hover {
  background: #fef2f2;
}

/* ============================================
   Bottom Navigation
   ============================================ */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(var(--nav-height) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: white;
  display: flex;
  align-items: center;
  justify-content: space-around;
  border-top: 1px solid var(--border);
  z-index: 300;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 12px;
  border: none;
  background: none;
  cursor: pointer;
  position: relative;
  transition: color 0.2s;
  min-width: 56px;
}

.nav-item svg {
  color: var(--text-muted);
  transition: color 0.2s;
}

.nav-item span {
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.2s;
}

.nav-item.active svg {
  color: var(--primary);
}

.nav-item.active span {
  color: var(--primary);
  font-weight: 600;
}

.nav-badge {
  position: absolute;
  top: 0;
  right: 6px;
  min-width: 18px;
  height: 18px;
  background: var(--primary);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}

.nav-badge.hidden {
  display: none;
}

/* ============================================
   Toast Notification
   ============================================ */
.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  background: var(--secondary);
  color: white;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  z-index: 500;
  box-shadow: var(--shadow-lg);
  transition: transform 0.3s ease;
  max-width: 90vw;
  text-align: center;
}

.toast.visible {
  transform: translateX(-50%) translateY(0);
}

/* ============================================
   Order Success Modal
   ============================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  padding: 24px;
}

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

.modal-box {
  background: white;
  border-radius: var(--radius-xl);
  padding: 32px 24px;
  text-align: center;
  max-width: 340px;
  width: 100%;
  transform: scale(0.9);
  transition: transform 0.3s;
}

.modal-overlay.active .modal-box {
  transform: scale(1);
}

.modal-icon {
  width: 64px;
  height: 64px;
  background: var(--success-bg);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.modal-icon svg {
  width: 32px;
  height: 32px;
  color: var(--success);
}

.modal-box h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.modal-box p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

/* ============================================
   Animations
   ============================================ */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

.view {
  display: none;
  animation: fadeIn 0.3s ease;
}

.view.active {
  display: block;
}

/* ============================================
   Order Card Meta
   ============================================ */
.order-card-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.order-card-payment {
  display: flex;
  align-items: center;
  gap: 4px;
}

.order-card-note {
  margin-top: 6px;
  padding: 6px 10px;
  background: var(--bg-tertiary);
  border-radius: 6px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-style: italic;
}

/* ============================================
   Location Picker
   ============================================ */
.location-modal {
  max-width: 420px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 0;
  border-radius: var(--radius-xl);
  text-align: left;
}

.modal-handle {
  width: 36px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: 10px auto;
}

.location-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px 12px;
  border-bottom: 1px solid var(--border-light);
}

.location-modal-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
}

.location-close-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
}

.location-search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 20px;
  padding: 10px 14px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  transition: border-color 0.2s;
}

.location-search-box:focus-within {
  border-color: var(--primary);
  background: white;
}

.location-search-box svg {
  color: var(--text-muted);
  flex-shrink: 0;
}

.location-search-box input {
  flex: 1;
  border: none;
  background: transparent;
  font-family: var(--font);
  font-size: 0.9rem;
  color: var(--text-primary);
  outline: none;
}

.location-search-box input::placeholder {
  color: var(--text-muted);
}

.location-suggestions {
  margin: 0 20px 10px;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.location-suggestion {
  padding: 12px 14px;
  font-size: 0.9rem;
  cursor: pointer;
  border-bottom: 1px solid var(--border-light);
  transition: background 0.15s;
}

.location-suggestion:last-child {
  border-bottom: none;
}

.location-suggestion:hover {
  background: var(--bg-secondary);
}

.location-suggestion:active {
  background: var(--bg-tertiary);
}

/* Map Container */
.map-container {
  margin: 0 20px 14px;
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
  border: 1px solid var(--border);
}

.map-placeholder {
  height: 180px;
  background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 50%, #a5d6a7 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: relative;
  overflow: hidden;
}

.map-placeholder p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
  z-index: 1;
}

.map-placeholder svg {
  z-index: 1;
}

.map-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.1) 1px, transparent 1px);
  background-size: 30px 30px;
}

.map-current-location {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  background: white;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
  transition: background 0.15s;
}

.map-current-location:active {
  background: var(--bg-secondary);
}

/* Saved Addresses */
.location-saved {
  padding: 0 20px;
  margin-bottom: 14px;
}

.location-saved h4 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.saved-addresses-list {
  margin-bottom: 10px;
}

.saved-address-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s;
  border: 2px solid transparent;
  margin-bottom: 6px;
}

.saved-address-item.active {
  background: var(--primary-bg);
  border-color: var(--primary);
}

.saved-address-item:active {
  background: var(--bg-tertiary);
}

.addr-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.addr-icon.home {
  background: var(--primary-bg);
  color: var(--primary);
}

.addr-icon.work {
  background: #e8f5e9;
  color: var(--success);
}

.addr-icon.other {
  background: var(--accent-light);
  color: var(--accent);
}

.addr-info {
  flex: 1;
  min-width: 0;
}

.addr-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
}

.addr-address {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.addr-check {
  color: var(--primary);
  flex-shrink: 0;
}

.addr-check.hidden {
  display: none;
}

.add-address-btn {
  margin-top: 4px;
}

.location-modal .btn-full {
  margin: 0 20px 20px;
  width: calc(100% - 40px);
}

/* ============================================
   Checkout Page
   ============================================ */
.checkout-page {
  background: var(--bg-secondary);
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  max-width: 100%;
  animation: slideUp 0.3s ease;
}

.checkout-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: white;
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--border);
}

.checkout-back {
  width: 36px;
  height: 36px;
  border: none;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.checkout-header h2 {
  font-size: 1.1rem;
  font-weight: 700;
}

.checkout-body {
  padding: 12px 16px 120px;
}

.checkout-section {
  background: white;
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}

.checkout-section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-light);
}

.checkout-section-header svg {
  color: var(--primary);
  flex-shrink: 0;
}

/* Checkout Address */
.checkout-address-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.2s;
}

.checkout-address-card:active {
  border-color: var(--primary);
}

.addr-details {
  flex: 1;
  min-width: 0;
}

/* Payment Options */
.payment-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.payment-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.payment-option.active {
  border-color: var(--primary);
  background: var(--primary-bg);
}

.payment-option:active {
  transform: scale(0.99);
}

.pm-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.payment-option span {
  flex: 1;
  font-size: 0.9rem;
  font-weight: 500;
}

.pm-check {
  color: var(--primary);
  flex-shrink: 0;
}

.pm-check.hidden {
  display: none;
}

/* Delivery Note */
.delivery-note-input {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.9rem;
  color: var(--text-primary);
  resize: none;
  transition: border-color 0.2s;
  background: var(--bg-secondary);
}

.delivery-note-input:focus {
  outline: none;
  border-color: var(--primary);
  background: white;
}

.delivery-note-input::placeholder {
  color: var(--text-muted);
}

/* Checkout Items */
.checkout-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.checkout-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
}

.checkout-item-qty {
  color: var(--primary);
  font-weight: 600;
  min-width: 24px;
}

.checkout-item-name {
  flex: 1;
  color: var(--text-primary);
}

.checkout-item-price {
  font-weight: 600;
  color: var(--text-primary);
}

/* Checkout Price */
.checkout-price-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  padding: 6px 0;
  color: var(--text-secondary);
}

.checkout-price-total {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  border-top: 1px solid var(--border);
  padding-top: 10px;
  margin-top: 6px;
}

/* Checkout Footer */
.checkout-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  padding: 12px 16px;
  padding-bottom: calc(12px + var(--safe-bottom));
  display: flex;
  align-items: center;
  gap: 12px;
  border-top: 1px solid var(--border);
  box-shadow: 0 -2px 10px rgba(0,0,0,0.08);
  z-index: 20;
}

.checkout-footer-info {
  flex: 1;
  min-width: 0;
}

.checkout-footer-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.checkout-footer-price {
  display: block;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.place-order-btn {
  padding: 14px 28px;
  font-size: 1rem;
  flex-shrink: 0;
}

/* ============================================
   Responsive - Tablet & Desktop
   ============================================ */
@media (min-width: 768px) {
  .restaurant-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .banner-slide {
    min-height: 180px;
  }

  .banner-content h3 {
    font-size: 1.8rem;
  }
}

@media (min-width: 1024px) {
  .restaurant-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  #main-app {
    max-width: 480px;
    margin: 0 auto;
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    min-height: 100vh;
  }

  .bottom-nav {
    max-width: 480px;
    left: 50%;
    transform: translateX(-50%);
  }

  .cart-bar {
    max-width: 480px;
    left: 50%;
    transform: translateX(-50%) translateY(100%);
  }

  .cart-bar.visible {
    transform: translateX(-50%) translateY(0);
  }

  .panel-content {
    max-width: 480px;
    left: 50%;
    transform: translateX(-50%) translateY(100%);
  }

  .restaurant-panel.active .panel-content {
    transform: translateX(-50%) translateY(0);
  }

  .checkout-page {
    max-width: 480px;
    margin: 0 auto;
  }
}
