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

:root {
  --primary: #ff4214;
  --primary-dark: #e03200;
  --ink: #1a1d29;
  --muted: #6b7280;
  --border: #e5e7eb;
  --bg: #f7f8fa;
  --card: #ffffff;
  --success: #16a34a;
  --warning: #d97706;
  --danger: #dc2626;
  --radius: 14px;
}

body {
  margin: 0;
  font-family: 'Inter', Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
}

a { color: var(--primary); text-decoration: none; }

.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

/* ── Top bar ───────────────────────────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.logo { font-size: 1.4rem; font-weight: 900; letter-spacing: -0.03em; color: var(--ink); }
.logo span { color: var(--primary); }
.topbar-actions { display: flex; gap: 10px; align-items: center; }

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  border-radius: 10px;
  padding: 10px 18px;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: transform 0.1s ease, opacity 0.15s ease;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--ink); }
.btn-outline:hover { background: #f3f4f6; }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Cards ─────────────────────────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}

/* ── Forms ─────────────────────────────────────────────────── */
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 0.82rem; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.95rem;
  font-family: inherit;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { outline: 2px solid var(--primary); outline-offset: 1px; }

/* ── Badges ────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: capitalize;
}
.badge-pending   { background: #fef3c7; color: var(--warning); }
.badge-accepted, .badge-preparing { background: #dbeafe; color: #2563eb; }
.badge-ready     { background: #ede9fe; color: #7c3aed; }
.badge-picked_up { background: #cffafe; color: #0891b2; }
.badge-delivered { background: #dcfce7; color: var(--success); }
.badge-cancelled { background: #fee2e2; color: var(--danger); }

/* ── Auth screen ───────────────────────────────────────────── */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  background: #fff;
}
.auth-card {
  background: transparent;
  border-radius: 0;
  padding: 52px 28px 48px;
  width: 100%;
  max-width: 420px;
  box-shadow: none;
}
.auth-card h1 { font-size: 1.6rem; font-weight: 900; margin: 0 0 4px; }
.auth-card p.sub { color: var(--muted); margin: 0 0 20px; font-size: 0.9rem; }
.role-tabs { display: flex; gap: 8px; margin-bottom: 20px; }
.role-tab {
  flex: 1;
  text-align: center;
  padding: 10px 6px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  color: var(--muted);
}
.role-tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.auth-toggle { text-align: center; font-size: 0.85rem; color: var(--muted); margin-top: 14px; }
.auth-toggle span { color: var(--primary); font-weight: 700; cursor: pointer; }
.error-msg { color: var(--danger); font-size: 0.85rem; margin-top: 8px; }
.success-msg { color: var(--success); font-size: 0.85rem; margin-top: 8px; }

/* ── Restaurant grid ───────────────────────────────────────── */
.restaurant-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  padding: 20px 0;
}
.restaurant-card { cursor: pointer; }
.restaurant-card .logo-box {
  height: 120px;
  border-radius: 10px;
  background: linear-gradient(135deg, #ffd9cc, #ffb199);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin-bottom: 12px;
}
.restaurant-card h3 { margin: 0 0 4px; font-size: 1.05rem; }
.restaurant-card p { margin: 0; color: var(--muted); font-size: 0.85rem; }
.restaurant-card.closed { opacity: 0.55; }

/* ── Menu item rows ────────────────────────────────────────── */
.menu-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.menu-item-row:last-child { border-bottom: none; }
.menu-item-info h4 { margin: 0 0 4px; font-size: 0.98rem; }
.menu-item-info p { margin: 0 0 6px; color: var(--muted); font-size: 0.82rem; max-width: 360px; }
.menu-item-info .price { font-weight: 700; }

/* ── Cart (bottom sheet) ──────────────────────────────────── */
.sheet-backdrop {
  position: fixed; inset: 0; background: rgba(15,17,23,0.45); z-index: 49;
}
.cart-panel {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--shell-width);
  background: var(--card);
  box-shadow: 0 -8px 32px rgba(0,0,0,0.18);
  border-radius: 20px 20px 0 0;
  z-index: 50;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}
.sheet-handle { width: 40px; height: 4px; background: var(--border); border-radius: 100px; margin: 10px auto 0; }
.cart-header { display: flex; justify-content: space-between; align-items: center; padding: 12px 18px; border-bottom: 1px solid var(--border); }
.cart-body { max-height: 50vh; overflow-y: auto; padding: 12px 18px; }
.cart-footer { padding: 16px 18px; border-top: 1px solid var(--border); }
.cart-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; font-size: 0.9rem; }
.qty-controls { display: flex; align-items: center; gap: 8px; }
.qty-controls button {
  width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--border);
  background: #fff; cursor: pointer; font-weight: 700; line-height: 1;
}

