/* ============================================================
   Header & Footer — dựng trên Astra Header/Footer Builder.
   Markup: functions/site-builder.php + template-parts/site-builder/*.
   Breakpoint khớp filter astra_tablet_breakpoint (1180px):
     desktop > 1180 · tablet 700–1180 · mobile < 700 · mobile nhỏ < 420.
   Màu/khoảng cách lấy từ design-tokens.css; các mã màu thiết kế đã map sang token.
   ============================================================ */

#masthead,
#colophon {
  --vf-line: color-mix(in srgb, var(--color-brand-primary) 10%, transparent);
  --vf-line-strong: color-mix(in srgb, var(--color-brand-primary) 14%, transparent);
  --vf-glass-edge: rgba(255, 255, 255, .9);
  --vf-blur: 22px;
  --vf-admin: var(--wp-admin--admin-bar--height, 0px);
  /* Lề ngang = đúng lề .vf-container của thân trang (16px mobile, 32px từ 768px) và khung --container-max,
     nên logo/CTA header, nội dung footer và thân trang cùng mép. Nền footer vẫn full-bleed. */
  --vf-edge: var(--container-px);
  --vf-fpad: max(var(--vf-edge), calc((100% - var(--container-max)) / 2 + var(--vf-edge)));
}

@media (min-width: 768px) { #masthead, #colophon { --vf-edge: var(--container-px-md); } }

/* ── Header: khung ─────────────────────────────────────────── */
#masthead {
  position: sticky !important;
  top: var(--vf-admin);
  z-index: 100;
  isolation: isolate;
  background: transparent;
  --vf-navfs: var(--text-base);
  --vf-navpad: 12px;
  --vf-mega-top: 84px;
}
/* Màn 1181-1439px: thu nhỏ menu để không tràn sang logo khi cụm SĐT hiện đủ số */
@media (min-width: 1181px) and (max-width: 1439px) { #masthead { --vf-navfs: 15px; --vf-navpad: 8px; } }
#masthead.is-scrolled { --vf-mega-top: 76px; }

/* Nền trắng đặc (không trong suốt khi cuộn). Nằm ở ::before để không tạo containing block
   cho mega menu / drawer position:fixed bên trong. */
#masthead::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--color-surface-elevated);
  border-bottom: 1px solid var(--vf-line-strong);
  /* Bóng nhẹ luôn bật để header tách khỏi nền trang cùng tông; đậm hơn khi cuộn */
  box-shadow: 0 4px 16px -10px color-mix(in srgb, var(--color-brand-deep) 25%, transparent);
  transition: box-shadow .2s;
}
#masthead.is-scrolled::before {
  box-shadow: 0 10px 30px -14px color-mix(in srgb, var(--color-brand-deep) 40%, transparent);
}

#masthead .main-header-bar,
#masthead .ast-primary-header-bar,
#masthead .ast-mobile-header-wrap .main-header-bar {
  background: transparent;
  border: 0;
  box-shadow: none;
}
#masthead .ast-primary-header-bar { height: 72px; min-height: 72px; padding-top: 0; padding-bottom: 0; padding-inline: 0; }
/* Căn giữa theo chiều dọc: hàng grid của Astra chỉ cao bằng nội dung nên mặc định dính mép trên. */
#masthead .ast-primary-header-bar { display: flex; align-items: center; }
#masthead .ast-primary-header-bar > * { width: 100%; }
#masthead .site-primary-header-wrap.ast-container,
#masthead .site-primary-header-wrap { max-width: none; padding: 0; min-height: 0; }

/* Logo */
#masthead .site-branding,
#masthead .ast-site-identity { padding: 0; }
#masthead .site-logo-img img { display: block; width: 236px; height: auto; max-width: none; }
#masthead .site-title,
#masthead .site-description { display: none; }

/* SĐT: cỡ chữ tường minh ở mọi breakpoint (ẩn dưới 1181px; trước đây rơi về 13.33px mặc định của trình duyệt) */
#masthead .vf-phone, #masthead .vf-phone__num { font-size: var(--text-sm); font-weight: 800; }

