/* ============ Hong Chiang Ordering — ESB-style UI ============ */
:root {
  --orange: #f05a24;
  --orange-soft: #fdeee7;
  --orange-banner: #fdecd9;
  --ink: #1f2024;
  --ink-2: #5c5f66;
  --ink-3: #9a9da3;
  --bg: #f4f4f5;
  --card: #ffffff;
  --line: #ececee;
  --green: #18a553;
  --red: #d7263d;
  --radius: 14px;
  --shadow: 0 1px 4px rgba(20, 20, 30, .07);
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: "Inter", "PingFang TC", "Noto Sans TC", system-ui, -apple-system, "Segoe UI", sans-serif;
  background: #e8e8ea;
  color: var(--ink);
}
.phone {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
  background: var(--bg);
  position: relative;
  box-shadow: 0 0 24px rgba(0,0,0,.12);
  padding-bottom: 110px;
}
button { font: inherit; cursor: pointer; border: 0; background: none; }
input, textarea { font: inherit; }
.hidden { display: none !important; }

/* ---- top table chip ---- */
.table-chip {
  background: #fbe3dc;
  text-align: center;
  padding: 9px 0;
  font-size: 14px;
  color: var(--ink);
  letter-spacing: .2px;
}

/* ---- header ---- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 10px;
  background: var(--card);
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}
.topbar .back {
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  border: 1px solid var(--line); background: #fff;
  font-size: 17px; flex: none;
}
.topbar h1 { font-size: 17px; font-weight: 800; flex: 1; letter-spacing: .2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .icon-btn { width: 36px; height: 36px; display: grid; place-items: center; font-size: 18px; flex: none; }

/* ---- hero banner ---- */
.hero {
  position: relative; overflow: hidden;
  background: linear-gradient(120deg, #7a1313, #b3321b 55%, #7a1313);
  color: #fff; padding: 22px 18px 26px;
}
.hero .zh { font-family: "Noto Serif TC", serif; font-size: 21px; font-weight: 900; letter-spacing: 2px; text-shadow: 0 2px 0 rgba(0,0,0,.35); }
.hero .sub { margin-top: 6px; font-size: 12.5px; opacity: .92; }
.hero .bowls { position: absolute; right: 10px; top: 8px; font-size: 34px; filter: drop-shadow(0 4px 4px rgba(0,0,0,.4)); }
.hero .ribbon {
  display: inline-block; margin-top: 12px;
  background: #8e0e0e; border: 1px solid #ffffff55;
  padding: 4px 14px; border-radius: 999px; font-size: 12px; font-weight: 700;
}

/* ---- cards ---- */
.wrap { padding: 12px 14px; display: grid; gap: 12px; }
.card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 14px 16px;
}
.store-card { display: flex; align-items: center; justify-content: space-between; }
.store-card b { font-size: 16.5px; font-weight: 800; }
.store-card .hours { color: var(--ink-3); font-size: 13px; margin-top: 4px; }
.store-card .chev { color: var(--ink-3); font-size: 18px; }

