:root {
  --primary: #ef4444;
  --primary-dark: #dc2626;
  --primary-light: #fef2f2;
  --dark: #191a1f;
  --gray: #6b7280;
  --gray-light: #9ca3af;
  --light-bg: #f7f7f9;
  --card-bg: #ffffff;
  --border: #ececef;
  --green: #16a34a;
  --green-light: #e9f9ef;
  --radius: 14px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 3px rgba(20,20,30,.06);
  --shadow-md: 0 8px 24px rgba(20,20,30,.08);
  --shadow-lg: 0 16px 40px rgba(20,20,30,.14);
  --header-h: 64px;
}
* { margin:0; padding:0; box-sizing:border-box; -webkit-tap-highlight-color:transparent; }
html { scroll-behavior:smooth; }
body { font-family:'Poppins',sans-serif; color:var(--dark); background:var(--light-bg); -webkit-font-smoothing:antialiased; }
.container { max-width:1200px; margin:0 auto; padding:0 20px; }
a { text-decoration:none; color:inherit; }
img { max-width:100%; display:block; }
ul { list-style:none; }
button { font-family:inherit; }
input, select, textarea { font-family:inherit; }
body.nav-open { overflow:hidden; }

/* ---------------- Header ---------------- */
.site-header {
  background:rgba(255,255,255,.92); backdrop-filter:saturate(180%) blur(10px);
  border-bottom:1px solid var(--border); position:sticky; top:0; z-index:200;
}
.header-inner { display:flex; align-items:center; justify-content:space-between; height:var(--header-h); gap:12px; }
.logo { font-size:22px; font-weight:700; color:var(--primary); letter-spacing:-.02em; flex-shrink:0; }

.nav-toggle {
  display:none; width:40px; height:40px; border:none; background:var(--light-bg); border-radius:10px;
  align-items:center; justify-content:center; cursor:pointer; flex-shrink:0; position:relative; z-index:210;
}
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
  content:''; display:block; width:18px; height:2px; background:var(--dark); border-radius:2px; transition:.25s;
}
.nav-toggle span { position:relative; }
.nav-toggle span::before { position:absolute; top:-6px; left:0; }
.nav-toggle span::after { position:absolute; top:6px; left:0; }
.nav-toggle.active span { background:transparent; }
.nav-toggle.active span::before { top:0; transform:rotate(45deg); }
.nav-toggle.active span::after { top:0; transform:rotate(-45deg); }

