/* =========================================================
   RESTAURANT ORDERING — CORE STYLESHEET
   Mobile-first, brand colors driven by CSS variables (see header.php)
   ========================================================= */

:root {
  --brand: #d62828;
  --brand-dark: #1a1a1a;
  --bg: #faf9f7;
  --surface: #ffffff;
  --text: #1a1a1a;
  --text-muted: #6b6b6b;
  --border: #ececec;
  --success: #1e8e3e;
  --warning: #b45309;
  --danger: #c62828;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 6px 20px rgba(0,0,0,0.08);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.14);
  --font-heading: 'Poppins', sans-serif;
  --font-body: 'Inter', sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 16px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.site-header__inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px;
}
.site-header__brand { display: flex; align-items: center; gap: 8px; }
.site-header__logo { width: 34px; height: 34px; border-radius: 8px; object-fit: cover; }
.site-header__name { font-family: var(--font-heading); font-weight: 600; font-size: 17px; }
.site-header__nav { display: flex; align-items: center; gap: 18px; }
.site-header__link { font-size: 14px; font-weight: 500; color: var(--text-muted); }
.site-header__cart { position: relative; display: flex; }
.site-header__cart svg { color: var(--brand-dark); }
.site-header__cart-count {
  position: absolute; top: -6px; right: -8px;
  background: var(--brand); color: #fff; font-size: 10px; font-weight: 700;
  min-width: 16px; height: 16px; border-radius: 999px;
  display: flex; align-items: center; justify-content: center; padding: 0 3px;
}