/* ── Header desktop ────────────────────────────────────────── */
@media (min-width: 1181px) {
  /* Logo co theo viewport (192px tai 1181px -> 220px tu ~1440px; khung header toi da 1280px nen khong to hon) de menu khong de len logo khi man hinh hep/zoom. */
  #masthead .site-logo-img img { width: clamp(192px, calc(192px + (100vw - 1181px) * 0.108), 220px); }
  #masthead #ast-desktop-header .ast-builder-grid-row {
    /* Logo bên trái; menu dồn sang phải, liền kề cụm SĐT + CTA. */
    grid-template-columns: auto minmax(0, 1fr) auto;
    column-gap: 24px;
    align-items: center;
    padding-inline: var(--vf-edge);
    /* Khung tối đa = --container-max như thân trang, căn giữa; nền kính vẫn full-bleed. */
    width: 100%;
    max-width: var(--container-max);
    margin-inline: auto;
  }
  #masthead .site-header-primary-section-center { justify-content: flex-end; min-width: 0; }
  #masthead .site-header-primary-section-right { justify-content: flex-end; }

  #masthead .main-navigation,
  #masthead .main-header-bar-navigation,
  #masthead .ast-main-header-bar-alignment { display: flex; align-items: center; }
  #masthead .main-header-menu { display: flex; align-items: center; gap: 2px; flex-wrap: nowrap; }
  #masthead .main-header-menu > .menu-item { position: static; }
  #masthead .main-header-menu > .menu-item > .menu-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 40px;
    padding: 0 var(--vf-navpad);
    border-radius: 999px;
    font-size: var(--vf-navfs);
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    color: var(--color-text-primary);
    background: transparent;
    transition: background .15s, color .15s;
  }
  #masthead .main-header-menu > .vf-panel-xe > .menu-link { font-weight: 800; }
  #masthead .main-header-menu > .menu-item > .menu-link > .ast-icon { display: none; }
  #masthead .main-header-menu > .menu-item > .menu-link:hover,
  #masthead .main-header-menu > .menu-item > .menu-link:focus-visible {
    background: color-mix(in srgb, var(--color-brand-primary) 6%, transparent);
    color: var(--color-text-primary);
  }
  #masthead .main-header-menu > .menu-item > .menu-link[aria-current="page"] { color: var(--color-cta-primary); }
  #masthead .main-header-menu > .vf-has-panel:hover > .menu-link,
  #masthead .main-header-menu > .vf-has-panel:focus-within > .menu-link {
    background: color-mix(in srgb, var(--color-cta-primary) 10%, transparent);
    color: var(--color-cta-primary);
  }
  #masthead .vf-has-panel.is-dismissed > .menu-link { background: transparent; color: var(--color-text-primary); }
  #masthead .vf-chev { flex: none; transition: transform .2s; }
  #masthead .vf-has-panel:hover > .menu-link .vf-chev,
  #masthead .vf-has-panel:focus-within > .menu-link .vf-chev { transform: rotate(180deg); }
  #masthead .vf-has-panel.is-dismissed > .menu-link .vf-chev { transform: none; }

  /* Cụm phải: SĐT */
  #masthead .vf-hactions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
  #masthead .vf-phone {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 44px;
    padding: 0 16px 0 8px;
    border-radius: 999px;
    border: 1px solid var(--vf-line-strong);
    background: rgba(255, 255, 255, .7);
    color: var(--color-brand-deep);
    font-size: var(--text-sm);
    font-weight: 800;
    white-space: nowrap;
  }
  #masthead .vf-phone:hover { color: var(--color-brand-deep); background: var(--color-brand-light); }
  #masthead .vf-phone__ico {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--color-brand-light);
    color: var(--color-cta-primary);
  }
}


/* ── Mega menu "Xe VinFast" & dropdown "Dịch vụ" (desktop) ─── */
.vf-mega,
.vf-drop {
  position: fixed;
  top: calc(var(--vf-mega-top) + var(--vf-admin));
  z-index: 99;
  background: rgba(255, 255, 255, .96);
  border: 1px solid var(--vf-glass-edge);
  opacity: 0;
  visibility: hidden;
  transition: opacity .18s .14s, transform .18s .14s, visibility .18s .14s;
}
@supports (backdrop-filter: blur(1px)) {
  /* Nền panel nhạt hơn trắng một chút (xanh-xám) để card trắng thuần nổi lên: card phải sáng hơn nền chứa nó. */
  .vf-mega { background: color-mix(in srgb, color-mix(in srgb, var(--color-brand-primary) 6%, var(--color-surface-soft)) 96%, transparent); backdrop-filter: blur(28px) saturate(1.7); -webkit-backdrop-filter: blur(28px) saturate(1.7); }
}
.vf-mega {
  left: 50%;
  width: 1040px;
  max-width: calc(100vw - 48px);
  padding: var(--space-4);
  max-height: calc(100dvh - var(--vf-mega-top) - var(--vf-admin) - 20px);
  overflow-y: auto;
  overscroll-behavior: contain;
  border-radius: var(--radius-2xl);
  transform: translateX(-50%) translateY(8px);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--color-brand-primary) 8%, transparent),
              0 40px 90px -24px color-mix(in srgb, var(--color-brand-deep) 38%, transparent);
}
/* Dropdown neo dưới chính mục "Dịch vụ" / "Tiện ích". */
#masthead .main-header-menu > .vf-panel-dv,
#masthead .main-header-menu > .vf-panel-ti { position: relative; }
.vf-drop {
  position: absolute;
  top: calc(var(--vf-mega-top) - 16px);
  left: 50%;
  width: 300px;
  /* Nền đặc giữ nội dung rõ và tránh lớp backdrop blur tràn khi hover mục con; cùng tông xanh-xám với mega menu
     để các mục trắng (card) nổi lên. */
  background: color-mix(in srgb, var(--color-brand-primary) 6%, var(--color-surface-soft));
  padding: 12px;
  border-radius: 24px;
  transform: translateX(-50%) translateY(8px);
  box-shadow: var(--shadow-lg);
}
.vf-has-panel:hover > .vf-mega,
.vf-has-panel:focus-within > .vf-mega,
.vf-has-panel:hover > .vf-drop,
.vf-has-panel:focus-within > .vf-drop {
  opacity: 1;
  visibility: visible;
  transition-delay: 0s;
}
.vf-has-panel:hover > .vf-mega,
.vf-has-panel:focus-within > .vf-mega { transform: translateX(-50%); }
.vf-has-panel:hover > .vf-drop,
.vf-has-panel:focus-within > .vf-drop { transform: translateX(-50%); }
.vf-has-panel.is-dismissed > .vf-mega,
.vf-has-panel.is-dismissed > .vf-drop { opacity: 0; visibility: hidden; }

