/* =====================================================================
   NOVA Customer — mobile-first stylesheet
   ===================================================================== */
:root {
  --red: #e11d2e;
  --red-deep: #b31328;
  --red-soft: rgba(225, 29, 46, 0.08);

  --ink: #131316;
  --muted: #6b7280;
  --line: #e8e8ec;
  --bg: #f5f6f8;
  --card: #ffffff;
  --chip-bg: #f4f4f6;

  --green: #16a34a;
  --amber: #d97706;
  --blue: #2563eb;

  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Plus Jakarta Sans", var(--font-body);

  --radius: 16px;
  --radius-sm: 11px;
  --frame: 560px;
  --tabbar-h: 62px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
input, select, textarea, button { font-family: inherit; }
img { max-width: 100%; display: block; }

.app { max-width: var(--frame); margin: 0 auto; min-height: 100%; position: relative; }

/* ================= Top app bar ================= */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--card);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: var(--frame);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
}
.topbar .loc {
  display: flex; flex-direction: column; line-height: 1.15;
  min-width: 0;
}
.topbar .loc small {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--muted);
}
.topbar .loc b { font-size: 14.5px; font-family: var(--font-display); display: flex; align-items: center; gap: 5px; }
.topbar .loc b .caret { color: var(--red); }
.topbar .actions { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.icon-btn {
  position: relative;
  width: 40px; height: 40px;
  border-radius: 12px;
  border: 0; background: transparent; color: var(--ink);
  display: grid; place-items: center; cursor: pointer;
}
.icon-btn:hover { background: var(--chip-bg); }
.icon-btn .dot {
  position: absolute; top: 6px; right: 6px;
  min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 999px; background: var(--red); color: #fff;
  font-size: 10.5px; font-weight: 800; display: grid; place-items: center;
  border: 2px solid var(--card);
}

/* ================= Bottom tab bar ================= */
.tabbar {
  position: fixed;
  left: 50%; transform: translateX(-50%);
  bottom: 0;
  width: 100%; max-width: var(--frame);
  height: var(--tabbar-h);
  background: var(--card);
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  z-index: 30;
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; font-size: 10.5px; font-weight: 700; color: var(--muted);
  position: relative;
}
.tabbar a.active { color: var(--red); }
.tabbar a .icon { position: relative; }
.tabbar a .dot {
  position: absolute; top: -5px; right: -9px;
  min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 999px; background: var(--red); color: #fff;
  font-size: 10px; font-weight: 800; display: grid; place-items: center;
}

/* ================= Layout ================= */
.wrap { padding: 16px; padding-bottom: calc(var(--tabbar-h) + 24px); }
.wrap.flush { padding-left: 0; padding-right: 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin: 20px 0 10px; }
.section-head h2 { font-family: var(--font-display); font-size: 17px; margin: 0; letter-spacing: -0.01em; }
.section-head a { font-size: 13px; font-weight: 700; color: var(--red); }
.muted { color: var(--muted); }
.center { text-align: center; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
}
.card + .card { margin-top: 12px; }

/* ================= Buttons ================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 14.5px; font-weight: 700; font-family: var(--font-display);
  color: #fff; cursor: pointer;
  background: linear-gradient(135deg, var(--red), var(--red-deep));
  box-shadow: 0 12px 24px -14px rgba(225, 29, 46, 0.85);
  transition: filter 0.15s, transform 0.07s;
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { cursor: progress; filter: saturate(0.8) brightness(0.98); opacity: 0.85; }
.btn.block { width: 100%; }
.btn.ghost {
  background: var(--card); color: var(--ink);
  border: 1px solid var(--line); box-shadow: none;
}
.btn.ghost:hover { border-color: var(--red); color: var(--red); }
.btn.danger { background: #fff; color: var(--red); border: 1px solid #f3c6cc; box-shadow: none; }
.btn.sm { padding: 9px 12px; font-size: 13px; }

/* ================= Fields ================= */
.field { margin-bottom: 13px; }
.field label { display: block; font-size: 12.5px; font-weight: 600; margin-bottom: 6px; }
.input, select.input, textarea.input {
  width: 100%;
  padding: 11px 13px;
  font-size: 14px; color: var(--ink);
  background: #fafafb;
  border: 1px solid #e6e6eb;
  border-radius: var(--radius-sm);
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.input:focus { outline: none; background: #fff; border-color: var(--red); box-shadow: 0 0 0 4px var(--red-soft); }
textarea.input { min-height: 72px; resize: vertical; }

/* ================= Chips / segmented ================= */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 6px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; border: 1px solid var(--line); background: var(--card);
  border-radius: 999px; padding: 8px 14px; font-size: 13px; font-weight: 600;
  color: var(--muted); cursor: pointer; white-space: nowrap;
}
.chip.on { background: var(--red-soft); border-color: rgba(225, 29, 46, 0.3); color: var(--red); }

.seg { display: flex; background: var(--chip-bg); border-radius: 12px; padding: 4px; gap: 4px; }
.seg button {
  flex: 1; border: 0; background: transparent; padding: 9px 10px; border-radius: 9px;
  font-size: 13px; font-weight: 700; color: var(--muted); cursor: pointer;
}
.seg button.on { background: var(--card); color: var(--ink); box-shadow: 0 2px 8px -4px rgba(0,0,0,0.25); }

/* ================= Search ================= */
.search {
  display: flex; align-items: center; gap: 9px;
  background: var(--chip-bg); border-radius: 12px; padding: 11px 13px;
}
.search input { border: 0; background: transparent; outline: none; font-size: 14px; width: 100%; color: var(--ink); }
.search svg { color: var(--muted); flex: none; }

/* ================= Store card ================= */
.store-card {
  display: flex; gap: 12px; align-items: center;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px; cursor: pointer;
  transition: border-color 0.15s, transform 0.08s;
}
.store-card:hover { border-color: #d9d9df; }
.store-card:active { transform: scale(0.995); }
.store-card .thumb {
  width: 56px; height: 56px; border-radius: 13px; flex: none;
  display: grid; place-items: center; font-size: 24px;
  background: var(--red-soft); color: var(--red);
}
.store-card .info { min-width: 0; flex: 1; }
.store-card .info b { font-family: var(--font-display); font-size: 15px; display: block; }
.store-card .info .meta { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.store-card .info .tags { display: flex; gap: 6px; margin-top: 7px; flex-wrap: wrap; }
.stack { display: grid; gap: 10px; }

.badge {
  font-size: 11px; font-weight: 700; border-radius: 999px; padding: 2px 9px;
  background: var(--chip-bg); color: var(--muted);
}
.badge.open { background: rgba(22,163,74,0.1); color: var(--green); }
.badge.closed { background: rgba(107,114,128,0.12); color: var(--muted); }
.badge.pending { background: rgba(217,119,6,0.12); color: var(--amber); }
.badge.info { background: rgba(37,99,235,0.1); color: var(--blue); }

/* ================= Menu item ================= */
.menu-item {
  display: flex; gap: 12px; align-items: center;
  padding: 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
}
.menu-item .thumb {
  width: 52px; height: 52px; border-radius: 12px; flex: none;
  display: grid; place-items: center; font-size: 22px; background: var(--chip-bg);
}
.menu-item .info { flex: 1; min-width: 0; }
.menu-item .info b { font-size: 14.5px; display: block; }
.menu-item .info small { color: var(--muted); font-size: 12px; }
.menu-item .price { font-weight: 800; font-family: var(--font-display); color: var(--ink); font-size: 14.5px; margin-top: 3px; }
.menu-item .add {
  width: 34px; height: 34px; border-radius: 10px; flex: none;
  border: 0; background: var(--red); color: #fff; cursor: pointer; display: grid; place-items: center;
}
.menu-item .add:hover { background: var(--red-deep); }
.menu-item .add[disabled] { background: var(--chip-bg); color: var(--muted); cursor: not-allowed; }

/* ================= Qty control ================= */
.qty { display: inline-flex; align-items: center; gap: 12px; }
.qty button {
  width: 30px; height: 30px; border-radius: 9px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink); font-size: 17px; font-weight: 700;
  cursor: pointer; display: grid; place-items: center; line-height: 1;
}
.qty button:hover { border-color: var(--red); color: var(--red); }
.qty b { min-width: 20px; text-align: center; font-size: 14.5px; }

/* ================= Cart line ================= */
.cart-line { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.cart-line:last-child { border-bottom: 0; }
.cart-line .info { flex: 1; min-width: 0; }
.cart-line .info b { font-size: 14px; display: block; }
.cart-line .info small { color: var(--muted); font-size: 12.5px; }

/* ================= Summary ================= */
.summary .row { display: flex; justify-content: space-between; align-items: center; font-size: 13.5px; padding: 6px 0; }
.summary .row .k { color: var(--muted); }
.summary .row.total { border-top: 1px dashed var(--line); margin-top: 6px; padding-top: 12px; }
.summary .row.total .k { color: var(--ink); font-weight: 700; }
.summary .row.total .v { font-family: var(--font-display); font-size: 19px; font-weight: 800; }
.summary .row .v { font-weight: 700; }
.summary .note { font-size: 12px; color: var(--muted); margin-top: 8px; }

/* ================= Order status badge ================= */
.status {
  font-size: 11.5px; font-weight: 800; border-radius: 999px; padding: 3px 10px; text-transform: capitalize;
  background: var(--chip-bg); color: var(--muted);
}
.status.pending { background: rgba(217,119,6,0.12); color: var(--amber); }
.status.preparing { background: rgba(37,99,235,0.1); color: var(--blue); }
.status.ready { background: rgba(37,99,235,0.1); color: var(--blue); }
.status.assigned { background: rgba(124,58,237,0.12); color: #7c3aed; }
.status.on_the_way { background: rgba(124,58,237,0.12); color: #7c3aed; }
.status.delivered { background: rgba(22,163,74,0.12); color: var(--green); }
.status.completed { background: rgba(22,163,74,0.12); color: var(--green); }
.status.cancelled, .status.rejected { background: rgba(225,29,46,0.1); color: var(--red); }

/* ================= Stepper (tracking) ================= */
.stepper { display: grid; gap: 2px; }
.step { display: flex; gap: 12px; align-items: flex-start; }
.step .rail { display: flex; flex-direction: column; align-items: center; }
.step .dot {
  width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line);
  background: var(--card); display: grid; place-items: center; color: var(--muted);
  font-size: 12px; font-weight: 800;
}
.step .line { width: 2px; flex: 1; min-height: 20px; background: var(--line); }
.step .label { padding: 3px 0 16px; }
.step .label b { font-size: 14px; display: block; }
.step .label small { color: var(--muted); font-size: 12.5px; }
.step.done .dot { border-color: var(--green); background: var(--green); color: #fff; }
.step.done .line { background: var(--green); }
.step.now .dot { border-color: var(--red); color: var(--red); box-shadow: 0 0 0 4px var(--red-soft); }
.step:last-child .line { display: none; }

/* ================= Empty / loading ================= */
.empty { text-align: center; padding: 44px 20px; color: var(--muted); }
.empty .ic { font-size: 40px; margin-bottom: 10px; }
.empty h3 { font-family: var(--font-display); color: var(--ink); margin: 0 0 6px; font-size: 16px; }
.skeleton { background: linear-gradient(90deg, #eee 25%, #f5f5f5 37%, #eee 63%); background-size: 400% 100%; animation: sk 1.2s ease infinite; border-radius: 10px; }
@keyframes sk { 0% { background-position: 100% 50% } 100% { background-position: 0 50% } }
.spinner { width: 18px; height: 18px; border: 2px solid rgba(255,255,255,0.4); border-top-color: #fff; border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ================= Toast ================= */
.toast {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--tabbar-h) + 18px);
  background: var(--ink); color: #fff; font-size: 13.5px; font-weight: 600;
  padding: 11px 16px; border-radius: 12px; z-index: 60;
  opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s;
  max-width: calc(var(--frame) - 32px);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(-4px); }

/* ================= Modal ================= */
.modal { position: fixed; inset: 0; z-index: 70; display: none; }
.modal.show { display: block; }
.modal .backdrop { position: absolute; inset: 0; background: rgba(19,19,22,0.45); }
.modal .sheet {
  position: absolute; left: 50%; transform: translateX(-50%); bottom: 0;
  width: 100%; max-width: var(--frame);
  background: var(--card); border-radius: 20px 20px 0 0; padding: 20px 18px 26px;
  animation: slideup 0.22s ease both;
}
@keyframes slideup { from { transform: translateX(-50%) translateY(22px); opacity: 0; } to { transform: translateX(-50%) translateY(0); opacity: 1; } }
.modal h3 { font-family: var(--font-display); margin: 0 0 6px; font-size: 17px; }
.modal p { color: var(--muted); font-size: 13.5px; margin: 0 0 16px; }
.modal .actions { display: flex; gap: 10px; }
.modal .actions .btn { flex: 1; }

/* ================= Login page ================= */
.auth-hero {
  background: linear-gradient(160deg, #e11d2e, #9e1020);
  color: #fff; padding: 40px 24px 30px; border-radius: 0 0 26px 26px;
}
.auth-hero .mark {
  width: 52px; height: 52px; border-radius: 15px; display: grid; place-items: center;
  background: rgba(255,255,255,0.16); border: 1px solid rgba(255,255,255,0.3); margin-bottom: 16px;
}
.auth-hero h1 { font-family: var(--font-display); font-size: 24px; margin: 0 0 6px; letter-spacing: -0.02em; }
.auth-hero p { margin: 0; font-size: 13.5px; color: rgba(255,255,255,0.85); }
.auth-panel { padding: 22px 18px calc(var(--tabbar-h) + 24px); }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12.5px; margin: 16px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.btn-google {
  width: 100%; border: 1px solid var(--line); background: #fff; color: var(--ink);
  border-radius: var(--radius-sm); padding: 12px; font-size: 14px; font-weight: 600;
  display: flex; align-items: center; justify-content: center; gap: 10px; cursor: pointer;
}
.btn-google:hover { border-color: var(--red); }
.err { display: none; background: #fef2f2; color: #b31328; border: 1px solid #fbd0d0; border-radius: 11px; padding: 11px 13px; font-size: 13px; margin-bottom: 14px; }
.err.show { display: block; }
.foot-note { text-align: center; font-size: 13px; color: var(--muted); margin-top: 18px; }
.foot-note a { color: var(--red); font-weight: 700; }

/* ================= Utilities ================= */
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; } .mb-12 { margin-bottom: 12px; } .mb-16 { margin-bottom: 16px; }
.hidden { display: none !important; }
.grow { flex: 1; }
.pill-soft { background: var(--chip-bg); border-radius: 10px; padding: 8px 12px; font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 8px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ================= Horizontal step progress (order) ================= */
.steps { display: flex; gap: 5px; }
.steps .step {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center;
}
.steps .step .dot {
  width: 100%; height: 5px; border-radius: 999px; background: var(--line); border: 0;
}
.steps .step.done .dot { background: var(--green); }
.steps .step.now .dot { background: var(--red); }
.steps .step small { font-size: 9.5px; line-height: 1.2; color: var(--muted); font-weight: 600; }
.steps .step.now small { color: var(--red); }
.steps .step.done small { color: var(--ink); }

/* ================= Key/value rows ================= */
.kv { display: flex; justify-content: space-between; gap: 14px; padding: 7px 0; font-size: 13.5px; }
.kv span { color: var(--muted); flex: none; }
.kv b { text-align: right; }

/* ================= Note ================= */
.note { font-size: 12px; color: var(--muted); }
.note.bad { color: var(--red); font-weight: 700; }

/* ================= Button row ================= */
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-row .btn { flex: 1; min-width: 120px; }

/* ================= Profile card ================= */
.card.profile { display: flex; align-items: center; gap: 14px; }
.card.profile .avatar {
  width: 54px; height: 54px; border-radius: 50%; flex: none;
  background: var(--red-soft); color: var(--red);
  display: grid; place-items: center; font-family: var(--font-display); font-size: 22px; font-weight: 800;
}

/* ================= Simple list ================= */
.card.list { padding: 4px 14px; }
.card.list .item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0; font-size: 14.5px; font-weight: 600; border-bottom: 1px solid var(--line);
}
.card.list .item:last-child { border-bottom: 0; }

