/* Be Vietnam Pro: font thiết kế cho tiếng Việt (SIL OFL, xem /fonts/OFL.txt).
   Chỉ có chữ Latin + tiếng Việt; chữ Hàn, Nhật, Trung, Nga, Thái, Hindi dùng font của máy. */
@font-face { font-family: "Be Vietnam Pro"; font-style: normal; font-weight: 400; font-display: swap; src: url(/fonts/be-vietnam-pro-vietnamese-400-normal.woff2) format("woff2");
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; }
@font-face { font-family: "Be Vietnam Pro"; font-style: normal; font-weight: 400; font-display: swap; src: url(/fonts/be-vietnam-pro-latin-400-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Be Vietnam Pro"; font-style: normal; font-weight: 600 800; font-display: swap; src: url(/fonts/be-vietnam-pro-vietnamese-700-normal.woff2) format("woff2");
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; }
@font-face { font-family: "Be Vietnam Pro"; font-style: normal; font-weight: 600 800; font-display: swap; src: url(/fonts/be-vietnam-pro-latin-700-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --bg: #f6f3ee;
  --card: #ffffff;
  --text: #1d1712;
  --muted: #74695d;
  --line: #ebe4da;
  --accent: #e8590c;
  --accent-ink: #ffffff;
  --accent-soft: #fff1e6;
  --hero: #2a1c10;
  --hero-2: #5a3a1a;
  --amber: #f2a516;
  --tag: #e03131;
  --zalo: #0068ff;
  --error: #c92a2a;
  --radius: 16px;
  --shadow: 0 1px 3px rgb(42 28 16 / .07);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15120e;
    --card: #221d17;
    --text: #f3ede6;
    --muted: #a99f94;
    --line: #362f27;
    --accent: #f76707;
    --accent-soft: #3a2414;
    --hero: #1f150c;
    --shadow: none;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  padding-bottom: 32px;
  -webkit-text-size-adjust: 100%;
}
body.has-cart { padding-bottom: 104px; }
.muted { color: var(--muted); }
.stack { display: flex; flex-direction: column; gap: 10px; }

/* ---------- Đầu trang quán ---------- */
.shop-hero { background: radial-gradient(120% 100% at 100% 0, var(--hero-2) 0, var(--hero) 62%); color: #fff; padding: 16px 16px 46px; }
.hero-inner { max-width: 928px; margin: 0 auto; }
.hero-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.shop-logo { width: 52px; height: 52px; border-radius: 14px; background: var(--amber); display: grid; place-items: center; font-size: 28px; flex: none; box-shadow: 0 4px 12px rgb(0 0 0 / .3); }
.lang-wrap { position: relative; min-width: 0; }
.lang-btn {
  font: inherit; font-size: .95rem; font-weight: 700; color: #2a1c10; cursor: pointer;
  display: flex; align-items: center; gap: 6px; max-width: 100%;
  background: #fff; border: 0; border-radius: 999px; padding: 8px 12px 8px 8px; min-height: 44px;
  box-shadow: 0 0 0 3px rgb(255 255 255 / .25), 0 4px 12px rgb(0 0 0 / .3);
}
.lang-btn #lang-cur { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lang-btn .globe { width: 28px; height: 28px; border-radius: 999px; background: #fff1e6; display: grid; place-items: center; font-size: 1.05rem; flex: none; }
.lang-btn .caret { font-size: .8rem; opacity: .6; }
.lang-hint {
  position: absolute; top: calc(100% + 10px); right: 0; z-index: 5; white-space: nowrap;
  font: inherit; font-size: .85rem; font-weight: 700; color: var(--accent-ink); background: var(--accent);
  border: 0; border-radius: 10px; padding: 6px 12px; cursor: pointer; box-shadow: 0 4px 12px rgb(0 0 0 / .3);
  animation: hint-bob 1.4s ease-in-out infinite;
}
.lang-hint::before { content: ""; position: absolute; bottom: 100%; right: 22px; border: 7px solid transparent; border-bottom-color: var(--accent); }
@keyframes hint-bob { 50% { transform: translateY(3px); } }
@media (prefers-reduced-motion: reduce) { .lang-hint { animation: none; } }
.lang-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.lang-list button {
  font: inherit; font-size: 1rem; font-weight: 600; color: inherit; cursor: pointer; text-align: left;
  display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 10px 12px;
  background: var(--bg); border: 2px solid var(--line); border-radius: 12px;
}
.lang-list button span { font-size: 1.5rem; line-height: 1; }
.lang-list button.on { border-color: var(--accent); background: var(--accent-soft); }
.shop-hero h1 { margin: 12px 0 2px; font-size: clamp(1.4rem, 6.5vw, 1.8rem); font-weight: 800; line-height: 1.2; overflow-wrap: anywhere; }
.shop-address { margin: 0; font-size: .85rem; opacity: .82; }

.table-card {
  position: relative; max-width: 928px; margin: -30px auto 0; width: calc(100% - 32px);
  background: var(--card); border-radius: var(--radius); padding: 12px 14px;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; box-shadow: 0 6px 20px rgb(42 28 16 / .14);
}
.table-num { background: var(--accent); color: var(--accent-ink); border-radius: 12px; padding: 6px 12px; text-align: center; line-height: 1.1; flex: none; }
.table-num small { display: block; font-size: .65rem; font-weight: 700; text-transform: uppercase; opacity: .9; }
.table-num b { font-size: 1.3rem; font-weight: 800; }
.table-txt { flex: 1 1 140px; min-width: 0; font-size: .82rem; color: var(--muted); }
.table-txt b { display: block; color: var(--text); font-size: .95rem; }
.history-chip { white-space: nowrap; font: inherit; font-size: .82rem; padding: 7px 12px; border-radius: 999px; border: 1.5px solid var(--accent); background: transparent; color: var(--accent); cursor: pointer; font-weight: 700; margin-left: auto; }

.search {
  display: flex; align-items: center; gap: 8px; max-width: 928px; width: calc(100% - 32px); margin: 14px auto 0;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 0 12px;
}
.table-card[hidden] + .search { margin-top: -26px; position: relative; box-shadow: 0 6px 20px rgb(42 28 16 / .14); }
.search input { border: 0; background: none; padding: 12px 0; outline: none; }
.search:focus-within { outline: 2px solid var(--accent); }

/* ---------- Danh mục ---------- */
.categories {
  position: sticky; top: 0; z-index: 5; margin-top: 8px;
  display: flex; gap: 4px; overflow-x: auto;
  padding: 4px max(16px, calc((100% - 928px) / 2)) 0; background: var(--bg);
  border-bottom: 1px solid var(--line);
  scrollbar-width: none;
}
.categories::-webkit-scrollbar { display: none; }
.categories a {
  flex: none; padding: 10px 12px; border-bottom: 3px solid transparent;
  color: var(--muted); text-decoration: none; font-weight: 600; font-size: .92rem; white-space: nowrap;
}
.categories a.active { color: var(--accent); border-color: var(--accent); }

/* ---------- Thực đơn ---------- */
.menu { max-width: 960px; margin: 0 auto; padding: 0 16px; }
.menu section { scroll-margin-top: 56px; }
.menu h2 { font-size: 1.1rem; font-weight: 800; margin: 20px 0 10px; }
.menu .empty { text-align: center; padding: 40px 0; }
.grid { display: grid; gap: 10px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid { grid-template-columns: 1fr 1fr; } }

.item {
  display: flex; gap: 12px; align-items: stretch; text-align: left;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 10px; color: inherit; cursor: pointer; width: 100%; min-width: 0;
}
.item:focus-visible { outline: 2px solid var(--accent); }
.item img { width: 92px; height: 92px; object-fit: cover; border-radius: 12px; flex: none; background: var(--line); }
.item .ph { width: 92px; height: 92px; border-radius: 12px; flex: none; display: grid; place-items: center; font-size: 2.5rem; background: linear-gradient(160deg, color-mix(in srgb, var(--amber) 18%, var(--card)), color-mix(in srgb, var(--accent) 22%, var(--card))); }
.item .info { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.item .name { font-weight: 700; overflow-wrap: anywhere; hyphens: auto; }
.item .tag { display: inline-block; font-size: .7rem; font-weight: 700; color: #fff; background: var(--tag); border-radius: 6px; padding: 1px 6px; vertical-align: 2px; white-space: nowrap; }
.item .desc { color: var(--muted); font-size: .82rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.size-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.size-chips span { font-size: .7rem; border: 1px solid var(--line); border-radius: 6px; padding: 0 6px; color: var(--muted); }
.item .bottom { margin-top: auto; padding-top: 6px; display: flex; gap: 8px; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; }
.item .price { color: var(--text); font-size: 1rem; font-weight: 800; }
.item .price small { font-size: .75rem; font-weight: 400; color: var(--muted); margin: 0 3px; }
.item .price small:first-child { margin-left: 0; }
.item .price .fx { display: block; margin: 0; font-size: .75rem; }
.item .add { margin-left: auto; }
.qty-ctrl .add { margin-left: 0; }
.item .add, .item .dec {
  width: 36px; height: 36px; border-radius: 11px; border: 0; display: grid; place-items: center; flex: none;
  background: var(--accent); color: var(--accent-ink); font: inherit; font-size: 1.35rem; font-weight: 600; line-height: 1; cursor: pointer;
}
.item .dec { background: transparent; color: var(--accent); border: 1.5px solid var(--accent); }
.qty-ctrl { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.qty-ctrl > b { min-width: 14px; text-align: center; }
.item.soldout { opacity: .5; cursor: not-allowed; }
.item .qty-badge { background: var(--accent-soft); color: var(--accent); border-radius: 999px; padding: 2px 8px; font-size: .8rem; font-weight: 700; }

.price { color: var(--accent); font-weight: 700; }
.tags span { display: inline-block; font-size: .75rem; padding: 1px 8px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 15%, transparent); color: var(--accent); margin-right: 4px; }

.hint { color: var(--muted); font-size: .85rem; }
.h-order { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.h-order header { display: flex; justify-content: space-between; color: var(--muted); font-size: .85rem; margin-bottom: 6px; }
.h-order ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.h-order li { display: flex; justify-content: space-between; gap: 10px; }
.h-order li > span:last-child { flex: none; max-width: 45%; text-align: right; }
.h-order li small { color: var(--muted); display: block; }
.h-order .sum { text-align: right; margin-top: 6px; font-weight: 600; }
.total-row { border-top: 1px solid var(--line); padding-top: 10px; }
.rich p { margin: 0 0 6px; }
.rich p:last-child { margin-bottom: 0; }
.rich ul { margin: 4px 0; padding-left: 20px; }
/* ---------- Thanh giỏ hàng dưới đáy ---------- */
.cart-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  background: var(--card); border-top: 1px solid var(--line); box-shadow: 0 -4px 16px rgb(0 0 0 / .08);
  padding: 10px 16px max(12px, env(safe-area-inset-bottom));
}
.cart-bar-inner {
  max-width: 928px; margin: 0 auto; width: 100%; display: flex; align-items: center; gap: 12px;
  background: none; border: 0; padding: 0; color: var(--text); text-align: left; cursor: pointer;
}
.bag { position: relative; width: 46px; height: 46px; border-radius: 14px; background: var(--accent-soft); display: grid; place-items: center; font-size: 1.35rem; flex: none; }
.bag b { position: absolute; top: -6px; right: -6px; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 999px; background: var(--tag); color: #fff; font-size: .72rem; display: grid; place-items: center; border: 2px solid var(--card); }
.cart-sum { flex: 1; min-width: 0; }
.cart-sum small { display: block; color: var(--muted); font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cart-sum strong { font-size: 1.15rem; font-weight: 800; white-space: nowrap; }
.cart-go { background: var(--accent); color: var(--accent-ink); border-radius: 14px; padding: 13px 18px; font-weight: 700; white-space: nowrap; flex: none; max-width: 50%; overflow: hidden; text-overflow: ellipsis; }

dialog.sheet {
  border: 0; overscroll-behavior: contain; padding: 0; width: 100%; max-width: 560px; max-height: 92vh; max-height: 92dvh;
  margin: auto auto 0; border-radius: 18px 18px 0 0;
  background: var(--card); color: var(--text);
}
@media (min-width: 640px) { dialog.sheet { margin: auto; border-radius: 18px; } }
dialog::backdrop { background: rgb(0 0 0 / .45); }
.sheet-inner .tags:empty, .sheet-inner .rich:empty { display: none; }
.sheet-inner h2 { font-weight: 800; font-size: 1.3rem; padding-right: 40px; }
.sheet-inner .price { font-size: 1.1rem; }
.sheet-inner { padding: 20px 16px max(24px, env(safe-area-inset-bottom)); position: relative; display: flex; flex-direction: column; gap: 10px; }
.sheet-inner h2, .sheet-inner h3, .sheet-inner p { margin: 0; }
.sheet-inner h3 { margin-top: 10px; }
.sheet-inner img { width: 100%; aspect-ratio: 16/10; object-fit: cover; border-radius: 12px; background: var(--line); }
.close { position: absolute; top: 8px; right: 8px; z-index: 1; width: 36px; height: 36px; border-radius: 999px; border: 0; background: rgb(0 0 0 / .5); color: #fff; font-size: 1.4rem; line-height: 1; cursor: pointer; }
.center { text-align: center; align-items: stretch; }
.big { font-size: 3rem; }

.field { display: flex; flex-direction: column; gap: 4px; font-size: .9rem; border: 0; padding: 0; margin: 0; }
.field legend { padding: 0; margin-bottom: 4px; }
input, textarea {
  font: inherit; color: inherit; background: var(--bg);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; width: 100%;
}
input:focus, textarea:focus { outline: 2px solid var(--accent); border-color: transparent; }
.radio { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.radio input { width: auto; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; }

.row { display: flex; gap: 10px; align-items: center; }
.row.space { justify-content: space-between; }
.grow { flex: 1; }
button, a.block { font: inherit; }
button.block, a.block {
  display: block; width: 100%; text-align: center; padding: 12px; border-radius: 12px;
  border: 1px solid var(--line); background: transparent; color: var(--text); cursor: pointer; text-decoration: none;
}
.primary { background: var(--accent) !important; color: var(--accent-ink) !important; border: 0 !important; padding: 13px 16px; border-radius: 14px; font-weight: 700; cursor: pointer; min-height: 48px; }
.primary:disabled { opacity: .6; cursor: progress; }
.zalo { background: var(--zalo) !important; }

.stepper { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 12px; }
.stepper button { width: 40px; height: 44px; border: 0; background: none; color: var(--text); font-size: 1.2rem; cursor: pointer; }
.stepper span { min-width: 24px; text-align: center; font-weight: 600; }
.stepper.small button { width: 32px; height: 32px; }

.cart-lines { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.cart-lines li { display: flex; gap: 10px; align-items: center; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.cart-lines .ln { flex: 1; min-width: 0; }
.cart-lines .ln small { color: var(--muted); display: block; }
.error { color: var(--error); }

.sizes { display: flex; gap: 8px; }
.sizes button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font: inherit; cursor: pointer; }
.sizes button small { color: var(--muted); }
.sizes button.active { border-color: var(--accent); outline: 2px solid var(--accent); }
.sizes button.active small { color: var(--accent); }
@media (max-width: 360px) {
  .bag { display: none; }
  .cart-go { padding: 10px 14px; white-space: normal; text-align: center; line-height: 1.2; }
  .item img, .item .ph { width: 76px; height: 76px; }
}
