* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --red: #D6293B;
  --red-dark: #A81729;
  --red-light: #FF4757;
  --gold: #F2A93C;
  --cream: #FAF6F0;
  --card: #FFFFFF;
  --ink: #211A15;
  --muted: #8A8078;
  --border: #F0E6D8;
  --veg: #1FA855;
  --nonveg: #E23744;
  --egg: #D89A22;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 10px;
  --max-width: 740px;
  --shadow-sm: 0 2px 10px rgba(33, 26, 21, 0.06);
  --shadow-md: 0 8px 28px rgba(33, 26, 21, 0.12);
  --shadow-lg: 0 14px 40px rgba(0, 0, 0, 0.25);
}

html, body { height: 100%; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--cream);
  color: var(--ink);
  padding-bottom: 100px;
  -webkit-font-smoothing: antialiased;
}

h1, h2 { font-family: 'Poppins', 'Inter', sans-serif; }

/* ---------- Topbar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: linear-gradient(135deg, var(--red-light) 0%, var(--red) 45%, var(--red-dark) 100%);
  color: #fff;
  padding: 16px 18px 14px;
  box-shadow: var(--shadow-md);
}
.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max-width);
  margin: 0 auto;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-seal {
  font-size: 26px;
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.18);
  border-radius: 14px;
  backdrop-filter: blur(6px);
}
.brand-text h1 { font-size: 19px; font-weight: 700; letter-spacing: 0.2px; }
.brand-text p { font-size: 11px; opacity: 0.88; margin-top: 2px; font-weight: 500; }
.topbar-actions { display: flex; gap: 8px; }
.icon-btn {
  background: rgba(255,255,255,0.18);
  border: none;
  color: #fff;
  width: 40px; height: 40px;
  border-radius: 13px;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  backdrop-filter: blur(6px);
}
.icon-btn:hover { background: rgba(255,255,255,0.3); }
.icon-btn:active { transform: scale(0.92); }

.search-wrap {
  max-width: var(--max-width);
  margin: 14px auto 0;
  position: relative;
}
.search-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--red); }
#searchInput {
  width: 100%;
  padding: 12px 14px 12px 38px;
  border-radius: 14px;
  border: none;
  font-size: 14px;
  outline: none;
  background: rgba(255,255,255,0.96);
  font-family: inherit;
  box-shadow: var(--shadow-sm);
}
#searchInput::placeholder { color: var(--muted); }

/* ---------- Category tabs ---------- */
.cat-tabs {
  position: sticky;
  top: 84px;
  z-index: 19;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 16px;
  background: var(--cream);
  border-bottom: 1px solid var(--border);
  scrollbar-width: none;
}
.cat-tabs::-webkit-scrollbar { display: none; }
.cat-tab {
  flex: none;
  padding: 9px 16px;
  border-radius: 24px;
  border: 1.5px solid var(--border);
  background: var(--card);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}
.cat-tab.active {
  background: linear-gradient(135deg, var(--red-light), var(--red));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(214, 41, 59, 0.3);
}

/* ---------- Menu list ---------- */
.menu-list {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 10px 16px 24px;
}
.menu-section { margin-top: 24px; }
.menu-section h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 3px;
}
.menu-section .cat-note { font-size: 12px; color: var(--muted); margin-bottom: 12px; }

