/* Mô Kafe – menu & đặt món qua Zalo. Màu lấy theo logo và ảnh món (nâu đồng, kem). */
:root {
  --bg: #f7f0e6;
  --surface: #fffaf3;
  --surface-2: #f1e6d6;
  --ink: #2b170c;
  --ink-2: #5e4434;
  --muted: #7a6455;
  --line: #e2d3bf;
  --brand: #3a1a0c;
  --brand-2: #7c3412;
  --accent: #a8481a;
  --price: #8a3510;
  --ok: #2f6b3a;
  --warn-bg: #fff3d6;
  --warn-ink: #6b4a00;
  --err: #b3261e;
  --zalo: #0068ff;
  --zalo-ink: #fff;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 6px 24px rgba(58, 26, 12, .10);
  --tap: 44px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  /* Georgia thiếu một số chữ tiếng Việt (vd "ầ" nghiêng) nên chỉ dùng phông serif có đủ dấu. */
  --font-display: "Noto Serif", "Times New Roman", Times, serif;
  --topbar-h: 60px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1b120d; --surface: #251912; --surface-2: #2f2118; --ink: #f6ece1; --ink-2: #dccbbb;
    --muted: #b9a594; --line: #3e2d22; --brand: #f1e2cf; --brand-2: #e0a77e; --accent: #e08a55;
    --price: #f0a774; --ok: #8fd19c; --warn-bg: #3a2c10; --warn-ink: #f3d68b; --err: #ff8a80;
    --shadow: 0 6px 24px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
  .brand-mark, .footer-mark, .hero-logo { filter: brightness(0) invert(.93) sepia(.25); }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 190px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 var(--font); padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
img { max-width: 100%; display: block; }
h1, h2, h3 { line-height: 1.2; margin: 0; }
button, input, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -60px; background: var(--brand); color: #fff; padding: 10px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { top: 8px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.ico { width: 20px; height: 20px; flex: none; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--tap); padding: 10px 18px;
  border-radius: 999px; border: 1px solid transparent; font-weight: 600; text-decoration: none; cursor: pointer; line-height: 1.2; text-align: center; }
