@import url("colors.css");

/* =========================================================
   Máy hút bụi cầm tay mini USB — landing bán hàng
   DNA: FMCG Digital Shelf (mobile-first, 1 sản phẩm)
   Chỉ dùng biến từ colors.css (accent/gray) + đen/trắng.
   Ngoại lệ màu duy nhất: --zalo (#0088FF) cho nút Zalo.
   ========================================================= */

:root {
  --zalo: #0088ff;
  --shell: 1120px;
  --gutter: 24px;
  --r: var(--radius);
  --r-lg: calc(var(--radius) * 2);
  --line: 1px solid var(--gray-6);
  --sticky-h: 72px;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Be Vietnam Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-weight: 500;
  font-size: 16px;
  line-height: 1.6;
  color: var(--gray-12);
  background: var(--background);
  overflow-x: hidden;
  padding-bottom: calc(var(--sticky-h) + 24px); /* chừa chỗ sticky CTA mobile */
}

h1, h2, h3 { font-weight: 700; line-height: 1.2; margin: 0 0 12px; letter-spacing: -0.01em; }
h1 { font-size: clamp(28px, 7vw, 44px); }
h2 { font-size: clamp(23px, 5.2vw, 32px); }
h3 { font-size: 18px; }
p { margin: 0 0 14px; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent-11); }

.shell { width: 100%; max-width: var(--shell); margin: 0 auto; padding: 0 var(--gutter); }
.section { padding: 48px 0; }
.section--tint { background: var(--gray-2); }
.eyebrow {
  font-size: 12px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accent-11); margin: 0 0 8px;
}
.lede { color: var(--gray-11); max-width: 60ch; }

:where(a, button, summary, input):focus-visible {
  outline: 3px solid var(--accent-8);
  outline-offset: 2px;
  border-radius: var(--r);
}

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 310;
  background: var(--background);
  border-bottom: var(--line);
}
.site-header__in {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 58px;
}
.brand { font-weight: 700; font-size: 15px; letter-spacing: -0.01em; color: var(--gray-12); text-decoration: none; }
.brand span { color: var(--accent-11); }
.site-header__tel {
  font-size: 14px; font-weight: 700; color: var(--gray-12); text-decoration: none;
  white-space: nowrap;
}
.site-header__tel:hover { color: var(--accent-11); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 24px;
  font: inherit; font-weight: 700; font-size: 16px; white-space: nowrap;
  border: 0; border-radius: var(--r); cursor: pointer; text-decoration: none;
  transition: transform .15s ease, filter .15s ease;
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(1px); }
.btn--ghost { background: transparent; color: var(--gray-12); border: 1px solid var(--gray-7); }
.btn--lg { min-height: 58px; font-size: 17px; width: 100%; }
.btn--onaccent { background: var(--accent-contrast); color: var(--accent-12); }
/* Nền Zalo #0088FF trên chữ trắng chỉ đạt 3.52:1 — dưới ngưỡng 4.5:1 của chữ thường.
   Mọi nút Zalo giữ >= 19px/700 để nằm trong ngưỡng large-text (3:1), bất kể cỡ nút. */
.btn--zalo { background: var(--zalo); color: #ffffff; font-size: 19px; }

/* ---------- Hero ---------- */
.hero { padding: 32px 0 40px; background: var(--accent-2); border-bottom: var(--line); }
.hero__grid { display: grid; gap: 28px; }
.hero__frame {
  background: var(--background);
  border: var(--line);
  border-radius: var(--r-lg);
  padding: 14px;
  max-width: 340px; /* mobile: giữ giá + CTA gần màn hình đầu */
  margin: 0 auto;
}
.hero__frame img { border-radius: var(--r); width: 100%; aspect-ratio: 1 / 1; object-fit: cover; }
.hero__tag {
  display: inline-block; margin: 0 0 10px;
  font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--accent-12); background: var(--accent-4);
  padding: 5px 10px; border-radius: var(--r);
}
.hero p.lede { font-size: 17px; }

