/*
 * Ghaint Food — all styling for the single-page site (mobile-first, two breakpoints).
 * Component classes are grouped in the order they appear on the page; theme colors
 * live only in :root custom properties so light/dark and future rebrands touch one place.
 */
:root {
  --bg: #FFF8EF;
  --bg-alt: #FCEEDA;
  --surface: #FFFFFF;
  --ink: #241A14;
  --ink-soft: #5C4A3E;
  --teal: #0E4B4E;
  --teal-dark: #083234;
  --teal-light: #1E7C7F;
  --chili: #E8491D;
  --chili-dark: #C7360F;
  --gold: #F2A93B;
  --border: rgba(36, 26, 20, 0.1);
  --shadow: 0 10px 30px rgba(14, 75, 78, 0.12);
  --radius: 16px;
  --font-display: "Baloo 2", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;

  /* Fixed brand colors that must never shift between themes (hero/order-banner gradients, header scrim). */
  --header-bg: rgba(255, 248, 239, 0.92);
  --hero-from: #0E4B4E;
  --order-banner-end: #C7360F;
  --card-shadow: 0 2px 8px rgba(36, 26, 20, 0.04);
}

/* Dark theme: follows system preference by default, or the visitor's explicit toggle (saved in a cookie). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14100B;
    --bg-alt: #1D1712;
    --surface: #221B15;
    --ink: #F3EAE0;
    --ink-soft: #C9BBAA;
    --teal: #4FC3C6;
    --chili-dark: #FF7A4D;
    --border: rgba(255, 255, 255, 0.14);
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    --header-bg: rgba(20, 16, 11, 0.88);
    --card-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  }
}
:root[data-theme="dark"] {
  --bg: #14100B;
  --bg-alt: #1D1712;
  --surface: #221B15;
  --ink: #F3EAE0;
  --ink-soft: #C9BBAA;
  --teal: #4FC3C6;
  --chili-dark: #FF7A4D;
  --border: rgba(255, 255, 255, 0.14);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  --header-bg: rgba(20, 16, 11, 0.88);
  --card-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--font-display); margin: 0 0 .5em; line-height: 1.1; }
p { margin: 0 0 1em; color: var(--ink-soft); }
a { color: inherit; text-decoration: none; }
ul { padding: 0; margin: 0; list-style: none; }
img { max-width: 100%; display: block; }

.container {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--teal);
  color: #fff;
  padding: 10px 16px;
  z-index: 999;
}
.skip-link:focus { left: 12px; top: 12px; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  padding: 13px 22px;
  border-radius: 999px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  white-space: nowrap;
  border: 2px solid transparent;
  transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
}
.btn:active { transform: scale(0.97); }
.btn .icon { width: 18px; height: 18px; }
.btn-whatsapp { background: #25D366; color: #06341c; box-shadow: 0 6px 18px rgba(37, 211, 102, 0.35); }
.btn-outline { background: transparent; border-color: var(--surface); color: var(--surface); }
.btn-upi { background: var(--gold); color: var(--teal-dark); box-shadow: 0 6px 18px rgba(242, 169, 59, 0.35); }
.btn-lg { padding: 16px 28px; font-size: 16px; }
.btn.is-disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-logo { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; }
.brand-fallback {
  display: none;
  width: 38px; height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--chili) 50%, var(--teal) 50%);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  align-items: center;
  justify-content: center;
}
.js-logo.logo-fallback .brand-logo,
.js-logo.logo-fallback img { display: none; }
.js-logo.logo-fallback .brand-fallback { display: flex; }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 20px; color: var(--teal); }
.brand-name em { font-style: normal; color: var(--chili); }

.nav-toggle {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  padding: 6px;
  cursor: pointer;
}
.nav-toggle span { width: 24px; height: 2px; background: var(--ink); border-radius: 2px; }

/* Header actions: language switch + theme toggle */
.site-actions { display: flex; align-items: center; gap: 10px; }

.lang-switch { display: flex; gap: 2px; background: var(--bg-alt); border-radius: 999px; padding: 3px; }
.lang-btn {
  border: none;
  background: transparent;
  color: var(--ink-soft);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12px;
  padding: 6px 9px;
  border-radius: 999px;
  cursor: pointer;
}
.lang-btn.is-active { background: var(--chili); color: #fff; }

.theme-toggle {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}
.theme-toggle .icon-sun,
.theme-toggle .icon-moon { width: 18px; height: 18px; }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
}

/* Images on/off toggle: same round-button style as the theme toggle. */
.images-toggle {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}
.images-toggle .icon-image-on,
.images-toggle .icon-image-off { width: 18px; height: 18px; }
/* Icon shown = the action a click performs (matches the sun/moon convention above):
   "image-off" (crossed out) shows while images are on, meaning "click to turn them off". */