/* ── Order status / tracking ──────────────────────────────── */
.status-track { display: flex; flex-wrap: wrap; gap: 6px 4px; margin: 20px 0; }
.status-step {
  flex: 1 1 auto; min-width: 56px; text-align: center; font-size: 0.68rem;
  color: var(--muted); position: relative; line-height: 1.3;
}
.status-step.active { color: var(--primary); font-weight: 700; }
#tracking-map { height: 320px; border-radius: var(--radius); margin-top: 16px; }

/* ── Misc ──────────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 60px 20px; color: var(--muted); }
.muted { color: var(--muted); }
.row { display: flex; align-items: center; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; }
.mt-16 { margin-top: 16px; }
.section-title { font-size: 1.2rem; font-weight: 800; margin: 24px 0 12px; }

/* ── App shell (mobile-app feel) ──────────────────────────── */
:root { --shell-width: 480px; }
.app-shell {
  max-width: var(--shell-width);
  margin: 0 auto;
  min-height: 100vh;
  background: var(--card);
  box-shadow: 0 0 60px rgba(0,0,0,0.06);
  padding-bottom: 90px;
  position: relative;
}

.home-header { padding: 18px 20px 0; }
.location-row { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 14px; }
.location-label { font-size: 0.72rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.location-value { font-size: 0.95rem; font-weight: 700; margin-top: 2px; display: flex; align-items: center; gap: 6px; }
.location-value .icon { color: var(--primary); flex-shrink: 0; }
.chevron { color: var(--muted); }
.header-icons { display: flex; gap: 8px; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--border);
  background: #fff; display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--ink); padding: 0;
}
.icon-btn:hover { background: #f3f4f6; }
.icon { display: inline-block; vertical-align: middle; flex-shrink: 0; }

.search-bar {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg); border: 1px solid var(--border); border-radius: 12px;
  padding: 10px 14px; margin-bottom: 14px; color: var(--muted);
}
.search-bar input { flex: 1; border: none; background: none; outline: none; font-size: 0.9rem; font-family: inherit; color: var(--ink); }

