:root {
  --bg: #f7f4ee;
  --card: #ffffff;
  --ink: #1f2a23;
  --muted: #66726a;
  --line: #e4ded3;
  --accent: #22392d;
  --accent-2: #2f5d46;
  --accent-ink: #ffffff;
  --accent-soft: #e6ece3;
  --gold: #e0a95a;
  --ok: #2f7a4b;   --ok-soft: #e4f3ea;
  --warn: #8a5a00; --warn-soft: #fff3dc;
  --info: #2c5a7a; --info-soft: #e8f1f6;
  --bad: #a12f2f;  --bad-soft: #fbe7e7;
  --radius: 18px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, "Times New Roman", serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, "Roboto Mono", monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.6 var(--font); }
body.locked { overflow: hidden; }
a { color: var(--accent-2); }
code, pre { font-family: var(--mono); font-size: 0.9em; }
small, .hint { color: var(--muted); font-size: 0.88rem; }
[hidden] { display: none !important; }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; letter-spacing: -0.01em; line-height: 1.15; }
h1 { font-size: clamp(2.1rem, 5vw, 3.6rem); margin: 10px 0 18px; }
h1 em, h2 em { font-style: italic; color: var(--accent-2); }
h2 { font-size: clamp(1.6rem, 3.2vw, 2.4rem); margin: 6px 0 16px; }
h3 { font-size: 1.25rem; margin: 0 0 6px; }

.wrap { max-width: 760px; margin: 0 auto; padding: 0 20px; }
.wrap-wide { max-width: 1160px; margin: 0 auto; padding: 0 20px; }
.wrap-narrow { max-width: 760px; margin: 0 auto; padding: 0 20px; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.76rem; font-weight: 600; color: var(--accent-2); margin: 0; }