.vf-mega, .vf-drop, .vf-acc {
  /* Panel nằm trong <li> của menu Astra nên thừa hưởng line-height = chiều cao header; đặt lại. */
  font-size: var(--text-sm);
  line-height: 1.5;
  font-weight: 400;
  text-align: left;
  text-transform: none;
  letter-spacing: normal;
  white-space: normal;
}
.vf-mega ul, .vf-drop ul, .vf-acc ul { list-style: none; margin: 0; padding: 0; }
.vf-eyebrow {
  font-size: var(--text-sm);
  font-weight: var(--font-extrabold);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--color-brand-primary);
}
.vf-mega__sub { display: block; margin: var(--space-4) 0 var(--space-3); }

.vf-mega__cards { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--space-2); }
.vf-mega .vf-mega__card {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  height: 88px;
  padding: var(--space-2);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  background: #fff;
  box-shadow: 0 1px 2px color-mix(in srgb, var(--color-brand-deep) 6%, transparent),
              0 6px 14px -8px color-mix(in srgb, var(--color-brand-deep) 18%, transparent);
  color: var(--color-text-heading);
  transition: transform .18s, box-shadow .18s, border-color .18s;
}
.vf-mega .vf-mega__card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--color-brand-primary) 35%, transparent);
  box-shadow: 0 2px 4px color-mix(in srgb, var(--color-brand-deep) 8%, transparent),
              0 18px 30px -16px color-mix(in srgb, var(--color-brand-primary) 55%, transparent);
  color: var(--color-text-heading);
}
.vf-mega .vf-mega__card:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.vf-mega .vf-nav-image { flex: none; width: var(--space-16); }
.vf-mega .vf-nav-image img { display: block; width: 100%; height: var(--space-12); object-fit: contain; }
.vf-mega__card strong { font-size: var(--text-sm); font-weight: 800; line-height: 1.25; overflow-wrap: anywhere; }
.vf-price {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: auto;
  font-size: var(--text-sm);
  font-weight: 800;
  color: var(--color-brand-primary);
}
.vf-price svg { flex: none; color: var(--color-cta-primary); }
.vf-price--sm { margin-top: 0; font-size: var(--text-sm); }

.vf-mega__pill-txt { display: flex; flex-direction: column; min-width: 0; }

.vf-mega .vf-mega__all { display: inline-flex; align-items: center; gap: 8px; font-size: var(--text-sm); font-weight: 800; color: var(--color-cta-primary); }

/* Cấp cha-con lấy từ menu core, giữ thứ tự quản trị trên cả hai breakpoint. */
.vf-mega > .vf-nav-children { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--space-4); }
.vf-mega > .vf-nav-children > .vf-nav-item:has(> .vf-nav-children) { grid-column: 1 / -1; }
.vf-mega > .vf-nav-children > .vf-nav-item > .vf-mega__all {
  display: flex;
  min-height: 44px;
  margin-top: 8px;
}
.vf-mega .vf-eyebrow { display: block; }
.vf-mega .vf-mega__card .vf-mega__pill-txt { gap: 4px; }
.vf-mega .vf-price { font-size: var(--text-xs); white-space: nowrap; }
.vf-drop .vf-nav-children .vf-nav-children { padding-left: 12px; }

.vf-drop .vf-nav-children { display: flex; flex-direction: column; gap: var(--space-2); }
.vf-drop a {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 52px;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  background: #fff;
  box-shadow: 0 1px 2px color-mix(in srgb, var(--color-brand-deep) 6%, transparent),
              0 6px 14px -8px color-mix(in srgb, var(--color-brand-deep) 18%, transparent);
  font-size: var(--text-sm);
  font-weight: 800;
  color: var(--color-text-heading);
  transition: transform .18s, box-shadow .18s, border-color .18s, color .15s;
}
.vf-drop a:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--color-brand-primary) 35%, transparent);
  box-shadow: 0 2px 4px color-mix(in srgb, var(--color-brand-deep) 8%, transparent),
              0 14px 24px -14px color-mix(in srgb, var(--color-brand-primary) 55%, transparent);
  color: var(--color-brand-primary);
}
.vf-drop a:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
/* Ô icon: nền tint nhạt, đổi sang xanh đặc khi hover mục. */
.vf-drop__icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--color-brand-tint-soft);
  color: var(--color-brand-primary);
  transition: background .18s, color .18s;
}
.vf-drop a:hover .vf-drop__icon { background: var(--color-brand-primary); color: var(--color-text-inverse); }
.vf-drop__label { min-width: 0; }

