/* ==========================================================================
   Hoà Phát Smart — base layer dùng chung cho 3 phương án
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
}

body {
  margin: 0;
  font-family: var(--font-body, "Be Vietnam Pro", system-ui, sans-serif);
  font-size: var(--text-base, 16px);
  line-height: 1.6;
  color: var(--ink, #14201c);
  background: var(--bg, #fff);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body.no-scroll { overflow: hidden; }

img, svg, video { display: block; max-width: 100%; }
img { height: auto; }

a { color: inherit; text-decoration: none; }

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
figure, blockquote, p, h1, h2, h3, h4 { margin: 0; }
h1, h2, h3, h4 { line-height: 1.12; font-weight: 700; text-wrap: balance; }
p { text-wrap: pretty; }

:focus-visible {
  outline: 2px solid var(--focus, #c96f3b);
  outline-offset: 3px;
  border-radius: 2px;
}

::selection { background: var(--selection, #c96f3b); color: #fff; }

/* --- Layout --------------------------------------------------------------- */
.container {
  width: min(100% - (var(--gutter, 24px) * 2), var(--container-max, 1240px));
  margin-inline: auto;
}

.section { padding-block: clamp(56px, 8vw, 112px); }
.section--tight { padding-block: clamp(40px, 5vw, 72px); }

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 400;
  padding: 10px 16px;
  background: var(--ink, #14201c);
  color: #fff;
  border-radius: 6px;
  transform: translateY(-160%);
  transition: transform .2s ease;
}
.skip-link:focus { transform: translateY(0); }

.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;
}

