/* ===================================================================
   Bite & Brew JTMK — Design System
   Modern blue & white theme, mobile-first, responsive to tablet/desktop
=================================================================== */

:root {
  --blue-900: #0b2e63;
  --blue-800: #123a7a;
  --blue-700: #1a4ba3;
  --blue-600: #2563c9;
  --blue-500: #3b82f6;
  --blue-400: #60a5fa;
  --blue-100: #e5f0ff;
  --blue-50:  #f4f8ff;
  --white: #ffffff;
  --ink: #10192b;
  --ink-soft: #4b5768;
  --border: #dfe7f5;
  --success: #16a34a;
  --warning: #d97706;
  --danger: #dc2626;

  /* Accent palette — blue + gold/beige theme. Gold carries CTAs, prices,
     tags and badges; the softer beige tones fill gradients so the app
     reads warm without drifting into unrelated hues. */
  --accent: #eaa221;       /* warm gold */
  --accent-dark: #c07f0f;
  --accent-2: #f4c04f;     /* light gold */
  --accent-3: #f6d998;     /* beige/sand */
  --accent-4: #1a4ba3;     /* deep blue (reused for gradients) */
  --accent-100: #fdf1da;   /* pale beige */

  --bg: var(--blue-50);
  --surface: var(--white);
  --text: var(--ink);
  --text-soft: var(--ink-soft);
  --border-c: var(--border);
  --shadow: 0 4px 18px rgba(18, 58, 122, 0.08);
  --shadow-lg: 0 12px 32px rgba(11, 46, 99, 0.14);
  --radius: 16px;
  --radius-sm: 10px;
  --header-h: 68px;
  --bottom-nav-h: 64px;
}

