/* Kiểu nền tảng dùng chung toàn site: khung, chữ, header, footer, nút.
   CSS riêng từng trang đặt ở file khác (home.css).
   Chỉ dùng var() từ tokens.css — không hard-code màu/khoảng cách. */

/* ---------- 1. Nền tảng ---------- */

/* Flatsome in CSS chữ từ Customizer hai lần, lần cuối ở gần cuối <head> nên
   xếp file sau nó cũng vô ích. Thêm html để hơn một bậc chọn lọc là đủ. */
html body {
  font-family: var(--font-sans);
  color: var(--text-body);
  background: var(--surface);
  line-height: var(--leading-normal);
}

/* Bọc trong :where() để reset có độ ưu tiên bằng 0 — mọi class component
   đè lại được mà không cần viết selector dài hay !important. */
:where(.mv-scope) :where(h1, h2, h3, p, ul, ol, dl, dd) { margin: 0; }

/* Flatsome đặt li{margin-bottom:.6em} cho cả trang. Selector đó có một phần tử
   nên mạnh hơn khối :where() ở trên (độ ưu tiên 0) — phải viết riêng và giữ
   .mv-scope ngoài :where() để thắng. Nếu không, khoảng cách thật luôn dôi ra so
   với con số khai trong component: bước quy trình hở 9,6px, bullet checklist
   thành 14,1px thay vì gap 6px. */
.mv-scope :where(li) { margin-bottom: 0; }
:where(.mv-scope) :where(ul, ol) { list-style: none; padding: 0; }
:where(.mv-scope) :where(a) { color: inherit; text-decoration: none; }
:where(.mv-scope) :where(img) { max-width: 100%; display: block; }

/* Flatsome đặt scroll-behavior ở html; neo phải trừ chiều cao header dính */
html { scroll-behavior: smooth; }
[id] { scroll-margin-top: calc(var(--header-h) + var(--space-4)); }

:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important; /* đè hoạt ảnh của Flatsome */
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Flatsome sinh CSS từ Customizer ép Lato lên h1-h6 và in ở gần cuối <head>,
   nên phải hơn một bậc chọn lọc mới giành lại được. */
.mv-scope h1, .mv-scope h2, .mv-scope h3,
.mv-scope h4, .mv-scope h5, .mv-scope h6 { font-family: inherit; }

/* flatsome.css còn đặt h1-h6 màu #555, làm tiêu đề trong khối nền xanh không
   ăn được màu trắng của khối. Bọc .mv-scope trong :where() để rule này ngang
   bậc với Flatsome (thắng nhờ nạp sau) mà vẫn thua mọi class thành phần. */
:where(.mv-scope) h1, :where(.mv-scope) h2, :where(.mv-scope) h3,
:where(.mv-scope) h4, :where(.mv-scope) h5, :where(.mv-scope) h6 { color: inherit; }

/* flatsome.css đắp nguyên bộ mặt nút lên mọi <button>: viết hoa, đệm 0 1.2em,
   min-height 2.5em, chữ đậm và nhỏ hơn. Nó viết hoa câu hỏi FAQ, và cái đệm
   1.2em bóp icon trong nút mở menu còn 5px. Trả <button> về trung tính rồi để
   từng thành phần tự khai — bọc :where() nên mọi class của ta đều đè lại được. */
:where(.mv-scope) button {
  padding: 0;
  min-height: 0;
  text-transform: none;
  letter-spacing: inherit;
  font: inherit;
}

/* ---------- 2. Khung ---------- */

.mv-wrap {
  max-width: var(--container-max);
  margin: 0 auto;
  padding-inline: var(--gutter);
}

/* Vùng cuối section để kéo element Flatsome vào — cùng khổ ngang với .mv-wrap.
   Chỉ in ra khi có nội dung (xem mv_slot()) nên section trống không dôi khoảng cách. */
.mv-slot {
  max-width: var(--container-max);
  margin: 40px auto 0;
  padding-inline: var(--gutter);
  /* Section nền xanh có lưới và vầng sáng đặt tuyệt đối — nâng vùng này lên trên. */
  position: relative;
}

/* Element Flatsome tự có margin-bottom — bỏ khoảng dôi ở đáy section. */
.mv-slot > :last-child { margin-bottom: 0; }

.mv-section { padding-block: var(--section-y); }
.mv-section--tint { background: var(--surface-subtle); }

/* ---------- 3. Chữ ---------- */

/* Thiết kế dùng ResizeObserver co chữ cho vừa 1 dòng. Thay bằng clamp():
   cùng hiệu quả, không tốn JS, không giật khi tải font. */