.images-toggle .icon-image-on { display: none; }
.images-toggle .icon-image-off { display: block; }
:root[data-images="off"] .images-toggle .icon-image-on { display: block; }
:root[data-images="off"] .images-toggle .icon-image-off { display: none; }

/* Images off: collapse every food photo's slot entirely rather than just hiding the <img>,
   so the menu reads as a denser, text-only list instead of leaving blank reserved space. */
:root[data-images="off"] .menu-card-img-wrap,
:root[data-images="off"] .tiffin-visual { display: none; }

.site-nav {
  position: fixed;
  top: 64px;
  left: 0;
  right: 0;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  padding: 10px 20px 20px;
  gap: 4px;
  transform: translateY(-8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
  border-bottom: 1px solid var(--border);
}
.site-nav.is-open { opacity: 1; transform: translateY(0); pointer-events: auto; }
.site-nav a { padding: 12px 6px; font-weight: 600; border-bottom: 1px solid var(--border); }
.site-nav a:last-child { border-bottom: none; }
.nav-cta { color: var(--chili) !important; }

/* Hero */
.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(160deg, var(--hero-from) 0%, var(--teal-dark) 65%);
  color: #fff;
  padding: 56px 0 44px;
  text-align: center;
}
.hero-decor {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 15% 20%, rgba(242, 169, 59, 0.35), transparent 40%),
    radial-gradient(circle at 85% 80%, rgba(232, 73, 29, 0.35), transparent 45%);
  pointer-events: none;
}
.hero-inner { position: relative; display: flex; flex-direction: column; align-items: center; }
.hero-logo { width: 110px; height: 110px; margin-bottom: 18px; }
.hero-logo img, .hero-logo .brand-fallback { width: 110px; height: 110px; border-radius: 50%; box-shadow: 0 8px 24px rgba(0,0,0,0.25); }
.hero-logo .brand-fallback { display: none; font-size: 44px; }
.hero-logo.logo-fallback img { display: none; }
.hero-logo.logo-fallback .brand-fallback { display: flex; align-items: center; justify-content: center; }

.hero h1 {
  font-size: 42px;
  letter-spacing: 1px;
  margin-bottom: 10px;
}
.hero h1 span { color: var(--gold); }
.tagline { color: #fff; font-size: 17px; font-weight: 600; max-width: 520px; margin: 0 auto 8px; }
.hero-sub { color: rgba(255,255,255,0.8); max-width: 480px; margin: 0 auto 26px; }
.hero-ctas { display: flex; flex-direction: column; gap: 12px; width: 100%; max-width: 340px; }

/* Category nav */
.category-nav {
  position: sticky;
  top: 64px;
  z-index: 40;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 10px 0;
}
.category-nav-inner {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}
.category-nav-inner::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-weight: 600;
  font-size: 14px;
  color: var(--ink-soft);
}
.chip.is-active { background: var(--chili); color: #fff; border-color: var(--chili); }

/* Sections */
.section-title { font-size: 28px; color: var(--teal); }
.section-title.light { color: #fff; }
.section-sub { max-width: 560px; }
.section-sub strong { color: var(--chili-dark); }
.section-sub span { color: var(--teal); }

.menu-section { padding: 48px 0; }
.menu-category { margin-bottom: 34px; }
.menu-category h3 { font-size: 21px; color: var(--teal); display: flex; align-items: baseline; gap: 8px; }
.category-note { font-family: var(--font-body); font-size: 13px; font-weight: 500; color: var(--ink-soft); }
.menu-divider { border: none; border-top: 1px solid var(--border); margin: 30px 0; }

.menu-grid { display: grid; grid-template-columns: 1fr; gap: 12px; margin-top: 14px; }
.menu-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--card-shadow);
}
.menu-card-img { width: 100%; height: 140px; object-fit: cover; background: var(--bg-alt); }
.menu-card-img-fallback { height: 140px; display: flex; align-items: center; justify-content: center; text-align: center; padding: 10px; background: var(--bg-alt); color: var(--ink-soft); font-weight: 600; font-size: 13px; }
.menu-card-img-fallback[hidden] { display: none; }
.menu-card-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.menu-card-name { font-weight: 600; }
.menu-card-description { color: var(--ink-soft); font-size: 14px; line-height: 1.5; margin-top: 4px; }
.menu-card-price { color: var(--chili-dark); font-weight: 700; }
.menu-card-price small { display: block; font-weight: 500; font-size: 11px; text-transform: uppercase; letter-spacing: .03em; opacity: .75; color: var(--ink-soft); }