.price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 12px; margin: 18px 0 6px; }
.price__now { font-size: clamp(34px, 9vw, 46px); font-weight: 700; color: var(--accent-11); line-height: 1; }
.price__old { font-size: 18px; color: var(--gray-10); text-decoration: line-through; }
.price__save {
  font-size: 13px; font-weight: 700; color: var(--accent-contrast);
  background: var(--accent-9); padding: 4px 9px; border-radius: var(--r);
}
.hero__note { font-size: 14px; color: var(--gray-11); margin: 12px 0 0; }
.hero__cta { display: grid; gap: 10px; margin-top: 18px; }

/* ---------- USP strip ---------- */
.usp { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--gray-6); border: var(--line); border-radius: var(--r-lg); overflow: hidden; }
.usp__item { background: var(--background); padding: 20px 16px; display: grid; gap: 8px; justify-items: center; text-align: center; }
.usp__item svg { width: 28px; height: 28px; stroke: var(--accent-11); fill: none; stroke-width: 1.6; }
.usp__item b { font-size: 14px; font-weight: 700; }
.usp__item span { font-size: 13px; color: var(--gray-11); }

/* ---------- Công dụng ---------- */
.use { display: grid; gap: 20px; padding: 28px 0; border-bottom: var(--line); }
.use:last-child { border-bottom: 0; }
.use img { border-radius: var(--r-lg); border: var(--line); aspect-ratio: 3 / 2; object-fit: cover; width: 100%; }
.use__num { font-size: 13px; font-weight: 700; color: var(--gray-10); letter-spacing: .1em; }
.use ul { margin: 0; padding-left: 18px; color: var(--gray-11); }
.use li { margin-bottom: 6px; }

/* ---------- 3 bước ---------- */
.steps { display: grid; gap: 16px; counter-reset: s; }
.step {
  background: var(--background); border: var(--line); border-radius: var(--r-lg);
  padding: 20px; display: grid; gap: 6px;
}
.step__n {
  font-size: 26px; font-weight: 700; color: var(--accent-9); line-height: 1;
  font-variant-numeric: tabular-nums;
}

/* ---------- Thông số ---------- */
.specs { width: 100%; border-collapse: collapse; font-size: 15px; }
.specs caption { text-align: left; color: var(--gray-11); font-size: 14px; padding-bottom: 10px; }
.specs th, .specs td { padding: 13px 4px; border-bottom: var(--line); vertical-align: top; }
.specs th { text-align: left; font-weight: 500; color: var(--gray-11); width: 46%; }
.specs td {
  text-align: right; font-weight: 700; color: var(--gray-12);
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  font-size: 14px;
}

/* ---------- Đánh giá ---------- */
.reviews { display: grid; gap: 16px; }
.review { background: var(--background); border: var(--line); border-radius: var(--r-lg); padding: 20px; }
.review p { font-size: 15px; }
.review__who { font-size: 13px; color: var(--gray-11); margin: 0; }
.review__who b { color: var(--gray-12); }
.stars { display: flex; gap: 3px; margin-bottom: 10px; }
.stars svg { width: 15px; height: 15px; fill: var(--accent-9); }

/* ---------- Ưu đãi cuối ---------- */
.offer {
  background: var(--accent-9); color: var(--accent-contrast);
  border-radius: var(--r-lg); padding: 32px 24px; text-align: center;
}
.offer h2 { color: var(--accent-contrast); }
.offer__price { font-size: clamp(38px, 10vw, 52px); font-weight: 700; line-height: 1; margin: 8px 0; }
.offer__old { text-decoration: line-through; opacity: .75; font-size: 17px; }
.offer__list { list-style: none; margin: 18px 0; padding: 0; display: grid; gap: 8px; font-size: 15px; }
.offer__list li::before { content: "✓"; font-weight: 700; margin-right: 8px; }
.offer .btn { max-width: 380px; margin: 0 auto; }
.offer__limit { font-size: 13px; opacity: .85; margin: 14px 0 0; }

