/* Bố cục: cột nội dung 1120px, lưới bảng tính làm điểm nhấn ở hero và ảnh sản phẩm; phần còn lại tĩnh, nhiều khoảng trắng. */
:root {
  --bg: #f5f8f6;
  --surface: #ffffff;
  --ink: #14211d;
  --muted: #56675f;
  --line: #d8e2dd;
  --grid: #e7eeea;
  --accent: #0d6b54;
  --accent-ink: #ffffff;
  --accent-soft: #e2f1eb;
  --mark: #e9a91d;
  --mark-soft: #fcf0d2;
  --warn-ink: #7a5300;

  --f-display: "Bricolage Grotesque", "Be Vietnam Pro", system-ui, sans-serif;
  --f-body: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --f-mono: "Roboto Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;

  --r: 10px;
  --wrap: 1120px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1412; --surface: #151d1a; --ink: #e5eee9; --muted: #98a9a1;
    --line: #26332e; --grid: #1c2723; --accent: #42c39a; --accent-ink: #052019;
    --accent-soft: #143229; --mark: #f0b43a; --mark-soft: #3a2e10; --warn-ink: #f6cf7a;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1412; --surface: #151d1a; --ink: #e5eee9; --muted: #98a9a1;
  --line: #26332e; --grid: #1c2723; --accent: #42c39a; --accent-ink: #052019;
  --accent-soft: #143229; --mark: #f0b43a; --mark-soft: #3a2e10; --warn-ink: #f6cf7a;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.65 var(--f-body);
}
img { max-width: 100%; display: block; }
a { color: var(--accent); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--mark); outline-offset: 2px;
}
h1, h2, h3 { font-family: var(--f-display); line-height: 1.15; text-wrap: balance; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: clamp(2rem, 5vw, 3.25rem); font-weight: 700; }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 650; }
h3 { font-size: 1.15rem; font-weight: 650; }
p { margin: 0; }
.mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }

.wrap {
  max-width: var(--wrap); margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.stack { display: grid; gap: 16px; }
.section { padding-block: 56px; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.lede { color: var(--muted); max-width: 62ch; font-size: 1.05rem; }
.eyebrow {
  font: 600 0.75rem/1 var(--f-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent);
}

/* ---------- Header ---------- */
body::before {
  content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px);
  z-index: 10; background: var(--surface);
}
.site-header {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 9;
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; gap: 16px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font: 700 1.1rem var(--f-display); }
.brand-mark {
  width: 30px; height: 30px; border-radius: 6px; background: var(--accent);
  display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 2px; padding: 5px;
}
.brand-mark i { background: var(--accent-ink); opacity: .85; border-radius: 1px; }
.brand-mark i:nth-child(4) { background: var(--mark); opacity: 1; }
.nav { margin-left: auto; display: flex; gap: 4px; align-items: center; }
.nav a {
  text-decoration: none; color: var(--muted); padding: 8px 12px; border-radius: 8px; font-weight: 500; font-size: .95rem;
}
.nav a:hover { color: var(--ink); background: var(--grid); }
.nav a[aria-current="page"] { color: var(--ink); background: var(--accent-soft); }
.menu-btn {
  display: none; margin-left: auto; background: none; border: 1px solid var(--line); color: var(--ink);
  border-radius: 8px; padding: 8px 12px; font: 500 .95rem var(--f-body); cursor: pointer;
}
@media (max-width: 820px) {
  .menu-btn { display: inline-block; }
  .nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; background: var(--surface); border-bottom: 1px solid var(--line);
    padding: 8px max(16px, env(safe-area-inset-right, 0px)) 16px max(16px, env(safe-area-inset-left, 0px));
  }
  .nav.open { display: flex; }
  .nav a { padding: 12px; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px; border-radius: 8px; font: 600 1rem var(--f-body); text-decoration: none;
  border: 1px solid transparent; cursor: pointer; transition: background .15s, transform .15s;
}
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--grid); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- Hero: lưới bảng tính ---------- */
.hero { padding-block: 48px 56px; }
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 48px; align-items: center; }
.hero-grid > * { min-width: 0; }
.hero h1 em { font-style: normal; background: linear-gradient(transparent 62%, var(--mark-soft) 62%); }
.hero .lede { margin-block: 20px 28px; }
@media (max-width: 860px) { .hero-grid { grid-template-columns: 1fr; gap: 32px; } }