/* ── Header mobile / tablet ────────────────────────────────── */
@media (max-width: 1180px) {
  #masthead { --vf-blur: 12px; --vf-drawer-top: calc(64px + var(--vf-admin)); }
  #masthead .ast-primary-header-bar { height: 64px; min-height: 64px; }
  /* Ẩn khi kéo xuống: dùng top (không dùng transform) để không tạo containing block cho drawer fixed. */
  #masthead { transition: top .25s ease; }
  #masthead.is-hidden { top: calc(var(--vf-admin) - 80px); }
  #masthead #ast-mobile-header .ast-primary-header-bar { padding-inline: var(--vf-edge) !important; }
  #masthead #ast-mobile-header .ast-builder-grid-row { padding-inline: 0; align-items: center; }
  #masthead .site-logo-img img { width: 188px; }

  #masthead .menu-toggle.main-header-menu-toggle {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    margin: 0;
    border-radius: 14px;
    border: 1px solid var(--vf-line-strong);
    background: rgba(255, 255, 255, .8);
    color: var(--color-brand-deep);
  }
  #masthead .menu-toggle .ast-mobile-svg { width: 20px; height: 20px; fill: currentColor; }

  /* Drawer */
  #masthead .ast-mobile-header-content {
    position: fixed;
    top: var(--vf-drawer-top);
    bottom: 0;
    left: 0;
    right: 0;
    height: auto;
    max-height: none;
    z-index: 98;
    padding: 18px 20px 28px;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: var(--color-surface-elevated);
    border-top: 1px solid var(--vf-line);
    border-bottom: 0;
    box-shadow: none;
    animation: vf-drawer-in .2s ease;
  }
  #masthead .ast-mobile-header-content { display: none; }
  body.ast-main-header-nav-open #masthead .ast-mobile-header-content { display: block; }
  #masthead .ast-mobile-header-content .ast-builder-menu-mobile,
  #masthead .ast-mobile-header-content .main-header-bar-navigation,
  #masthead .ast-mobile-header-content .ast-main-header-bar-alignment,
  #masthead .ast-mobile-header-content .main-navigation { width: 100%; }
  #masthead #ast-hf-mobile-menu {
    display: flex;
    flex-direction: column;
    min-height: calc(100dvh - var(--vf-drawer-top) - 46px);
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
  }
  #masthead #ast-hf-mobile-menu > li { list-style: none; border: 0; }
  .vf-drawer-label { font-size: var(--text-sm); font-weight: var(--font-extrabold); letter-spacing: .12em; text-transform: uppercase; color: var(--color-text-muted); }

  #masthead #ast-hf-mobile-menu > .menu-item > .menu-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 52px;
    padding: 0;
    border-bottom: 1px solid var(--color-border);
    font-size: var(--text-lg);
    font-weight: 800;
    line-height: 1.2;
    color: var(--color-brand-deep);
    background: transparent;
  }
  #masthead #ast-hf-mobile-menu > .menu-item > .menu-link > .ast-icon { display: none; }
  #masthead #ast-hf-mobile-menu > .menu-item > .menu-link .vf-chev { width: 14px; height: 14px; transition: transform .2s; }
  #masthead #ast-hf-mobile-menu > .vf-has-acc.is-open > .menu-link,
  #masthead #ast-hf-mobile-menu > .menu-item > .menu-link[aria-current="page"] { color: var(--color-cta-primary); }
  #masthead #ast-hf-mobile-menu > .vf-has-acc.is-open > .menu-link .vf-chev { transform: rotate(180deg); }
  /* Icon bên trái mục menu cấp 1 (mặt nạ SVG, ăn theo màu chữ) */
  #masthead #ast-hf-mobile-menu > .menu-item > .menu-link { justify-content: flex-start; gap: 14px; }
  #masthead #ast-hf-mobile-menu > .menu-item > .menu-link::before { content: ""; flex: none; width: 22px; height: 22px; background: currentColor; -webkit-mask: var(--vf-ico) center / contain no-repeat; mask: var(--vf-ico) center / contain no-repeat; }
  #masthead #ast-hf-mobile-menu > .menu-item > .menu-link .vf-chev { margin-left: auto; }
  #masthead #ast-hf-mobile-menu > .menu-item > .menu-link[href$="/xe-vinfast/"] { --vf-ico: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><path d='M19 17h2c.6 0 1-.4 1-1v-3c0-.9-.7-1.7-1.5-1.9C18.7 10.6 16 10 16 10s-1.3-1.4-2.2-2.3c-.5-.4-1.1-.7-1.8-.7H5c-.6 0-1.1.4-1.4.9l-1.4 2.9A3.7 3.7 0 0 0 2 12v4c0 .6.4 1 1 1h2'/><circle cx='7' cy='17' r='2'/><path d='M9 17h6'/><circle cx='17' cy='17' r='2'/></svg>"); }
  #masthead #ast-hf-mobile-menu > .menu-item > .menu-link[href$="/dich-vu/"] { --vf-ico: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><path d='M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z'/></svg>"); }
  #masthead #ast-hf-mobile-menu > .menu-item > .menu-link[href$="/bang-gia-xe-vinfast/"] { --vf-ico: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><path d='M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z'/><circle cx='7.5' cy='7.5' r='1'/></svg>"); }
  #masthead #ast-hf-mobile-menu > .menu-item > .menu-link[href$="/tien-ich/"] { --vf-ico: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><rect width='7' height='7' x='3' y='3' rx='1'/><rect width='7' height='7' x='14' y='3' rx='1'/><rect width='7' height='7' x='14' y='14' rx='1'/><rect width='7' height='7' x='3' y='14' rx='1'/></svg>"); }
  #masthead #ast-hf-mobile-menu > .menu-item > .menu-link[href$="/khuyen-mai/"] { --vf-ico: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='8' width='18' height='4' rx='1'/><path d='M12 8v13M19 12v7a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2v-7'/><path d='M7.5 8a2.5 2.5 0 0 1 0-5A4.8 8 0 0 1 12 8a4.8 8 0 0 1 4.5-5 2.5 2.5 0 0 1 0 5'/></svg>"); }
  #masthead #ast-hf-mobile-menu > .menu-item > .menu-link[href$="/kien-thuc-xe-dien/"] { --vf-ico: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><path d='M12 7v14'/><path d='M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z'/></svg>"); }
  #masthead #ast-hf-mobile-menu > .menu-item > .menu-link[href$="/lien-he/"] { --vf-ico: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><path d='M5 4h4l2 5-2.5 1.5a11 11 0 005 5L15 13l5 2v4a2 2 0 01-2 2A16 16 0 013 6a2 2 0 012-2z'/></svg>"); }

  .vf-acc { display: none; }
  .vf-has-acc.is-open > .vf-acc { display: block; }
  .vf-acc__label { margin: 12px 0 0; font-size: var(--text-sm); font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--color-text-muted); }
  #masthead .vf-acc .vf-acc__label { display: flex; align-items: center; min-height: 44px; }
  #masthead .vf-acc .vf-mega__all { display: flex; align-items: center; min-height: 44px; color: var(--color-cta-primary); font-weight: 800; }
  /* Hai link cuối ("Xem tất cả dòng xe", "Bảng giá xe VinFast") cùng một hàng; nhóm xe chiếm trọn hàng. */
  .vf-nav-vehicles > .vf-acc > .vf-nav-children { display: grid; grid-template-columns: 1fr 1fr; column-gap: 8px; }
  .vf-nav-vehicles > .vf-acc > .vf-nav-children > .vf-nav-item:has(> .vf-nav-children) { grid-column: 1 / -1; }
  .vf-acc__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 8px 0 4px; }
  #masthead .vf-acc__tile {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 60px;
    padding: 8px 10px;
    border-radius: 16px;
    background: var(--color-brand-tint-soft);
    color: var(--color-text-heading);
  }
  .vf-acc__img { display: grid; place-items: center; flex: none; width: 48px; height: 36px; border-radius: 10px; background: #fff; overflow: hidden; }
  .vf-acc__img img { width: 100%; height: 100%; object-fit: contain; }
  .vf-acc__txt { display: flex; flex-direction: column; min-width: 0; }
  .vf-acc__txt strong { font-size: var(--text-base); font-weight: 800; line-height: 1.25; }
  .vf-acc__all { margin: 0; }
  #masthead .vf-acc__all a { display: flex; align-items: center; min-height: 44px; font-size: var(--text-sm); font-weight: 800; color: var(--color-cta-primary); }
  .vf-acc__list { display: grid; gap: 8px; padding: 12px 0 16px; }
  #masthead .vf-acc__list a {
    display: flex;
    align-items: center;
    min-height: 46px;
    padding: 0 16px;
    border-radius: 14px;
    background: var(--color-brand-tint-soft);
    font-size: var(--text-sm);
    font-weight: 800;
    color: var(--color-text-heading);
  }

  #masthead li.vf-drawer-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: auto; padding-top: 24px; }
  #masthead .vf-drawer-actions:has(> :only-child) { grid-template-columns: 1fr; }
  #masthead .vf-drawer-actions a {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    padding: 0 12px;
    border-radius: 999px;
    font-size: var(--text-sm);
    font-weight: 800;
    text-align: center;
  }
  #masthead .vf-btn-call { border: 1px solid color-mix(in srgb, var(--color-brand-primary) 30%, transparent); color: var(--color-brand-primary); }
  #masthead .vf-btn-trial {
    background: var(--gradient-action);
    color: #fff;
    box-shadow: 0 10px 24px -8px color-mix(in srgb, var(--color-cta-primary) 60%, transparent);
  }

  /* Drawer tự cuộn; ẩn thanh CTA và nút Zalo nổi để không đè lên nút "Đăng ký lái thử" ở đáy drawer (drawer áp dụng tới 1180px, rộng hơn mốc 767px của thanh CTA). */
  body.ast-main-header-nav-open .vf-mobile-sticky-bar,
  body.ast-main-header-nav-open .vf-zalo-fab { display: none; }
}
@media (max-width: 419px) {
  /* Giữ 2 cột, thumbnail nhỏ bên trái, tên + giá bên phải. */
  #masthead .vf-acc__tile { gap: 8px; padding: 8px; }
  .vf-acc__img { width: 40px; height: 30px; border-radius: 8px; }
  .vf-acc__txt strong { font-size: var(--text-sm); }
  .vf-acc__txt .vf-price { white-space: nowrap; }
}
@keyframes vf-drawer-in {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: none; }
}