/* ---------- FAQ ---------- */
.faq { display: grid; gap: 0; border-top: var(--line); }
.faq details { border-bottom: var(--line); }
.faq summary {
  list-style: none; cursor: pointer; padding: 18px 34px 18px 0; position: relative;
  font-weight: 700; font-size: 16px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: 6px; top: 24px;
  width: 10px; height: 10px; border-right: 2px solid var(--accent-11); border-bottom: 2px solid var(--accent-11);
  transform: rotate(45deg); transition: transform .2s ease;
}
.faq details[open] summary::after { transform: rotate(-135deg); }
.faq p { color: var(--gray-11); font-size: 15px; padding-bottom: 6px; }

/* ---------- Footer ---------- */
.site-footer { border-top: var(--line); padding: 32px 0 40px; background: var(--gray-2); font-size: 14px; color: var(--gray-11); }
.site-footer h3 { font-size: 15px; color: var(--gray-12); }
.site-footer a { color: var(--gray-12); }
.site-footer__grid { display: grid; gap: 20px; }
.site-footer__legal { margin-top: 24px; padding-top: 16px; border-top: var(--line); font-size: 13px; }

/* ---------- Sticky CTA (mobile) ---------- */
.sticky-cta {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 350;
  display: none;
  align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom));
  background: var(--background); border-top: var(--line);
  box-shadow: 0 -6px 20px var(--gray-a4);
  transform: translateY(110%); transition: transform .25s ease;
}
.sticky-cta__price { display: grid; line-height: 1.15; }
.sticky-cta__now { font-size: 20px; font-weight: 700; color: var(--accent-11); }
.sticky-cta__old { font-size: 12px; color: var(--gray-10); text-decoration: line-through; }
.sticky-cta .btn { min-height: 46px; padding: 0 16px; }
.js-on .sticky-cta.is-on { transform: translateY(0); }
@media (max-width: 639.98px) { .sticky-cta { display: flex; } }
/* Máy hẹp 320px: nút Zalo 19px + cụm giá không đủ chỗ ở gutter mặc định —
   bóp đệm ngang và cỡ giá thay vì hạ cỡ chữ nút. */
@media (max-width: 379.98px) {
  .sticky-cta { padding-left: 14px; padding-right: 14px; gap: 10px; }
  .sticky-cta .btn { padding: 0 12px; }
  .sticky-cta__now { font-size: 18px; }
}
@media (min-width: 640px) { body { padding-bottom: 0; } }

/* ---------- GDPR ---------- */
.gdpr-banner {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 400;
  background: var(--background); border-top: 2px solid var(--accent-9);
  box-shadow: 0 -10px 30px var(--gray-a5);
  padding: 20px var(--gutter) calc(20px + env(safe-area-inset-bottom));
}
.gdpr-banner[hidden] { display: none; }
.gdpr-banner__in { max-width: var(--shell); margin: 0 auto; display: grid; gap: 14px; }
.gdpr-banner p { font-size: 14px; color: var(--gray-11); margin: 0; }
.gdpr-banner b { color: var(--gray-12); }
.gdpr-banner__actions { display: grid; gap: 8px; }
.gdpr-banner .btn { min-height: 46px; font-size: 15px; }
.btn--accent { background: var(--accent-9); color: var(--accent-contrast); }

/* ---------- Trang Privacy ---------- */
.doc { padding: 40px 0 56px; }
.doc h1 { margin-bottom: 8px; }
.doc__meta { color: var(--gray-11); font-size: 14px; margin-bottom: 28px; }
.doc section { padding: 22px 0; border-top: var(--line); }
.doc h2 { font-size: 20px; }
.doc ul { color: var(--gray-11); padding-left: 20px; }
.doc li { margin-bottom: 6px; }
.doc p { color: var(--gray-11); }