.menu-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 10px;
  transition: box-shadow 0.15s, transform 0.1s;
}
.menu-card:hover { box-shadow: var(--shadow-sm); }
.menu-card-info { flex: 1; min-width: 0; }
.item-name-row { display: flex; align-items: center; gap: 7px; }
.diet-dot { width: 11px; height: 11px; border-radius: 3px; border: 1.5px solid; flex: none; }
.diet-dot.veg { border-color: var(--veg); }
.diet-dot.veg::after { content:''; display:block; width:5px;height:5px;margin:1.5px auto; border-radius:50%; background:var(--veg);}
.diet-dot.nonveg { border-color: var(--nonveg); }
.diet-dot.nonveg::after { content:''; display:block; width:0;height:0; margin:2.5px auto; border-left:3.5px solid transparent; border-right:3.5px solid transparent; border-bottom:5.5px solid var(--nonveg);}
.diet-dot.egg { border-color: var(--egg); }
.diet-dot.egg::after { content:''; display:block; width:5px;height:5px;margin:1.5px auto; border-radius:50%; background:var(--egg);}
.item-name { font-size: 14.5px; font-weight: 600; }
.item-note { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.item-price { font-size: 13px; color: var(--muted); margin-top: 5px; font-weight: 500; }

.menu-card-action { flex: none; text-align: right; }
.size-toggle {
  display: flex;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 7px;
  font-size: 11px;
}
.size-toggle button {
  border: none;
  background: var(--card);
  padding: 5px 9px;
  cursor: pointer;
  color: var(--ink);
  font-weight: 600;
}
.size-toggle button.active { background: var(--gold); color: #fff; }

.add-btn {
  background: var(--card);
  border: 1.5px solid var(--red);
  color: var(--red);
  font-weight: 700;
  font-size: 13px;
  padding: 8px 18px;
  border-radius: 10px;
  cursor: pointer;
  min-width: 68px;
  transition: all 0.15s;
}
.add-btn:hover { background: var(--red); color: #fff; }
.qty-stepper {
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, var(--red-light), var(--red));
  border-radius: 10px;
  padding: 6px 10px;
  color: #fff;
  font-weight: 700;
  min-width: 68px;
  justify-content: space-between;
}
.qty-stepper button {
  background: none;
  border: none;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  width: 18px;
}

.no-results { text-align: center; padding: 60px 20px; color: var(--muted); }
.no-results span { font-size: 34px; display: block; margin-bottom: 10px; }

.skeleton-wrap { padding-top: 10px; }
.skeleton-header, .skeleton-card {
  background: linear-gradient(90deg, #f0e8d8 25%, #f8f2e4 37%, #f0e8d8 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: var(--radius-md);
}
.skeleton-header { height: 20px; width: 40%; margin-bottom: 14px; }
.skeleton-card { height: 68px; margin-bottom: 10px; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

/* ---------- Cart bar ---------- */
.cart-bar {
  position: fixed;
  bottom: 16px;
  left: 16px;
  right: 16px;
  max-width: calc(var(--max-width) - 32px);
  margin: 0 auto;
  background: linear-gradient(135deg, var(--red-light), var(--red-dark));
  color: #fff;
  border: none;
  border-radius: 16px;
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  z-index: 25;
  transition: transform 0.1s;
}
.cart-bar:active { transform: scale(0.98); }
.cart-bar-cta strong { margin-left: 8px; font-size: 15px; }

/* ---------- Drawers ---------- */
.drawer-overlay {
  position: fixed; inset: 0;
  background: rgba(20,14,8,0.55);
  backdrop-filter: blur(2px);
  z-index: 40;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.drawer {
  background: var(--card);
  width: 100%;
  max-width: var(--max-width);
  max-height: 88vh;
  overflow-y: auto;
  border-radius: 26px 26px 0 0;
  padding: 12px 22px 26px;
  position: relative;
  animation: slideUp 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}
.drawer-small { max-height: 60vh; }
@keyframes slideUp { from { transform: translateY(40px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.drawer-handle { width: 42px; height: 4px; background: var(--border); border-radius: 3px; margin: 6px auto 14px; }
.drawer-close {
  position: absolute; top: 14px; right: 18px;
  background: #F4ECE0; border: none; width: 32px; height: 32px;
  border-radius: 50%; font-size: 14px; cursor: pointer; color: var(--ink);
  transition: background 0.15s;
}
.drawer-close:hover { background: var(--border); }
.drawer h2 { font-size: 19px; font-weight: 700; color: var(--ink); margin-bottom: 14px; }

.cart-items { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.cart-item-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.cart-item-name { font-size: 13.5px; font-weight: 600; flex: 1; }
.cart-item-price { font-size: 13px; color: var(--muted); font-weight: 600; }
.cart-item-empty { text-align: center; padding: 34px 0; color: var(--muted); font-size: 13.5px; }

.cart-total-row {
  display: flex; justify-content: space-between; align-items: center;
  border-top: 1.5px dashed var(--border); padding-top: 14px; margin-bottom: 16px;
  font-weight: 700; font-size: 16px;
}

.checkout-form { display: flex; flex-direction: column; gap: 13px; }
.checkout-form label { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--ink); }
.checkout-form input, .checkout-form textarea {
  border: 1.5px solid var(--border); border-radius: 12px; padding: 11px 13px;
  font-size: 14px; font-family: inherit; outline: none; resize: none; background: #FDFBF8;
  transition: border-color 0.15s;
}
.checkout-form input:focus, .checkout-form textarea:focus { border-color: var(--red); background: #fff; }
.checkout-form textarea { min-height: 56px; }

.segmented { display: flex; border: 1.5px solid var(--border); border-radius: 12px; overflow: hidden; }
.seg-btn { flex: 1; border: none; background: var(--card); padding: 10px 4px; font-size: 13px; font-weight: 600; cursor: pointer; color: var(--ink); transition: all 0.15s; }
.seg-btn.selected { background: linear-gradient(135deg, var(--red-light), var(--red)); color: #fff; }

.form-error {
  color: #B91C1C; font-size: 12.5px; font-weight: 500;
  background: #FEF2F2; padding: 8px 12px; border-radius: 8px;
}

.place-order-btn {
  background: linear-gradient(135deg, var(--red-light), var(--red-dark));
  color: #fff;
  border: none;
  border-radius: 14px;
  padding: 15px;
  font-size: 15px;
  font-weight: 700;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-left: 20px; padding-right: 20px;
  cursor: pointer;
  margin-top: 4px;
  box-shadow: 0 6px 16px rgba(214, 41, 59, 0.3);
  transition: transform 0.1s;
}
.place-order-btn:active { transform: scale(0.98); }
.place-order-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* My orders */
.orders-lookup-hint { font-size: 12.5px; color: var(--muted); margin-bottom: 12px; }
.orders-lookup-row { display: flex; gap: 8px; margin-bottom: 18px; }
.orders-lookup-row input {
  flex: 1; border: 1.5px solid var(--border); border-radius: 12px; padding: 11px 13px; font-size: 14px; outline: none; font-family: inherit;
}
.orders-lookup-row input:focus { border-color: var(--red); }
.orders-lookup-row button {
  background: linear-gradient(135deg, var(--red-light), var(--red)); color: #fff; border: none; border-radius: 12px; padding: 0 18px; font-weight: 700; cursor: pointer;
}
.orders-empty { text-align: center; color: var(--muted); padding: 34px 0; font-size: 13.5px; }
.order-card { border: 1px solid var(--border); border-radius: 16px; padding: 14px 16px; margin-bottom: 10px; }
.order-card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 7px; }
.order-code { font-weight: 700; font-size: 13.5px; }
.order-status { font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 20px; text-transform: uppercase; }
.status-New { background: #FEF3D6; color: #A16207; }
.status-Preparing { background: #DBEAFE; color: #1D4ED8; }
.status-Ready { background: #DCFCE7; color: #15803D; }
.status-Delivered { background: #E5E7EB; color: #374151; }
.status-Cancelled { background: #FEE2E2; color: #B91C1C; }
.order-items-line { font-size: 12.5px; color: var(--muted); margin-bottom: 5px; }
.order-card-bottom { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted); font-weight: 500; }

.help-text { font-size: 14px; color: var(--ink); margin-bottom: 18px; line-height: 1.55; }
.help-action-btn {
  display: block; text-align: center; background: linear-gradient(135deg, var(--red-light), var(--red)); color: #fff;
  padding: 13px; border-radius: 14px; font-weight: 700; text-decoration: none; margin-bottom: 10px; font-size: 14px;
  box-shadow: 0 6px 16px rgba(214, 41, 59, 0.25);
}

.web-confirm-text {
  white-space: pre-wrap; font-family: inherit; font-size: 13.5px; background: #FBF3E6;
  border-radius: 14px; padding: 16px; margin-bottom: 18px; line-height: 1.7; color: var(--ink); min-height: 20px;
}

/* ---------- Desktop / tablet ---------- */
@media (min-width: 720px) {
  body { padding-bottom: 30px; }
  .cat-tabs { top: 92px; }
  .drawer-overlay { align-items: center; }
  .drawer { border-radius: 24px; max-height: 85vh; }
  .cart-bar { bottom: 26px; }
  .menu-card { padding: 18px 20px; }
  .menu-list { padding-top: 16px; }
}

@media (min-width: 900px) {
  :root { --max-width: 820px; }
  .brand-text h1 { font-size: 22px; }
}