/* ── Footer: khung 3 hàng full-bleed ───────────────────────── */
#colophon { background: #fff; padding: 0; }
/* Astra căn giữa phần tử HTML của footer; đặt lại trên chính khối của theme. */
#colophon .vf-fcta,
#colophon .vf-flinks,
#colophon .vf-flegal { text-align: left; }
#colophon .ast-builder-grid-row-container-inner,
#colophon .ast-builder-footer-grid-columns,
#colophon .footer-widget-area,
#colophon .ast-header-html,
#colophon .ast-builder-html-element { width: 100%; max-width: none; margin: 0; padding: 0; min-height: 0; }
#colophon .site-above-footer-wrap,
#colophon .site-primary-footer-wrap,
#colophon .site-below-footer-wrap { padding: 0; min-height: 0; border: 0; background: transparent; }
#colophon .vf-h { display: flex; align-items: center; gap: 8px; margin: 0; font-size: var(--text-sm); font-weight: var(--font-extrabold); letter-spacing: .1em; text-transform: uppercase; color: var(--color-text-heading); line-height: 1.3; }
#colophon .vf-h svg { flex: none; color: var(--color-text-muted); }
/* Tiêu đề 3 cột liên kết: icon theo nhóm thay cho tia sét (mặt nạ SVG, màu trung tính). */
#colophon .vf-h--ico::before { content: ""; flex: none; width: 20px; height: 20px; background: var(--color-text-muted); -webkit-mask: var(--vf-ico) center / contain no-repeat; mask: var(--vf-ico) center / contain no-repeat; }
#colophon .vf-h--ca-nhan { --vf-ico: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><path d='M19 17h2c.6 0 1-.4 1-1v-3c0-.9-.7-1.7-1.5-1.9C18.7 10.6 16 10 16 10s-1.3-1.4-2.2-2.3c-.5-.4-1.1-.7-1.8-.7H5c-.6 0-1.1.4-1.4.9l-1.4 2.9A3.7 3.7 0 0 0 2 12v4c0 .6.4 1 1 1h2'/><circle cx='7' cy='17' r='2'/><path d='M9 17h6'/><circle cx='17' cy='17' r='2'/></svg>"); }
#colophon .vf-h--dich-vu { --vf-ico: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><path d='M8 6v6M15 6v6M2 12h19.6'/><path d='M18 18h3s.5-1.7.8-2.8c.1-.4.2-.8.2-1.2 0-.4-.1-.8-.2-1.2l-1.4-5C20.1 6.8 19.1 6 18 6H4a2 2 0 0 0-2 2v10h3'/><circle cx='7' cy='18' r='2'/><path d='M9 18h5'/><circle cx='16' cy='18' r='2'/></svg>"); }
#colophon .vf-h--support { --vf-ico: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><path d='M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z'/></svg>"); }
#colophon .vf-h--tienich { --vf-ico: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='3' width='7' height='7' rx='1.6'/><rect x='14' y='3' width='7' height='7' rx='1.6'/><rect x='3' y='14' width='7' height='7' rx='1.6'/><rect x='14' y='14' width='7' height='7' rx='1.6'/></svg>"); }
#colophon .vf-h a { color: inherit; }
#colophon .vf-h a:hover { color: var(--color-cta-primary); }
#colophon ul { list-style: none; margin: 0; padding: 0; }