/* ---------- Responsive ---------- */
@media (min-width: 640px) {
  .section { padding: 64px 0; }
  .usp { grid-template-columns: repeat(3, 1fr); }
  .hero__cta { grid-template-columns: auto auto; justify-content: start; }
  .btn--lg { width: auto; min-width: 260px; }
  .steps { grid-template-columns: repeat(3, 1fr); }
  .reviews { grid-template-columns: repeat(3, 1fr); }
  .site-footer__grid { grid-template-columns: 1.4fr 1fr 1fr; }
  .gdpr-banner__in { grid-template-columns: 1fr auto; align-items: center; }
  .gdpr-banner__actions { grid-auto-flow: column; }
  .offer { padding: 48px 40px; }
}

@media (min-width: 900px) {
  .hero { padding: 56px 0 64px; }
  .hero__grid { grid-template-columns: 1fr 1.05fr; align-items: center; gap: 48px; }
  .hero__frame { max-width: none; }
  .usp { grid-template-columns: repeat(5, 1fr); }
  .use { grid-template-columns: 1fr 1fr; align-items: center; gap: 40px; padding: 40px 0; }
  .use--flip .use__media { order: 2; }
  .specs { font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
  .sticky-cta { transition: none; }
}

/* =========================================================
   KHỐI CHỐT ĐƠN — social proof, countdown, form, popup
   Vẫn chỉ dùng biến accent/gray + đen/trắng (ngoại lệ: --zalo).
   ========================================================= */

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Social proof (hero) ---------- */
.hero__frame { position: relative; }
.badge-off {
  position: absolute; top: 10px; left: 10px; z-index: 1;
  background: var(--accent-9); color: var(--accent-contrast);
  font-size: 15px; font-weight: 700; line-height: 1;
  padding: 7px 10px; border-radius: var(--r);
}
.social-proof {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px;
  font-size: 14px; color: var(--gray-11); margin: 0 0 12px;
}
.social-proof b { color: var(--gray-12); }
.badge-top {
  background: var(--accent-3); color: var(--accent-12);
  font-size: 12px; font-weight: 700; padding: 4px 9px; border-radius: var(--r);
}

/* ---------- Bố cục khối chốt đơn ---------- */
.order { display: grid; gap: 20px; }
.order__pitch {
  background: var(--accent-9); color: var(--accent-contrast);
  border-radius: var(--r-lg); padding: 28px 24px; text-align: center;
}
.order__pitch h2 { color: var(--accent-contrast); }
.order__panel {
  background: var(--background); border: var(--line);
  border-radius: var(--r-lg); padding: 20px; text-align: left;
}

/* ---------- Countdown evergreen ---------- */
.countdown { margin: 0 0 18px; text-align: center; }
.countdown__label { font-size: 14px; font-weight: 700; color: var(--gray-12); margin: 0 0 8px; }
.countdown__grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
  max-width: 320px; margin: 0 auto;
}
.cd { display: grid; gap: 3px; background: var(--accent-3); border-radius: var(--r); padding: 8px 4px; }
.cd b {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  font-size: 21px; font-weight: 700; line-height: 1;
  color: var(--accent-12); font-variant-numeric: tabular-nums;
}
.cd i { font-style: normal; font-size: 11px; color: var(--gray-11); }

/* ---------- Form đặt hàng ---------- */
.order-form { display: grid; gap: 12px; text-align: left; }
.order-form h3 { margin: 0; font-size: 20px; }
.order-form input[type="text"],
.order-form input[type="tel"] {
  width: 100%; min-height: 50px; padding: 0 14px;
  font: inherit; font-size: 16px; color: var(--gray-12);
  background: var(--background); border: 1px solid var(--gray-7); border-radius: var(--r);
}
.order-form input::placeholder { color: var(--gray-10); opacity: 1; }
.order-form [aria-invalid="true"] { border-color: var(--accent-10); }
.combo {
  margin: 0; padding: 10px 14px 14px;
  border: 1px solid var(--gray-6); border-radius: var(--r);
  display: grid; gap: 10px;
}
.combo legend { font-size: 13px; font-weight: 700; color: var(--gray-11); padding: 0 4px; }
.combo label { display: flex; align-items: flex-start; gap: 10px; font-size: 15px; cursor: pointer; }
.combo b { color: var(--accent-11); }
.combo input[type="radio"],
.consent input[type="checkbox"] {
  flex: none; width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--accent-9);
}
.consent { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; color: var(--gray-11); }
.tls-note { font-size: 13px; color: var(--gray-11); margin: 0; }
.order-form button[type="submit"] {
  width: 100%; white-space: normal; line-height: 1.25;
  min-height: 58px; padding: 12px 18px; text-align: center;
}
.ship-anchor { font-size: 14px; color: var(--gray-11); margin: 12px 0 0; text-align: center; }
.ship-anchor s { color: var(--gray-10); }
.ship-anchor b { color: var(--accent-11); }