/* --- Typography ----------------------------------------------------------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--accent, #c96f3b);
}

.eyebrow__line {
  width: 28px;
  height: 1px;
  background: currentColor;
  display: inline-block;
}

.display {
  font-family: var(--font-display, inherit);
  font-weight: 600;
  letter-spacing: -.025em;
  line-height: .98;
}

.lead {
  font-size: clamp(16px, 1.6vw, 18px);
  line-height: 1.65;
  color: var(--muted, #5c6b60);
}

.section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, .72fr);
  gap: clamp(20px, 4vw, 56px);
  align-items: end;
  margin-bottom: clamp(28px, 4vw, 48px);
}
.section-head h2 {
  font-family: var(--font-display, inherit);
  font-size: clamp(30px, 4.2vw, 52px);
  font-weight: 600;
  letter-spacing: -.03em;
  margin-top: 14px;
}
.section-head .lead { max-width: 46ch; justify-self: end; }

/* --- Buttons -------------------------------------------------------------- */
.btn {
  --btn-bg: var(--brand, #1f4d3a);
  --btn-fg: #fff;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 22px;
  border-radius: var(--btn-radius, 8px);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .01em;
  line-height: 1.2;
  transition: transform .2s ease, background-color .2s ease, box-shadow .2s ease, color .2s ease;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 12px 26px -14px rgba(0,0,0,.45); }
.btn:active { transform: translateY(0); }
.btn svg { width: 18px; height: 18px; flex: none; }

.btn--lg { min-height: 54px; padding: 15px 28px; font-size: 15px; }
.btn--sm { min-height: 40px; padding: 9px 16px; font-size: 13px; }

.btn--accent { --btn-bg: var(--accent, #c96f3b); --btn-fg: #fff; }
.btn--dark { --btn-bg: var(--ink, #14201c); --btn-fg: #fff; }
.btn--light { --btn-bg: #fff; --btn-fg: var(--ink, #14201c); }
.btn--outline {
  --btn-bg: transparent;
  --btn-fg: var(--ink, #14201c);
  border: 1px solid var(--line, rgba(0,0,0,.18));
}
.btn--outline:hover { background: var(--surface, #fff); }
.btn--ghost { --btn-bg: transparent; --btn-fg: inherit; padding-inline: 0; min-height: 0; }
.btn--ghost:hover { transform: none; box-shadow: none; }
.btn--text {
  --btn-bg: transparent;
  --btn-fg: inherit;
  padding-inline: 0;
  min-height: 0;
  border-bottom: 1px solid currentColor;
  border-radius: 0;
  padding-bottom: 4px;
}
.btn--text:hover { transform: none; box-shadow: none; color: var(--accent, #c96f3b); }
.btn--block { width: 100%; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line, rgba(0,0,0,.14));
  transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}
.icon-btn:hover { background: var(--surface, #fff); }
.icon-btn svg { width: 20px; height: 20px; }

/* --- Forms ---------------------------------------------------------------- */
.field { display: grid; gap: 7px; }
.field label,
.field-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted, #5c6b60);
}
.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--input-line, rgba(0,0,0,.16));
  border-radius: var(--input-radius, 8px);
  background: var(--input-bg, #fff);
  font-size: 15px;
  color: var(--ink, #14201c);
  transition: border-color .2s ease, box-shadow .2s ease;
}
.field textarea { min-height: 88px; resize: vertical; }
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent, #c96f3b);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent, #c96f3b) 18%, transparent);
}
.field input::placeholder,
.field textarea::placeholder { color: color-mix(in srgb, var(--muted, #5c6b60) 70%, transparent); }

.form-note {
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted, #5c6b60);
}

/* --- Modal ---------------------------------------------------------------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  padding: 18px;
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s ease, visibility .25s ease;
}
.modal.is-open { opacity: 1; visibility: visible; }
.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 20, 16, .6);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
}
.modal__panel {
  position: relative;
  width: min(540px, 100%);
  max-height: 92vh;
  overflow: auto;
  padding: clamp(22px, 4vw, 38px);
  background: var(--surface, #fff);
  border-radius: var(--modal-radius, 18px);
  box-shadow: 0 40px 80px -30px rgba(0,0,0,.5);
  transform: translateY(16px) scale(.985);
  transition: transform .28s cubic-bezier(.2,.8,.2,1);
}
.modal.is-open .modal__panel { transform: none; }
.modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line, rgba(0,0,0,.12));
}
.modal__close:hover { background: var(--bg, #f5f2ea); }
.modal__close svg { width: 18px; height: 18px; }
.modal__kicker {
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--accent, #c96f3b);
}
.modal__title {
  font-family: var(--font-display, inherit);
  font-size: clamp(26px, 4vw, 34px);
  letter-spacing: -.02em;
  margin: 8px 0 8px;
}
.modal__sub { font-size: 14px; color: var(--muted, #5c6b60); margin-bottom: 22px; }
.modal .field { margin-bottom: 14px; }
.modal .field input,
.modal .field select { background: var(--input-bg, #fff); }

.form-success {
  display: grid;
  justify-items: center;
  gap: 10px;
  text-align: center;
  padding: 22px 8px 8px;
}
.form-success svg { width: 52px; height: 52px; color: var(--brand, #1f4d3a); }
.form-success h3 { font-size: 22px; }
.form-success p { font-size: 14px; color: var(--muted, #5c6b60); max-width: 38ch; }
.form-success a { font-weight: 600; color: var(--brand, #1f4d3a); text-decoration: underline; text-underline-offset: 3px; }

/* --- Toast ---------------------------------------------------------------- */
.toast-wrap {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  z-index: 350;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: max-content;
  max-width: calc(100% - 32px);
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: 999px;
  background: var(--ink, #14201c);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 16px 40px -16px rgba(0,0,0,.5);
  animation: toast-in .3s ease both;
}
.toast svg { width: 16px; height: 16px; color: var(--accent, #c96f3b); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }

/* --- Accordion ------------------------------------------------------------ */
.faq-item {
  border-bottom: 1px solid var(--line, rgba(0,0,0,.14));
}
.faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 0;
  cursor: pointer;
  font-size: clamp(15px, 1.5vw, 17px);
  font-weight: 600;
  list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  flex: none;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line, rgba(0,0,0,.18));
  font-weight: 400;
  font-size: 18px;
  line-height: 1;
  transition: transform .2s ease, background-color .2s ease;
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item p {
  padding: 0 40px 20px 0;
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--muted, #5c6b60);
  max-width: 68ch;
}

/* --- Brand ---------------------------------------------------------------- */
.brand { display: inline-flex; align-items: center; gap: 11px; }
.brand__mark { width: 42px; height: 42px; flex: none; }
.brand__text { display: grid; line-height: 1.05; }
.brand__text strong {
  font-family: var(--font-display, inherit);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -.02em;
}
.brand__text small {
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--muted, #5c6b60);
  margin-top: 4px;
}

/* --- Header / nav shared -------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 120;
  transition: box-shadow .25s ease, background-color .25s ease, border-color .25s ease;
}
.site-header.is-scrolled { box-shadow: 0 10px 30px -22px rgba(0,0,0,.45); }

.nav ul { display: flex; align-items: center; gap: clamp(14px, 2vw, 30px); }
.nav > ul > li { position: relative; }
.nav > ul > li > a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 10px 0;
  font-size: 14px;
  font-weight: 500;
}
.nav > ul > li > a::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  bottom: 4px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s ease;
}
.nav > ul > li > a:hover::after { transform: scaleX(1); }

.has-mega > a::before {
  content: "";
  width: 4px; height: 4px;
  border-radius: 50%;
  background: currentColor;
  order: 2;
  opacity: .5;
}

.mega {
  position: absolute;
  top: calc(100% + 14px);
  left: 50%;
  translate: -50% 0;
  width: min(760px, 78vw);
  padding: 26px;
  background: var(--surface, #fff);
  border: 1px solid var(--line, rgba(0,0,0,.1));
  border-radius: 14px;
  box-shadow: 0 30px 70px -30px rgba(0,0,0,.35);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px 28px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity .2s ease, transform .2s ease, visibility .2s;
}
.has-mega:hover .mega,
.has-mega:focus-within .mega { opacity: 1; visibility: visible; transform: none; }
.mega__group h4 {
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted, #5c6b60);
  margin-bottom: 10px;
}
.mega__group a { display: block; padding: 5px 0; font-size: 13.5px; }
.mega__group a:hover { color: var(--accent, #c96f3b); }
.mega__promo {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line, rgba(0,0,0,.1));
  font-size: 13px;
}

/* --- Mobile nav shared ---------------------------------------------------- */
.menu-btn { display: none; width: 44px; height: 44px; align-items: center; justify-content: center; }
.menu-btn svg { width: 24px; height: 24px; }

.mobile-nav {
  position: fixed;
  inset: 0 0 0 auto;
  z-index: 250;
  width: min(380px, 90vw);
  background: var(--surface, #fff);
  padding: 22px;
  overflow-y: auto;
  transform: translateX(102%);
  visibility: hidden;
  transition: transform .32s cubic-bezier(.2,.8,.2,1), visibility .32s;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.mobile-nav.is-open { transform: none; visibility: visible; }
.mobile-nav__head { display: flex; align-items: center; justify-content: space-between; }
.mobile-nav__links { display: grid; }
.mobile-nav__links > li { border-bottom: 1px solid var(--line, rgba(0,0,0,.1)); }
.mobile-nav__links > li > a,
.mobile-nav__links > li > button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 0;
  font-size: 16px;
  font-weight: 600;
  text-align: left;
}
.mobile-nav__sub { display: none; padding: 0 0 12px 12px; }
.mobile-nav__sub a { display: block; padding: 7px 0; font-size: 14px; color: var(--muted, #5c6b60); }
.mobile-nav__links > li.is-open .mobile-nav__sub { display: block; }
.mobile-nav__links > li.is-open > button svg { transform: rotate(180deg); }
.mobile-nav__links svg { width: 18px; height: 18px; transition: transform .2s ease; }
.mobile-nav__foot { margin-top: auto; display: grid; gap: 10px; padding-top: 18px; }

.nav-backdrop {
  position: fixed;
  inset: 0;
  z-index: 240;
  background: rgba(10, 18, 14, .5);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s ease, visibility .3s;
}
.nav-backdrop.is-open { opacity: 1; visibility: visible; }

/* --- Search --------------------------------------------------------------- */
.search-panel {
  border-top: 1px solid var(--line, rgba(0,0,0,.1));
  background: var(--surface, #fff);
}
.search-panel[hidden] { display: none; }
.search-panel form {
  display: flex;
  gap: 10px;
  padding-block: 16px;
}
.search-panel input {
  flex: 1;
  min-height: 48px;
  padding: 12px 18px;
  border: 1px solid var(--line, rgba(0,0,0,.16));
  border-radius: 999px;
  background: var(--bg, #fff);
  font-size: 15px;
}
.search-panel input:focus { outline: 2px solid var(--accent, #c96f3b); outline-offset: 1px; }
.search-panel button { flex: none; }

/* --- Product card shared bits -------------------------------------------- */
.price {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  letter-spacing: -.01em;
}
.price--contact { font-weight: 600; font-size: 13px; letter-spacing: .02em; }
.price small { font-size: .72em; font-weight: 600; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  line-height: 1.4;
}

/* --- Footer bits ---------------------------------------------------------- */
.footer-col h4 {
  font-size: 12px;
  letter-spacing: .16em;
  text-transform: uppercase;
  margin-bottom: 16px;
  font-weight: 600;
}
.footer-col a, .footer-col p { display: block; font-size: 13.5px; line-height: 1.75; }
.footer-col a:hover { color: var(--accent, #c96f3b); }

/* --- Sticky mobile bar ---------------------------------------------------- */
.mobile-bar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 130;
  display: none;
  background: color-mix(in srgb, var(--surface, #fff) 94%, transparent);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line, rgba(0,0,0,.12));
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  gap: 6px;
}
.mobile-bar__item {
  flex: 1;
  display: grid;
  justify-items: center;
  gap: 3px;
  padding: 5px 2px;
  font-size: 10.5px;
  font-weight: 600;
  border-radius: 10px;
}
.mobile-bar__item svg { width: 20px; height: 20px; }
.mobile-bar__item--cta { background: var(--brand, #1f4d3a); color: #fff; }
.mobile-bar__item--cta:hover { color: #fff; }

/* --- Reveal --------------------------------------------------------------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .7s ease, transform .7s cubic-bezier(.2,.8,.2,1);
}
[data-reveal].is-revealed { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  [data-reveal] { opacity: 1; transform: none; }
}

/* --- Responsive shared ---------------------------------------------------- */
@media (max-width: 1024px) {
  .nav, .header__phone, .header__desktop-cta { display: none; }
  .menu-btn { display: inline-flex; }
  .section-head { grid-template-columns: 1fr; }
  .section-head .lead { justify-self: start; }
}

@media (max-width: 560px) {
  :root { --gutter: 18px; }
  html { scroll-padding-top: 80px; }
  .brand__mark { width: 36px; height: 36px; }
  .brand__text strong { font-size: 19px; }
  .brand__text small { font-size: 7.5px; letter-spacing: .16em; }
  .btn { min-height: 46px; padding: 11px 18px; }
  .modal { padding: 10px; }
  .modal__panel { border-radius: 16px; }
  .toast-wrap { bottom: 78px; }
}