.mv-h2 {
  font-size: clamp(27px, 3.4vw, 44px);
  font-weight: var(--weight-extrabold);
  line-height: 1.12;
  letter-spacing: var(--tracking-tight);
  color: var(--text-body);
  text-wrap: pretty;
}
.mv-h2--light { color: #fff; }

.mv-lead {
  font-size: var(--text-md);
  color: var(--text-muted);
  line-height: var(--leading-relaxed);
}

.mv-mono { font-family: var(--font-mono); }

/* Nhãn kicker đầu section */
.mv-kicker {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: 22px;
}
.mv-kicker__slash {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: var(--weight-bold);
  color: var(--green-500);
  letter-spacing: .05em;
}
.mv-kicker__text {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--text-muted);
}
.mv-kicker__rule {
  flex: 1;
  height: 1px;
  background: var(--border);
  position: relative;
}
.mv-kicker__rule::after {
  content: "";
  position: absolute;
  right: 0; top: -2.5px;
  width: 6px; height: 6px;
  border-radius: var(--radius-pill);
  background: var(--green-500);
}
.mv-kicker--light .mv-kicker__slash { color: #fff; }
.mv-kicker--light .mv-kicker__text { color: rgba(255,255,255,.85); }
.mv-kicker--light .mv-kicker__rule { background: rgba(255,255,255,.4); }

/* ---------- 4. Nút ---------- */

.mv-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  border: none;
  border-radius: var(--radius-pill);
  font-family: var(--font-sans);
  font-size: 15.5px;
  font-weight: var(--weight-bold);
  line-height: 1;
  padding: 16px 30px;
  cursor: pointer;
  white-space: nowrap;
  transition: transform var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out),
              background-color var(--dur-fast) var(--ease-out);
}
.mv-btn:hover { transform: translateY(-2px); }
.mv-btn:active { transform: translateY(0); }

.mv-btn--brand { background: var(--green-500); color: #fff; box-shadow: var(--shadow-brand); }
.mv-btn--brand:hover { background: var(--green-600); color: #fff; }

.mv-btn--light { background: #fff; color: var(--green-700); box-shadow: var(--shadow-cta); }
.mv-btn--light:hover { color: var(--green-700); }

.mv-btn--sm { font-size: var(--text-sm); padding: 11px 22px; }

.mv-btn__icon { width: 1em; height: 1em; flex: 0 0 auto; }

/* Nút gọi: vòng tròn đỏ + số mono */
.mv-call {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  font-weight: var(--weight-bold);
  font-size: 15.5px;
  padding: 16px 10px;
}
.mv-call__ring {
  width: 42px; height: 42px;
  border-radius: var(--radius-pill);
  background: var(--red-500);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}
.mv-call__num { font-family: var(--font-mono); white-space: nowrap; }

/* ---------- 5. Header ---------- */

/* Header của ta nằm trong <header id="header"><div class="header-wrapper"> của
   Flatsome. Khối bọc đó cao đúng bằng header nên position:sticky đặt bên trong
   không có chỗ trượt — phải dính ở lớp ngoài cùng. */
#header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
}
#header .header-wrapper { background: none; }

.mv-topbar {
  background: var(--slate-900);
  color: var(--slate-300);
  font-size: 12.5px;
}
.mv-topbar__inner {
  display: flex;
  align-items: center;
  gap: 20px;
  height: 34px;
}
.mv-topbar__status { display: flex; align-items: center; gap: var(--space-2); }
.mv-topbar__dot {
  width: 6px; height: 6px;
  border-radius: var(--radius-pill);
  background: var(--green-500);
  flex: 0 0 auto;
}
.mv-topbar__area { margin-left: auto; }
.mv-topbar__tel { font-family: var(--font-mono); font-weight: var(--weight-bold); color: #fff; }

.mv-navbar {
  background: rgba(255,255,255,.92);
  border-bottom: 1px solid var(--border-subtle);
}
@supports (backdrop-filter: blur(12px)) {
  .mv-navbar { backdrop-filter: blur(12px); }
}
.mv-navbar__inner {
  display: flex;
  align-items: center;
  gap: 26px;
  height: 66px;
}

.mv-logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-weight: var(--weight-extrabold);
  font-size: 19px;
  letter-spacing: -0.02em;
  color: var(--text-body);
}
.mv-logo img {
  height: 40px; width: 40px;
  object-fit: cover;
  border-radius: var(--radius-md);
}
.mv-logo__accent { color: var(--green-500); }

.mv-nav {
  display: flex;
  gap: 22px;
  margin-left: auto;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
}
.mv-nav a {
  color: var(--slate-700);
  padding-block: var(--space-2);
  border-bottom: 2px solid transparent;
  transition: color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}
.mv-nav a:hover,
.mv-nav a[aria-current="true"] { color: var(--green-600); border-bottom-color: var(--green-500); }

/* Nút mở menu — chỉ hiện ở mobile */
.mv-navtoggle {
  display: none;
  margin-left: auto;
  width: 44px; height: 44px;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--slate-700);
  cursor: pointer;
}

/* ---------- 6. Footer ---------- */

.mv-footer {
  background: var(--slate-900);
  color: var(--footer-text);
  padding: 72px 0 40px;
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
}
.mv-footer__grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 40px;
  align-items: start;
}
.mv-footer__brand {
  font-size: var(--text-2xl);
  font-weight: var(--weight-extrabold);
  color: #fff;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-4);
}
.mv-footer__title {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: #fff;
  margin-bottom: var(--space-4);
}
.mv-footer__list { display: grid; gap: var(--space-3); }
.mv-footer__list a:hover { color: var(--green-500); }
.mv-footer__tel {
  display: block;
  font-family: var(--font-mono);
  color: var(--green-500);
  font-weight: var(--weight-bold);
  font-size: var(--text-lg);
}
.mv-footer__tel--alt { font-size: var(--text-md); color: var(--slate-300); }
.mv-footer__bottom {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,.1);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  justify-content: space-between;
  font-size: var(--text-xs);
}

