/* HPL79 — màu lấy từ bộ nhận diện: xanh lá logo, vàng bông lúa, nâu con dấu */
@font-face {
  font-family: "Lato HPL";
  src: url("../fonts/lato-bold-vi.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --forest: #0E3729;     /* xanh đậm chủ đạo (nền header, hero, mua sỉ) */
  --forest-2: #134634;   /* xanh đậm nhạt hơn một bậc */
  --green: #156634;      /* xanh logo HPL79: nút, link */
  --green-deep: #0F4D27;
  --gold: #F0A71E;       /* vàng bông lúa */
  --gold-soft: #FDF1D8;
  --clay: #80533C;       /* nâu con dấu: dấu hiệu "truyền thống" */
  --cream: #F3E6CF;      /* kem con dấu trên nền xanh */
  --paper: #FFFFFF;
  --rice: #F4F5EF;       /* nền trang */
  --ink: #142A20;
  --muted: #56655C;
  --line: #DFE5DC;

  --display: "Lato HPL", "Be Vietnam Pro", system-ui, sans-serif;
  --body: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", sans-serif;

  --r-sm: 6px;
  --r-md: 12px;
  --r-lg: 20px;
  --wrap: 1120px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; animation: none !important; } }

body {
  margin: 0;
  background: var(--rice);
  color: var(--ink);
  font: 400 1rem/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--green); }
h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.12; margin: 0; letter-spacing: -0.01em; }
h2 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.25rem); }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 4px; }

.wrap { width: min(var(--wrap), 100% - 32px); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--paper); padding: 8px 12px; z-index: 100; }
.skip:focus { left: 16px; }