html[data-theme="dark"] {
  --bg: #0a1526;
  --surface: #111f38;
  --text: #eef3fc;
  --text-soft: #a8b8d3;
  --border-c: #223257;
  --blue-50: #0f1d36;
  --blue-100: #14294a;
  --accent-100: #35280f;
  --shadow: 0 4px 18px rgba(0,0,0,0.35);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.5);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  transition: background .25s ease, color .25s ease;
  /* Layered colour glows (blue, pink, teal, orange) + a faint coffee-bean tile,
     instead of a flat fill — gives the whole app a warmer, more "café" feel. */
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 6% 0%, rgba(59,130,246,0.22), transparent 42%),
    radial-gradient(circle at 100% 10%, rgba(234,162,33,0.16), transparent 40%),
    radial-gradient(circle at 15% 100%, rgba(37,99,201,0.14), transparent 44%),
    radial-gradient(circle at 92% 92%, rgba(244,192,79,0.18), transparent 42%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cg fill='none' stroke='rgba(37,99,201,0.10)' stroke-width='3' stroke-linecap='round'%3E%3Cellipse cx='28' cy='30' rx='15' ry='9' transform='rotate(-30 28 30)'/%3E%3Cpath d='M16 30 Q28 22 40 30' transform='rotate(-30 28 30)'/%3E%3Cellipse cx='90' cy='84' rx='15' ry='9' transform='rotate(35 90 84)'/%3E%3Cpath d='M78 84 Q90 76 102 84' transform='rotate(35 90 84)'/%3E%3C/g%3E%3C/svg%3E");
  background-repeat: no-repeat, no-repeat, no-repeat, no-repeat, repeat;
  background-size: auto, auto, auto, auto, 120px 120px;
  background-attachment: fixed, fixed, fixed, fixed, fixed;
}
html[data-theme="dark"] body {
  background-image:
    radial-gradient(circle at 6% 0%, rgba(59,130,246,0.26), transparent 42%),
    radial-gradient(circle at 100% 10%, rgba(234,162,33,0.20), transparent 40%),
    radial-gradient(circle at 15% 100%, rgba(37,99,201,0.18), transparent 44%),
    radial-gradient(circle at 92% 92%, rgba(244,192,79,0.20), transparent 42%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cg fill='none' stroke='rgba(96,165,250,0.14)' stroke-width='3' stroke-linecap='round'%3E%3Cellipse cx='28' cy='30' rx='15' ry='9' transform='rotate(-30 28 30)'/%3E%3Cpath d='M16 30 Q28 22 40 30' transform='rotate(-30 28 30)'/%3E%3Cellipse cx='90' cy='84' rx='15' ry='9' transform='rotate(35 90 84)'/%3E%3Cpath d='M78 84 Q90 76 102 84' transform='rotate(35 90 84)'/%3E%3C/g%3E%3C/svg%3E");
  background-repeat: no-repeat, no-repeat, no-repeat, no-repeat, repeat;
  background-size: auto, auto, auto, auto, 120px 120px;
}
@media (max-width: 640px) {
  /* fixed backgrounds can jank on mobile scroll — keep it static there */
  body { background-attachment: scroll; }
}
/* ---------------- Flash / splash screen ---------------- */
.bb-splash {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--blue-800), var(--blue-600) 55%, var(--accent));
  opacity: 1; transition: opacity .45s ease;
}
.bb-splash-hide { opacity: 0; pointer-events: none; }
.bb-splash-inner { text-align: center; color: #fff; }
.bb-splash-icon {
  font-size: 3.4rem; display: inline-block;
  animation: bb-splash-bounce 1.1s ease-in-out infinite;
}
.bb-splash-title { margin-top: 10px; font-size: 1.15rem; font-weight: 800; letter-spacing: .3px; }
.bb-splash-spinner {
  margin: 22px auto 0; width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.3); border-top-color: #fff;
  animation: bb-splash-spin .8s linear infinite;
}
@keyframes bb-splash-bounce { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes bb-splash-spin { to { transform: rotate(360deg); } }

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
::selection { background: var(--blue-400); color: #fff; }

/* ---------------- Layout ---------------- */
.bb-main { min-height: calc(100vh - var(--header-h) - 76px); padding: 24px 20px 60px; max-width: 1200px; margin: 0 auto; }
.container-narrow { max-width: 640px; margin: 0 auto; }

/* ---------------- Navbar ---------------- */
.bb-navbar {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(10px) saturate(1.1);
  -webkit-backdrop-filter: blur(10px) saturate(1.1);
  border-bottom: 1px solid var(--border-c);
  height: var(--header-h);
  box-shadow: var(--shadow);
}
.bb-navbar-inner {
  max-width: 1200px; margin: 0 auto; height: 100%;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px;
}
.bb-brand {
  font-size: 1.25rem; font-weight: 800; color: var(--blue-800);
  display: flex; align-items: center; gap: 8px; white-space: nowrap;
}
html[data-theme="dark"] .bb-brand { color: var(--blue-400); }
.bb-brand-icon { font-size: 1.4rem; }
.brand-amp { color: var(--blue-500); }
.brand-jtmk { color: var(--text-soft); font-weight: 600; font-size: 0.95rem; }

.bb-nav { display: flex; align-items: center; gap: 6px; }
.bb-nav a {
  padding: 9px 14px; border-radius: var(--radius-sm); font-weight: 600; font-size: 0.94rem;
  color: var(--text-soft); position: relative;
}
.bb-nav a:hover, .bb-nav a.active { background: var(--blue-100); color: var(--blue-700); }
html[data-theme="dark"] .bb-nav a.active, html[data-theme="dark"] .bb-nav a:hover { color: var(--blue-400); }

.bb-brand-textcol { display: flex; flex-direction: column; line-height: 1.18; min-width: 0; }
.bb-hello { display: none; font-size: 0.72rem; font-weight: 700; color: var(--text-soft); }
.bb-brand-name { white-space: nowrap; }
.bb-tagline { display: none; font-size: 0.68rem; font-weight: 500; color: var(--text-soft); }

.bb-header-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; order: 2; }
.bb-header-cart-btn {
  position: relative; background: var(--blue-100); width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 1.05rem; color: var(--blue-700);
}
.bb-header-cart-btn .bb-notif-badge { position: absolute; top: -4px; right: -4px; background: var(--accent); }

.bb-btn-outline, .bb-btn-solid {
  padding: 9px 18px; border-radius: 999px; font-weight: 700; font-size: 0.9rem; border: 2px solid var(--blue-600);
}
.bb-btn-outline { color: var(--blue-700); background: transparent; }
.bb-btn-outline:hover { background: var(--blue-100); }
.bb-btn-solid { color: #fff; background: linear-gradient(135deg, var(--blue-600), var(--blue-700)); border-color: transparent; }
.bb-btn-solid:hover { filter: brightness(1.08); }

.bb-theme-toggle {
  background: var(--blue-100); border: none; width: 38px; height: 38px; border-radius: 50%;
  font-size: 1.05rem; display: flex; align-items: center; justify-content: center;
}

.bb-burger {
  display: none; flex-direction: column; justify-content: center; gap: 5px;
  background: none; border: none; width: 40px; height: 40px;
}
.bb-burger span { width: 100%; height: 2.5px; background: var(--blue-700); border-radius: 2px; }

/* ---------------- Mobile bottom tab bar (students only) ---------------- */
.bb-bottom-nav {
  display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 100;
  height: var(--bottom-nav-h);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(10px) saturate(1.1);
  -webkit-backdrop-filter: blur(10px) saturate(1.1);
  border-top: 1px solid var(--border-c);
  box-shadow: 0 -4px 18px rgba(18, 58, 122, 0.10);
  align-items: stretch; justify-content: space-around;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.bb-bottom-nav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; font-size: 0.66rem; font-weight: 700; color: var(--text-soft); position: relative;
}
.bb-bottom-nav .bn-icon { font-size: 1.25rem; line-height: 1; }
.bb-bottom-nav a.active { color: var(--blue-700); }
html[data-theme="dark"] .bb-bottom-nav a.active { color: var(--accent); }
.bb-bottom-nav a.active .bn-icon { transform: translateY(-1px); }
.bn-badge {
  position: absolute; top: 4px; right: calc(50% - 22px);
  background: var(--accent); color: #fff; font-size: 0.62rem; font-weight: 800;
  border-radius: 999px; padding: 0 5px; min-width: 15px; text-align: center; line-height: 15px;
}
@media (max-width: 780px) {
  .bb-bottom-nav { display: flex; }
  .bb-main { padding-bottom: calc(var(--bottom-nav-h) + 28px); }
}

/* ---------------- Footer ---------------- */
.bb-footer { background: var(--surface); border-top: 1px solid var(--border-c); margin-top: 24px; }
.bb-footer-inner {
  max-width: 1200px; margin: 0 auto; padding: 14px 20px;
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px;
}
.bb-footer-inner strong { font-size: 0.92rem; }
.bb-footer-inner p { color: var(--text-soft); font-size: 0.78rem; margin: 1px 0 0; }
.bb-footer-links { display: flex; gap: 16px; }
.bb-footer-links a { color: var(--text-soft); font-size: 0.82rem; font-weight: 600; }
.bb-footer-links a:hover { color: var(--blue-600); }
.bb-footer-bottom { text-align: center; padding: 8px; font-size: 0.72rem; color: var(--text-soft); border-top: 1px solid var(--border-c); }

@media (max-width: 480px) {
  .bb-footer-inner { flex-direction: column; align-items: flex-start; padding: 12px 16px; }
  .bb-footer-links { gap: 12px; }
}

/* ---------------- Toasts / flash ---------------- */
.bb-toast {
  padding: 13px 18px; border-radius: var(--radius-sm); margin-bottom: 18px; font-weight: 600; font-size: 0.92rem;
  border-left: 4px solid; animation: slideIn .25s ease;
}
.bb-toast-success { background: #ecfdf3; color: #087443; border-color: var(--success); }
.bb-toast-error { background: #fef2f2; color: #a3182b; border-color: var(--danger); }
.bb-toast-info { background: var(--blue-100); color: var(--blue-700); border-color: var(--blue-500); }
html[data-theme="dark"] .bb-toast-success { background: #0d2a1c; }
html[data-theme="dark"] .bb-toast-error { background: #2a1213; }
@keyframes slideIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }

/* toast popup (JS-triggered, floating) */
.bb-toast-float {
  position: fixed; top: 84px; right: 20px; z-index: 999;
  background: var(--surface); box-shadow: var(--shadow-lg); border-radius: var(--radius-sm);
  padding: 14px 20px; border-left: 4px solid var(--blue-600); font-weight: 600;
  animation: slideIn .25s ease; max-width: 320px;
}

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: 999px; border: none; font-weight: 700; font-size: 0.95rem;
  transition: transform .12s ease, filter .12s ease; cursor: pointer;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: linear-gradient(135deg, var(--blue-600), var(--blue-800)); color: #fff; box-shadow: 0 6px 16px rgba(37,99,201,0.3); }
.btn-primary:hover { filter: brightness(1.07); }
.btn-secondary { background: var(--blue-100); color: var(--blue-700); }
.btn-secondary:hover { background: var(--blue-400); color: #fff; }
.btn-accent { background: linear-gradient(135deg, var(--accent), var(--accent-dark)); color: #fff; box-shadow: 0 6px 16px rgba(234,162,33,0.35); }
.btn-accent:hover { filter: brightness(1.07); }
.btn-danger { background: #fee2e2; color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-success { background: #dcfce7; color: var(--success); }
.btn-success:hover { background: var(--success); color: #fff; }
.btn-sm { padding: 8px 16px; font-size: 0.83rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.add-to-cart { background: linear-gradient(135deg, var(--accent), var(--accent-dark)); box-shadow: 0 6px 16px rgba(234,162,33,0.35); }

/* ---------------- Cards ---------------- */
.card {
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
  border: 1px solid var(--border-c); padding: 22px;
}
.section-title { font-size: 1.5rem; font-weight: 800; margin: 0 0 6px; color: var(--blue-800); }
html[data-theme="dark"] .section-title { color: var(--blue-400); }
.section-sub { color: var(--text-soft); margin: 0 0 22px; }

/* ---------------- Grid ---------------- */
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 980px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* ---------------- Forms ---------------- */
.form-group { margin-bottom: 18px; }
label { display: block; font-weight: 700; font-size: 0.88rem; margin-bottom: 6px; color: var(--text); }
input, select, textarea {
  width: 100%; padding: 12px 14px; border-radius: var(--radius-sm); border: 1.5px solid var(--border-c);
  background: var(--surface); color: var(--text); font-size: 0.95rem; font-family: inherit;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue-500); box-shadow: 0 0 0 3px rgba(59,130,246,0.15); }
.form-hint { font-size: 0.78rem; color: var(--text-soft); margin-top: 4px; }
.input-row { display: flex; gap: 12px; }
.input-row > * { flex: 1; }

/* ---------------- Payment method picker ---------------- */
.pay-options { display: flex; flex-direction: column; gap: 10px; }
.pay-option {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  border: 1.5px solid var(--border-c); border-radius: var(--radius-sm);
  cursor: pointer; transition: border-color .15s, background .15s; margin-bottom: 0;
}
.pay-option:hover { border-color: var(--blue-500); }
.pay-option.selected { border-color: var(--accent); background: var(--accent-100); }
.pay-option input[type="radio"] { width: auto; flex: 0 0 auto; margin: 0; }
.pay-option-icon { font-size: 1.4rem; flex: 0 0 auto; }
.pay-option-text { display: flex; flex-direction: column; gap: 2px; }
.pay-option-text strong { font-size: 0.92rem; }
.pay-option-text small { font-size: 0.76rem; color: var(--text-soft); font-weight: 500; }

/* ---------------- Avatar ---------------- */
.avatar-circle {
  width: 96px; height: 96px; border-radius: 50%; object-fit: cover;
  border: 3px solid var(--surface); box-shadow: 0 4px 14px rgba(0,0,0,0.15); background: var(--blue-100);
}
.avatar-initials {
  width: 96px; height: 96px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 2.1rem; font-weight: 800; color: #fff; box-shadow: 0 4px 14px rgba(0,0,0,0.15);
  background: linear-gradient(135deg, var(--blue-600), var(--accent-4));
}
.avatar-picker { display: flex; align-items: center; gap: 18px; margin-bottom: 18px; flex-wrap: wrap; }
.avatar-picker-actions { display: flex; flex-direction: column; gap: 6px; }
.bb-profile-link { display: flex; align-items: center; gap: 7px; }
.bb-nav-avatar { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; }

/* ---------------- Auth pages ---------------- */
.auth-wrap { display: flex; justify-content: center; padding: 30px 0 60px; }
.auth-card { width: 100%; max-width: 420px; text-align: center; }
.auth-icon { font-size: 2.6rem; margin-bottom: 6px; }
.auth-switch { margin-top: 16px; font-size: 0.9rem; color: var(--text-soft); }
.auth-switch a { color: var(--blue-600); font-weight: 700; }
.demo-box { background: var(--blue-100); border-radius: var(--radius-sm); padding: 12px 14px; font-size: 0.78rem; color: var(--blue-800); margin-top: 18px; text-align: left; }
html[data-theme="dark"] .demo-box { color: var(--blue-400); }

/* ---------------- Hero (landing) ---------------- */
.hero {
  background: linear-gradient(135deg, var(--blue-900), var(--blue-600) 65%, var(--accent));
  border-radius: 24px; color: #fff; padding: 56px 36px; text-align: center; margin-bottom: 40px;
  box-shadow: var(--shadow-lg);
}
.hero h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); margin: 0 0 12px; font-weight: 800; }
.hero p { font-size: 1.05rem; opacity: 0.92; max-width: 560px; margin: 0 auto 26px; }
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.hero .btn-primary { background: #fff; color: var(--blue-700); box-shadow: none; }
.hero .btn-secondary { background: rgba(255,255,255,0.18); color: #fff; }

.feature-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 40px; }
@media (max-width: 780px) { .feature-strip { grid-template-columns: repeat(2, 1fr); } }
.feature-item { text-align: center; padding: 20px 10px; }
.feature-item .icon { font-size: 1.8rem; margin-bottom: 8px; }
.feature-item h4 { margin: 0 0 4px; font-size: 0.95rem; }
.feature-item p { margin: 0; font-size: 0.8rem; color: var(--text-soft); }

/* ---------------- Menu / product cards ---------------- */
.bb-home-greeting { margin-bottom: 4px; }
.bb-home-hello { margin: 0 0 4px; font-weight: 700; color: var(--text-soft); font-size: 0.92rem; }

.bb-search-row { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; }
.bb-search-bar {
  flex: 1; display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1.5px solid var(--border-c); border-radius: 999px;
  padding: 12px 18px; box-shadow: var(--shadow);
}
.bb-search-bar .bb-search-icon { font-size: 1rem; color: var(--text-soft); flex-shrink: 0; }
.bb-search-bar input {
  border: none; padding: 0; background: transparent; font-size: 0.95rem;
}
.bb-search-bar input:focus { outline: none; box-shadow: none; }

.bb-filter-wrap { position: relative; flex-shrink: 0; }
.bb-filter-btn {
  width: 46px; height: 46px; border-radius: 50%; border: 1.5px solid var(--border-c);
  background: var(--surface); font-size: 1.05rem; box-shadow: var(--shadow);
  display: flex; align-items: center; justify-content: center;
}
.bb-filter-panel {
  display: none; position: absolute; top: 54px; right: 0; z-index: 60; min-width: 200px;
  background: var(--surface); border: 1px solid var(--border-c); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg); padding: 8px; flex-direction: column; gap: 2px;
}
.bb-filter-panel.open { display: flex; }
.sort-option {
  text-align: left; padding: 9px 12px; border-radius: 8px; font-size: 0.85rem; font-weight: 600;
  color: var(--text-soft); background: transparent;
}
.sort-option:hover { background: var(--blue-100); }
.sort-option.active { background: var(--accent-100); color: var(--accent-dark); }

.category-tabs { display: flex; gap: 16px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 22px; scrollbar-width: thin; }
.category-tabs button {
  flex-shrink: 0; display: flex; flex-direction: column; align-items: center; gap: 6px;
  white-space: nowrap; background: transparent; color: var(--text-soft); font-weight: 700; font-size: 0.74rem;
}
.category-tabs .cat-icon {
  width: 56px; height: 56px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; background: var(--surface); border: 1.5px solid var(--border-c); box-shadow: var(--shadow);
  transition: background .15s ease, border-color .15s ease;
}
.category-tabs button.active .cat-icon {
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); border-color: transparent;
}
.category-tabs button.active .cat-label { color: var(--accent-dark); }
html[data-theme="dark"] .category-tabs button.active .cat-label { color: var(--accent); }

.menu-card {
  position: relative;
  background: var(--surface); border-radius: var(--radius); border: 1px solid var(--border-c); overflow: hidden;
  box-shadow: var(--shadow); display: flex; flex-direction: column; transition: transform .15s ease, box-shadow .15s ease;
}
.menu-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.menu-card-img {
  position: relative;
  height: 130px; background: linear-gradient(135deg, var(--accent-2), var(--accent-3), var(--blue-400));
  display: flex; align-items: center; justify-content: center; font-size: 2.6rem;
}
.menu-card-body { padding: 16px; flex: 1; display: flex; flex-direction: column; }
.menu-card-body h3 { margin: 0 0 4px; font-size: 1.02rem; }
.menu-card-body p { margin: 0 0 10px; font-size: 0.83rem; color: var(--text-soft); flex: 1; }
.menu-card-footer { display: flex; align-items: center; justify-content: space-between; margin-top: auto; }
.price-tag { font-weight: 800; color: var(--accent-dark); font-size: 1.05rem; }
html[data-theme="dark"] .price-tag { color: var(--accent); }

.tag-pill-overlay {
  position: absolute; top: 10px; left: 10px; z-index: 2;
  background: var(--accent); color: #fff; box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}
html[data-theme="dark"] .tag-pill-overlay { color: #fff; }

.add-to-cart-circle {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0; border: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark)); color: #fff;
  font-size: 1.2rem; font-weight: 700; line-height: 1; box-shadow: 0 4px 12px rgba(234,162,33,0.4);
  display: flex; align-items: center; justify-content: center;
}
.add-to-cart-circle:active { transform: scale(0.92); }
.tag-pill { display: inline-block; font-size: 0.68rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--accent-100); color: var(--accent-dark); margin-bottom: 6px; width: fit-content; }
html[data-theme="dark"] .tag-pill { color: var(--accent); }
.stock-low { color: var(--warning); font-weight: 700; font-size: 0.75rem; }
.stock-out { color: var(--danger); font-weight: 700; font-size: 0.75rem; }

.qty-stepper { display: flex; align-items: center; gap: 10px; background: var(--blue-50); border-radius: 999px; padding: 4px; }
.qty-stepper button { width: 28px; height: 28px; border-radius: 50%; border: none; background: var(--surface); font-weight: 800; color: var(--blue-700); box-shadow: 0 1px 4px rgba(0,0,0,0.1); }
.qty-stepper span { min-width: 18px; text-align: center; font-weight: 700; }

.cart-layout { grid-template-columns: 2fr 1fr; align-items: start; }
@media (max-width: 780px) { .cart-layout { grid-template-columns: 1fr; } }

/* ---------------- Cart ---------------- */
.cart-item { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--border-c); }
.cart-item:last-child { border-bottom: none; }
.cart-item-icon { width: 52px; height: 52px; border-radius: 12px; background: var(--blue-100); display: flex; align-items: center; justify-content: center; font-size: 1.5rem; flex-shrink: 0; }
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-info h4 { margin: 0 0 2px; font-size: 0.95rem; }
.cart-item-info span { font-size: 0.8rem; color: var(--text-soft); }
.cart-remove { background: none; border: none; color: var(--danger); font-size: 0.8rem; font-weight: 700; }
.cart-summary-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 0.92rem; }
.cart-summary-row.total { font-size: 1.15rem; font-weight: 800; border-top: 1px dashed var(--border-c); margin-top: 8px; padding-top: 14px; }
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-soft); }
.empty-state .icon { font-size: 3rem; margin-bottom: 12px; }

/* ---------------- Order tracking ---------------- */
.order-card { padding: 18px 20px; }
.order-card-head { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.order-number { font-weight: 800; font-size: 1.05rem; }
.order-date { font-size: 0.8rem; color: var(--text-soft); }
.status-pill { padding: 5px 14px; border-radius: 999px; font-size: 0.78rem; font-weight: 700; }
.status-pending { background: #fef3c7; color: #92400e; }
.status-preparing { background: #dbeafe; color: #1e40af; }
.status-ready { background: #d1fae5; color: #065f46; }
.status-completed { background: #e5e7eb; color: #374151; }
.status-cancelled { background: #fee2e2; color: #991b1b; }

/* Payment-incomplete warning flag — used on the student & staff order cards */
.payment-flag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 999px; font-size: 0.76rem; font-weight: 800;
  background: var(--danger); color: #fff; margin: 2px 0 10px;
  box-shadow: 0 2px 10px rgba(220,38,38,0.35);
  animation: bb-flag-pulse 1.6s ease-in-out infinite;
}
@keyframes bb-flag-pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(220,38,38,0.45); } 50% { box-shadow: 0 0 0 6px rgba(220,38,38,0); } }

.track-steps { display: flex; justify-content: space-between; margin: 22px 0 8px; position: relative; }
.track-steps::before { content: ''; position: absolute; top: 15px; left: 0; right: 0; height: 3px; background: var(--border-c); z-index: 0; }
.track-step { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; flex: 1; }
.track-dot { width: 32px; height: 32px; border-radius: 50%; background: var(--surface); border: 3px solid var(--border-c); display: flex; align-items: center; justify-content: center; font-size: 0.85rem; }
.track-step.done .track-dot { background: var(--blue-600); border-color: var(--blue-600); color: #fff; }
.track-step.current .track-dot { border-color: var(--blue-600); color: var(--blue-600); animation: pulse 1.5s infinite; }
.track-step span.label { font-size: 0.72rem; color: var(--text-soft); text-align: center; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(37,99,201,0.4);} 50% { box-shadow: 0 0 0 6px rgba(37,99,201,0);} }

/* ---------------- Loyalty / badges ---------------- */
.points-hero {
  background: linear-gradient(135deg, var(--blue-900), var(--blue-600) 55%, var(--accent)); color: #fff; border-radius: var(--radius);
  padding: 28px; text-align: center; margin-bottom: 28px; box-shadow: var(--shadow-lg);
}
.points-hero .num { font-size: 2.6rem; font-weight: 800; }
.points-hero .lbl { opacity: 0.9; font-size: 0.9rem; }

.badge-card { text-align: center; padding: 24px 16px; position: relative; }
.badge-card.locked { opacity: 0.55; filter: grayscale(0.4); }
.badge-icon {
  font-size: 2.6rem; margin-bottom: 8px; display: inline-flex; align-items: center; justify-content: center;
  width: 72px; height: 72px; border-radius: 50%; background: var(--blue-100);
}
.badge-card:nth-of-type(4n+1) .badge-icon { background: linear-gradient(135deg, #f7c893, #b9793f22), #fdeee0; }
.badge-card:nth-of-type(4n+2) .badge-icon { background: linear-gradient(135deg, #e6e9ef, #b8bfcb22), #eef1f6; }
.badge-card:nth-of-type(4n+3) .badge-icon { background: linear-gradient(135deg, #ffe49a, #d4a01722), #fff3d1; }
.badge-card:nth-of-type(4n+4) .badge-icon { background: linear-gradient(135deg, #a9c6f2, #2563c922), #e5f0ff; }
.badge-card h4 { margin: 0 0 4px; }
.badge-card p { font-size: 0.8rem; color: var(--text-soft); margin: 0 0 12px; }
.progress-bar { height: 8px; border-radius: 999px; background: var(--blue-100); overflow: hidden; margin-bottom: 14px; }
.progress-bar-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 999px; transition: width .4s ease; }
.voucher-code { background: var(--accent-100); border: 1.5px dashed var(--accent); border-radius: var(--radius-sm); padding: 8px 12px; font-weight: 800; letter-spacing: 1px; color: var(--accent-dark); margin-top: 10px; }
html[data-theme="dark"] .voucher-code { color: var(--accent); }

/* ---------------- AI Chatbot ---------------- */
.chatbot-card {
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, var(--accent-100), var(--blue-50));
  border-color: transparent;
}
.chatbot-icon {
  font-size: 1.8rem; flex-shrink: 0; width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 4px 12px rgba(234,162,33,0.35);
  animation: chatbotFloat 2.6s ease-in-out infinite;
}
@keyframes chatbotFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-4px) rotate(-6deg); }
}
#chatbotInput { transition: box-shadow .2s ease, border-color .2s ease; }
#chatbotInput:focus { border-color: var(--blue-500); box-shadow: 0 0 0 3px rgba(59,130,246,0.15); }

.chatbot-typing { display: inline-flex; align-items: center; gap: 4px; padding: 2px 0; }
.chatbot-typing span {
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
  animation: chatbotBounce 1.2s infinite ease-in-out;
}
.chatbot-typing span:nth-child(2) { animation-delay: .15s; }
.chatbot-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes chatbotBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: .5; }
  30% { transform: translateY(-6px); opacity: 1; }
}

.chatbot-msg { animation: chatbotIn .3s ease; }
@keyframes chatbotIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

.chatbot-suggest-btn { animation: chatbotIn .3s ease backwards; }
.chatbot-suggest-btn:nth-child(1) { animation-delay: .05s; }
.chatbot-suggest-btn:nth-child(2) { animation-delay: .15s; }
.chatbot-suggest-btn:nth-child(3) { animation-delay: .25s; }

/* ---------------- Required-field validation ---------------- */
.input-error, select.input-error, textarea.input-error {
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 3px rgba(220,38,38,0.15) !important;
  animation: fieldShake .3s ease;
}
@keyframes fieldShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}
.field-error-msg { color: var(--danger); font-size: 0.78rem; margin-top: 4px; display: block; }

/* ---------------- Ratings ---------------- */
.star-rating { display: flex; gap: 4px; font-size: 1.8rem; justify-content: center; }
.star-rating button { background: none; border: none; color: var(--border-c); }
.star-rating button.active, .star-rating button:hover { color: #f59e0b; }

/* ---------------- Tables (admin) ---------------- */
.table-wrap { overflow-x: auto; }
table.bb-table { width: 100%; border-collapse: collapse; min-width: 640px; }
table.bb-table th, table.bb-table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--border-c); font-size: 0.88rem; }
table.bb-table th { color: var(--text-soft); font-weight: 700; text-transform: uppercase; font-size: 0.72rem; letter-spacing: 0.03em; }
table.bb-table tr:hover { background: var(--blue-50); }
.pill-role { padding: 3px 10px; border-radius: 999px; font-size: 0.72rem; font-weight: 700; background: var(--blue-100); color: var(--blue-700); }

/* ---------------- Admin layout ---------------- */
.admin-shell { display: grid; grid-template-columns: 230px 1fr; gap: 24px; align-items: start; }
@media (max-width: 900px) { .admin-shell { grid-template-columns: 1fr; } }
.admin-side { background: var(--surface); border: 1px solid var(--border-c); border-radius: var(--radius); padding: 16px; position: sticky; top: 90px; }
@media (max-width: 900px) { .admin-side { position: static; } }
.admin-side a {
  display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: var(--radius-sm);
  color: var(--text-soft); font-weight: 700; font-size: 0.9rem; margin-bottom: 4px;
}
.admin-side a.active, .admin-side a:hover { background: var(--blue-100); color: var(--blue-700); }
.stat-card { display: flex; align-items: center; gap: 14px; }
.stat-card .icon { width: 48px; height: 48px; border-radius: 12px; background: linear-gradient(135deg, var(--accent-100), var(--blue-100)); display: flex; align-items: center; justify-content: center; font-size: 1.4rem; flex-shrink: 0; }
.stat-card .num { font-size: 1.5rem; font-weight: 800; }
.stat-card .lbl { font-size: 0.8rem; color: var(--text-soft); }

.modal-overlay {
  display: none; position: fixed; inset: 0; background: rgba(10,21,38,0.55); z-index: 200;
  align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal-box { background: var(--surface); border-radius: var(--radius); padding: 26px; width: 100%; max-width: 480px; max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-lg); }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.modal-close { background: none; border: none; font-size: 1.3rem; color: var(--text-soft); }

/* ---------------- Utility ---------------- */
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; } .mt-32 { margin-top: 32px; }
.mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; } .mb-24 { margin-bottom: 24px; }
.text-center { text-align: center; }
.text-soft { color: var(--text-soft); }
.w-full { width: 100%; }

/* ---------------- Responsive nav ---------------- */
@media (max-width: 880px) {
  .bb-burger { display: flex; }
  .bb-nav {
    position: fixed; top: var(--header-h); left: 0; right: 0; bottom: 0;
    background: var(--surface); flex-direction: column; align-items: stretch; padding: 18px;
    transform: translateX(100%); transition: transform .25s ease; overflow-y: auto;
  }
  .bb-nav.open { transform: translateX(0); }
  .bb-nav a, .bb-nav button { width: 100%; justify-content: flex-start; margin-bottom: 6px; text-align: left; }
  .bb-hello, .bb-tagline { display: block; }
  .bb-brand-name { font-size: 1rem; }
  .bb-header-actions { order: 0; }
}

@media (max-width: 480px) {
  .bb-main { padding: 16px 14px calc(var(--bottom-nav-h) + 28px); }
  .hero { padding: 38px 20px; border-radius: 18px; }
}

/* ---------------- Notification bell ---------------- */
.bb-notif-wrap { position: relative; }
.bb-notif-btn {
  position: relative; background: var(--blue-100); border: none; width: 38px; height: 38px;
  border-radius: 50%; cursor: pointer; font-size: 1.05rem; display: flex; align-items: center; justify-content: center;
}
.bb-notif-badge {
  position: absolute; top: -4px; right: -4px; background: var(--danger); color: #fff;
  font-size: 0.65rem; font-weight: 800; min-width: 17px; height: 17px; border-radius: 999px;
  display: flex; align-items: center; justify-content: center; padding: 0 3px; line-height: 1;
}
.bb-notif-panel {
  position: absolute; top: 46px; right: 0; width: 320px; max-height: 400px; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border-c); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg); z-index: 500; display: none;
}
.bb-notif-panel.open { display: block; }
.bb-notif-panel-head {
  display: flex; align-items: center; justify-content: space-between; padding: 12px 14px;
  border-bottom: 1px solid var(--border-c); position: sticky; top: 0; background: var(--surface);
}
.bb-notif-panel-head button {
  background: none; border: none; color: var(--blue-600); font-size: 0.78rem; font-weight: 700; cursor: pointer;
}
.bb-notif-list { padding: 6px; }
.bb-notif-empty { padding: 20px 10px; text-align: center; color: var(--text-soft); font-size: 0.85rem; margin: 0; }
.bb-notif-item {
  display: block; width: 100%; text-align: left; padding: 10px 10px; border-radius: var(--radius-sm);
  border: none; background: transparent; cursor: pointer; margin-bottom: 2px;
}
.bb-notif-item:hover { background: var(--blue-50); }
.bb-notif-item.unread { background: var(--blue-50); }
.bb-notif-item .n-title { font-weight: 700; font-size: 0.86rem; display: flex; align-items: center; gap: 6px; }
.bb-notif-item .n-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--blue-600); flex-shrink: 0; }
.bb-notif-item .n-msg { font-size: 0.8rem; color: var(--text-soft); margin: 3px 0 0; }
.bb-notif-item .n-time { font-size: 0.7rem; color: var(--text-soft); margin-top: 4px; display: block; }

