@import url('https://fonts.googleapis.com/css2?family=Anton&family=Barlow:wght@400;500;600;700&family=Barlow+Semi+Condensed:wght@600;700&display=swap');

:root {
  --bg: #FBF5E7;
  --bg-panel: #FFFFFF;
  --bg-panel-2: #F3E9D2;
  --bg-card: #FFFFFF;
  --ink: #241207;
  --gold: #C98B12;
  --gold-bright: #E0A521;
  --gold-deep: #9C6B0B;
  --maroon: #8A2418;
  --maroon-bright: #C1350F;
  --cream-dim: #6E5B45;
  --line: rgba(36, 18, 7, 0.14);
  --shadow: 0 4px 14px rgba(36, 18, 7, 0.12);
  --status-received: #1F5C8A;
  --status-progress: #C98B12;
  --status-ready: #1F8A4C;
  --danger: #C1350F;
}

* { box-sizing: border-box; touch-action: manipulation; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Barlow', -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
}

h1, h2, h3, .display {
  font-family: 'Anton', sans-serif;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-weight: 400;
}

/* -------- Signature glow bar, echoes the poster's light strip -------- */
.glow-bar {
  height: 9px;
  width: 100%;
  background: linear-gradient(90deg, var(--maroon) 0%, var(--maroon-bright) 30%, var(--gold-bright) 55%, var(--maroon-bright) 80%, var(--maroon) 100%);
}

/* -------- Top bar shared across pages -------- */
.topbar {
  background: var(--maroon);
  color: #FFF6E4;
  padding: 16px 28px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}
.topbar h1 {
  margin: 0;
  font-size: 1.4rem;
  color: #FFF6E4;
}
.topbar .subtitle {
  font-size: 0.85rem;
  color: #F0CFA0;
  font-family: 'Barlow Semi Condensed', sans-serif;
}