/* Dải CTA */
.vf-fcta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  padding: 36px var(--vf-fpad);
  background: linear-gradient(100deg, var(--color-brand-deep-soft), var(--color-brand-primary) 55%, var(--color-cta-primary));
}
.vf-fcta__title { max-width: 640px; margin: 0; font-size: var(--font-size-h2); font-weight: var(--font-extrabold); line-height: 1.15; letter-spacing: -.04em; color: #fff; }
.vf-fcta__btns { display: flex; gap: 10px; flex: none; }
#colophon .vf-fcta__primary,
#colophon .vf-fcta__ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 52px;
  padding: 0 26px;
  border-radius: 14px;
  font-size: var(--text-sm);
  font-weight: 800;
  white-space: nowrap;
  transition: background .15s;
}
#colophon .vf-fcta__primary { background: #fff; color: var(--color-brand-deep); }
#colophon .vf-fcta__primary:hover { background: var(--color-brand-light); color: var(--color-brand-deep); }
#colophon .vf-fcta__ghost { border: 1px solid rgba(255, 255, 255, .45); color: #fff; }
#colophon .vf-fcta__ghost:hover { background: rgba(255, 255, 255, .12); color: #fff; }

/* Khối link */
.vf-flinks {
  display: grid;
  grid-template-columns: minmax(340px, 1fr) minmax(0, 1.9fr);
  align-items: start;
  gap: var(--space-fluid-lg);
  padding: 56px var(--vf-fpad);
  background: var(--color-surface-alt);
  border-bottom: 1px solid var(--color-border);
}

