:root {
  --bg: #0e0e12;
  --bg-soft: #17171f;
  --card: #1c1c26;
  --card-hover: #23232f;
  --gold: #d4a95f;
  --gold-soft: #e7c789;
  --text: #f4f1ea;
  --muted: #9a968d;
  --line: rgba(212, 169, 95, 0.18);
  --green: #4caf50;
  --radius: 18px;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Poppins', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  overflow-x: hidden;
  min-height: 100vh;
}

/* Decorative glows */
.bg-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  z-index: 0;
  opacity: 0.35;
  pointer-events: none;
}
.glow-1 { width: 420px; height: 420px; background: #6b4f1e; top: -120px; right: -100px; }
.glow-2 { width: 360px; height: 360px; background: #2a3d4d; bottom: -120px; left: -120px; }

/* Header */
.header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px clamp(18px, 5vw, 60px);
  background: rgba(14, 14, 18, 0.75);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 46px; height: 46px;
  display: grid; place-items: center;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--gold), #a97e3a);
  color: #1a1a1a;
  font-family: 'Cormorant Garamond', serif;
  font-weight: 700;
  font-size: 26px;
  box-shadow: 0 6px 18px rgba(212, 169, 95, 0.35);
}
.brand-text h1 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0.5px;
  line-height: 1;
}
.brand-text span { font-size: 11px; color: var(--muted); letter-spacing: 2px; text-transform: uppercase; }