.btn-sm { min-height: 40px; padding: 8px 14px; font-size: 15px; }
.btn-primary { background: var(--brand); color: #fff; }
@media (prefers-color-scheme: dark) { .btn-primary { background: var(--accent); color: #1b120d; } }
.btn-primary:hover { filter: brightness(1.12); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost-light { background: rgba(255,255,255,.1); color: #fff; border-color: rgba(255,255,255,.45); }
.btn-zalo { background: var(--zalo); color: var(--zalo-ink); }
.btn-zalo:hover { filter: brightness(1.08); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; filter: none; }
.btn-block { width: 100%; }
.link-btn { background: none; border: 0; padding: 8px 0; color: var(--accent); text-decoration: underline; cursor: pointer; min-height: var(--tap); }
.icon-btn { width: var(--tap); height: var(--tap); border-radius: 50%; border: 0; background: transparent; color: var(--ink); display: grid; place-items: center; cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); }

/* Top bar */
.topbar { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar-in { display: flex; align-items: center; justify-content: space-between; height: var(--topbar-h); gap: 8px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); min-width: 0; }
.brand-mark { width: 46px; height: auto; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text b { font-family: var(--font-display); font-size: 20px; }
.brand-text small { color: var(--muted); font-size: 12px; }
.topnav { display: flex; gap: 8px; }
@media (max-width: 380px) { .brand-text small { display: none; } .topnav .btn-ghost { display: none; } }

.config-notice { background: var(--warn-bg); color: var(--warn-ink); font-size: 14px; border-bottom: 1px solid var(--line); }
.config-notice .wrap { padding-top: 10px; padding-bottom: 10px; }
.config-notice ul { margin: 4px 0 0; padding-left: 20px; }

/* Hero */
.hero { background: radial-gradient(120% 120% at 85% 10%, #8a3a14 0%, #5a240c 45%, #2e1307 100%); color: #fbeee0; }
.hero-in { display: grid; gap: 20px; padding-top: 28px; padding-bottom: 28px; align-items: center; }
.eyebrow { margin: 0 0 8px; text-transform: uppercase; letter-spacing: .08em; font-size: 13px; color: #f2c9a4; font-weight: 600; }
.hero h1 { font-family: var(--font-display); font-size: clamp(30px, 7vw, 52px); font-weight: 700; }
.hero h1 span { display: block; color: #f2c9a4; font-style: italic; font-weight: 400; }
.lead { margin: 14px 0 20px; font-size: 17px; max-width: 46ch; color: #f3e2d0; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 10px; }
.hero-cta .btn-primary { background: #fbeee0; color: #3a1a0c; }
.hero-logo { display: none; width: 100%; max-width: 360px; justify-self: center; filter: brightness(0) invert(.94) sepia(.3); opacity: .95; }
@media (min-width: 760px) {
  .hero-in { grid-template-columns: 1.3fr 1fr; padding-top: 56px; padding-bottom: 56px; }
  .hero-logo { display: block; }
}
@media (prefers-color-scheme: dark) { .hero-logo { filter: brightness(0) invert(.94) sepia(.3); } }

.how { background: var(--surface); border-bottom: 1px solid var(--line); }
.how-steps { list-style: none; margin: 0; padding: 14px 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.how-steps li { display: flex; flex-direction: column; font-size: 13px; color: var(--muted); }
.how-steps b { color: var(--ink); font-size: 14px; }
@media (min-width: 760px) { .how-steps li { font-size: 15px; } .how-steps b { font-size: 16px; } }

/* Menu */
.menu-sticky { position: sticky; top: var(--topbar-h); z-index: 20; background: var(--bg); border-bottom: 1px solid var(--line); padding-top: 12px; }
.menu-head { display: flex; align-items: center; gap: 12px; }
.menu-head h2 { font-family: var(--font-display); font-size: 26px; }
.search { flex: 1; max-width: 360px; margin-left: auto; position: relative; display: flex; align-items: center; }
.search .ico { position: absolute; left: 12px; color: var(--muted); }
.search input { width: 100%; min-height: var(--tap); border-radius: 999px; border: 1px solid var(--line); background: var(--surface); padding: 8px 14px 8px 40px; }
.cats { display: flex; gap: 8px; overflow-x: auto; padding: 10px 0 12px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.cats::-webkit-scrollbar { display: none; }
.cat { flex: none; min-height: 40px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap; }
.cat[aria-current="true"] { background: var(--brand); color: var(--bg); border-color: var(--brand); }

.menu-layout { display: grid; gap: 24px; padding-top: 16px; padding-bottom: 40px; }
@media (min-width: 1024px) { .menu-layout { grid-template-columns: 1fr 360px; align-items: start; } }
.menu-group { margin-bottom: 28px; }
.menu-group h3 { font-family: var(--font-display); font-size: 22px; margin: 6px 0 12px; display: flex; align-items: baseline; gap: 8px; }
.menu-group h3 small { font-family: var(--font); font-size: 14px; color: var(--muted); font-weight: 400; }
.grid { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 600px) { .grid { grid-template-columns: repeat(2, 1fr); gap: 16px; } }
@media (min-width: 1024px) { .grid { grid-template-columns: repeat(3, 1fr); } }
.empty, .loading { color: var(--muted); padding: 24px 0; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: grid; grid-template-columns: 112px 1fr; }
.card-media { position: relative; background: var(--surface-2); aspect-ratio: 1; }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 12px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.card h4 { margin: 0; font-size: 16px; font-weight: 700; }
.card p { margin: 0; font-size: 14px; color: var(--muted); }
.card-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.price { font-weight: 700; color: var(--price); font-size: 17px; }
.card.is-out .card-media img { filter: grayscale(1); opacity: .6; }
.badge-out { display: inline-block; font-size: 13px; font-weight: 600; color: var(--muted); background: var(--surface-2); border-radius: 999px; padding: 6px 12px; }
@media (min-width: 600px) {
  .card { grid-template-columns: 1fr; }
  .card-body { padding: 14px; }
}
.add-btn { min-height: var(--tap); padding: 8px 16px; border-radius: 999px; border: 0; background: var(--brand); color: var(--bg); font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.add-btn:hover { filter: brightness(1.15); }

.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); }
.stepper button { width: var(--tap); height: var(--tap); border: 0; background: none; font-size: 22px; line-height: 1; cursor: pointer; color: var(--ink); border-radius: 50%; }
.stepper button:hover { background: var(--surface-2); }
.stepper button[disabled] { opacity: .35; cursor: not-allowed; }
.stepper output { min-width: 28px; text-align: center; font-weight: 700; }

/* Cart (desktop side + dialog step 1) */
.cart-side { display: none; }
@media (min-width: 1024px) {
  .cart-side { display: block; position: sticky; top: calc(var(--topbar-h) + 130px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); max-height: calc(100vh - var(--topbar-h) - 150px); overflow: auto; }
  body { padding-bottom: 0; }
  .cartbar { display: none !important; }
}
.cart-title { font-family: var(--font-display); font-size: 20px; margin-bottom: 10px; }
.lines { list-style: none; margin: 0; padding: 0; }
.line { display: grid; grid-template-columns: 52px 1fr auto; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.line img { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; background: var(--surface-2); }
.line-name { font-weight: 600; font-size: 15px; }
.line-sub { font-size: 13px; color: var(--muted); }
.line-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.line-total { font-weight: 700; font-size: 15px; }
.line .stepper button { width: 38px; height: 38px; font-size: 20px; }
.line.is-out .line-name::after { content: " · Tạm hết"; color: var(--err); font-weight: 600; }
.sum-row { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; }
.sum-row.total { font-weight: 800; font-size: 18px; border-top: 2px solid var(--ink); margin-top: 6px; padding-top: 10px; }
.cart-empty { color: var(--muted); padding: 8px 0 4px; }
.cart-side .btn-block { margin-top: 12px; }
.small-actions { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; font-size: 14px; }

/* Mobile cart bar */
.cartbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, var(--bg) 35%); }
.cartbar-btn { width: 100%; max-width: 640px; margin: 0 auto; display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 18px 8px 10px; border: 0; border-radius: 999px; background: var(--brand); color: var(--bg); font-weight: 700; font-size: 16px; box-shadow: 0 8px 24px rgba(58,26,12,.35); cursor: pointer; }
.cartbar-count { min-width: 38px; height: 38px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; }
.cartbar-label { flex: 1; text-align: left; }
.cartbar.bump .cartbar-btn { animation: bump .35s ease; }
@keyframes bump { 50% { transform: scale(1.04); } }

/* Footer */
.footer { background: #2a1308; color: #f1e2cf; padding: 32px 0 calc(32px + env(safe-area-inset-bottom)); }
.footer a { color: #ffc89e; }
.footer-in { display: grid; gap: 20px; }
.footer-brand { display: flex; gap: 12px; align-items: center; }
.footer-brand b { display: block; font-family: var(--font-display); font-size: 22px; }
.footer-brand span { color: #c9b29c; font-size: 14px; }
.footer-mark { filter: brightness(0) invert(.93) sepia(.25); }
.footer-info { margin: 0; display: grid; gap: 12px; }
.footer-info div { display: grid; grid-template-columns: 110px 1fr; gap: 8px; }
.footer-info dt { color: #c9b29c; }
.footer-info dd { margin: 0; }
.footer-info .pending { color: #c9b29c; font-style: italic; }
.privacy { background: rgba(255,255,255,.05); border-radius: var(--radius-sm); padding: 10px 14px; }
.privacy summary { cursor: pointer; font-weight: 600; min-height: 32px; display: flex; align-items: center; }
.privacy ul { margin: 8px 0 4px; padding-left: 20px; color: #e5d3c0; font-size: 14px; }
.footer-note { margin: 0; font-size: 13px; color: #c9b29c; }
@media (min-width: 900px) { .footer-in { grid-template-columns: 1fr 1.4fr; } .privacy, .footer-note { grid-column: 1 / -1; } }

/* Checkout dialog */
.checkout { padding: 0; border: 0; background: var(--surface); color: var(--ink); width: 100%; max-width: 100%; height: 100%; max-height: 100%; margin: 0; }
.checkout::backdrop { background: rgba(20, 10, 5, .55); }
@media (min-width: 700px) {
  .checkout { width: min(620px, calc(100% - 32px)); height: min(860px, calc(100% - 48px)); margin: auto; border-radius: 20px; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
}
.ck { display: flex; flex-direction: column; height: 100%; }
.ck-head { display: grid; grid-template-columns: var(--tap) 1fr var(--tap); align-items: center; gap: 4px; padding: 8px 8px 8px; padding-top: calc(8px + env(safe-area-inset-top)); border-bottom: 1px solid var(--line); }
.ck-title { text-align: center; min-width: 0; }
.ck-title h2 { font-size: 18px; }
.ck-steps { list-style: none; display: flex; justify-content: center; gap: 6px; margin: 6px 0 0; padding: 0; font-size: 12px; color: var(--muted); }
.ck-steps li { padding: 2px 10px; border-radius: 999px; background: var(--surface-2); }
.ck-steps li.on { background: var(--brand); color: var(--bg); font-weight: 700; }
.ck-steps li.done { color: var(--ok); }
.ck-body { flex: 1; overflow-y: auto; padding: 16px; overscroll-behavior: contain; }
.ck-foot { border-top: 1px solid var(--line); padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); display: grid; gap: 8px; background: var(--surface); }
.ck-foot .row { display: flex; gap: 8px; }
.ck-foot .row > * { flex: 1; }
.ck-foot .foot-sum { display: flex; justify-content: space-between; font-weight: 700; }

fieldset { border: 0; margin: 0 0 8px; padding: 0; }
legend { font-weight: 800; font-size: 16px; margin-bottom: 8px; padding: 0; }
.field { margin-bottom: 14px; }
.field label, .label-like { display: block; font-weight: 600; margin-bottom: 6px; font-size: 15px; }
.req { color: var(--err); }
.opt { color: var(--muted); font-weight: 400; }
.field input, .field textarea { width: 100%; min-height: 48px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg); font-size: 16px; }
.field textarea { resize: vertical; min-height: 84px; }
.field input:focus, .field textarea:focus { border-color: var(--accent); outline: 2px solid color-mix(in srgb, var(--accent) 35%, transparent); outline-offset: 0; }
.field [aria-invalid="true"] { border-color: var(--err); }
.static-field { margin: 0; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--surface-2); color: var(--ink-2); }
.hint { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.count { text-align: right; }
.err { margin: 6px 0 0; font-size: 14px; color: var(--err); font-weight: 600; }
.err:empty { display: none; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; margin: 6px 0 12px; cursor: pointer; }
.check input { width: 22px; height: 22px; margin: 1px 0 0; flex: none; accent-color: var(--brand); }
.privacy-mini { font-size: 13px; color: var(--muted); margin: 0; }

.box { border-radius: var(--radius-sm); padding: 12px 14px; margin: 0 0 14px; font-size: 15px; }
.box h3 { font-size: 15px; margin-bottom: 6px; }
.box p { margin: 0 0 6px; }
.box p:last-child { margin-bottom: 0; }
.box-info { background: var(--surface-2); }
.box-warn { background: var(--warn-bg); color: var(--warn-ink); }
.box-notice { background: color-mix(in srgb, var(--zalo) 10%, var(--surface)); border: 1px solid color-mix(in srgb, var(--zalo) 35%, transparent); }
.box-ok { background: color-mix(in srgb, var(--ok) 12%, var(--surface)); border: 1px solid color-mix(in srgb, var(--ok) 35%, transparent); }
.fee-rule { margin: 4px 0 14px; }
.fee-rule ul { margin: 4px 0 0; padding-left: 20px; }

.review h3 { font-size: 16px; margin: 18px 0 8px; }
.review-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.review-table td { padding: 8px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.review-table td:last-child { text-align: right; white-space: nowrap; padding-left: 12px; font-weight: 600; }
.review-table .qty { color: var(--muted); white-space: nowrap; padding: 8px 10px; }
.kv { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; font-size: 15px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; }
.sums { margin-top: 10px; }
.sums .muted { color: var(--muted); font-weight: 400; font-size: 14px; }
.spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -3px; margin-right: 6px; }
@keyframes spin { to { transform: rotate(360deg); } }
.msg-box { width: 100%; min-height: 220px; font: 14px/1.5 ui-monospace, Menlo, Consolas, monospace; padding: 12px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--bg); resize: vertical; white-space: pre-wrap; }
.howto { margin: 6px 0 0; padding-left: 20px; font-size: 15px; }
.howto li { margin-bottom: 4px; }

.toast { position: fixed; left: 50%; bottom: calc(92px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(20px); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-size: 15px; opacity: 0; pointer-events: none; transition: .25s; z-index: 1000; max-width: calc(100% - 32px); text-align: center; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
@media (min-width: 1024px) { .toast { bottom: 24px; } }
.noscript { background: var(--warn-bg); color: var(--warn-ink); padding: 16px; text-align: center; }