/* ---------- 7. Nút Zalo nổi (phát sinh ngoài thiết kế) ---------- */

.mv-zalo {
  position: fixed;
  right: var(--space-5);
  bottom: var(--space-5);
  z-index: var(--z-sticky-bar);
  width: 56px; height: 56px;
  border-radius: var(--radius-pill);
  background: var(--zalo-blue);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-cta);
  transition: transform var(--dur-fast) var(--ease-out);
}
.mv-zalo:hover { transform: translateY(-3px); color: #fff; }
.mv-zalo svg { width: 30px; height: 30px; }

/* ---------- 8. Thanh gọi dính đáy — chỉ mobile ---------- */

.mv-callbar {
  display: none;
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: var(--z-sticky-bar);
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: var(--space-2) var(--space-3);
  padding-bottom: calc(var(--space-2) + env(safe-area-inset-bottom));
  gap: var(--space-2);
  box-shadow: 0 -6px 20px rgba(15,23,42,.08);
}
.mv-callbar > * { flex: 1; justify-content: center; }

/* ---------- 9. Hoạt ảnh ---------- */

@keyframes mv-marq { to { transform: translateX(-50%); } }
@keyframes mv-rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }

.mv-rise { animation: mv-rise .7s var(--ease-out) both; }
.mv-rise--2 { animation-delay: .15s; }
.mv-rise--3 { animation-delay: .25s; }
.mv-rise--4 { animation-delay: .35s; }

/* ---------- 10. Màn hình nhỏ ---------- */

@media (max-width: 1099px) {
  .mv-footer__grid { grid-template-columns: 1fr 1fr; gap: 32px; }
}

@media (max-width: 849px) {
  .mv-topbar__status { display: none; }
  .mv-topbar__area { margin-left: 0; }
  .mv-topbar__inner { justify-content: space-between; }

  .mv-navtoggle { display: inline-flex; }

  .mv-nav {
    position: absolute;
    left: 0; right: 0;
    top: 100%;
    flex-direction: column;
    gap: 0;
    margin: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-card);
    padding: var(--space-2) var(--gutter) var(--space-4);
  }
  .mv-nav[hidden] { display: none; }
  .mv-nav a {
    padding: 14px 0;
    border-bottom: 1px solid var(--border-subtle);
    font-size: var(--text-md);
  }
  .mv-navbar { position: relative; }
  .mv-navbar__inner { gap: var(--space-3); }
  .mv-navbar .mv-btn { display: none; }

  .mv-callbar { display: flex; }
  /* Nút Zalo phải nhường chỗ cho thanh gọi dính, nếu không sẽ chồng lên nhau */
  .mv-zalo { bottom: calc(72px + env(safe-area-inset-bottom)); width: 48px; height: 48px; }
  .mv-zalo svg { width: 26px; height: 26px; }

  body { padding-bottom: 68px; }
}

@media (max-width: 549px) {
  .mv-footer__grid { grid-template-columns: 1fr; }
  .mv-footer { padding-top: 48px; }
}