.banner-card { background: var(--orange-banner); border-radius: var(--radius); overflow: hidden; }
.banner-card .tno { text-align: center; padding: 11px; font-size: 15.5px; border-bottom: 1px solid #f3ddc3; }
.banner-card .points { display: flex; gap: 10px; padding: 11px 14px; font-size: 13.5px; background: #fdf4ea; align-items: center; }
.banner-card .points .coin { font-size: 17px; }
.banner-card .points a { color: #e8930c; font-weight: 700; text-decoration: none; display: block; margin-top: 2px; }

/* ---- category tabs ---- */
.tabs {
  position: sticky; top: 61px; z-index: 25;
  display: flex; overflow-x: auto; gap: 4px;
  background: var(--bg); padding: 10px 8px 0;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: none; padding: 9px 14px; font-size: 14px; font-weight: 600;
  color: var(--ink-2); border-radius: 10px 10px 0 0; white-space: nowrap;
  border-bottom: 3px solid transparent;
}
.tab.active { color: var(--ink); border-bottom-color: var(--orange); font-weight: 800; }

/* ---- menu sections ---- */
.section-title { font-size: 16.5px; font-weight: 800; padding: 16px 14px 4px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 8px 14px; }
.meal-card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
  display: flex; flex-direction: column;
}
.meal-tile {
  aspect-ratio: 1/1; display: grid; place-items: center;
  font-size: 54px; position: relative;
  border-radius: 10px; margin: 10px 10px 0;
}
.meal-tile .zhname {
  position: absolute; top: 8px; left: 0; right: 0; text-align: center;
  color: #fff; font-family: "Noto Serif TC", serif; font-weight: 900;
  font-size: 13px; letter-spacing: 1px; text-shadow: 0 1px 2px rgba(0,0,0,.5);
  padding: 0 6px;
}
.meal-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 7px; flex: 1; }
.meal-body .name { font-size: 14.5px; font-weight: 700; line-height: 1.3; min-height: 2.6em; }
.meal-body .price { font-size: 15px; font-weight: 800; }
.btn-add {
  border: 1px solid #f2c4ae; color: var(--orange); font-weight: 700;
  border-radius: 9px; padding: 8px 0; width: 100%; background: #fff; font-size: 14px;
}
.btn-add:active { background: var(--orange-soft); }
.qty-inline { display: flex; align-items: center; justify-content: space-between; }

/* ---- floating cart bar ---- */
.cartbar {
  position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%);
  width: min(452px, calc(100% - 28px)); z-index: 40;
  background: var(--orange); color: #fff; border-radius: 14px;
  display: flex; align-items: center; padding: 10px 16px 10px 56px;
  box-shadow: 0 8px 20px rgba(240, 90, 36, .45);
}
.cartbar .basket {
  position: absolute; left: -2px; top: 50%; transform: translateY(-50%);
  width: 52px; height: 52px; background: #fff; border-radius: 13px;
  display: grid; place-items: center; font-size: 26px;
  box-shadow: var(--shadow); color: var(--orange);
}
.cartbar .basket .bubble {
  position: absolute; top: -6px; right: -6px; background: var(--red); color: #fff;
  min-width: 20px; height: 20px; border-radius: 999px; font-size: 11.5px; font-weight: 800;
  display: grid; place-items: center; padding: 0 5px;
}
.cartbar .mid { flex: 1; }
.cartbar .mid .l1 { font-size: 12.5px; opacity: .95; }
.cartbar .mid .l2 { font-size: 16.5px; font-weight: 800; }
.cartbar .go { font-weight: 800; font-size: 14.5px; letter-spacing: .4px; color: #fff; }

/* ---- bottom sheet ---- */
.sheet-mask {
  position: fixed; inset: 0; background: rgba(15, 15, 20, .55); z-index: 60;
  display: flex; align-items: flex-end; justify-content: center;
}
.sheet {
  background: var(--bg); width: min(480px, 100%);
  border-radius: 18px 18px 0 0; max-height: 88dvh; overflow-y: auto;
  animation: up .22s ease;
}
@keyframes up { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }
.sheet .sheet-pad { padding: 18px 16px calc(16px + env(safe-area-inset-bottom)); }
.sheet h2 { font-size: 17px; font-weight: 800; text-align: center; margin-bottom: 14px; }
.choice {
  display: block; width: 100%; text-align: center;
  background: var(--card); border: 1px solid var(--line); border-radius: 11px;
  padding: 14px; font-size: 15px; font-weight: 600; margin-bottom: 10px;
}
.choice:active, .choice.sel { background: #e9e9eb; }

/* package sheet */
.pkg-hero { height: 190px; display: grid; place-items: center; font-size: 84px; position: relative; }
.pkg-hero .x {
  position: absolute; top: 12px; right: 12px; width: 34px; height: 34px;
  background: #fff; border-radius: 50%; display: grid; place-items: center; font-size: 15px; font-weight: 700;
}
.pkg-head { background: var(--card); padding: 14px 16px; }
.pkg-head .nm { font-size: 18px; font-weight: 800; }
.pkg-head .pr { font-size: 16px; font-weight: 800; margin-top: 4px; }
.pkg-head .ds { color: #8a7b56; font-size: 13px; margin-top: 6px; }
.og { background: var(--card); margin-top: 10px; padding: 13px 16px; }
.og .og-head { display: flex; justify-content: space-between; align-items: center; }
.og .og-name { font-weight: 800; font-size: 15.5px; }
.og .og-req { font-size: 12.5px; margin-top: 3px; }
.og .og-req.must { color: var(--orange); }
.og .og-req.done { color: var(--ink-3); }
.og .ok { color: var(--green); font-size: 20px; }
.opt { display: flex; justify-content: space-between; align-items: center; padding: 11px 0 2px; font-size: 14.5px; }
.opt .op-price { color: var(--ink-2); font-size: 13px; margin-right: 10px; }
.cbox {
  width: 22px; height: 22px; border: 1.6px solid #cfcfd4; border-radius: 6px;
  display: grid; place-items: center; color: #fff; font-size: 13px; flex: none;
}
.cbox.on { background: var(--orange); border-color: var(--orange); }
.sheet-foot {
  position: sticky; bottom: 0; background: var(--bg);
  padding: 12px 16px calc(14px + env(safe-area-inset-bottom));
  box-shadow: 0 -6px 14px rgba(0,0,0,.05);
}
.tot-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; font-size: 15px; font-weight: 600; }
.stepper { display: flex; align-items: center; gap: 14px; }
.stepper button {
  width: 30px; height: 30px; border-radius: 50%; border: 1.6px solid #c9c9cf;
  font-size: 17px; display: grid; place-items: center; color: var(--ink-2); background: #fff;
}
.stepper b { min-width: 18px; text-align: center; font-size: 16px; }
.btn-primary {
  display: block; width: 100%; background: var(--orange); color: #fff;
  font-weight: 800; font-size: 15.5px; border-radius: 12px; padding: 14px; text-align: center;
}
.btn-primary:disabled { background: #f0a083; }
.btn-ghost {
  display: block; width: 100%; border: 1px solid #f2c4ae; color: var(--orange);
  font-weight: 700; border-radius: 12px; padding: 13px; text-align: center; background: #fff;
}

/* ---- cart / order page ---- */
.ordertype {
  display: flex; justify-content: space-between; align-items: center;
  border: 1.4px solid var(--orange); background: var(--orange-soft);
  border-radius: 11px; padding: 12px 14px; font-size: 14.5px;
}
.ordertype b { color: var(--ink); font-weight: 800; }
.sec-head { display: flex; justify-content: space-between; align-items: center; padding: 4px 2px; }
.sec-head h3 { font-size: 16.5px; font-weight: 800; }
.add-item { color: var(--orange); border: 1px solid #f2c4ae; background: #fff; border-radius: 9px; padding: 7px 12px; font-weight: 700; font-size: 13px; }
.citem { border-bottom: 1px solid var(--line); padding: 13px 0; }
.citem:last-child { border-bottom: 0; }
.citem .n { font-weight: 800; font-size: 15px; display: flex; justify-content: space-between; align-items: center; }
.citem .edit { border: 1px solid var(--line); border-radius: 8px; padding: 5px 11px; font-size: 12.5px; color: var(--ink-2); background: #fff; }
.citem .sub { color: var(--ink-2); font-size: 13.5px; line-height: 1.55; margin-top: 6px; }
.citem .note { color: var(--ink-3); font-style: italic; font-size: 13px; margin-top: 6px; }
.citem .row { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }
.citem .pr { color: var(--orange); font-weight: 800; font-size: 15px; }
.notes-row {
  display: flex; gap: 10px; align-items: center;
  border-left: 3px solid var(--orange); background: var(--card);
  border-radius: 10px; padding: 13px 14px; color: var(--ink-2); font-size: 14px;
}
.notes-row input { border: 0; outline: 0; flex: 1; font-style: italic; background: transparent; }
.pay-detail h3 { text-align: center; font-size: 16.5px; font-weight: 800; margin-bottom: 10px; }
.pd-row { display: flex; justify-content: space-between; font-size: 14.5px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.pd-row:last-child { border: 0; }
.pd-row .lbl { color: var(--ink-2); }
.pd-row.total { font-weight: 800; font-size: 15.5px; }
.pd-row.total .val { color: var(--orange); }

/* ---- bottom fixed bar ---- */
.footbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: min(480px, 100%); background: var(--card); z-index: 40;
  border-radius: 16px 16px 0 0; box-shadow: 0 -6px 18px rgba(0,0,0,.08);
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
}
.footbar .tp .l1 { font-size: 12.5px; color: var(--ink-2); }
.footbar .tp .l2 { font-size: 19px; font-weight: 800; }
.footbar .btn-primary { width: auto; padding: 13px 26px; }

/* ---- payment page ---- */
.flabel { font-size: 14px; font-weight: 700; margin: 14px 2px 7px; }
.flabel .req { color: var(--red); }
.finput {
  display: flex; gap: 10px; align-items: center;
  background: var(--card); border: 1px solid var(--line); border-radius: 11px; padding: 12px 13px;
}
.finput input { border: 0; outline: 0; flex: 1; font-size: 14.5px; background: transparent; }
.finput .fi { color: var(--ink-3); }
.promo-row {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--card); border-radius: 11px; padding: 13px 14px;
  color: var(--orange); font-weight: 700; font-size: 14.5px;
}
.paytype { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.paytype button {
  display: flex; gap: 8px; align-items: center; justify-content: center;
  border: 1.4px solid var(--line); background: var(--card); border-radius: 11px;
  padding: 12px; font-weight: 700; font-size: 13.5px; color: var(--ink-2);
}
.paytype button.sel { border-color: var(--orange); color: var(--ink); background: var(--orange-soft); }
.method { display: flex; align-items: center; gap: 12px; background: var(--card); border-radius: 11px; padding: 14px; margin-bottom: 9px; border: 1.4px solid var(--line); }
.method.sel { border-color: var(--orange); }
.method .mi { font-size: 20px; }
.method .mn { flex: 1; font-weight: 600; font-size: 14.5px; }
.radio { width: 20px; height: 20px; border-radius: 50%; border: 1.6px solid #cfcfd4; display: grid; place-items: center; }
.method.sel .radio { border-color: var(--orange); }
.method.sel .radio::after { content: ""; width: 11px; height: 11px; border-radius: 50%; background: var(--orange); }

/* ---- status page ---- */
.success-hero { text-align: center; padding: 34px 20px 10px; }
.success-hero .big { font-size: 56px; }
.success-hero h2 { font-size: 19px; font-weight: 800; margin-top: 10px; }
.success-hero p { color: var(--ink-2); font-size: 13.5px; margin-top: 6px; }
.ordno { text-align: center; background: var(--orange-banner); border-radius: 11px; padding: 11px; font-weight: 800; letter-spacing: .5px; }
.meal-status { display: flex; justify-content: space-between; align-items: center; padding: 11px 0; border-bottom: 1px dashed var(--line); font-size: 14.5px; }
.meal-status:last-child { border: 0; }
.badge { font-size: 11.5px; font-weight: 800; border-radius: 999px; padding: 4px 10px; letter-spacing: .3px; }
.badge.PREPARING { background: #fdf1d7; color: #b07a0a; }
.badge.READY { background: #def3e5; color: #15823f; }
.badge.SERVED { background: #e7e7ea; color: #5c5f66; }
.badge.PAID, .badge.COMPLETED { background: #def3e5; color: #15823f; }

/* ---- tables grid ---- */
.tgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tcell {
  background: var(--card); border: 1.4px solid var(--line); border-radius: 12px;
  padding: 14px 8px; text-align: center;
}
.tcell.sel { border-color: var(--orange); background: var(--orange-soft); }
.tcell.busy { opacity: .45; }
.tcell b { font-size: 16px; }
.tcell .st { font-size: 11.5px; color: var(--ink-3); margin-top: 4px; }
.tcell .st.busy { color: var(--red); }

/* takeout board */
.tk-row { display: flex; justify-content: space-between; align-items: center; background: var(--card); border-radius: 11px; padding: 14px; margin-bottom: 10px; box-shadow: var(--shadow); }
.tk-row b { font-size: 14px; letter-spacing: .4px; }

/* home */
.home-hero { background: linear-gradient(135deg, #7a1313, #c0392b); color: #fff; padding: 46px 22px 38px; text-align: center; }
.home-hero .logo { font-size: 54px; }
.home-hero h1 { font-family: "Noto Serif TC", serif; font-size: 25px; letter-spacing: 3px; margin-top: 10px; }
.home-hero p { opacity: .9; font-size: 13px; margin-top: 6px; }
.mode-btn {
  display: flex; gap: 14px; align-items: center; background: var(--card);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 16px; width: 100%;
  text-align: left;
}
.mode-btn .ic { font-size: 30px; }
.mode-btn b { font-size: 16px; }
.mode-btn p { color: var(--ink-2); font-size: 13px; margin-top: 3px; }
.mode-btn .chev { margin-left: auto; color: var(--ink-3); font-size: 18px; }

/* toast */
#toast-root { position: fixed; left: 50%; bottom: 120px; transform: translateX(-50%); z-index: 90; display: grid; gap: 8px; }
.toast { background: rgba(25,25,30,.92); color: #fff; padding: 10px 18px; border-radius: 999px; font-size: 13.5px; animation: up .2s ease; }

.center { text-align: center; }
.muted { color: var(--ink-3); font-size: 13px; }
.mt8 { margin-top: 8px; } .mt16 { margin-top: 16px; }
.spin { display: inline-block; width: 18px; height: 18px; border: 2.5px solid #eee; border-top-color: var(--orange); border-radius: 50%; animation: rot .8s linear infinite; }
@keyframes rot { to { transform: rotate(360deg); } }
