/* =========================================================
   QR Menu — Customer App
   Design: "Lacquer & Gold"
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,600;9..144,700&family=Work+Sans:wght@400;500;600&family=IBM+Plex+Mono:wght@500&display=swap');

:root {
  --jade-deep: #0F3D3E;
  --jade-mid: #17514F;
  --gold: #C9A227;
  --gold-soft: #E4C873;
  --lac-red: #A63D40;
  --ivory: #F5EFE0;
  --paper: #FBF8F2;
  --charcoal: #201C1A;
  --line: rgba(15, 61, 62, 0.14);
  --radius: 14px;
  --shadow: 0 6px 20px rgba(15, 61, 62, 0.10);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--charcoal);
  font-family: 'Work Sans', sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .display { font-family: 'Fraunces', serif; font-weight: 600; letter-spacing: -0.01em; }
.price, .qty, .total-amount { font-family: 'IBM Plex Mono', monospace; }
a { color: inherit; }

/* ---------- Header ---------- */
.top-bar { background: var(--jade-deep); color: var(--ivory); padding: 22px 20px 26px; position: relative; overflow: hidden; }
.top-bar::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 10px;
  background-image: radial-gradient(circle at 10px 0, transparent 9px, var(--paper) 9.5px);
  background-size: 20px 10px; background-repeat: repeat-x;
}
.top-bar .eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--gold); margin-bottom: 6px; display: flex; align-items: center; gap: 8px; }
.top-bar h1 { margin: 0; font-size: 26px; color: var(--paper); }
.top-bar .table-tag { margin-top: 8px; font-size: 13px; color: rgba(245, 239, 224, 0.75); }

/* ---------- Category tabs ---------- */
.tabs-wrap { position: sticky; top: 0; z-index: 20; background: var(--paper); padding: 14px 16px 10px; border-bottom: 1px solid var(--line); }
.tabs { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab-btn { flex: 0 0 auto; padding: 9px 16px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font-size: 14px; font-weight: 500; cursor: pointer; white-space: nowrap; transition: all 0.15s ease; }
.tab-btn.active { background: var(--jade-deep); border-color: var(--jade-deep); color: var(--ivory); }

/* ---------- Menu list ---------- */
.menu-section { padding: 22px 16px 8px; }
.section-title { font-size: 20px; margin: 0 0 4px; color: var(--jade-deep); }
.section-divider { width: 100%; height: 10px; margin: 10px 0 16px; opacity: 0.55; }

.item-card { display: flex; gap: 14px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; margin-bottom: 12px; box-shadow: var(--shadow); }
.item-card img { width: 84px; height: 84px; border-radius: 10px; object-fit: cover; flex: 0 0 auto; background: var(--ivory); }
.item-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.item-info .name { font-weight: 600; font-size: 15.5px; margin: 0 0 3px; }
.item-info .desc { font-size: 12.5px; color: #6b6259; margin: 0 0 8px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.item-footer { margin-top: auto; display: flex; align-items: center; justify-content: space-between; }
.price { font-weight: 600; color: var(--lac-red); font-size: 14.5px; }

.stepper { display: flex; align-items: center; gap: 10px; background: var(--ivory); border-radius: 999px; padding: 4px 6px; }
.stepper button { width: 26px; height: 26px; border-radius: 50%; border: none; background: var(--jade-deep); color: var(--ivory); font-size: 16px; line-height: 1; cursor: pointer; }
.stepper button.add-btn { background: var(--gold); color: var(--charcoal); width: auto; padding: 0 14px; border-radius: 999px; font-size: 13px; font-weight: 600; height: 28px; }
.unavailable-tag { font-size: 11px; color: var(--lac-red); font-weight: 600; text-transform: uppercase; }

/* ---------- Sticky cart bar ---------- */
.cart-bar { position: fixed; left: 16px; right: 16px; bottom: 16px; background: var(--jade-deep); color: var(--ivory); border-radius: 999px; padding: 14px 20px; display: none; align-items: center; justify-content: space-between; box-shadow: 0 10px 30px rgba(15, 61, 62, 0.35); cursor: pointer; z-index: 30; }
.cart-bar.show { display: flex; }
.cart-bar .cart-count { background: var(--gold); color: var(--charcoal); border-radius: 50%; width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; margin-right: 10px; }
.cart-bar .label { font-weight: 600; font-size: 14.5px; }

/* ---------- Cart / Checkout drawer ---------- */
.drawer-overlay { position: fixed; inset: 0; background: rgba(15, 61, 62, 0.35); z-index: 40; display: none; }
.drawer-overlay.show { display: block; }
.drawer { position: fixed; left: 0; right: 0; bottom: 0; background: var(--paper); border-radius: 20px 20px 0 0; max-height: 86vh; overflow-y: auto; z-index: 50; transform: translateY(100%); transition: transform 0.25s ease; padding: 20px 18px 24px; }
.drawer.show { transform: translateY(0); }
.drawer-handle { width: 40px; height: 4px; background: var(--line); border-radius: 99px; margin: 0 auto 16px; }
.cart-line { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.summary-row { display: flex; justify-content: space-between; font-size: 14px; padding: 6px 0; color: #6b6259; }
.summary-row.total { font-weight: 700; font-size: 17px; color: var(--charcoal); border-top: 1px solid var(--line); margin-top: 8px; padding-top: 12px; }

.btn-primary { width: 100%; background: var(--lac-red); color: #fff; border: none; padding: 15px; border-radius: 12px; font-size: 15.5px; font-weight: 600; cursor: pointer; margin-top: 14px; }
.btn-primary:disabled { opacity: 0.5; }
.btn-secondary { width: 100%; background: transparent; border: 1.5px solid var(--line); padding: 13px; border-radius: 12px; font-weight: 600; cursor: pointer; margin-top: 10px; color: var(--charcoal); font-family: inherit; font-size: 14px; }
.btn-secondary:disabled { opacity: 0.5; }

.empty-state { text-align: center; padding: 40px 20px; color: #6b6259; }

/* ---------- Payment / status screens ---------- */
.status-screen { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 30px 24px; }
.qr-frame { border: 3px solid var(--gold); border-radius: 16px; padding: 14px; background: #fff; margin: 16px 0; }
.status-pill { display: inline-block; padding: 6px 14px; border-radius: 999px; background: var(--ivory); color: var(--jade-deep); font-weight: 600; font-size: 13px; margin-top: 10px; text-transform: capitalize; }

@media (min-width: 640px) {
  .page-wrap { max-width: 480px; margin: 0 auto; box-shadow: 0 0 40px rgba(0,0,0,0.06); min-height: 100vh; }
}

@media print {
  .cart-bar, .drawer-overlay, .drawer, .tabs-wrap, #backBtn, #recheckBtn, #qrDownloadBtn { display: none !important; }
}