/* Thẻ Showroom */
.vf-showroom {
  overflow: hidden;
  border-radius: 24px;
  border: 1px solid var(--color-border);
  background: #fff;
  box-shadow: 0 24px 48px -32px color-mix(in srgb, var(--color-brand-deep) 28%, transparent);
}
.vf-showroom__bar { height: 4px; background: linear-gradient(90deg, var(--color-brand-primary), var(--color-cta-primary) 60%, var(--color-brand-on-dark)); }
.vf-showroom__body { padding: 28px; }
.vf-showroom__head { display: flex; align-items: center; justify-content: space-between; padding-bottom: 22px; border-bottom: 1px solid var(--color-border); }
.vf-showroom__head .vf-logo { width: 150px; height: auto; }
.vf-showroom__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 22px 0 0; font-style: normal; }
.vf-cell { display: block; padding: 14px 16px; border-radius: 16px; background: var(--color-surface-alt); color: var(--color-text-heading); }
.vf-cell--wide { grid-column: span 2; }
.vf-cell__label { display: block; margin-bottom: 6px; font-size: var(--text-sm); font-weight: var(--font-extrabold); letter-spacing: .1em; text-transform: uppercase; color: var(--color-text-muted); }
.vf-cell__addr { display: block; font-size: var(--text-sm); font-weight: 700; line-height: 1.5; }
.vf-cell__hours { display: block; font-size: var(--text-sm); font-weight: 700; line-height: 1.5; }
.vf-cell__hours + .vf-cell__hours { margin-top: 6px; }
#colophon .vf-cell--hotline { background: var(--color-surface-sunken); border: 1px solid var(--color-border); color: var(--color-text-heading); transition: border-color .15s, background .15s; }
#colophon .vf-cell--hotline:hover { background: var(--color-surface-soft); border-color: var(--color-border-strong); }
.vf-cell--hotline .vf-cell__label { color: var(--color-text-muted); }
.vf-cell__num { display: block; font-size: var(--text-xl); font-weight: var(--font-extrabold); letter-spacing: -.02em; white-space: nowrap; color: var(--color-text-heading); }
#colophon .vf-cell__mail { font-size: var(--text-sm); font-weight: 700; color: var(--color-brand-primary); word-break: break-all; }
#colophon .vf-cell__mail:hover { color: var(--color-cta-primary); }
@media (max-width: 559px) { .vf-showroom__grid { grid-template-columns: 1fr; } .vf-cell--wide { grid-column: auto; } }
#colophon .vf-showroom__map {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  margin-top: 14px;
  border-radius: 14px;
  border: 1px solid var(--color-border-strong);
  font-size: var(--text-sm);
  font-weight: 800;
  color: var(--color-text-heading);
  transition: background .15s, color .15s;
}
#colophon .vf-showroom__map:hover { background: var(--color-surface-soft); color: var(--color-cta-primary); }

/* 3 cột link */
.vf-fnav { display: grid; grid-template-columns: minmax(0, 2.1fr) minmax(0, 1fr) minmax(0, 1.1fr); gap: var(--space-fluid-sm); padding-top: 24px; }
/* Xe cá nhân (10 xe) chia 2 cột; các cột khác 1 cột. */
#colophon .vf-fcol--wide ul { display: grid; grid-template-columns: 1fr 1fr; column-gap: 28px; }
.vf-fcol .vf-h { margin: 0; }
.vf-bars { display: flex; gap: 4px; margin: 10px 0 8px; }
.vf-bars > span { width: 22px; height: 4px; border-radius: 2px; background: var(--color-border-strong); }
.vf-bars > span:nth-child(2) { opacity: .55; }
.vf-bars > span:nth-child(3) { opacity: .2; }
#colophon .vf-frow {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text-heading);
}
#colophon .vf-frow:hover { color: var(--color-cta-primary); }
.vf-frow__img { display: grid; place-items: center; flex: none; width: 58px; height: 40px; border-radius: 10px; border: 1px solid var(--color-border); background: #fff; overflow: hidden; }
.vf-frow__img img { width: 100%; height: 100%; object-fit: contain; }
.vf-frow__txt { display: flex; flex-direction: column; min-width: 0; }
.vf-frow__txt strong { font-size: var(--text-sm); font-weight: 800; line-height: 1.25; }
.vf-frow__txt span { font-size: var(--text-sm); font-weight: 700; color: var(--color-text-muted); white-space: nowrap; }
#colophon .vf-fsup {
  display: block;
  padding: 13px 0;
  border-bottom: 1px solid var(--color-border);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-text-heading);
  transition: color .15s, padding-left .15s;
}
#colophon .vf-fsup:hover { color: var(--color-cta-primary); padding-left: 6px; }