.main-nav { display:flex; align-items:center; gap:8px; font-weight:500; font-size:14.5px; }
.main-nav a { color:var(--dark); position:relative; padding:9px 14px; border-radius:8px; transition:.15s; white-space:nowrap; }
.main-nav a:hover { color:var(--primary); background:var(--primary-light); }
.btn-nav { background:var(--primary); color:#fff !important; padding:9px 18px !important; border-radius:8px; }
.btn-nav:hover { background:var(--primary-dark) !important; }
.cart-link { display:inline-flex; align-items:center; gap:6px; }
.cart-badge {
  background:var(--primary); color:#fff; font-size:11px; min-width:18px; height:18px; padding:0 5px;
  border-radius:10px; font-weight:700; display:inline-flex; align-items:center; justify-content:center; line-height:1;
}
.cart-badge.hidden { display:none; }
.nav-overlay { display:none; position:fixed; inset:0; background:rgba(15,15,20,.4); z-index:190; }
.nav-overlay.active { display:block; }

/* ---------------- Hero / Banner ---------------- */
.hero-search {
  background:linear-gradient(135deg, var(--primary), #f97316); padding:52px 0 60px; text-align:center; color:#fff;
  position:relative; overflow:hidden;
}
.hero-search h1 { font-size:clamp(24px,5vw,38px); margin-bottom:8px; font-weight:700; letter-spacing:-.02em; }
.hero-search p { opacity:.92; margin-bottom:24px; font-size:15px; }
.hero-search form { max-width:520px; margin:0 auto; display:flex; gap:8px; }
.hero-search input {
  flex:1; min-width:0; padding:14px 18px; border-radius:12px; border:none; font-size:14px;
  box-shadow:var(--shadow-md);
}
.hero-search input:focus { outline:3px solid rgba(255,255,255,.35); }
.hero-search .btn { border-radius:12px; padding:0 22px; }

.banner-slider { width:100%; overflow:hidden; background:var(--light-bg); }
.banner-slider img { width:100%; height:300px; object-fit:cover; }

/* ---------------- Sections ---------------- */
.section { padding:32px 0; }
.section-title { font-size:21px; font-weight:700; margin-bottom:18px; letter-spacing:-.01em; }
.empty-state { text-align:center; padding:50px 16px; color:var(--gray); }
.empty-state a { color:var(--primary); font-weight:600; }

/* Category grid */
.category-scroll { overflow-x:auto; margin:0 -20px; padding:0 20px 4px; -webkit-overflow-scrolling:touch; scrollbar-width:none; }
.category-scroll::-webkit-scrollbar { display:none; }
.category-grid { display:grid; grid-auto-flow:column; grid-auto-columns:96px; gap:14px; }
.category-card {
  text-align:center; background:var(--card-bg); border-radius:var(--radius); padding:14px 8px 12px;
  transition:.2s; border:1.5px solid var(--border);
}
.category-card:hover, .category-card:active { transform:translateY(-2px); box-shadow:var(--shadow-sm); border-color:var(--primary); }
.category-card img { width:52px; height:52px; object-fit:cover; border-radius:50%; margin:0 auto 8px; }
.category-card span { font-weight:600; font-size:12.5px; display:block; line-height:1.25; }

/* Food grid */
.food-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(220px,1fr)); gap:18px; }
.food-card { border:1px solid var(--border); border-radius:var(--radius); overflow:hidden; background:var(--card-bg); transition:.2s; display:flex; flex-direction:column; }
.food-card:hover { box-shadow:var(--shadow-md); transform:translateY(-3px); }
.food-card .food-img { height:150px; overflow:hidden; position:relative; background:var(--light-bg); }
.food-card .food-img img { width:100%; height:100%; object-fit:cover; }
.veg-badge {
  position:absolute; top:10px; left:10px; width:18px; height:18px; border:2px solid var(--green);
  border-radius:4px; background:#fff; display:flex; align-items:center; justify-content:center; box-shadow:var(--shadow-sm);
}
.veg-badge::after { content:''; width:8px; height:8px; border-radius:50%; background:var(--green); }
.non-veg-badge::after { background:var(--primary); }
.non-veg-badge { border-color:var(--primary); }
.food-info { padding:13px; display:flex; flex-direction:column; gap:6px; flex:1; }
.food-info h3 { font-size:15px; font-weight:600; }
.food-info p { font-size:12.5px; color:var(--gray); min-height:32px; line-height:1.4; }
.food-price-row { display:flex; align-items:center; justify-content:space-between; margin-top:auto; }
.food-price { font-weight:700; font-size:15px; }
.rating-chip { background:var(--green); color:#fff; font-size:11.5px; padding:2px 7px; border-radius:5px; font-weight:600; display:inline-flex; align-items:center; gap:3px; }

/* ---------------- Buttons ---------------- */
.btn {
  display:inline-flex; align-items:center; justify-content:center; padding:11px 20px; border-radius:10px;
  font-weight:600; cursor:pointer; border:none; font-size:14px; transition:.15s; gap:6px;
}
.btn-primary { background:var(--primary); color:#fff; }
.btn-primary:hover { background:var(--primary-dark); }
.btn-primary:active { transform:scale(.98); }
.btn-outline { background:#fff; border:1.5px solid var(--primary); color:var(--primary); }
.btn-outline:hover { background:var(--primary-light); }
.btn-block { width:100%; text-align:center; }
.btn-sm { padding:8px 14px; font-size:13px; border-radius:8px; }
.btn-secondary { background:var(--dark); color:#fff; }
.btn-danger { background:#fdeaea; color:#dc2626; }
.btn-danger:hover { background:#fbd5d5; }

/* ---------------- Forms ---------------- */
.auth-wrap { max-width:420px; margin:40px auto; padding:32px; background:var(--card-bg); border:1px solid var(--border); border-radius:var(--radius-lg); box-shadow:var(--shadow-sm); }
.auth-wrap h2 { margin-bottom:22px; text-align:center; font-size:22px; }
.form-group { margin-bottom:16px; }
.form-group label { display:block; margin-bottom:6px; font-weight:500; font-size:13.5px; color:var(--dark); }
.form-group input, .form-group select, .form-group textarea {
  width:100%; padding:12px 14px; border:1.5px solid var(--border); border-radius:10px; font-size:14px; font-family:inherit; background:#fff;
  transition:.15s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline:none; border-color:var(--primary); box-shadow:0 0 0 3px var(--primary-light); }
.form-row { display:flex; gap:14px; }
.form-row .form-group { flex:1; min-width:0; }
.radio-option { display:flex; align-items:center; gap:10px; font-weight:400; padding:12px 14px; border:1.5px solid var(--border); border-radius:10px; cursor:pointer; transition:.15s; }
.radio-option:hover { border-color:var(--primary); }
.radio-option input { width:auto !important; accent-color:var(--primary); }
.radio-option + .radio-option { margin-top:8px; }
.alert { padding:12px 14px; border-radius:10px; margin-bottom:16px; font-size:14px; }
.alert-error { background:#fdeaea; color:var(--primary-dark); border:1px solid #f5c2c7; }
.alert-success { background:var(--green-light); color:#166534; border:1px solid #b7ebc9; }
.text-center { text-align:center; }
.text-left { text-align:left; }
.mt-16 { margin-top:16px; }

/* ---------------- Cart & Checkout ---------------- */
.cart-layout { display:grid; grid-template-columns:2fr 1fr; gap:24px; align-items:start; }
.cart-items-wrap { background:var(--card-bg); border-radius:var(--radius); border:1px solid var(--border); padding:6px 16px; }
.cart-item { display:flex; align-items:center; gap:14px; padding:16px 0; border-bottom:1px solid var(--border); flex-wrap:wrap; }
.cart-item:last-child { border-bottom:none; }
.cart-item img { width:64px; height:64px; object-fit:cover; border-radius:10px; flex-shrink:0; }
.cart-item-info { flex:1 1 140px; min-width:0; }
.cart-item-info h3 { font-size:14.5px; font-weight:600; margin-bottom:3px; }
.cart-item-meta-row { display:flex; align-items:center; gap:16px; flex-wrap:wrap; margin-left:auto; }
.qty-control { display:flex; align-items:center; gap:10px; }
.qty-control button {
  width:28px; height:28px; border-radius:50%; border:1.5px solid var(--border); background:#fff; cursor:pointer;
  font-size:16px; line-height:1; display:flex; align-items:center; justify-content:center; color:var(--primary); font-weight:700;
}
.qty-control button:hover { border-color:var(--primary); background:var(--primary-light); }
.qty-control span { min-width:16px; text-align:center; font-weight:600; }
.cart-item-price { width:64px; text-align:right; font-weight:700; font-size:14px; }
.cart-summary { background:var(--card-bg); border:1px solid var(--border); border-radius:var(--radius); padding:20px; position:sticky; top:calc(var(--header-h) + 16px); }
.summary-row { display:flex; justify-content:space-between; margin-bottom:10px; font-size:14px; color:var(--gray); }
.summary-row.total { font-weight:700; font-size:17px; border-top:1px dashed var(--border); padding-top:12px; margin-top:12px; color:var(--dark); }
.promo-box { display:flex; gap:8px; margin-bottom:14px; }
.promo-box input { flex:1; min-width:0; }
#promo_msg { font-size:13px; margin-bottom:14px; min-height:18px; }

/* ---------------- WhatsApp floating button ---------------- */
.whatsapp-float {
  position:fixed; bottom:22px; right:20px; background:#25D366; width:54px; height:54px;
  border-radius:50%; display:flex; align-items:center; justify-content:center;
  box-shadow:0 4px 16px rgba(0,0,0,.25); z-index:150; animation:pulse 2.2s infinite;
}
@keyframes pulse { 0%{box-shadow:0 0 0 0 rgba(37,211,102,.5);} 70%{box-shadow:0 0 0 14px rgba(37,211,102,0);} 100%{box-shadow:0 0 0 0 rgba(37,211,102,0);} }

/* ---------------- Footer ---------------- */
.site-footer { background:var(--dark); color:#aaa; text-align:center; padding:26px 20px; margin-top:40px; font-size:13.5px; }

/* ---------------- Order status badges ---------------- */
.badge { padding:4px 10px; border-radius:20px; font-size:11.5px; font-weight:600; white-space:nowrap; }
.badge-placed { background:#fff3cd; color:#856404; }
.badge-confirmed, .badge-preparing { background:#cce5ff; color:#004085; }
.badge-out_for_delivery { background:#d1ecf1; color:#0c5460; }
.badge-delivered { background:#d4edda; color:#155724; }
.badge-cancelled { background:#f8d7da; color:#721c24; }

/* ---------------- Order cards (my-orders) ---------------- */
.order-card-head { display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:10px; }
.order-items-list { margin:12px 0; color:var(--gray); font-size:13.5px; }
.order-items-list li { padding:2px 0; }
.order-card-foot { display:flex; justify-content:space-between; flex-wrap:wrap; gap:8px; font-weight:600; border-top:1px solid var(--border); padding-top:10px; font-size:13.5px; }

/* ---------------- Admin ---------------- */
.admin-body { background:#f4f5f7; min-height:100vh; }
.admin-wrap { display:flex; min-height:100vh; }
.admin-sidebar {
  width:230px; background:#1c1c2b; color:#fff; flex-shrink:0; position:sticky; top:0; height:100vh; overflow-y:auto;
  transition:transform .25s ease; z-index:300;
}
.admin-sidebar .logo { padding:20px; font-size:20px; font-weight:700; color:#fff; border-bottom:1px solid #333; display:block; }
.admin-sidebar nav a { display:block; padding:13px 20px; color:#ccc; font-size:14px; border-left:3px solid transparent; }
.admin-sidebar nav a:hover, .admin-sidebar nav a.active { background:#2a2a3d; color:#fff; border-left-color:var(--primary); }
.admin-main { flex:1; padding:26px; min-width:0; }
.admin-topbar { display:flex; justify-content:space-between; align-items:center; margin-bottom:24px; gap:12px; }
.admin-topbar h1 { font-size:22px; }
.admin-menu-toggle {
  display:none; width:40px; height:40px; border-radius:10px; border:1px solid var(--border); background:#fff;
  align-items:center; justify-content:center; cursor:pointer; flex-shrink:0; font-size:18px;
}
.admin-sidebar-overlay { display:none; position:fixed; inset:0; background:rgba(0,0,0,.4); z-index:290; }
.admin-sidebar-overlay.active { display:block; }
.stat-cards { display:grid; grid-template-columns:repeat(auto-fit,minmax(180px,1fr)); gap:16px; margin-bottom:24px; }
.stat-card { background:#fff; border-radius:12px; padding:18px; box-shadow:0 2px 8px rgba(0,0,0,.05); }
.stat-card .num { font-size:26px; font-weight:700; }
.stat-card .label { color:var(--gray); font-size:12.5px; }
.admin-card { background:#fff; border-radius:12px; padding:20px; box-shadow:0 2px 8px rgba(0,0,0,.05); margin-bottom:22px; overflow-x:auto; }
table { width:100%; border-collapse:collapse; }
table th, table td { text-align:left; padding:10px 12px; border-bottom:1px solid var(--border); font-size:13.5px; white-space:nowrap; }
table th { color:var(--gray); font-weight:600; font-size:11.5px; text-transform:uppercase; }
table img.thumb { width:44px; height:44px; object-fit:cover; border-radius:8px; }
.admin-login-wrap { display:flex; align-items:center; justify-content:center; min-height:100vh; background:linear-gradient(135deg,#1c1c2b,#3a3a55); padding:20px; }

/* ---------------- Responsive ---------------- */
@media (max-width: 860px) {
  .cart-layout { grid-template-columns:1fr; }
  .cart-summary { position:static; }
}

@media (max-width: 768px) {
  .container { padding:0 16px; }
  .nav-toggle { display:flex; }
  .main-nav {
    position:fixed; top:0; right:0; height:100vh; width:min(78vw,300px); background:#fff; flex-direction:column;
    align-items:stretch; gap:2px; padding:calc(var(--header-h) + 16px) 16px 20px; transform:translateX(100%);
    transition:transform .25s ease; box-shadow:var(--shadow-lg); z-index:200; font-size:15px;
  }
  .main-nav.active { transform:translateX(0); }
  .main-nav a { padding:13px 14px; border-radius:10px; }
  .btn-nav { text-align:center; }

  .hero-search { padding:36px 0 44px; }
  .hero-search form { flex-direction:column; }
  .banner-slider img { height:160px; }
  .section { padding:24px 0; }
  .section-title { font-size:18px; }

  .food-grid { grid-template-columns:repeat(2, 1fr); gap:12px; }
  .food-card .food-img { height:110px; }
  .food-info { padding:10px; gap:4px; }
  .food-info h3 { font-size:13.5px; }
  .food-info p { font-size:11.5px; min-height:28px; }
  .food-price { font-size:14px; }
  .food-info .btn { padding:9px 10px; font-size:12.5px; }

  .admin-sidebar { position:fixed; left:0; top:0; transform:translateX(-100%); }
  .admin-sidebar.active { transform:translateX(0); }
  .admin-menu-toggle { display:flex; position:sticky; top:0; margin-bottom:14px; }
  .admin-main { padding:18px 16px; }
  .stat-cards { grid-template-columns:repeat(2,1fr); }

  .form-row { flex-direction:column; gap:0; }
  .auth-wrap { margin:20px auto; padding:24px 20px; }

  .cart-item { position:relative; padding-right:36px; }
  .cart-item .btn-danger { position:absolute; top:16px; right:0; }
  .cart-item-meta-row { width:100%; margin-left:74px; justify-content:space-between; }
}

@media (max-width: 420px) {
  .food-grid { grid-template-columns:repeat(2, 1fr); gap:10px; }
  .stat-cards { grid-template-columns:1fr 1fr; }
}