/* ---------- Nút ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 22px;
  border-radius: 999px; border: 2px solid var(--green);
  font: 600 .98rem/1 var(--body); text-decoration: none; cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.btn--solid { background: var(--green); color: #fff; }
.btn--solid:hover { background: var(--green-deep); border-color: var(--green-deep); }
.btn--line { background: transparent; color: var(--green); }
.btn--line:hover { background: #E7EFE6; }
.btn--gold { background: var(--gold); border-color: var(--gold); color: var(--forest); }
.btn--gold:hover { background: #FFB935; border-color: #FFB935; }
.btn--light { background: transparent; border-color: rgba(255,255,255,.55); color: #fff; }
.btn--light:hover { background: rgba(255,255,255,.1); border-color: #fff; }
.btn--ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn--ghost:hover { color: var(--ink); }
.btn--block { width: 100%; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; border: 0; background: #E7EFE6; color: var(--ink); font-size: 1rem; cursor: pointer; }

/* ---------- Header ---------- */
.top { position: sticky; top: 0; z-index: 20; background: var(--forest); border-bottom: 1px solid rgba(255,255,255,.08); }
.top__inner { display: flex; align-items: center; gap: 24px; height: 68px; }
.brand img { height: 42px; width: auto; }
.nav { display: flex; gap: 24px; margin-left: auto; }
.nav a { color: rgba(255,255,255,.88); text-decoration: none; font-weight: 500; }
.nav a:hover { color: var(--gold); }
.cart-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 12px 0 14px;
  border: 1.5px solid rgba(255,255,255,.35); background: transparent; border-radius: 999px;
  font: 600 .95rem var(--body); color: #fff; cursor: pointer;
}
.cart-btn:hover { border-color: #fff; }
.cart-btn svg { width: 20px; height: 20px; }
.cart-btn__count { min-width: 24px; height: 24px; padding: 0 7px; border-radius: 12px; background: var(--gold); color: var(--forest); font-size: .8rem; font-weight: 700; display: grid; place-items: center; }
.cart-btn.bump .cart-btn__count { animation: bump .35s ease; }
@keyframes bump { 50% { transform: scale(1.35); } }

/* ---------- Hero ---------- */
.hero {
  background: var(--forest);
  color: #fff;
  padding: clamp(36px, 6vw, 72px) 0 clamp(44px, 6vw, 80px);
  overflow: hidden;
}
.hero__grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(24px, 5vw, 64px); align-items: center; }
.hero h1 { font-size: clamp(2.3rem, 1.3rem + 4vw, 4.1rem); max-width: 14ch; color: #fff; }
.hero__lead { margin-top: 22px; font-size: 1.12rem; color: rgba(255,255,255,.8); max-width: 40ch; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.hero__note { margin-top: 18px; font-size: .92rem; color: var(--cream); }
.hero__seal { margin: 0; justify-self: center; width: min(100%, 440px); }
.hero__seal img { width: 100%; height: auto; }

/* ---------- Hôm nay làm bánh gì? ---------- */
.picker { padding: clamp(40px, 6vw, 72px) 0; background: var(--paper); border-bottom: 1px solid var(--line); }
.picker__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px 56px; align-items: start; }
.picker__hint { margin-top: 8px; color: var(--muted); }
.picker__chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.chip {
  border: 1.5px solid var(--line); background: var(--rice); color: var(--ink);
  padding: 8px 15px; border-radius: 999px; font: 500 .95rem var(--body); cursor: pointer;
}
.chip:hover { border-color: var(--green); }
.chip[aria-checked="true"] { background: var(--forest); color: #fff; border-color: var(--forest); font-weight: 600; }
.picker__result {
  background: var(--rice); border: 1.5px solid var(--line); border-left: 4px solid var(--clay);
  border-radius: var(--r-md); padding: 22px; min-height: 180px;
}
.picker__tip { color: var(--muted); }
.picker__tip strong { color: var(--ink); }
.picker__flours { display: grid; gap: 12px; margin-top: 16px; }
.pf { display: flex; align-items: center; gap: 12px; background: var(--paper); border-radius: var(--r-sm); padding: 10px 12px; }
.pf__bowl { width: 38px; height: 38px; color: var(--clay); flex: none; }
.pf__name { font-weight: 600; flex: 1; }
.pf__name small { display: block; font-weight: 400; color: var(--muted); }
.pf__opts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.pf__opt { font: inherit; font-size: .82rem; font-weight: 500; color: var(--muted); background: transparent; border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; cursor: pointer; font-variant-numeric: tabular-nums; }
.pf__opt:hover { border-color: var(--green); }
.pf__opt[aria-checked="true"] { color: var(--green); border-color: var(--green); background: #F1F7F0; font-weight: 600; }
.pf .btn { min-height: 38px; padding: 0 16px; font-size: .9rem; }

/* ---------- Bảng giá ---------- */
.board { padding: clamp(48px, 7vw, 88px) 0; }
.board__head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; margin-bottom: 26px; }
.board__head p { color: var(--muted); }
.board__rows { border-top: 2px solid var(--forest); }
.row {
  display: grid; grid-template-columns: 76px minmax(0, 1fr) minmax(0, 1.25fr);
  gap: 20px 28px; padding: 28px 0; border-bottom: 1px solid var(--line); align-items: start;
}
.row__bowl { width: 76px; height: 76px; color: var(--clay); }
.row__bowl img { width: 76px; height: 76px; object-fit: cover; border-radius: 50%; }
.row__name { font-size: 1.5rem; color: var(--forest); }
.row__desc { margin-top: 8px; color: var(--muted); max-width: 44ch; }
.row__uses { margin-top: 10px; font-size: .9rem; color: var(--clay); font-weight: 500; }
.row__buy { display: grid; gap: 14px; }
.variants { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.variant {
  text-align: left; border: 1.5px solid var(--line); background: var(--paper); border-radius: var(--r-sm);
  padding: 10px 12px; cursor: pointer; font: inherit; color: var(--ink);
}
.variant:hover { border-color: var(--green); }
.variant[aria-checked="true"] { border-color: var(--green); box-shadow: inset 0 0 0 1px var(--green); background: #F1F7F0; }
.variant__label { display: flex; align-items: center; gap: 6px; font-size: .85rem; color: var(--muted); }
.variant__price { display: block; font-weight: 600; font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.variant__tag { display: inline-block; font-size: .72rem; font-weight: 600; color: #8A5A00; background: var(--gold-soft); padding: 1px 7px; border-radius: 4px; }
.buyline { display: flex; gap: 10px; align-items: center; }
.qty { display: inline-flex; align-items: center; border: 1.5px solid var(--line); border-radius: 999px; height: 46px; background: #fff; }
.qty button { width: 40px; height: 100%; border: 0; background: none; font-size: 1.2rem; cursor: pointer; color: var(--ink); border-radius: 999px; }
.qty input { width: 40px; border: 0; text-align: center; font: 600 1rem var(--body); background: none; color: var(--ink); -moz-appearance: textfield; }
.qty input::-webkit-inner-spin-button { -webkit-appearance: none; }
.buyline .btn { flex: 1; }

/* ---------- Mua sỉ ---------- */
.wholesale { padding: clamp(48px, 7vw, 88px) 0; background: var(--forest); color: #fff; }
.wholesale__grid { display: grid; grid-template-columns: 1fr 1.15fr; gap: 32px 64px; align-items: start; }
.wholesale p { margin-top: 14px; color: rgba(255,255,255,.8); max-width: 42ch; }
.wholesale__cta { margin-top: 26px; }
.wholesale__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 20px; }
.wholesale__list li { display: grid; gap: 2px; padding-left: 18px; border-left: 3px solid var(--gold); }
.wholesale__list strong { font-family: var(--display); font-size: 1.1rem; }
.wholesale__list span { color: rgba(255,255,255,.78); }

/* ---------- Các bước ---------- */
.steps { padding: clamp(48px, 7vw, 88px) 0; }
.steps__list { list-style: none; counter-reset: s; margin: 28px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.steps__list li { counter-increment: s; display: grid; gap: 6px; }
.steps__list li::before { content: counter(s); font: 700 2.6rem/1 var(--display); color: var(--green); }
.steps__list strong { font-size: 1.1rem; }
.steps__list span { color: var(--muted); }

/* ---------- Liên hệ ---------- */
.contact { padding: clamp(48px, 7vw, 88px) 0; background: var(--paper); border-top: 1px solid var(--line); }
.contact__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: stretch; }
.contact__info { display: grid; grid-template-columns: max-content 1fr; gap: 10px 20px; margin: 24px 0 0; }
.contact__info dt { color: var(--muted); }
.contact__info dd { margin: 0; font-weight: 500; }
.contact__map { min-height: 280px; border-radius: var(--r-md); background: #E7EFE6; display: grid; place-items: center; padding: 24px; text-align: center; color: var(--muted); overflow: hidden; }
.contact__map iframe { width: 100%; height: 100%; min-height: 320px; border: 0; }
.contact__map:has(iframe) { padding: 0; }
.contact__map:has(.contact__mapbtn) { display: flex; flex-direction: column; align-items: center; justify-content: center; }
.contact__map:has(iframe) .contact__mapbtn { margin: 12px auto; }

/* ---------- Footer ---------- */
.foot { background: var(--forest); color: rgba(255,255,255,.75); padding: 36px 0 40px; font-size: .92rem; }
.foot__inner { display: flex; justify-content: space-between; align-items: center; gap: 20px 40px; flex-wrap: wrap; }
.foot__logo { height: 52px; width: auto; }
.foot__text { display: grid; gap: 4px; text-align: right; }
.foot a { color: var(--gold); }

/* ---------- Thanh nhanh trên điện thoại ---------- */
.quickbar { display: none; }

/* ---------- Giỏ hàng ---------- */
.drawer { position: fixed; inset: 0; z-index: 50; }
.drawer__scrim { position: absolute; inset: 0; background: rgba(14,55,41,.45); animation: fade .2s ease; }
.drawer__panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(440px, 100%);
  background: var(--paper); display: flex; flex-direction: column; animation: slide .25s ease;
}
@keyframes fade { from { opacity: 0; } }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }
.drawer__head { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.drawer__head h2 { font-size: 1.4rem; color: var(--forest); }
.drawer__body { flex: 1; overflow-y: auto; padding: 8px 20px 20px; }
.drawer__foot { border-top: 1px solid var(--line); padding: 16px 20px 20px; display: grid; gap: 10px; }

.cart-list { list-style: none; margin: 0; padding: 0; }
.ci { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.ci__name { font-weight: 600; }
.ci__name small { display: block; color: var(--muted); font-weight: 400; }
.ci__price { font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.ci__ctrl { display: flex; align-items: center; gap: 10px; }
.ci .qty { height: 36px; }
.ci .qty button { width: 32px; }
.ci__remove { border: 0; background: none; color: var(--muted); text-decoration: underline; cursor: pointer; font: inherit; font-size: .88rem; }
.cart-empty { padding: 40px 0; display: grid; gap: 16px; justify-items: start; color: var(--muted); }

.totals > div { display: flex; justify-content: space-between; font-size: 1.05rem; }
.totals strong { font-variant-numeric: tabular-nums; }
.totals__ship { margin-top: 4px; font-size: .88rem; color: var(--muted); }

.checkout { display: grid; gap: 14px; padding-top: 12px; }
.checkout label { display: grid; gap: 6px; font-weight: 500; font-size: .95rem; }
.checkout input:not([type=radio]), .checkout textarea {
  font: 400 1rem var(--body); padding: 11px 13px; border: 1.5px solid var(--line); border-radius: var(--r-sm); background: var(--rice); color: var(--ink);
}
.checkout input:focus, .checkout textarea:focus { outline: none; border-color: var(--green); background: #fff; }
.checkout [aria-invalid="true"] { border-color: #B3261E !important; }
.checkout__method { border: 0; padding: 0; margin: 0; display: flex; gap: 18px; flex-wrap: wrap; }
.checkout__method legend { font-weight: 500; font-size: .95rem; margin-bottom: 6px; padding: 0; }
.checkout .radio { display: flex; align-items: center; gap: 8px; font-weight: 400; }
.checkout .radio input { accent-color: var(--green); width: 18px; height: 18px; }
.form-error { color: #B3261E; font-size: .92rem; min-height: 1em; }

.done { padding-top: 16px; display: grid; gap: 12px; }
.done h3 { font-size: 1.4rem; color: var(--forest); }
.done p { color: var(--muted); }
.done__text { white-space: pre-wrap; font: 400 .88rem/1.5 var(--body); background: var(--rice); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px; margin: 0; max-height: 220px; overflow: auto; }
.done__actions { display: grid; gap: 8px; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--forest); color: #fff; padding: 12px 18px; border-radius: 999px; font-weight: 500; z-index: 60;
  transition: opacity .2s, transform .2s; max-width: calc(100% - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero__grid, .wholesale__grid, .contact__grid, .picker__grid { grid-template-columns: 1fr; }
  .hero__seal { width: min(78%, 340px); grid-row: 1; }
  .row { grid-template-columns: 60px minmax(0, 1fr); }
  .row__bowl, .row__bowl img { width: 60px; height: 60px; }
  .row__buy { grid-column: 1 / -1; }
  .steps__list { grid-template-columns: 1fr; gap: 20px; }
  .steps__list li { grid-template-columns: 48px 1fr; }
  .steps__list li::before { grid-row: span 2; font-size: 2rem; }
  .foot__text { text-align: left; }
}
@media (max-width: 640px) {
  .nav, .cart-btn span:not(.cart-btn__count) { display: none; }
  .brand img { height: 36px; }
  .cart-btn { margin-left: auto; padding: 0 10px; }
  .hero__seal { width: min(70%, 260px); }
  .variants { grid-template-columns: 1fr; }
  .variant { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
  .variant__label { font-size: .95rem; color: var(--ink); }
  body { padding-bottom: 64px; }
  .quickbar {
    display: grid; grid-template-columns: 1fr 1fr 1.4fr; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: var(--paper); border-top: 1px solid var(--line); padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); gap: 8px;
  }
  .quickbar a, .quickbar button {
    height: 44px; border-radius: 999px; display: flex; align-items: center; justify-content: center; gap: 4px; white-space: nowrap; text-decoration: none;
    font: 600 .95rem var(--body); border: 1.5px solid var(--green); color: var(--green); background: none; cursor: pointer;
  }
  .quickbar button { background: var(--forest); border-color: var(--forest); color: #fff; }
  .toast { bottom: auto; top: 80px; transform: translate(-50%, -20px); }
  .toast.show { transform: translate(-50%, 0); }
}

/* bẫy chống spam: ô ẩn */
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* nhóm sản phẩm + giá sỉ */
.board__group { font-size: 1.15rem; color: var(--clay); padding: 22px 0 4px; border-bottom: 1px solid var(--line); }
.board__group:first-child { padding-top: 14px; }
.variant__ws { display: block; font-size: .78rem; color: #8A5A00; margin-top: 2px; }
@media (max-width: 640px) { .variant { flex-wrap: wrap; } .variant__ws { flex-basis: 100%; margin-top: 0; } }