.sheet {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  overflow: hidden; font-family: var(--f-mono); font-size: .8rem;
}
.sheet-bar { display: flex; align-items: center; gap: 0; border-bottom: 1px solid var(--line); }
.sheet-bar .ref { padding: 8px 12px; border-right: 1px solid var(--line); color: var(--muted); min-width: 56px; }
.sheet-bar .fx { padding: 8px 12px; color: var(--muted); border-right: 1px solid var(--line); font-style: italic; }
.sheet-bar .formula { padding: 8px 12px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.sheet-table-wrap { overflow-x: auto; }
.sheet table { border-collapse: collapse; width: 100%; min-width: 420px; }
.sheet th, .sheet td { border: 1px solid var(--grid); padding: 7px 10px; text-align: left; white-space: nowrap; }
.sheet thead th { background: var(--bg); color: var(--muted); font-weight: 500; text-align: center; }
.sheet tbody th { background: var(--bg); color: var(--muted); font-weight: 500; width: 36px; text-align: center; }
.sheet td.num { text-align: right; font-variant-numeric: tabular-nums; }
.sheet td.sel { outline: 2px solid var(--mark); outline-offset: -2px; background: var(--mark-soft); color: var(--ink); font-weight: 600; }
.sheet td.ok { color: var(--accent); }
.sheet-note { padding: 10px 12px; border-top: 1px solid var(--line); color: var(--muted); font-family: var(--f-body); font-size: .8rem; }

/* ---------- Lợi ích ---------- */
.benefits { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.benefit { border-top: 2px solid var(--ink); padding-top: 16px; display: grid; gap: 8px; align-content: start; }
.benefit p { color: var(--muted); font-size: .95rem; }
@media (max-width: 860px) { .benefits { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .benefits { grid-template-columns: 1fr; } }

/* ---------- Thẻ sản phẩm ---------- */
.products { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  display: flex; flex-direction: column; overflow: hidden; text-decoration: none; color: inherit;
  transition: border-color .15s, transform .15s;
}
.card:hover { border-color: var(--accent); transform: translateY(-2px); }
.card-body { padding: 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; min-width: 0; }
.card-body h3 { font-size: 1.05rem; }
.card-body .desc { color: var(--muted); font-size: .9rem; }
.card-foot { margin-top: auto; padding-top: 12px; display: flex; justify-content: space-between; align-items: center; gap: 8px; border-top: 1px dashed var(--line); }
.price { font: 600 1.05rem var(--f-mono); font-variant-numeric: tabular-nums; }
.price s { color: var(--muted); font-weight: 400; font-size: .85em; margin-left: 6px; }
.price.pending { color: var(--muted); font: 500 .9rem var(--f-body); }

.thumb { aspect-ratio: 16 / 10; max-width: 100%; position: relative; background: var(--bg); border-bottom: 1px solid var(--line); overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb-sheet {
  position: absolute; inset: 14px; display: grid; grid-template-columns: 22px repeat(5, 1fr); grid-auto-rows: 1fr;
  border: 1px solid var(--line); background: var(--surface); border-radius: 4px; overflow: hidden;
}
.thumb-sheet span { border-right: 1px solid var(--grid); border-bottom: 1px solid var(--grid); }
.thumb-sheet span.h { background: var(--bg); }
.thumb-sheet span.f { background: var(--accent-soft); }
.thumb-sheet span.m { background: var(--mark-soft); outline: 2px solid var(--mark); outline-offset: -2px; }
.thumb-sheet span.b { position: relative; }
.thumb-sheet span.b::after { content: ""; position: absolute; left: 20%; right: 20%; bottom: 0; height: var(--h, 50%); background: var(--accent); opacity: .75; }
.thumb-label {
  position: absolute; left: 14px; bottom: 14px; background: var(--ink); color: var(--bg);
  font: 600 .7rem/1 var(--f-mono); letter-spacing: .06em; text-transform: uppercase; padding: 6px 8px; border-radius: 4px;
}

.tag {
  display: inline-flex; align-items: center; gap: 6px; font: 600 .72rem/1 var(--f-mono);
  letter-spacing: .05em; text-transform: uppercase; padding: 5px 8px; border-radius: 4px;
  background: var(--grid); color: var(--muted); width: fit-content;
}
.tag.pending { background: var(--mark-soft); color: var(--warn-ink); }
.tag.live { background: var(--accent-soft); color: var(--accent); }

/* ---------- Bộ lọc ---------- */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; }
.chip {
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  padding: 8px 14px; border-radius: 999px; font: 500 .9rem var(--f-body); cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip .count { font-family: var(--f-mono); color: inherit; opacity: .6; margin-left: 4px; }
.toolbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.search {
  flex: 1 1 240px; min-width: 0; padding: 11px 14px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font: 1rem var(--f-body);
}
.empty { padding: 40px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--r); }

/* ---------- Chi tiết ---------- */
.crumbs { font-size: .9rem; color: var(--muted); padding-block: 20px 0; display: flex; gap: 8px; flex-wrap: wrap; }
.crumbs a { color: var(--muted); }
.detail { display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; padding-block: 24px 56px; align-items: start; }
.detail > * { min-width: 0; }
.detail .thumb { border: 1px solid var(--line); border-radius: var(--r); }
.buybox { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 24px; display: grid; gap: 16px; }
.buybox .price { font-size: 1.6rem; }
.specs { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; font-size: .92rem; margin: 0; }
.specs dt { color: var(--muted); }
.specs dd { margin: 0; }
.prose { display: grid; gap: 14px; max-width: 68ch; }
.prose ul { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.notice {
  border: 1px solid var(--mark); background: var(--mark-soft); color: var(--ink);
  border-radius: 8px; padding: 12px 14px; font-size: .92rem;
}
@media (max-width: 860px) { .detail { grid-template-columns: 1fr; gap: 24px; } }

/* ---------- Trang nội dung ---------- */
.page-head { padding-block: 40px 8px; display: grid; gap: 12px; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; counter-reset: s; }
.steps li {
  counter-increment: s; display: grid; grid-template-columns: 56px 1fr; gap: 16px;
  padding-block: 20px; border-bottom: 1px solid var(--line);
}
.steps li::before {
  content: "B" counter(s); font: 600 .85rem var(--f-mono); color: var(--accent);
  border: 1px solid var(--line); border-radius: 6px; height: 36px; display: grid; place-items: center; background: var(--surface);
}
.steps li > div { display: grid; gap: 6px; min-width: 0; }
.steps p { color: var(--muted); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.two-col > * { min-width: 0; }
@media (max-width: 760px) { .two-col { grid-template-columns: 1fr; } }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 24px; display: grid; gap: 14px; align-content: start; }
.kv { display: grid; gap: 4px; padding-block: 10px; border-bottom: 1px solid var(--grid); }
.kv:last-child { border-bottom: 0; }
.kv span { color: var(--muted); font-size: .85rem; }
.kv strong { font-weight: 600; word-break: break-word; }
.faq details { border-bottom: 1px solid var(--line); padding-block: 14px; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq details p { color: var(--muted); margin-top: 8px; }
.policy h2 { font-size: 1.3rem; margin-top: 12px; }

/* ---------- Form ---------- */
.field { display: grid; gap: 6px; }
.field label { font-weight: 600; font-size: .92rem; }
.field small { color: var(--muted); }
.field input, .field select, .field textarea {
  width: 100%; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--bg); color: var(--ink); font: 1rem var(--f-body);
}
.field textarea { min-height: 90px; resize: vertical; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 600px) { .form-grid { grid-template-columns: 1fr; } }
.code {
  background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 14px;
  font: .82rem/1.55 var(--f-mono); overflow-x: auto; white-space: pre; max-height: 360px;
}
.status { font-size: .9rem; color: var(--accent); min-height: 1.4em; }

/* ---------- Thanh toán ---------- */
.qr-box { display: grid; grid-template-columns: 200px 1fr; gap: 24px; align-items: start; }
.qr-box > * { min-width: 0; }
.qr-box img { background: #fff; border-radius: 8px; border: 1px solid var(--line); }
.qr-ph { aspect-ratio: 1; max-width: 100%; border: 1px dashed var(--line); border-radius: 8px; display: grid; place-items: center; color: var(--muted); text-align: center; padding: 12px; font-size: .85rem; }
@media (max-width: 560px) { .qr-box { grid-template-columns: 1fr; } .qr-box img, .qr-ph { max-width: 240px; } }
.copy-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.copy-btn { border: 1px solid var(--line); background: var(--bg); color: var(--ink); border-radius: 6px; padding: 4px 10px; font: 500 .8rem var(--f-body); cursor: pointer; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); background: var(--surface); margin-top: 32px; }
.site-footer .wrap { padding-block: 40px; display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
.site-footer h4 { font: 600 .8rem var(--f-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 12px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.site-footer a { color: var(--ink); text-decoration: none; }
.site-footer a:hover { color: var(--accent); }
.site-footer p { color: var(--muted); font-size: .92rem; }
.footer-bottom { border-top: 1px solid var(--line); }
.footer-bottom .wrap { padding-block: 16px; display: block; color: var(--muted); font-size: .85rem; }
@media (max-width: 760px) { .site-footer .wrap { grid-template-columns: 1fr; gap: 24px; } }

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

.muted-txt { color: var(--muted); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.table-wrap table { border-collapse: collapse; width: 100%; min-width: 560px; font-size: .9rem; }
.table-wrap th, .table-wrap td { padding: 10px 12px; border-bottom: 1px solid var(--grid); text-align: left; }
.table-wrap th { font: 600 .75rem var(--f-mono); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); background: var(--bg); }
.check { display: flex; gap: 8px; align-items: center; font-weight: 500; }
a.chip { text-decoration: none; display: inline-flex; align-items: center; }
.site-footer .stack { align-content: start; }

/* Điện thoại: đưa khung tên/giá/nút mua lên trên phần mô tả */
@media (max-width: 860px) { .detail .buybox { order: -1; } }
.delivery { border-top: 1px dashed var(--line); padding-top: 14px; display: grid; gap: 6px; }
.delivery p { font-size: .92rem; color: var(--muted); }