/* Sold out: dim the whole card so it reads as unavailable without hiding it (still shown for
   menu completeness/trust) — used on both menu cards and the tiffin section. */
.menu-card.is-sold-out .menu-card-img,
.menu-card.is-sold-out .menu-card-img-fallback { filter: grayscale(60%); opacity: .55; }
.menu-card.is-sold-out .menu-card-name,
.menu-card.is-sold-out .menu-card-description,
.menu-card.is-sold-out .menu-card-price { opacity: .6; }
.sold-out-badge {
  align-self: flex-start;
  background: var(--ink-soft);
  color: var(--surface);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .02em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 8px 16px;
}
.sold-out-badge[hidden] { display: none; }

/* Cart add / stepper controls (used on menu cards, tiffin, and the cart drawer) */
.cart-add-btn {
  border: 2px solid var(--teal);
  background: transparent;
  color: var(--teal);
  font-family: var(--font-display);
  font-weight: 700;
  border-radius: 999px;
  padding: 8px 16px;
  cursor: pointer;
  align-self: flex-start;
}
.cart-add-btn:hover { background: var(--teal); color: #fff; }
.cart-stepper[hidden] { display: none; }
.cart-stepper {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-alt);
  border-radius: 999px;
  padding: 4px 6px;
  align-self: flex-start;
}
.stepper-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: var(--teal);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.stepper-qty { font-weight: 700; min-width: 16px; text-align: center; }

/* Tiffin */
.tiffin-section { background: var(--bg-alt); padding: 48px 0; }
.tiffin-inner { display: flex; flex-direction: column; gap: 32px; align-items: center; }
.tiffin-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; margin: 18px 0; }
.tiffin-list li { padding: 8px 0; border-bottom: 1px dashed var(--border); font-weight: 600; }
.tiffin-meta { display: flex; align-items: center; gap: 18px; margin-bottom: 20px; }
.tiffin-price { font-family: var(--font-display); font-size: 30px; font-weight: 800; color: var(--chili-dark); }
.tiffin-price small { font-family: var(--font-body); font-size: 13px; font-weight: 500; color: var(--ink-soft); margin-left: 4px; }
.tiffin-availability { font-weight: 600; color: var(--teal); font-size: 14px; }
.tiffin-copy .cart-controls { margin-top: 4px; }

.tiffin-visual { width: 220px; height: 220px; flex-shrink: 0; border-radius: 50%; overflow: hidden; box-shadow: var(--shadow); }
.tiffin-visual img { width: 100%; height: 100%; object-fit: cover; }
.tiffin-image-fallback { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; text-align: center; padding: 16px; background: var(--bg-alt); color: var(--ink-soft); font-weight: 700; }
.tiffin-image-fallback[hidden] { display: none; }

/* About */
.about-section { padding: 48px 0; }
.about-inner { max-width: 640px; }
.about-inner p { font-size: 16px; }

/* Order banner */
.order-banner { background: linear-gradient(160deg, var(--chili) 0%, var(--order-banner-end) 100%); color: #fff; padding: 48px 0; text-align: center; }
.order-banner p { color: rgba(255,255,255,0.85); }
.order-buttons { display: flex; flex-direction: column; gap: 12px; align-items: center; }
.order-buttons .btn { width: 100%; max-width: 320px; }

/* Footer */
.site-footer { background: var(--teal-dark); color: rgba(255,255,255,0.85); padding: 36px 0 16px; }
.footer-inner { display: flex; flex-direction: column; gap: 24px; }
.footer-brand .brand-name { color: #fff; }
.footer-brand p { color: rgba(255,255,255,0.65); margin: 4px 0; font-size: 14px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 16px; font-weight: 600; }
.footer-copy { text-align: center; font-size: 13px; color: rgba(255,255,255,0.5); margin-top: 24px; }

/* Floating WhatsApp button */
.fab-whatsapp {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #25D366;
  color: #06341c;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 24px rgba(0,0,0,0.25);
  z-index: 60;
}
.fab-whatsapp .icon { width: 28px; height: 28px; }

/* Cart floating button */
.cart-fab[hidden] { display: none; }
.cart-fab {
  position: fixed;
  bottom: 88px;
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--chili);
  color: #fff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 24px rgba(0,0,0,0.25);
  z-index: 60;
  cursor: pointer;
}
.cart-fab .icon { width: 26px; height: 26px; }
.cart-fab-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--gold);
  color: var(--teal-dark);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 12px;
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid var(--bg);
}