.form-note { margin: 12px 0 0; font-size: 15px; }
.form-note:empty { display: none; }
.form-note.is-error,
.form-note.is-ok {
  padding: 13px 14px; border-radius: var(--r);
  border-left: 4px solid var(--accent-9); background: var(--accent-3); color: var(--accent-12);
}
.form-note.is-ok { display: grid; gap: 10px; justify-items: start; }
.form-note p { margin: 0; }
.form-note .btn { min-height: 46px; }

/* ---------- Popup đặt hàng ----------
   z-index 460: đè banner GDPR (400) và sticky CTA (350) khi đang mở. */
.order-popup {
  position: fixed; inset: 0; z-index: 460;
  display: flex; align-items: flex-end; justify-content: center;
}
.order-popup[hidden] { display: none; }
.order-popup__backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .5); }
.order-popup__panel {
  position: relative; width: 100%; max-width: 520px; max-height: 92vh; overflow-y: auto;
  background: var(--background); border-radius: var(--r-lg) var(--r-lg) 0 0;
  /* Chừa chỗ cho nút X ở góc trên, tránh đè lên nhãn countdown khi máy hẹp. */
  padding: 50px 18px calc(20px + env(safe-area-inset-bottom));
  box-shadow: 0 -10px 40px var(--gray-a8);
}
.order-popup__x {
  position: absolute; top: 6px; right: 6px; width: 44px; height: 44px;
  display: grid; place-items: center; padding: 0;
  font: inherit; font-size: 26px; line-height: 1; color: var(--gray-11);
  background: transparent; border: 0; border-radius: var(--r); cursor: pointer;
}
.order-popup__x:hover { color: var(--gray-12); }
body.has-popup { overflow: hidden; }

/* ---------- Sticky CTA: 2 nút ---------- */
.sticky-cta__actions { display: flex; align-items: center; gap: 8px; }
.sticky-cta__actions .btn { min-height: 46px; padding: 0 14px; }
@media (max-width: 379.98px) {
  .sticky-cta__actions { gap: 6px; }
  .sticky-cta__actions .btn { padding: 0 9px; }
  .sticky-cta__actions .btn--accent { font-size: 15px; }
  .sticky-cta__old { display: none; }
}

@media (min-width: 640px) {
  .order-popup { align-items: center; padding: 24px; }
  .order-popup__panel { border-radius: var(--r-lg); padding: 50px 24px 26px; }
}

@media (min-width: 900px) {
  .order { grid-template-columns: 1fr 1.1fr; align-items: start; gap: 32px; }
  .order__pitch { padding: 36px 28px; }
  .order__panel { padding: 28px; }
}

/* Sticky CTA nhường chỗ cho banner cookie. */
/* Banner cookie (fixed bottom, z 400) phủ kín thanh CTA bám đáy (z 350) ở lượt
   truy cập đầu nên hai nút dưới đó bấm không được. Còn banner thì ẩn hẳn thanh
   CTA; chọn xong cookie, banner nhận [hidden] và thanh CTA hiện lại như cũ.
   :has() cần ở đây vì .sticky-cta đứng TRƯỚC .gdpr-banner trong DOM, không
   dùng được bộ chọn anh em ~. */
body:has(.gdpr-banner:not([hidden])) .sticky-cta { display: none; }