/* ---------------- Favourite heart ---------------- */
.fav-btn {
  position: absolute; top: 10px; right: 10px; z-index: 2; width: 32px; height: 32px; border-radius: 50%;
  border: none; background: rgba(255,255,255,0.9); cursor: pointer; font-size: 1.05rem;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  transition: transform 0.15s ease;
}
.fav-btn:hover { transform: scale(1.1); }
.fav-btn.is-fav { color: var(--danger); }
.menu-card { position: relative; }

/* ---------------- Pickup ETA ---------------- */
.eta-note {
  display: inline-flex; align-items: center; gap: 6px; font-size: 0.82rem; font-weight: 600;
  color: var(--blue-700); background: var(--blue-50); border-radius: 999px; padding: 5px 12px; margin-top: 10px;
}
html[data-theme="dark"] .eta-note { color: var(--blue-400); }

/* ---------------- Order again ---------------- */
.btn-reorder { margin-top: 10px; }


/* Real AI chatbot controls */
.chatbot-input-row { display:flex; gap:8px; align-items:center; }
.chatbot-input-row input { flex:1; min-width:0; }
.chatbot-quick-prompts { display:flex; flex-wrap:wrap; gap:6px; margin-top:8px; }
.chatbot-msg { padding:10px 12px; border-radius:12px; margin-bottom:8px; line-height:1.5; }
.chatbot-user { background:var(--surface); border:1px solid var(--border); }
.chatbot-ai { background:var(--blue-50); }

@media (max-width: 600px) {
  .chatbot-input-row { align-items:stretch; }
  .chatbot-input-row .btn { flex:0 0 auto; }
  .chatbot-quick-prompts .btn { flex:1 1 auto; }
}