/* Nhóm Tiện ích: chỉ hiện trên điện thoại, nằm cạnh cột Dịch vụ trong khối link. */
.vf-fcol--tienich { display: none; }

/* Dòng pháp lý */
.vf-flegal {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 48px;
  padding: 24px var(--vf-fpad) 36px;
  font-size: var(--text-sm);
  line-height: 1.65;
  color: var(--color-text-muted);
  text-align: left;
}
.vf-flegal p { margin: 0; }
.vf-flegal small { font-size: inherit; }
.vf-flegal__note { max-width: 640px; text-align: right; }

/* ── Footer tablet / mobile ────────────────────────────────── */
@media (max-width: 1180px) {
  .vf-fcta { flex-direction: column; align-items: flex-start; gap: 22px; padding: 36px var(--vf-edge); }
  .vf-flinks { grid-template-columns: 1fr; gap: 32px 24px; padding: 40px var(--vf-edge); }
  .vf-fnav { grid-template-columns: 1fr 1fr; padding-top: 0; }
  .vf-fcol--wide { grid-column: 1 / -1; }
  .vf-flegal { padding: 24px var(--vf-edge) 36px; }
}
@media (max-width: 699px) {
  .vf-fcta { padding: 36px var(--vf-edge); }
  .vf-fcta__btns { flex-direction: column; align-self: stretch; }
  .vf-flinks { padding: 32px var(--vf-edge); }
  .vf-fnav { gap: 20px 16px; } /* điện thoại: nhóm xe chiếm trọn hàng, Dịch vụ | Tiện ích đứng cạnh nhau */
  .vf-fcol--dich-vu { grid-column: 1 / -1; }
  .vf-fcol--tienich { display: block; } /* nhóm Tiện ích chỉ có trên điện thoại */
  .vf-flegal { flex-direction: column; gap: 8px; padding: 16px var(--vf-edge) 12px; } /* body đã chừa 60px cho thanh mobile */
  .vf-flegal__note { text-align: left; }
}
/* Nút +/− của nhóm xe: chỉ có trên mobile, mặc định thu gọn danh sách. */
.vf-fcol__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.vf-fcol__tgl { display: none; }
@media (max-width: 699px) {
  .vf-fcol__tgl { display: grid; place-items: center; flex: none; width: 44px; height: 44px; margin: -8px -8px -8px 0; padding: 0; border: 0; border-radius: 12px; background: transparent; box-shadow: none; color: var(--color-cta-primary); cursor: pointer; }
  .vf-fcol__tgl:hover, .vf-fcol__tgl:focus-visible { background: var(--color-brand-tint-soft); color: var(--color-cta-hover); }
  .vf-fcol__tgl::before { content: "+"; font: 400 28px/1 var(--font-body); }
  .vf-fcol__tgl[aria-expanded="true"]::before { content: "−"; }
  #colophon .vf-fcol:has(.vf-fcol__tgl):not(.is-open) > ul { display: none; }
  .vf-fcol:has(.vf-fcol__tgl):not(.is-open) > .vf-bars { margin-bottom: 0; }
}
@media (max-width: 559px) {
  /* Điện thoại: danh sách xe (bấm +) chia 2 cột, hàng gọn lại để vừa nửa chiều rộng. */
  #colophon .vf-fcol:has(.vf-fcol__tgl) > ul { display: grid; grid-template-columns: 1fr 1fr; column-gap: 16px; }
  #colophon .vf-fcol:has(.vf-fcol__tgl):not(.is-open) > ul { display: none; }
  #colophon .vf-fcol:has(.vf-fcol__tgl) .vf-frow { gap: 8px; }
  #colophon .vf-fcol:has(.vf-fcol__tgl) .vf-frow__img { width: 44px; height: 32px; border-radius: 8px; }
  #colophon .vf-fcol:has(.vf-fcol__tgl) .vf-frow__txt span { white-space: normal; font-size: var(--text-xs); }
}
@media (max-width: 419px) {
  .vf-showroom__body { padding: 22px; }
}

/* ── Focus + giảm chuyển động ──────────────────────────────── */
#masthead a:focus-visible,
#masthead button:focus-visible,
#colophon a:focus-visible { outline: 3px solid var(--color-focus); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) {
  #masthead *, #masthead::before, .vf-mega, .vf-drop, #colophon * { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