/* ---------- Thanh trên, menu ---------- */
.announce { background: var(--accent); color: #f3efe6; text-align: center; font-size: 0.85rem; padding: 8px 12px; }
.nav { position: sticky; top: 0; z-index: 20; background: rgba(247, 244, 238, 0.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.nav-in { display: flex; align-items: center; gap: 24px; height: 64px; }
.logo { font-family: var(--serif); font-size: 1.55rem; color: var(--ink); text-decoration: none; letter-spacing: -0.02em; }
.logo span { color: var(--gold); }
.nav-links { display: flex; gap: 22px; margin-left: auto; }
.nav-links a { color: var(--ink); text-decoration: none; font-size: 0.95rem; }
.nav-links a:hover { color: var(--accent-2); }
.cart-btn { font: inherit; border: 1px solid var(--ink); background: transparent; border-radius: 999px; padding: 7px 14px; cursor: pointer; display: inline-flex; gap: 8px; align-items: center; color: var(--ink); }
.cart-btn .count { display: inline-grid; place-items: center; min-width: 22px; height: 22px; border-radius: 999px; background: var(--line); font-size: 0.8rem; font-weight: 700; padding: 0 6px; }
.cart-btn .count.on { background: var(--gold); color: var(--ink); }
@media (max-width: 720px) { .nav-links { display: none; } .cart-btn { margin-left: auto; } }

/* ---------- Hero ---------- */
.hero { padding: 56px 0 40px; }
.hero-in { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 40px; align-items: center; }
.hero-sub { font-size: 1.15rem; color: var(--muted); max-width: 34em; }
.hero-svg { width: 100%; max-width: 440px; display: block; margin: 0 auto; }
@media (max-width: 820px) { .hero-in { grid-template-columns: 1fr; } .hero-art { order: -1; max-width: 300px; margin: 0 auto; } .hero { padding-top: 24px; } }

.trust { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #fbf9f5; }
.trust-in { display: grid; grid-template-columns: repeat(4, 1fr); }
.trust-in > div { padding: 22px 18px; border-left: 1px solid var(--line); display: grid; gap: 2px; }
.trust-in > div:first-child { border-left: 0; }
.trust-in strong { font-weight: 600; }
.trust-in span { color: var(--muted); font-size: 0.9rem; }
@media (max-width: 820px) { .trust-in { grid-template-columns: 1fr 1fr; } .trust-in > div:nth-child(3) { border-left: 0; } .trust-in > div { border-top: 1px solid var(--line); } }

/* ---------- Khối nội dung ---------- */
.section { padding: 72px 0; }
.section.tinted { background: var(--accent-soft); }
.section-head { margin-bottom: 28px; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; }
.split p { color: #3c4a40; font-size: 1.05rem; }
@media (max-width: 820px) { .split { grid-template-columns: 1fr; gap: 24px; } .section { padding: 52px 0; } }

/* ---------- Sản phẩm ---------- */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
@media (max-width: 960px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .grid { grid-template-columns: 1fr; } }
.product { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: transform .2s ease, box-shadow .2s ease; }
.product:hover { transform: translateY(-3px); box-shadow: 0 14px 30px -18px rgba(31, 42, 35, .35); }
.pimg { background: var(--t1); padding: 22px 0 10px; display: grid; place-items: center; }
.bottle { width: 150px; height: 180px; }
.bottle .b-body { fill: var(--t2); }
.bottle .b-cap { fill: var(--ink); }
.bottle .b-label { fill: #fbf8f2; }
.bottle .b-brand { font-family: var(--serif); font-size: 12px; fill: var(--ink); }
.bottle .b-name { font: 700 10px var(--font); letter-spacing: 1.5px; fill: var(--muted); }
.pbody { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.pdesc { margin: 0; color: #3c4a40; }
.psize { margin: 0; color: var(--muted); font-size: 0.88rem; }
.ing { margin: 8px 0 4px; font-size: 0.92rem; }
.ing summary { cursor: pointer; color: var(--accent-2); font-weight: 600; }
.ing ul { margin: 8px 0; padding-left: 18px; }
.pfoot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 12px; }
.price { font-family: var(--serif); font-size: 1.35rem; }
.soldout { color: var(--muted); font-size: 0.9rem; }

.tint-sun   { --t1: #fbf0dc; --t2: #e0a95a; }
.tint-sea   { --t1: #e4f0f3; --t2: #5f97a8; }
.tint-peach { --t1: #fbe9e1; --t2: #d98a6a; }
.tint-lilac { --t1: #efe9f6; --t2: #9c88c2; }
.tint-sage  { --t1: #e6efe8; --t2: #6f9a7c; }
.tint-ink   { --t1: #e5e9e4; --t2: #2f5d46; }

/* ---------- Nhãn thành phần ---------- */
.label-card { background: #fffdf8; border: 2px solid var(--ink); border-radius: 6px; padding: 20px 22px; font-size: 0.95rem; max-width: 440px; justify-self: center; width: 100%; }
.label-title { font: 800 1.5rem var(--font); margin: 0; letter-spacing: -0.01em; }
.label-sub { margin: 2px 0 10px; color: var(--muted); border-bottom: 8px solid var(--ink); padding-bottom: 8px; }
.label-list { list-style: none; margin: 0; padding: 0; }
.label-list li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid #cfc8bb; }
.label-list b { white-space: nowrap; }
.label-foot { margin: 10px 0 0; font-size: 0.8rem; color: var(--muted); }

/* ---------- Đặt lịch, AI ---------- */
.booking { margin: 0; }
.ai-band { background: var(--accent); color: #eef0ea; }
.ai-band h2 { color: #fff; }
.ai-band .eyebrow { color: var(--gold); }
.ai-band .split p { color: #d6ddd5; }
.ai-band em { color: #fff; }
.ai-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; counter-reset: s; }
.ai-steps li { counter-increment: s; display: grid; grid-template-columns: 42px 1fr; column-gap: 12px; padding: 14px 16px; border: 1px solid rgba(255,255,255,.16); border-radius: 14px; background: rgba(255,255,255,.04); }
.ai-steps li::before { content: counter(s); grid-row: span 2; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--gold); color: var(--ink); font-weight: 700; }
.ai-steps strong { color: #fff; }
.ai-steps span { color: #c9d1c8; font-size: 0.92rem; }

.faq { border-bottom: 1px solid var(--line); padding: 16px 0; }
.faq summary { cursor: pointer; font-weight: 600; font-size: 1.05rem; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::after { content: "+"; font-size: 1.3rem; color: var(--accent-2); }
.faq[open] summary::after { content: "−"; }
.faq p { color: #3c4a40; margin: 10px 0 0; }

/* ---------- Chân trang ---------- */
.site-foot { border-top: 1px solid var(--line); padding: 44px 0 30px; background: #f1ede5; }
.foot-in { display: flex; justify-content: space-between; gap: 30px; flex-wrap: wrap; }
.legal { color: var(--muted); font-size: 0.88rem; margin-top: 10px; }
.foot-links { display: grid; gap: 8px; align-content: start; }
.foot-links a { color: var(--ink); text-decoration: none; }
.disclaimer { margin-top: 26px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 0.86rem; color: var(--muted); font-weight: 600; }

/* ---------- Giỏ hàng ---------- */
.scrim { position: fixed; inset: 0; background: rgba(20, 28, 23, .38); z-index: 40; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 100vw); background: var(--bg); z-index: 50; display: flex; flex-direction: column; box-shadow: -20px 0 40px -20px rgba(0,0,0,.3); animation: slide .22s ease-out; }
@keyframes slide { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { margin: 0; font-size: 1.5rem; }
.icon-btn { border: 0; background: transparent; font-size: 1.8rem; line-height: 1; cursor: pointer; color: var(--ink); padding: 4px 8px; }
.cart-lines { flex: 1; overflow-y: auto; padding: 8px 22px; }
.cart-line { display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); align-items: start; }
.cart-line .dot { width: 44px; height: 54px; border-radius: 10px; background: var(--t2); }
.cl-name { font-weight: 600; }
.cl-meta { color: var(--muted); font-size: 0.85rem; margin-bottom: 6px; }
.cl-price { font-weight: 600; white-space: nowrap; }
.empty { color: var(--muted); padding: 30px 0; text-align: center; }
.drawer-foot { padding: 16px 22px 22px; border-top: 1px solid var(--line); background: #fbf9f5; }
.ship-bar { font-size: 0.88rem; color: var(--muted); margin-bottom: 12px; }
.ship-bar .bar { height: 6px; background: var(--line); border-radius: 999px; margin-top: 6px; overflow: hidden; }
.ship-bar i { display: block; height: 100%; width: 0; background: var(--accent-2); border-radius: 999px; transition: width .3s ease; }
.sum { display: flex; justify-content: space-between; margin-bottom: 12px; font-size: 1.05rem; }

/* ---------- Thành phần chung ---------- */
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: #fff; }
.stepper button { border: 0; background: transparent; color: var(--ink); width: 32px; height: 32px; font-size: 1.1rem; cursor: pointer; }
.stepper output { min-width: 26px; text-align: center; font-variant-numeric: tabular-nums; }

label { display: block; font-weight: 600; margin: 14px 0 6px; font-size: 0.95rem; }
label .hint { font-weight: 400; }
input[type=text], input[type=tel], input[type=date], select, textarea {
  width: 100%; font: inherit; padding: 12px 14px; border: 1px solid #d8d1c5; border-radius: 12px; background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: 3px solid #e7c792; outline-offset: 1px; }
.row { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
@media (max-width: 520px) { .row { grid-template-columns: 1fr; } }
.choice { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0; }
.choice label { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; margin: 0; padding: 10px 14px; border: 1px solid var(--line); border-radius: 999px; background: #fff; cursor: pointer; }
.choice input { accent-color: var(--accent-2); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 600; border-radius: 999px; padding: 12px 22px; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink); cursor: pointer; text-decoration: none; transition: background .15s ease; }
.btn:hover { background: var(--accent-2); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--accent); }
.btn.ghost:hover { background: var(--accent-soft); }
.btn.small { padding: 8px 14px; font-size: 0.9rem; }
.btn.block { width: 100%; padding: 15px; font-size: 1.05rem; }
.btns { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin: 16px 0; }

/* ---------- Trang /dat, /don ---------- */
.top { border-bottom: 1px solid var(--line); background: rgba(247, 244, 238, 0.95); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; height: 62px; gap: 12px; }
.secure { font-size: 0.82rem; color: var(--muted); }
.page { padding-top: 26px; padding-bottom: 60px; }
.page h1 { font-size: clamp(1.8rem, 4vw, 2.4rem); margin: 6px 0 8px; }
.lead { color: var(--muted); margin-top: 0; }

.notice { border-radius: 14px; padding: 12px 16px; margin: 12px 0; border: 1px solid transparent; }
.notice.info { background: var(--info-soft); color: var(--info); border-color: #d2e3ee; }
.notice.warn { background: var(--warn-soft); color: var(--warn); border-color: #f1ddb2; }
.notice.ok   { background: var(--ok-soft); color: var(--ok); border-color: #c8e6d3; }
.notice.bad  { background: var(--bad-soft); color: var(--bad); border-color: #f0c9c9; }
.notice ul { margin: 6px 0 0; padding-left: 18px; }
.notice a { font-weight: 600; color: inherit; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 0.8rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }
.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
tfoot td { font-weight: 700; border-bottom: 0; font-size: 1.15rem; }

.status { border-radius: var(--radius); padding: 18px 20px; margin: 14px 0; font-weight: 500; }
.status .big { font-family: var(--serif); font-size: 1.5rem; display: block; margin-bottom: 2px; }
.status.cho_thanh_toan { background: var(--info-soft); color: var(--info); }
.status.cho_bo_sung { background: var(--warn-soft); color: var(--warn); }
.status.da_xac_nhan { background: var(--ok-soft); color: var(--ok); }
.status.can_doi_lich { background: var(--warn-soft); color: var(--warn); }
.status.het_han { background: var(--bad-soft); color: var(--bad); }
.qr { display: grid; justify-items: center; gap: 8px; }
.qr canvas { width: min(300px, 80vw); height: auto; image-rendering: pixelated; border-radius: 12px; border: 1px solid var(--line); background: #fff; }
.fields { display: grid; gap: 8px; margin: 14px 0; }
.field { display: grid; grid-template-columns: 104px 1fr auto; gap: 8px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fbf9f5; }
.field .k { color: var(--muted); font-size: 0.86rem; }
.field .v { font-weight: 700; font-family: var(--mono); word-break: break-all; }
.dev { border: 2px dashed #c9a27f; background: #fffaf3; }
.ai-note { font-size: 0.92rem; color: var(--muted); }
footer.mini { border-top: 1px solid var(--line); padding: 20px 0 32px; color: var(--muted); font-size: 0.86rem; }
.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 9px 16px; border-radius: 999px; font-size: 0.9rem; z-index: 60; }

/* ---------- COD, captcha, theo dõi đơn ---------- */
.choice label.off { opacity: .5; cursor: not-allowed; }
.captcha { display: grid; gap: 6px; margin: 16px 0 6px; }
.captcha-btn { display: inline-flex; align-items: center; gap: 12px; font: inherit; font-weight: 600; padding: 12px 16px; border: 1px solid #d8d1c5; border-radius: 12px; background: #fff; cursor: pointer; color: var(--ink); justify-self: start; }
.captcha-btn .cbox { width: 22px; height: 22px; border: 2px solid var(--muted); border-radius: 6px; display: inline-grid; place-items: center; }
.captcha-btn.busy .cbox { border-color: var(--gold); border-top-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
.captcha-btn.done { border-color: var(--ok); color: var(--ok); }
.captcha-btn.done .cbox { background: var(--ok); border-color: var(--ok); }
.captcha-btn.done .cbox::after { content: "✓"; color: #fff; font-size: 14px; }
@keyframes spin { to { transform: rotate(360deg); } }
.track { list-style: none; margin: 0 0 8px; padding: 0; }
.track li { position: relative; padding: 0 0 18px 30px; display: flex; justify-content: space-between; gap: 10px; color: var(--muted); }
.track li::before { content: ""; position: absolute; left: 4px; top: 5px; width: 12px; height: 12px; border-radius: 50%; border: 2px solid #cfc8bb; background: #fff; }
.track li::after { content: ""; position: absolute; left: 10px; top: 21px; bottom: 0; width: 2px; background: #e4ded3; }
.track li:last-child::after { display: none; }
.track li.done { color: var(--ink); }
.track li.done::before { background: var(--accent-2); border-color: var(--accent-2); }
.track li.cancel { color: var(--bad); }
.track li.cancel::before { background: var(--bad); border-color: var(--bad); }
.track .tt { font-size: .85rem; white-space: nowrap; }

/* ---------- Trang quản trị ---------- */
.admin .nav-in { height: 62px; }
.admin .secure { margin-left: 12px; }
.admin #logout { margin-left: auto; }
.login { max-width: 420px; margin: 40px auto; }
.board-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 18px; }
.tab { font: inherit; font-size: .9rem; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 7px 12px; cursor: pointer; display: inline-flex; gap: 8px; align-items: center; color: var(--ink); }
.tab .n { background: var(--line); border-radius: 999px; padding: 0 7px; font-size: .8rem; font-weight: 700; }
.tab.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.tab.on .n { background: rgba(255,255,255,.2); }
.tab.alert .n { background: var(--gold); color: var(--ink); }
.orders { display: grid; gap: 14px; }
.order-card { background: #fff; border: 1px solid var(--line); border-left: 5px solid var(--line); border-radius: 14px; padding: 16px 18px; display: grid; gap: 12px; }
.order-card.s-cho_goi_xac_nhan { border-left-color: var(--gold); }
.order-card.s-da_xac_nhan { border-left-color: var(--accent-2); }
.order-card.s-dang_giao { border-left-color: var(--info); }
.order-card.s-da_huy, .order-card.s-het_han { opacity: .7; }
.oc-head { display: flex; justify-content: space-between; gap: 12px; align-items: start; }
.oc-code { font: 700 1.2rem var(--mono); color: var(--ink); text-decoration: none; margin-right: 10px; }
.oc-total { text-align: right; font-weight: 700; font-size: 1.1rem; display: grid; }
.oc-total small { font-weight: 400; }
.oc-body { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 20px; }
.oc-body > .hint { grid-column: 1 / -1; }
@media (max-width: 640px) { .oc-body { grid-template-columns: 1fr; } }
.oc-name { font-weight: 600; }
.oc-addr, .oc-note { color: #3c4a40; font-size: .95rem; }
.oc-items { margin: 0; padding-left: 18px; }
.oc-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ship-form { display: flex; gap: 8px; flex-wrap: wrap; }
.ship-form select, .ship-form input { width: auto; padding: 8px 10px; font-size: .9rem; }
.share { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; border-top: 1px dashed var(--line); padding-top: 10px; }
.pill { font-size: .8rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--line); }
.pill.s-cho_goi_xac_nhan { background: var(--warn-soft); color: var(--warn); }
.pill.s-cho_thanh_toan, .pill.s-cho_bo_sung { background: var(--info-soft); color: var(--info); }
.pill.s-da_xac_nhan, .pill.s-da_giao { background: var(--ok-soft); color: var(--ok); }
.pill.s-dang_giao { background: var(--info-soft); color: var(--info); }
.pill.s-da_huy, .pill.s-het_han, .pill.s-can_doi_lich { background: var(--bad-soft); color: var(--bad); }
.btn.danger { color: var(--bad); border-color: var(--bad); }

/* ---------- Hướng dẫn cho trợ lý AI (trang chủ) ---------- */
.ai-guide { background: #f1ede5; border-top: 1px solid var(--line); padding: 48px 0; }
.ai-guide h2 { font-size: clamp(1.3rem, 2.4vw, 1.7rem); }
.ai-guide p { color: #3c4a40; }
.ai-guide pre { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; white-space: pre-wrap; word-break: break-all; font-size: .85rem; }

/* Nút Mua ngay + Thêm vào giỏ */
.pfoot { gap: 10px; flex-wrap: wrap; }
.pbtns { display: inline-flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