.qr-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px;
  border: 1px solid var(--gold);
  background: transparent;
  color: var(--gold-soft);
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  transition: 0.25s;
}
.qr-btn:hover { background: var(--gold); color: #1a1a1a; }

/* Hero */
.hero { position: relative; z-index: 1; text-align: center; padding: 48px clamp(18px, 5vw, 60px) 24px; }
.eyebrow { color: var(--gold); letter-spacing: 4px; text-transform: uppercase; font-size: 12px; }
.hero-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(38px, 8vw, 64px);
  font-weight: 700;
  margin: 6px 0 12px;
  background: linear-gradient(120deg, #fff, var(--gold-soft));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-sub { color: var(--muted); max-width: 520px; margin: 0 auto 28px; }

/* Controls */
.controls {
  display: flex; flex-wrap: wrap; gap: 14px;
  justify-content: center; align-items: center;
  max-width: 720px; margin: 0 auto;
}
.search {
  display: flex; align-items: center; gap: 10px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 13px 18px;
  flex: 1 1 300px;
  max-width: 400px;
  color: var(--muted);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.search:focus-within {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212,169,95,0.12);
}
.search svg { flex-shrink: 0; }
.search input {
  border: none; background: transparent; outline: none;
  color: var(--text); font-family: inherit; font-size: 16px; width: 100%;
  min-width: 0;
}
.search input::placeholder { color: var(--muted); }
.diet-filters { display: flex; gap: 8px; flex-shrink: 0; }
.chip {
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--muted);
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  transition: 0.2s;
}
.chip:hover { color: var(--text); }
.chip.active { background: var(--gold); color: #1a1a1a; border-color: var(--gold); font-weight: 500; }

/* Tabs */
.tabs {
  position: relative; z-index: 1;
  display: flex; gap: 10px;
  overflow-x: auto;
  padding: 24px clamp(18px, 5vw, 60px);
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  white-space: nowrap;
  padding: 10px 20px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  transition: 0.2s;
}
.tab:hover { color: var(--text); border-color: var(--gold); }
.tab.active { background: linear-gradient(135deg, var(--gold), #a97e3a); color: #1a1a1a; font-weight: 500; border-color: transparent; }

/* Menu grid */
.menu {
  position: relative; z-index: 1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  padding: 8px clamp(18px, 5vw, 60px) 40px;
  max-width: 1200px;
  margin: 0 auto;
}

/* Category heading */
.cat-heading {
  grid-column: 1 / -1;
  font-family: 'Cormorant Garamond', serif;
  font-size: 30px;
  color: var(--gold-soft);
  margin-top: 12px;
  display: flex; align-items: center; gap: 14px;
}
.cat-heading::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* Card */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: 0.28s;
  animation: rise 0.5s ease both;
}
.card:hover { transform: translateY(-6px); background: var(--card-hover); box-shadow: var(--shadow); border-color: var(--gold); }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }

.card-img {
  height: 180px;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #26262f, #1b1b23);
}
.card-img img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}
.card:hover .card-img img { transform: scale(1.06); }
/* Graceful fallback when a photo fails to load */
.card-img img.img-failed { opacity: 0; }
.card-img[data-emoji]::after {
  content: attr(data-emoji);
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-size: 56px;
  background: linear-gradient(135deg, #2a2a35, #1b1b23);
}
.badge {
  position: absolute; top: 12px; left: 12px;
  width: 20px; height: 20px; border-radius: 5px;
  display: grid; place-items: center;
  background: rgba(0,0,0,0.55);
}
.badge span { width: 10px; height: 10px; border-radius: 50%; display: block; }
.veg span { background: #52c26a; box-shadow: 0 0 0 2px #52c26a inset; }
.nonveg span { background: #e05353; box-shadow: 0 0 0 2px #e05353 inset; }
.tag-pop {
  position: absolute; top: 12px; right: 12px;
  background: var(--gold); color: #1a1a1a;
  font-size: 11px; font-weight: 600;
  padding: 4px 10px; border-radius: 999px;
}
.card-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.card-title { font-family: 'Cormorant Garamond', serif; font-size: 21px; font-weight: 600; }
.card-price { color: var(--gold-soft); font-weight: 600; white-space: nowrap; }
.card-desc { color: var(--muted); font-size: 13.5px; flex: 1; }
.card-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 4px; }
.rating { color: var(--gold); font-size: 13px; }
.add-btn {
  border: none; cursor: pointer;
  background: rgba(212,169,95,0.14);
  color: var(--gold-soft);
  padding: 8px 16px; border-radius: 999px;
  font-family: inherit; font-size: 13px; font-weight: 500;
  transition: 0.2s;
}
.add-btn:hover { background: var(--gold); color: #1a1a1a; }

/* Inline quantity stepper (shows once item is in cart) */
.add-control { display: flex; align-items: center; }
.add-control.in-cart {
  gap: 6px;
  background: rgba(212,169,95,0.14);
  border-radius: 999px;
  padding: 3px;
}
.qty-btn {
  border: none; cursor: pointer;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--gold); color: #1a1a1a;
  font-size: 18px; font-weight: 700; line-height: 1;
  display: grid; place-items: center;
  transition: 0.15s;
}
.qty-btn:hover { background: var(--gold-soft); }
.qty-num {
  min-width: 22px; text-align: center;
  font-weight: 600; font-size: 14px; color: var(--gold-soft);
}

/* Empty state */
.empty { text-align: center; color: var(--muted); padding: 40px; font-size: 18px; }

/* Footer */
.footer { position: relative; z-index: 1; text-align: center; padding: 40px 20px; border-top: 1px solid var(--line); color: var(--text); }
.footer .muted, .muted { color: var(--muted); font-size: 13px; }

/* Modal */
.modal {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(6px);
  padding: 20px;
  overflow-y: auto;
}
.modal-card {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 30px 28px;
  text-align: center;
  max-width: 340px; width: 100%;
  position: relative;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  animation: rise 0.35s ease both;
}
.modal-card h3 { font-family: 'Cormorant Garamond', serif; font-size: 26px; margin-bottom: 6px; }
.close {
  position: absolute; top: 12px; right: 16px;
  background: none; border: none; color: var(--muted);
  font-size: 26px; cursor: pointer; line-height: 1;
}
.close:hover { color: var(--text); }
.qrcode { display: grid; place-items: center; margin: 20px auto; padding: 14px; background: #fff; border-radius: 14px; width: fit-content; }
.qr-url { color: var(--muted); font-size: 12px; word-break: break-all; margin-bottom: 16px; }
.download-btn {
  border: none; cursor: pointer;
  background: linear-gradient(135deg, var(--gold), #a97e3a);
  color: #1a1a1a; font-family: inherit; font-weight: 600;
  padding: 11px 20px; border-radius: 999px; width: 100%;
  transition: 0.2s;
}
.download-btn:hover { filter: brightness(1.08); }

.hidden { display: none !important; }

/* ===== Floating cart button ===== */
.cart-fab {
  position: fixed; z-index: 40;
  bottom: 26px; right: 26px;
  width: 62px; height: 62px;
  border-radius: 50%;
  border: none; cursor: pointer;
  background: linear-gradient(135deg, var(--gold), #a97e3a);
  color: #1a1a1a;
  display: grid; place-items: center;
  box-shadow: 0 10px 30px rgba(212,169,95,0.45);
  transition: 0.25s;
}
.cart-fab:hover { transform: scale(1.08); }
.cart-count {
  position: absolute; top: -4px; right: -4px;
  min-width: 22px; height: 22px; padding: 0 6px;
  border-radius: 999px;
  background: #e05353; color: #fff;
  font-size: 12px; font-weight: 600;
  display: grid; place-items: center;
  border: 2px solid var(--bg);
  transform: scale(0); transition: transform 0.2s;
}
.cart-count.show { transform: scale(1); }

/* ===== Cart panel ===== */
.cart-overlay {
  position: fixed; inset: 0; z-index: 45;
  background: rgba(0,0,0,0.6); backdrop-filter: blur(4px);
}
.cart-panel {
  position: fixed; z-index: 46;
  top: 0; right: 0; height: 100%;
  width: min(400px, 92vw);
  background: var(--bg-soft);
  border-left: 1px solid var(--line);
  display: flex; flex-direction: column;
  transform: translateX(105%);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: -20px 0 60px rgba(0,0,0,0.5);
}
.cart-panel.open { transform: translateX(0); }
.cart-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 24px;
  border-bottom: 1px solid var(--line);
}
.cart-head h3 { font-family: 'Cormorant Garamond', serif; font-size: 26px; }
.cart-items { flex: 1 1 auto; min-height: 120px; overflow-y: auto; padding: 16px 24px; display: flex; flex-direction: column; gap: 14px; }
.cart-empty { flex: 1; display: flex; flex-direction: column; justify-content: center; text-align: center; color: var(--muted); font-size: 18px; gap: 6px; }
.cart-empty span { font-size: 13px; }

.cart-item { display: flex; gap: 12px; align-items: center; animation: rise 0.3s ease both; }
.cart-item-img { width: 58px; height: 58px; border-radius: 12px; background-size: cover; background-position: center; flex-shrink: 0; }
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name { font-size: 15px; font-weight: 500; }
.cart-item-price { color: var(--gold-soft); font-size: 13px; }
.qty { display: flex; align-items: center; gap: 10px; background: var(--card); border-radius: 999px; padding: 4px; }
.qty button { width: 26px; height: 26px; border-radius: 50%; border: none; cursor: pointer; background: rgba(212,169,95,0.15); color: var(--gold-soft); font-size: 16px; line-height: 1; transition: 0.2s; }
.qty button:hover { background: var(--gold); color: #1a1a1a; }
.qty span { min-width: 18px; text-align: center; font-size: 14px; }

.cart-foot { flex-shrink: 0; max-height: 55%; overflow-y: auto; border-top: 1px solid var(--line); padding: 14px 24px 18px; }
.cart-row { display: flex; justify-content: space-between; margin-bottom: 6px; font-size: 15px; }
.cart-row.total { font-size: 20px; font-weight: 600; color: var(--gold-soft); margin: 10px 0 14px; padding-top: 10px; border-top: 1px dashed var(--line); }
.checkout-btn {
  width: 100%; border: none; cursor: pointer;
  background: linear-gradient(135deg, var(--gold), #a97e3a);
  color: #1a1a1a; font-family: inherit; font-weight: 600; font-size: 16px;
  padding: 14px; border-radius: 14px; transition: 0.2s;
}
.checkout-btn:hover { filter: brightness(1.08); }
.checkout-btn:disabled { opacity: 0.5; cursor: not-allowed; filter: none; }

/* Order confirmation */
.check-anim {
  width: 70px; height: 70px; margin: 0 auto 14px;
  border-radius: 50%; display: grid; place-items: center;
  background: rgba(82,194,106,0.15); color: #52c26a;
  font-size: 38px; animation: pop 0.4s ease both;
}
@keyframes pop { 0% { transform: scale(0); } 70% { transform: scale(1.15); } 100% { transform: scale(1); } }
.order-summary { color: var(--muted); font-size: 14px; margin: 14px 0 18px; white-space: pre-line; }

/* Order fields at checkout */
.order-fields { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.order-fields input {
  width: 100%; background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 14px; color: var(--text);
  font-family: inherit; font-size: 15px; outline: none; transition: border-color 0.2s;
}
.order-fields input:focus { border-color: var(--gold); }
.type-toggle { display: flex; gap: 8px; }
.type-btn {
  flex: 1; cursor: pointer; font-family: inherit; font-size: 14px;
  background: var(--card); border: 1px solid var(--line); color: var(--muted);
  padding: 11px; border-radius: 10px; transition: 0.2s;
}
.type-btn.active { background: var(--gold); color: #1a1a1a; border-color: var(--gold); font-weight: 500; }
.order-id { color: var(--gold-soft); font-weight: 600; font-size: 15px; margin-bottom: 6px; }

/* App toast (customer side) */
.app-toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: #1e1e28; border: 1px solid var(--gold); color: var(--text);
  padding: 13px 22px; border-radius: 999px; font-size: 14px; z-index: 200;
  opacity: 0; transition: 0.3s; box-shadow: var(--shadow); pointer-events: none;
}
.app-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 640px) {
  .qr-btn span { display: none; }
  .qr-btn { padding: 10px; }

  .hero { padding: 34px 18px 20px; }

  .controls {
    flex-direction: column;
    gap: 12px;
    width: 100%;
  }
  .search {
    width: 100%;
    max-width: none;
    flex: none;
  }
  .diet-filters {
    width: 100%;
    justify-content: space-between;
  }
  .chip {
    flex: 1;
    text-align: center;
    padding: 11px 8px;
  }

  .menu {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .cat-heading { font-size: 26px; }
  .cart-fab { bottom: 18px; right: 18px; }
}

@media (max-width: 380px) {
  .chip { font-size: 12px; padding: 10px 6px; }
}

/* Table number locked from a QR code */
#tableNo.locked {
  background: rgba(212, 169, 95, 0.12);
  border-color: var(--gold);
  color: var(--gold-soft);
  font-weight: 600;
  cursor: not-allowed;
}