/* ============ WELCOME SCREEN ============ */
.welcome-wrap {
  height: calc(100% - 61px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.welcome-card {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 48px 44px;
  width: min(520px, 100%);
  text-align: center;
}
.welcome-card h1 {
  font-size: 2rem;
  color: var(--maroon);
  margin: 0 0 8px;
}
.welcome-card .tagline {
  color: var(--cream-dim);
  margin-bottom: 32px;
  font-size: 1.05rem;
}
.welcome-card label {
  display: block; text-align: left; font-size: 0.9rem;
  color: var(--cream-dim); margin-bottom: 8px;
  font-family: 'Barlow Semi Condensed'; font-weight: 700;
}
.welcome-card input {
  width: 100%; padding: 16px 16px; border-radius: 12px;
  border: 2px solid var(--line); background: var(--bg);
  color: var(--ink); font-size: 1.2rem; font-family: 'Barlow';
  margin-bottom: 24px;
}
.welcome-card input:focus { outline: none; border-color: var(--gold-bright); }
.sms-consent-text {
  font-size: 0.72rem; color: var(--cream-dim); line-height: 1.4;
  margin-top: 8px; text-align: left;
}
.sms-consent-text a { color: var(--cream-dim); text-decoration: underline; }
.continue-btn {
  width: 100%; border: none; background: var(--maroon-bright); color: #FFF6E4;
  padding: 18px; border-radius: 12px; font-size: 1.15rem;
  font-family: 'Anton', sans-serif; letter-spacing: 0.04em;
}
.continue-btn:disabled { background: #D8CBB0; color: #9A8F79; }
.continue-btn:active:not(:disabled) { background: var(--maroon); }

/* ============ ORDER PAGE ============ */
.menu-wrap {
  display: grid;
  grid-template-columns: 1fr 380px;
  height: calc(100% - 61px);
}
.menu-scroll {
  overflow-y: auto;
  padding: 24px;
}
.category-label {
  font-family: 'Anton', sans-serif;
  font-size: 1.05rem;
  color: var(--maroon);
  margin: 22px 0 12px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--gold-bright);
}
.category-label:first-child { margin-top: 0; }

.item-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
.item-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.item-name { font-weight: 600; font-size: 1.02rem; color: var(--ink); }
.item-image {
  width: 100%; height: 110px; object-fit: cover; border-radius: 8px;
  margin-bottom: 2px;
}
.item-desc {
  font-size: 0.82rem; color: var(--cream-dim); line-height: 1.35;
}
.item-price { color: var(--gold-deep); font-weight: 700; font-family: 'Barlow Semi Condensed'; }
.item-status-tag {
  font-size: 0.78rem; font-weight: 700; padding: 4px 10px; border-radius: 8px;
  display: inline-block;
}
.tag-wait { background: rgba(201, 139, 18, 0.18); color: var(--gold-deep); }
.tag-out { background: rgba(193, 53, 15, 0.15); color: var(--danger); }
.item-card.item-out-of-stock { opacity: 0.6; }
.item-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
}
.stepper {
  display: flex;
  align-items: center;
  gap: 10px;
}
.stepper button {
  width: 42px; height: 42px;
  border-radius: 9px;
  border: 1.5px solid var(--line);
  background: var(--bg-panel-2);
  color: var(--ink);
  font-size: 1.3rem;
}
.stepper button:active { background: var(--gold-bright); color: #FFF; border-color: var(--gold-bright); }
.stepper .count { min-width: 20px; text-align: center; font-weight: 700; }

/* Cart panel */
.cart-panel {
  background: var(--bg-panel-2);
  border-left: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 20px;
}
.cart-panel h2 { margin: 0 0 4px; font-size: 1.05rem; color: var(--maroon); }
.ordering-for {
  font-family: 'Barlow Semi Condensed'; font-weight: 700;
  color: var(--gold-deep); margin-bottom: 14px; font-size: 1rem;
}

.cart-lines { flex: 1; overflow-y: auto; }
.cart-line {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0; border-bottom: 1px solid var(--line);
}
.cart-line .name { font-weight: 500; }
.cart-line .qty { color: var(--gold-deep); font-weight: 700; margin-right: 8px; }
.cart-empty { color: var(--cream-dim); text-align: center; margin-top: 40px; }
.cart-total-row {
  display: flex; justify-content: space-between;
  font-size: 1.3rem; font-weight: 700; padding: 16px 0;
  border-top: 2px solid var(--gold-deep);
  color: var(--maroon);
}
.checkout-btn {
  border: none; background: var(--maroon-bright); color: #FFF6E4;
  padding: 18px; border-radius: 12px; font-size: 1.15rem;
  font-family: 'Anton', sans-serif; letter-spacing: 0.04em;
}
.checkout-btn:disabled { background: #D8CBB0; color: #9A8F79; }
.checkout-btn:active:not(:disabled) { background: var(--maroon); }

/* Modal (payment method / confirmation / cash-confirm / payment-pending) */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(36, 18, 7, 0.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 50;
}
.modal {
  background: var(--bg-panel); border: 1px solid var(--line);
  border-radius: 18px; padding: 32px;
  width: min(520px, 90vw); text-align: center; box-shadow: var(--shadow);
}
.modal h2 { margin-top: 0; color: var(--maroon); }
.modal p { color: var(--cream-dim); line-height: 1.5; }
.pay-options { display: flex; gap: 16px; margin-top: 20px; }
.pay-btn {
  flex: 1; padding: 22px 14px; border-radius: 14px; border: 1.5px solid var(--line);
  background: var(--bg-panel-2); color: var(--ink);
  font-size: 1.05rem; font-weight: 600; font-family: 'Barlow';
}
.pay-btn:active { border-color: var(--gold-bright); background: #F0DFB8; }
.cancel-link { margin-top: 18px; color: var(--cream-dim); font-size: 0.9rem; }

.confirm-name-big {
  font-family: 'Anton', sans-serif; font-size: 2.6rem; color: var(--maroon);
  margin: 14px 0 4px;
}
.confirm-order-id {
  font-family: 'Barlow Semi Condensed'; font-weight: 700; font-size: 1.1rem;
  color: var(--cream-dim); letter-spacing: 0.03em; margin-bottom: 6px;
}

.volunteer-confirm-btn {
  width: 100%; border: none; background: var(--status-ready); color: #FFF;
  padding: 22px; border-radius: 14px; font-size: 1.15rem;
  font-family: 'Anton', sans-serif; letter-spacing: 0.03em; margin-top: 22px;
}
.volunteer-confirm-btn:active { filter: brightness(0.9); }
.flip-icon { font-size: 2.4rem; margin-bottom: 6px; }

.spinner {
  width: 46px; height: 46px; margin: 10px auto 4px;
  border: 5px solid var(--line); border-top-color: var(--gold-bright);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.add-btn {
  width: 100%; border: none; background: var(--gold-deep); color: #FFF6E4;
  padding: 12px; border-radius: 10px; font-weight: 700; font-size: 0.92rem;
  font-family: 'Barlow';
}
.add-btn:active { background: var(--maroon-bright); }
.item-badge {
  display: inline-block; background: var(--maroon-bright); color: #FFF;
  border-radius: 10px; padding: 1px 8px; font-size: 0.8rem; margin-left: 4px;
}

.retry-btn {
  border: none; background: var(--gold-bright); color: #241207;
  padding: 14px 22px; border-radius: 10px; font-weight: 700;
  font-family: 'Barlow'; margin-top: 16px;
}

.cart-line-options {
  font-size: 0.82rem; color: var(--gold-deep); font-weight: 600; margin-top: 2px;
}
.cart-line-right {
  display: flex; align-items: center; gap: 10px;
}
.cart-line-remove {
  border: none; background: none; color: var(--cream-dim); font-size: 1rem;
  padding: 2px 4px;
}
.cart-line-remove:active { color: var(--danger); }

.option-group { margin: 16px 0; text-align: left; }
.option-group-label {
  font-family: 'Barlow Semi Condensed'; font-weight: 700; color: var(--maroon);
  font-size: 0.95rem; margin-bottom: 8px;
}
.option-choices { display: flex; flex-wrap: wrap; gap: 8px; }
.option-choice-btn {
  padding: 10px 16px; border-radius: 20px; border: 1.5px solid var(--line);
  background: var(--bg-panel-2); color: var(--ink); font-size: 0.95rem; font-family: 'Barlow';
}
.option-choice-btn.selected {
  background: var(--maroon-bright); border-color: var(--maroon-bright); color: #FFF6E4; font-weight: 600;
}

/* Cash confirmation: total + passcode keypad */
.cash-summary {
  background: var(--bg-panel-2); border-radius: 12px; padding: 14px 18px;
  margin: 16px 0; text-align: left;
}
.cash-summary-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 4px 0; font-size: 1.05rem;
}
.cash-summary-row.total {
  font-family: 'Anton', sans-serif; font-size: 1.5rem; color: var(--maroon);
  border-top: 1px solid var(--line); margin-top: 6px; padding-top: 10px;
}

.passcode-dots {
  display: flex; justify-content: center; gap: 16px; margin: 18px 0;
}
.passcode-dots .dot {
  width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid var(--gold-deep); background: transparent;
}
.passcode-dots .dot.filled { background: var(--maroon-bright); border-color: var(--maroon-bright); }
.passcode-dots.error .dot { border-color: var(--danger); background: var(--danger); }

.keypad {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
  max-width: 300px; margin: 0 auto;
}
.keypad button {
  padding: 18px 0; border-radius: 12px; border: 1px solid var(--line);
  background: var(--bg-panel-2); color: var(--ink);
  font-size: 1.4rem; font-family: 'Barlow'; font-weight: 600;
}
.keypad button:active { background: var(--gold-bright); color: #FFF; }
.keypad button.keypad-back { font-size: 1.1rem; color: var(--maroon-bright); }

/* ============ HISTORY PAGE ============ */
.history-link {
  color: #FFF6E4; text-decoration: underline; font-size: 0.9rem;
  font-family: 'Barlow Semi Condensed'; font-weight: 600;
}
.history-search-bar {
  padding: 18px 24px 4px;
}
.history-search-bar input {
  width: 100%; padding: 14px 16px; border-radius: 10px;
  border: 1.5px solid var(--line); background: var(--bg-panel);
  color: var(--ink); font-size: 1.1rem; font-family: 'Barlow';
}
.history-list { padding: 12px 24px 24px; }
.history-card {
  background: var(--bg-card); border: 1px solid var(--line); border-radius: 12px;
  padding: 16px 18px; margin-bottom: 12px; box-shadow: var(--shadow);
}
.history-card-top {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px;
}
.history-meta { font-size: 0.85rem; color: var(--cream-dim); margin-top: 4px; }

/* ============ KITCHEN SCREEN ============ */
.board { padding: 22px; }
.columns { display: grid; gap: 22px; grid-template-columns: 1fr 1fr; }

.col-heading {
  font-family: 'Anton', sans-serif;
  font-size: 1.2rem;
  color: var(--maroon);
  padding-bottom: 8px;
  margin-bottom: 4px;
  border-bottom: 3px solid var(--gold-bright);
  display: flex; justify-content: space-between; align-items: baseline;
}
.col-heading .count { font-size: 1rem; color: var(--gold-deep); font-family: 'Barlow Semi Condensed'; }

.order-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 18px;
  box-shadow: var(--shadow);
  margin-bottom: 14px;
  border-left: 7px solid var(--status-received);
}
.order-card.status-received { border-left-color: var(--status-received); }
.order-card.status-in_progress { border-left-color: var(--status-progress); }
.order-card.status-ready { border-left-color: var(--status-ready); }

.order-card-top {
  display: flex; justify-content: space-between; align-items: center;
}
.order-id {
  font-family: 'Barlow Semi Condensed'; font-weight: 700; font-size: 0.9rem;
  color: var(--cream-dim); letter-spacing: 0.02em;
}
.order-name {
  font-family: 'Anton', sans-serif; font-size: 1.5rem; color: var(--ink);
  margin-right: 8px;
}
.order-elapsed { font-size: 0.82rem; color: var(--cream-dim); }
.order-items-list {
  margin: 10px 0; padding-left: 20px; font-size: 1rem; line-height: 1.6;
}
.order-items-list li { margin-bottom: 2px; }
.order-tag {
  display: inline-block; font-size: 0.72rem; font-weight: 700;
  padding: 3px 9px; border-radius: 20px; margin-left: 8px;
  background: var(--maroon-bright); color: #FFF6E4; vertical-align: middle;
}
.order-actions { display: flex; gap: 10px; margin-top: 10px; }
.order-actions button {
  flex: 1; padding: 13px; border-radius: 10px; border: none;
  font-weight: 700; font-size: 1rem; font-family: 'Anton', sans-serif;
  letter-spacing: 0.02em;
}
.btn-start { background: var(--status-progress); color: #FFF; }
.btn-ready { background: var(--status-ready); color: #FFF; }
.order-actions button:disabled { opacity: 0.5; }

/* ============ PICKUP SCREEN — row list ============ */
.pickup-list { padding: 8px 24px 24px; }
.pickup-row {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: 12px; padding: 16px 22px; margin-bottom: 10px;
  box-shadow: var(--shadow);
}
.pickup-row-left {
  display: flex; align-items: baseline; gap: 14px;
}
.pickup-order-id { font-family: 'Barlow Semi Condensed'; font-weight: 700; font-size: 1rem; color: var(--cream-dim); }
.pickup-name { font-size: 1.6rem; font-family: 'Anton', sans-serif; color: var(--maroon); }
.status-pill {
  font-family: 'Barlow Semi Condensed'; font-weight: 700; font-size: 0.95rem;
  padding: 8px 18px; border-radius: 30px; text-transform: uppercase; letter-spacing: 0.03em;
  color: #FFF;
}
.status-pill.received { background: var(--status-received); }
.status-pill.in_progress { background: var(--status-progress); }
.status-pill.ready { background: var(--status-ready); }
.status-pill.completed { background: var(--cream-dim); }
.status-pill.awaiting_payment { background: var(--gold-deep); }
.status-pill.failed { background: var(--danger); }

.empty-state { color: var(--cream-dim); text-align: center; padding: 40px; font-size: 1.1rem; }

/* ============ ADMIN DASHBOARD ============ */
.stat-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}
.stat-box {
  background: var(--bg-card); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 16px; box-shadow: var(--shadow); text-align: center;
}
.stat-value { font-family: 'Anton', sans-serif; font-size: 1.8rem; color: var(--maroon); }
.stat-label { font-size: 0.82rem; color: var(--cream-dim); margin-top: 2px; }
.stat-note { font-size: 0.7rem; color: var(--cream-dim); margin-top: 6px; line-height: 1.3; }
.stat-box.quota-ok .stat-value { color: var(--status-ready); }
.stat-box.quota-warn { border-color: var(--gold-deep); }
.stat-box.quota-warn .stat-value { color: var(--gold-deep); }
.stat-box.quota-danger { border-color: var(--danger); background: rgba(193,53,15,0.08); }
.stat-box.quota-danger .stat-value { color: var(--danger); }

.menu-status-row {
  background: var(--bg-card); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 18px; margin-bottom: 10px;
}
.menu-status-name { font-weight: 600; margin-bottom: 8px; }
.menu-status-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.status-btn {
  padding: 8px 14px; border-radius: 20px; border: 1.5px solid var(--line);
  background: var(--bg-panel-2); color: var(--ink); font-size: 0.88rem; font-family: 'Barlow'; font-weight: 600;
}
.status-btn.selected-normal { background: var(--status-ready); border-color: var(--status-ready); color: #FFF; }
.status-btn.selected-wait { background: var(--status-progress); border-color: var(--status-progress); color: #FFF; }
.status-btn.selected-out { background: var(--danger); border-color: var(--danger); color: #FFF; }
.menu-status-note {
  width: 100%; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--bg); color: var(--ink); font-size: 0.88rem; font-family: 'Barlow';
}

@media (max-width: 900px) {
  .menu-wrap { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  .cart-panel { max-height: 48vh; }
  .columns { grid-template-columns: 1fr; }
}

/* ============ MOBILE ONLINE ORDERING (online.html) ============ */
.mobile-menu-wrap {
  height: calc(100% - 61px);
  overflow-y: auto;
  padding-bottom: 90px; /* room for the sticky cart bar */
}
.mobile-menu-wrap .menu-scroll { padding: 18px; }

.cart-bar {
  position: fixed; left: 16px; right: 16px; bottom: 16px; width: auto;
  background: var(--maroon-bright); color: #FFF6E4;
  border: none; border-radius: 16px; padding: 16px 20px; margin: 0;
  display: flex; align-items: center; justify-content: space-between;
  box-shadow: 0 6px 20px rgba(0,0,0,0.35);
  font-family: 'Barlow'; font-weight: 700; font-size: 1rem;
  z-index: 30;
  -webkit-appearance: none; appearance: none;
  -webkit-tap-highlight-color: transparent;
}
.cart-bar-total { font-family: 'Anton', sans-serif; font-size: 1.15rem; }
.cart-bar-view {
  background: rgba(255,255,255,0.2); padding: 6px 14px; border-radius: 20px;
  font-size: 0.9rem;
}
.wallet-btn-slot { min-height: 44px; margin-bottom: 10px; }
.apple-pay-native-btn {
  width: 100%; background: #000; color: #FFF; border: none;
  border-radius: 8px; padding: 10px; font-size: 1rem; font-weight: 600;
  font-family: -apple-system, 'SF Pro Text', 'Barlow', sans-serif;
  -webkit-appearance: none; appearance: none;
}
.apple-pay-native-btn:active { background: #222; }
.payment-divider {
  width: 100%; background: none; border: none;
  text-align: center; color: var(--cream-dim); font-size: 0.85rem;
  margin: 14px 0; padding: 8px 0; position: relative;
  font-family: 'Barlow'; text-decoration: underline;
  -webkit-appearance: none; appearance: none;
}
.payment-divider::before, .payment-divider::after {
  content: ''; position: absolute; top: 50%; width: 32%; height: 1px; background: var(--line);
}
.payment-divider::before { left: 0; }
.payment-divider::after { right: 0; }