/* ---------- Restaurant info block ---------- */
.restaurant-info {
  background: linear-gradient(135deg, var(--brand-dark), #2c2c2c);
  color: #fff; padding: 22px 16px 26px;
}
.restaurant-info__name { font-family: var(--font-heading); font-size: 24px; font-weight: 700; margin: 0 0 6px; }
.restaurant-info__cuisine { font-size: 13px; opacity: 0.85; margin: 0 0 12px; }
.restaurant-info__meta { display: flex; flex-wrap: wrap; gap: 10px; font-size: 12.5px; }
.restaurant-info__pill {
  background: rgba(255,255,255,0.12); padding: 6px 10px; border-radius: 999px;
  display: flex; align-items: center; gap: 5px;
}

/* ---------- Category nav ---------- */
.category-nav {
  position: sticky; top: 54px; z-index: 40;
  background: var(--surface); border-bottom: 1px solid var(--border);
  overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.category-nav::-webkit-scrollbar { display: none; }
.category-nav__inner { display: inline-flex; gap: 6px; padding: 10px 0px; }
.category-nav__item {
  padding: 8px 16px; border-radius: 999px; font-size: 13.5px; font-weight: 500;
  background: var(--bg); color: var(--text-muted); border: 1px solid var(--border);
  white-space: nowrap; transition: all .15s ease;
}
.category-nav__item.active { background: var(--brand); color: #fff; border-color: var(--brand); }

/* ---------- Menu ---------- */
.menu-section { padding: 22px 0px 8px; }
.menu-section__title { font-family: var(--font-heading); font-size: 19px; font-weight: 600; margin: 0 0 12px; }

.food-card {
  display: flex; gap: 12px; align-items: center;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 12px; margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}
.food-card__img-wrap { position: relative; flex-shrink: 0; width: 92px; height: 92px; }
.food-card__img { width: 92px; height: 92px; border-radius: var(--radius-sm); object-fit: cover; background: #eee; }
.food-card__veg-badge {
  position: absolute; top: 4px; left: 4px; width: 15px; height: 15px;
  border: 2px solid var(--success); border-radius: 3px; background: #fff;
  display: flex; align-items: center; justify-content: center;
}
.food-card__veg-badge.nonveg { border-color: var(--danger); }
.food-card__veg-badge span { width: 7px; height: 7px; border-radius: 50%; background: var(--success); }
.food-card__veg-badge.nonveg span { background: var(--danger); border-radius: 50%; }
.food-card__body { flex: 1; min-width: 0; }
.food-card__name { font-weight: 600; font-size: 15px; margin: 0 0 3px; }
.food-card__desc {
  font-size: 12.5px; color: var(--text-muted); margin: 0 0 8px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.food-card__footer { display: flex; align-items: center; justify-content: space-between; }
.food-card__price { font-weight: 700; font-size: 15px; }
.food-card__unavailable { font-size: 12px; color: var(--danger); font-weight: 600; }

.add-btn {
  border: 1.5px solid var(--brand); color: var(--brand); background: #fff;
  font-weight: 700; font-size: 13px; border-radius: var(--radius-sm);
  padding: 7px 16px; min-width: 74px; transition: all .15s ease;
}
.add-btn.added { background: var(--brand); color: #fff; }

.qty-stepper {
  display: flex; align-items: center; gap: 10px;
  border: 1.5px solid var(--brand); border-radius: var(--radius-sm); overflow: hidden;
}
.qty-stepper button {
  background: var(--brand); color: #fff; border: none; width: 26px; height: 26px;
  font-size: 16px; font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.qty-stepper span { min-width: 16px; text-align: center; font-weight: 700; font-size: 13.5px; color: var(--brand); }

/* ---------- Sticky mobile cart bar ---------- */
.sticky-cart {
  position: fixed; bottom: 12px; left: 12px; right: 12px; z-index: 60;
}
.sticky-cart__inner {
  background: var(--brand); color: #fff; border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 18px; box-shadow: var(--shadow-lg);
  font-weight: 600; font-size: 14px;
}
.sticky-cart__cta { display: flex; align-items: center; gap: 4px; }
.sticky-cart__cta::after { content: '→'; }

/* ---------- Cart page ---------- */
.cart-page { padding: 18px 16px 24px; max-width: 640px; margin: 0 auto; min-height: calc(100vh - 250px); }
.cart-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 0; border-bottom: 1px solid var(--border);
}
.cart-item__name { font-weight: 600; font-size: 14.5px; }
.cart-item__price { font-size: 12.5px; color: var(--text-muted); }
.cart-item__remove { color: var(--danger); font-size: 12px; font-weight: 600; margin-top: 4px; background: none; border: none; padding: 0; }
.cart-summary {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 16px; margin-top: 18px;
}
.cart-summary__row { display: flex; justify-content: space-between; font-size: 14px; padding: 5px 0; }
.cart-summary__row.total { font-weight: 700; font-size: 16px; border-top: 1px dashed var(--border); margin-top: 8px; padding-top: 10px; }
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }

/* ---------- Buttons ---------- */
.btn-primary {
  display: block; width: 100%; text-align: center;
  background: var(--brand); color: #fff; border: none; border-radius: var(--radius-sm);
  padding: 14px; font-weight: 700; font-size: 15px; box-shadow: var(--shadow-sm);
  transition: filter .15s ease;
}
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary:hover:not(:disabled) { filter: brightness(1.07); }
.btn-secondary {
  display: block; width: 100%; text-align: center; background: var(--bg);
  color: var(--text); border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px; font-weight: 600; font-size: 14px;
}

/* ---------- Forms ---------- */
.form-group { margin-bottom: 14px; }
.form-label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.form-input, .form-textarea {
  width: 100%; padding: 12px 14px; font-size: 14.5px; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); background: var(--surface); font-family: inherit;
}
.form-input:focus, .form-textarea:focus { outline: none; border-color: var(--brand); }
.form-error { color: var(--danger); font-size: 12px; margin-top: 4px; display: none; }
.form-error.visible { display: block; }

/* ---------- Location / distance widget ---------- */
.location-box {
  background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius-md);
  padding: 14px; margin-bottom: 16px;
}
.location-box__status { font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.location-box__status.loading { color: var(--text-muted); }
.location-box__status.success { color: var(--success); }
.location-box__status.warning { color: var(--warning); }
.location-box__status.danger { color: var(--danger); }
.location-box__address { font-size: 13px; color: var(--text-muted); margin-top: 6px; }
.location-box__change { font-size: 12.5px; font-weight: 600; color: var(--brand); margin-top: 8px; background: none; border: none; padding: 0; }

/* ---------- Order success ---------- */
.success-page { text-align: center; padding: 50px 20px; max-width: 480px; margin: 0 auto; }
.success-icon {
  width: 68px; height: 68px; border-radius: 50%; background: #e8f5e9;
  display: flex; align-items: center; justify-content: center; margin: 0 auto 18px;
  color: var(--success); font-size: 34px;
}
.success-page__order-id { font-family: var(--font-heading); font-size: 20px; font-weight: 700; margin: 6px 0; }
.success-page__total { font-size: 15px; color: var(--text-muted); margin-bottom: 20px; }
.whatsapp-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: #25D366; color: #fff; font-weight: 700; font-size: 15px;
  border: none; border-radius: var(--radius-sm); padding: 14px; width: 100%;
}

/* ---------- Footer ---------- */
.site-footer { background: var(--brand-dark); color: rgba(255,255,255,0.75); padding: 26px 16px 90px; margin-top: 30px; height: 250px; }
.site-footer__inner { max-width: 1200px; margin: 0 auto; font-size: 13px; line-height: 1.8; }
.site-footer__name { color: #fff; font-weight: 600; font-size: 15px; margin: 0 0 4px; }

/* ---------- Loading skeleton ---------- */
.skeleton { background: linear-gradient(90deg,#eee 25%,#f5f5f5 37%,#eee 63%); background-size: 400% 100%; animation: skeleton 1.4s ease infinite; border-radius: var(--radius-sm); }
@keyframes skeleton { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ---------- Responsive (tablet/desktop) ---------- */
@media (min-width: 720px) {
  body { padding-bottom: 0; }
  .sticky-cart { display: none !important; }
  .menu-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
  .food-card { margin-bottom: 0; }
  .restaurant-info__name { font-size: 30px; }
}

/* Toast */
.toast {
  position: fixed; bottom: 100px; left: 50%; transform: translateX(-50%);
  background: var(--brand-dark); color: #fff; padding: 10px 18px; border-radius: 999px;
  font-size: 13px; font-weight: 500; z-index: 100; opacity: 0; pointer-events: none;
  transition: opacity .25s ease, transform .25s ease; text-align: center;
}
.toast.visible { opacity: 1; transform: translateX(-50%) translateY(-6px); }