.chip-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 14px; scrollbar-width: none; }
.chip-row::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0; padding: 8px 14px; border-radius: 100px; border: 1px solid var(--border);
  background: #fff; font-size: 0.82rem; font-weight: 600; cursor: pointer; white-space: nowrap; color: var(--ink);
}
.chip.active { background: var(--ink); border-color: var(--ink); color: #fff; }

.promo-banner {
  margin: 0 20px 20px;
  background: linear-gradient(120deg, #fff1ec, #ffe0d6);
  border-radius: 16px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.promo-banner strong { font-size: 0.95rem; }
.promo-banner p { margin: 2px 0 0; font-size: 0.8rem; color: var(--muted); }
.promo-icon { color: var(--primary); flex-shrink: 0; }

#view-restaurants .section-title { margin: 0 20px 12px; }

/* ── Restaurant list (vertical, photo-led cards) ──────────── */
.restaurant-list { display: flex; flex-direction: column; gap: 16px; padding: 0 20px 20px; }
.restaurant-card { cursor: pointer; border-radius: 16px; overflow: hidden; border: 1px solid var(--border); background: #fff; }
.restaurant-card.closed { opacity: 0.55; cursor: default; }
.restaurant-hero {
  position: relative;
  height: 140px;
  background: linear-gradient(135deg, #ffd9cc, #ffb199);
  display: flex; align-items: center; justify-content: center;
}
.restaurant-hero-icon { color: rgba(255,255,255,0.85); }
.hero-badge {
  position: absolute; font-size: 0.72rem; font-weight: 700; padding: 4px 9px;
  border-radius: 100px; background: rgba(255,255,255,0.92); color: var(--ink);
  display: flex; align-items: center; gap: 4px;
}
.hero-badge-rating { top: 10px; left: 10px; }
.hero-badge-rating .icon { color: var(--warning); }
.hero-badge-time { bottom: 10px; right: 10px; }
.restaurant-meta { padding: 12px 14px; }
.restaurant-meta h3 { margin: 0 0 4px; font-size: 1rem; }
.restaurant-meta p { margin: 0; color: var(--muted); font-size: 0.82rem; }

/* ── Sticky sub-header (menu / orders views) ──────────────── */
.sticky-subheader {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 20px; position: sticky; top: 0; background: var(--card); z-index: 5;
  border-bottom: 1px solid var(--border);
}
.sticky-subheader h2 { margin: 0; font-size: 1.1rem; font-weight: 800; }

/* ── Sticky mini cart bar ──────────────────────────────────── */
.cart-bar {
  position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%);
  width: calc(100% - 40px); max-width: calc(var(--shell-width) - 40px);
  background: var(--ink); color: #fff; border-radius: 14px;
  padding: 14px 18px; display: flex; align-items: center; justify-content: space-between;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25); z-index: 40; font-size: 0.88rem; font-weight: 600;
}
.cart-bar .btn-primary { background: var(--primary); }

/* ── Driver header (status + online switch) ───────────────── */
.driver-header { padding: 18px 20px; border-bottom: 1px solid var(--border); }
.status-row { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 14px; }
.status-dot-row { display: flex; align-items: center; gap: 8px; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); flex-shrink: 0; }
.status-dot.online { background: var(--success); box-shadow: 0 0 0 3px rgba(22,163,74,0.18); }

.switch-row { display: flex; align-items: center; justify-content: space-between; font-size: 0.88rem; font-weight: 600; }
.switch { position: relative; display: inline-block; width: 46px; height: 26px; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch-track {
  position: absolute; inset: 0; background: var(--border); border-radius: 100px;
  transition: background 0.15s ease; cursor: pointer; display: block;
}
.switch-thumb {
  position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.25); transition: transform 0.15s ease;
}
.switch input:checked + .switch-track { background: var(--success); }
.switch input:checked + .switch-track .switch-thumb { transform: translateX(20px); }

/* ── Delivery cards (driver pool / active order) ──────────── */
.delivery-list { display: flex; flex-direction: column; gap: 16px; padding: 0 20px 20px; }
.delivery-card { border: 1px solid var(--border); border-radius: 16px; padding: 16px; background: #fff; }
.delivery-card-top { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.delivery-icon {
  width: 36px; height: 36px; border-radius: 10px; background: var(--bg);
  display: flex; align-items: center; justify-content: center; color: var(--primary); flex-shrink: 0;
}
.delivery-card-info { flex: 1; }
.delivery-card-info strong { font-size: 0.95rem; }
.fee-badge { font-size: 0.85rem; font-weight: 700; color: var(--ink); }

.route-line { margin-bottom: 16px; }
.route-row { display: flex; align-items: flex-start; gap: 10px; font-size: 0.85rem; color: var(--ink); padding: 2px 0; }
.route-dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 4px; flex-shrink: 0; }
.route-dot.pickup { background: var(--primary); }
.route-dot.dropoff { background: var(--ink); }
.route-connector { width: 1px; height: 14px; background: var(--border); margin-left: 4px; }

.order-items { margin: 0 0 14px; padding: 0; list-style: none; font-size: 0.85rem; color: var(--ink); }
.order-items li { padding: 2px 0; }

/* ── Small switch variant (menu availability) ─────────────── */
.switch.sm { width: 36px; height: 20px; flex-shrink: 0; }
.switch.sm .switch-thumb { width: 14px; height: 14px; top: 3px; left: 3px; }
.switch.sm input:checked + .switch-track .switch-thumb { transform: translateX(16px); }

/* ── Menu management cards (restaurant dashboard) ─────────── */
.menu-card { border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; margin-bottom: 12px; background: #fff; }
.menu-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.menu-card-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 10px; }
.icon-btn.sm { width: 30px; height: 30px; }

/* ── Phone auth ─────────────────────────────────────────────── */
.auth-logo { font-size: 2rem; font-weight: 900; margin: 0 0 8px; letter-spacing: -0.04em; }
.auth-tagline { color: var(--muted); font-size: 0.9rem; margin: 0 0 32px; line-height: 1.5; }
.auth-back-btn { background: none; border: none; cursor: pointer; padding: 0; color: var(--primary); display: flex; align-items: center; }

.phone-field {
  display: flex; align-items: center;
  border: 1.5px solid var(--border); border-radius: 12px; overflow: hidden; margin-bottom: 14px;
}
.phone-prefix {
  display: flex; align-items: center; gap: 8px; padding: 0 14px;
  border-right: 1.5px solid var(--border); height: 52px; font-weight: 600; flex-shrink: 0; background: #fafafa;
}
.flag-emoji { font-size: 1.3rem; line-height: 1; }
.dial-code { font-size: 0.95rem; color: var(--ink); }
.phone-field input {
  flex: 1; border: none; outline: none; padding: 0 14px;
  font-size: 1.05rem; font-family: inherit; height: 52px; color: var(--ink); background: transparent;
}

.otp-row { display: flex; gap: 8px; justify-content: center; }
.otp-box {
  width: 46px; height: 56px; text-align: center; font-size: 1.5rem; font-weight: 700;
  border: 1.5px solid var(--border); border-radius: 12px; outline: none; font-family: inherit; color: var(--ink);
  transition: border-color 0.15s;
}
.otp-box:focus { border-color: var(--primary); }

/* ── Profile completion ─────────────────────────────────────── */
.profile-setup-wrap { padding: 24px 20px 32px; }
.avatar-upload { position: relative; width: 96px; height: 96px; margin: 0 auto; }
.avatar-circle {
  width: 96px; height: 96px; border-radius: 50%;
  background: linear-gradient(160deg, #ffd9cc 40%, #e8956d);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.avatar-circle img { width: 100%; height: 100%; object-fit: cover; }
.avatar-circle svg { color: rgba(255,255,255,0.85); }
.avatar-edit-btn {
  position: absolute; bottom: 2px; right: 2px;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--primary); border: 2.5px solid #fff; color: #fff;
  display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0;
}

/* ── Address setup ──────────────────────────────────────────── */
.addr-map-wrap { position: relative; height: 240px; }
#addr-map { height: 100%; }
.addr-center-pin {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -100%) translateY(4px);
  z-index: 1000; pointer-events: none;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.35));
}
.addr-detail-section { padding: 20px 20px 32px; }
.addr-street-line { font-size: 1.15rem; font-weight: 800; margin: 0 0 2px; }
.addr-city-line { color: var(--muted); font-size: 0.88rem; margin: 0 0 20px; }

.addr-type-row { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; margin-bottom: 20px; }
.addr-type-row::-webkit-scrollbar { display: none; }
.addr-type-item { flex-shrink: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer; min-width: 62px; }
.addr-type-icon {
  width: 58px; height: 58px; border-radius: 14px; border: 1.5px solid var(--border);
  display: flex; align-items: center; justify-content: center; color: var(--muted);
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.addr-type-item.active .addr-type-icon { border-color: var(--primary); color: var(--primary); background: #fff5f3; }
.addr-type-item span { font-size: 0.7rem; text-align: center; line-height: 1.3; color: var(--muted); font-weight: 500; }
.addr-type-item.active span { color: var(--primary); font-weight: 600; }

.floating-input-group {
  background: var(--bg); border-radius: 12px; padding: 10px 14px 10px; position: relative; margin-bottom: 12px;
}
.floating-input-group label { display: block; font-size: 0.72rem; color: var(--muted); font-weight: 500; margin-bottom: 3px; }
.floating-input-group input {
  width: 100%; border: none; background: none; outline: none;
  font-size: 1rem; font-family: inherit; color: var(--ink); padding-right: 28px;
}
.floating-clear {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  background: #d1d5db; border: none; border-radius: 50%; width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center; cursor: pointer; color: #fff; font-size: 0.9rem; line-height: 1; padding: 0;
}
.addr-instructions-box {
  background: var(--bg); border: none; border-radius: 12px; padding: 12px 14px;
  font-size: 0.95rem; font-family: inherit; color: var(--ink); resize: none; width: 100%;
  outline: none;
}
.addr-instructions-box:focus { outline: 2px solid var(--primary); }

/* ── Cart rows — Zulzi-style steppers ──────────────────────── */
.cart-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.cart-row:last-child { border-bottom: none; }
.cart-item-name { font-size: 0.92rem; font-weight: 600; margin-bottom: 3px; }
.cart-item-price { font-size: 0.82rem; color: var(--muted); }
.qty-stepper { display: flex; align-items: center; background: var(--primary); border-radius: 100px; overflow: hidden; flex-shrink: 0; }
.qty-stepper button { background: none; border: none; color: #fff; cursor: pointer; width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; padding: 0; font-size: 1.1rem; font-weight: 700; }
.qty-stepper button:active { opacity: 0.7; }
.qty-stepper span { color: #fff; font-weight: 700; font-size: 0.9rem; min-width: 18px; text-align: center; }