/* Cart drawer */
.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 50, 52, 0.55);
  z-index: 70;
}
.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  z-index: 80;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform .25s ease;
  box-shadow: -10px 0 30px rgba(0,0,0,0.2);
}
.cart-drawer.is-open { transform: translateX(0); }
.cart-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}
.cart-drawer-header h3 { margin: 0; color: var(--teal); }
.cart-close {
  background: none;
  border: none;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  color: var(--ink-soft);
  padding: 4px 8px;
}
.cart-drawer-body { flex: 1; overflow-y: auto; padding: 12px 20px; }
.cart-empty { color: var(--ink-soft); text-align: center; margin-top: 24px; }
.cart-row {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.cart-row-name { font-weight: 600; font-size: 14px; }
.cart-row-unit { font-size: 12px; color: var(--ink-soft); }
.cart-row-total { font-weight: 700; color: var(--chili-dark); font-size: 14px; }
.cart-row-remove {
  background: none;
  border: none;
  font-size: 20px;
  line-height: 1;
  color: var(--ink-soft);
  cursor: pointer;
  padding: 4px;
}
.cart-drawer-footer { padding: 16px 20px 20px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 10px; }
.cart-total-row { display: flex; justify-content: space-between; align-items: baseline; font-family: var(--font-display); }
.cart-total-row strong { font-size: 22px; color: var(--chili-dark); }
.cart-drawer-footer .btn { width: 100%; }
.cart-note { font-size: 12px; margin: 0; color: var(--ink-soft); }

/* Checkout: items subtotal / delivery fee rows, Pickup/Delivery toggle, address, inline error, UPI VPA */
.cart-summary-row { display: flex; justify-content: space-between; align-items: baseline; font-size: 14px; color: var(--ink-soft); padding: 4px 0; }

.order-mode-toggle { display: flex; gap: 2px; background: var(--bg-alt); border-radius: 999px; padding: 3px; }
.order-mode-toggle input[type="radio"] { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.order-mode-btn { flex: 1; text-align: center; padding: 8px 14px; border-radius: 999px; font-weight: 700; font-family: var(--font-display); font-size: 14px; color: var(--ink-soft); cursor: pointer; }
.order-mode-toggle input:checked + .order-mode-btn { background: var(--teal); color: #fff; }

.delivery-address-field { display: flex; flex-direction: column; gap: 6px; }
.delivery-address-field[hidden] { display: none; }
.delivery-address-field label { font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.delivery-address-input { width: 100%; resize: vertical; min-height: 56px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--ink); font-family: var(--font-body); font-size: 14px; }
.delivery-address-input:focus { outline: 2px solid var(--teal); outline-offset: 1px; }

.checkout-error { font-size: 13px; font-weight: 600; color: var(--chili-dark); margin: 0; }
.checkout-error[hidden] { display: none; }

.upi-vpa-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--ink-soft); }
.upi-vpa-value { font-family: monospace; background: var(--bg-alt); padding: 2px 8px; border-radius: 6px; color: var(--ink); user-select: all; }
.upi-vpa-copy { border: 1px solid var(--border); background: var(--surface); color: var(--teal); font-weight: 700; font-size: 12px; padding: 4px 10px; border-radius: 999px; cursor: pointer; }
.upi-vpa-copy:hover { background: var(--teal); color: #fff; }

/* Tablet+ */
@media (min-width: 640px) {
  .hero-ctas, .order-buttons .btn { max-width: none; width: auto; }
  .hero-ctas { flex-direction: row; }
  .hero h1 { font-size: 52px; }
  .menu-grid { grid-template-columns: 1fr 1fr; }
  .order-buttons { flex-direction: row; justify-content: center; }
  .tiffin-inner { flex-direction: row; align-items: flex-start; text-align: left; }
  .about-inner { text-align: left; }
}

/* Desktop */
@media (min-width: 1024px) {
  .nav-toggle { display: none; }
  .site-nav {
    position: static;
    flex-direction: row;
    align-items: center;
    padding: 0;
    background: transparent;
    opacity: 1;
    transform: none;
    pointer-events: auto;
    border-bottom: none;
    gap: 28px;
  }
  .site-nav a { border-bottom: none; padding: 0; }
  .nav-cta {
    background: var(--chili);
    color: #fff !important;
    padding: 10px 20px;
    border-radius: 999px;
  }
  .site-nav { order: 1; }
  .site-actions { order: 2; }
  .menu-grid { grid-template-columns: 1fr 1fr 1fr; }
  .hero { padding: 80px 0 60px; }
}

/* What this file does: theming (CSS custom properties) + layout/components for the whole page. */
/* Security limits: presentation only — no user input is rendered unescaped here; that safety lives in js/main.js. */
/* Before production: swap placeholder image dimensions/colors if real photos differ, and re-check contrast if brand colors change. */
