/* ============================================================
   VinFast — Layout
   Grid systems, header, footer, page structure
   ============================================================ */

/* ── Vehicle Grid ─────────────────────────────────────────── */
.vf-vehicle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-6);
}
@media (min-width: 1024px) {
  .vf-vehicle-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 479px) {
  .vf-vehicle-grid { grid-template-columns: 1fr; }
}

/* ── 2-column content + sidebar ──────────────────────────── */
.vf-content-sidebar {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: var(--space-10);
  align-items: start;
}
@media (max-width: 1023px) {
  .vf-content-sidebar {
    grid-template-columns: 1fr;
  }
  .vf-content-sidebar .vf-sidebar {
    order: -1; /* Sidebar lên trên trên mobile */
  }
}

/* ── Sticky sidebar ───────────────────────────────────────── */
.vf-sidebar--sticky {
  position: sticky;
  top: calc(var(--space-16) + 20px); /* chiều cao specs bar + offset */
}

/* ── Counter strip ────────────────────────────────────────── */
.vf-counter-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--color-border);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  overflow: hidden;
}
@media (max-width: 639px) {
  .vf-counter-strip { grid-template-columns: repeat(2, 1fr); }
}
.vf-counter-strip__item {
  background: var(--color-surface);
  padding: var(--space-8) var(--space-6);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
}
.vf-counter-strip__value {
  font-family: var(--font-mono);
  font-size: var(--text-5xl);
  font-weight: var(--font-extrabold);
  color: var(--color-brand-primary);
  line-height: 1;
}
.vf-counter-strip__label {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
}

/* ── Header ───────────────────────────────────────────────── */
.vf-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-sticky);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  transition: box-shadow var(--transition-fast);
}
.vf-header--scrolled {
  box-shadow: var(--shadow-md);
}
.vf-header-spacer {
  height: 68px; /* desktop header height */
}
@media (max-width: 767px) {
  .vf-header-spacer { height: 60px; }
}

.vf-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
  height: 68px;
}
@media (max-width: 767px) {
  .vf-header__inner { height: 60px; }
}

.vf-header__logo img {
  display: block;
  height: 36px;
  width: auto;
}

/* ── Desktop Nav ──────────────────────────────────────────── */
.vf-header__nav { display: none; }
@media (min-width: 1024px) {
  .vf-header__nav { display: flex; }
}

.vf-nav {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: var(--space-1);
}
.vf-nav__item { position: relative; }

.vf-nav__link {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--color-text-primary);
  text-decoration: none;
  border-radius: var(--radius-md);
  transition: color var(--transition-fast), background var(--transition-fast);
  white-space: nowrap;
}
.vf-nav__link:hover {
  color: var(--color-brand-primary);
  background: var(--color-brand-light);
  text-decoration: none;
}
.vf-nav__chevron {
  transition: transform var(--transition-fast);
  flex-shrink: 0;
}
.vf-nav__item--has-dropdown:hover .vf-nav__chevron {
  transform: rotate(180deg);
}

/* ── Dropdown ─────────────────────────────────────────────── */
.vf-nav__dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  min-width: 560px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
  transform: translateX(-50%) translateY(-4px);
}
.vf-nav__item--has-dropdown:hover .vf-nav__dropdown,
.vf-nav__item--has-dropdown:focus-within .vf-nav__dropdown {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.vf-dropdown {
  display: flex;
  gap: 0;
  padding: var(--space-4);
}
.vf-dropdown__col {
  flex: 1;
  padding: var(--space-3) var(--space-4);
  border-right: 1px solid var(--color-border);
}
.vf-dropdown__col:last-of-type { border-right: none; }

.vf-dropdown__heading {
  font-size: var(--text-xs);
  font-weight: var(--font-bold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  color: var(--color-text-muted);
  margin-bottom: var(--space-3);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--color-border);
}
.vf-dropdown__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.vf-dropdown__link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: background var(--transition-fast);
}
.vf-dropdown__link:hover {
  background: var(--color-brand-light);
  text-decoration: none;
}
.vf-dropdown__model {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--color-text-primary);
}
.vf-dropdown__price {
  font-size: var(--text-xs);
  color: var(--color-brand-electric);
  font-family: var(--font-mono);
  white-space: nowrap;
}
.vf-dropdown__empty {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  padding: var(--space-2) var(--space-3);
}
.vf-dropdown__footer {
  width: 100%;
  padding: var(--space-3) var(--space-4) var(--space-2);
  border-top: 1px solid var(--color-border);
  margin-top: var(--space-2);
}
.vf-dropdown__footer a {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--color-brand-primary);
  text-decoration: none;
}
.vf-dropdown__footer a:hover { text-decoration: underline; }

/* ── Header actions ───────────────────────────────────────── */
.vf-header__actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-shrink: 0;
}
.vf-header__phone {
  display: none;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--color-brand-primary);
  text-decoration: none;
  white-space: nowrap;
}
.vf-header__phone:hover { color: var(--color-brand-electric); text-decoration: none; }
@media (min-width: 1024px) {
  .vf-header__phone { display: flex; }
}
.vf-header__cta {
  display: none;
}
@media (min-width: 768px) {
  .vf-header__cta { display: inline-flex; }
}

/* ── Hamburger ────────────────────────────────────────────── */
.vf-header__toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 8px;
  background: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: border-color var(--transition-fast);
}
.vf-header__toggle:hover { border-color: var(--color-brand-primary); }
@media (min-width: 1024px) {
  .vf-header__toggle { display: none; }
}

.vf-header__bar {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--color-text-primary);
  border-radius: 2px;
  transition: transform var(--transition-base), opacity var(--transition-fast);
  transform-origin: center;
}
/* Hamburger → X animation */
.vf-header__toggle[aria-expanded="true"] .vf-header__bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.vf-header__toggle[aria-expanded="true"] .vf-header__bar:nth-child(2) {
  opacity: 0;
}
.vf-header__toggle[aria-expanded="true"] .vf-header__bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ── Mobile Nav ───────────────────────────────────────────── */
.vf-header__mobile-nav {
  position: fixed;
  top: 60px;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--color-surface);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  transform: translateX(-100%);
  transition: transform var(--transition-base);
  z-index: calc(var(--z-sticky) - 1);
  border-top: 1px solid var(--color-border);
}
.vf-header__mobile-nav.is-open {
  transform: translateX(0);
}
@media (min-width: 1024px) {
  .vf-header__mobile-nav { display: none; }
}

.vf-mobile-nav__inner {
  padding: var(--space-4) var(--space-5) var(--space-12);
}
.vf-mobile-nav__list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.vf-mobile-nav__item {
  border-bottom: 1px solid var(--color-border);
}
.vf-mobile-nav__item--cta {
  border-bottom: none;
  padding-top: var(--space-4);
}
.vf-mobile-nav__link {
  display: block;
  padding: var(--space-4) 0;
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  color: var(--color-text-primary);
  text-decoration: none;
}
.vf-mobile-nav__sub {
  list-style: none;
  margin: 0;
  padding: 0 0 var(--space-4);
}
.vf-mobile-nav__sub-group { margin-bottom: var(--space-3); }
.vf-mobile-nav__sub-label {
  display: block;
  font-size: var(--text-xs);
  font-weight: var(--font-bold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
}
.vf-mobile-nav__sub ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.vf-mobile-nav__sub-link {
  display: block;
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  text-decoration: none;
  border-radius: var(--radius-md);
}
.vf-mobile-nav__sub-link:hover {
  background: var(--color-brand-light);
  color: var(--color-brand-primary);
}

/* ── Breadcrumbs ──────────────────────────────────────────── */
.vf-breadcrumbs-wrap {
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface-alt);
}
.vf-breadcrumbs-wrap .rank-math-breadcrumb,
.vf-breadcrumbs-wrap .vf-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.vf-breadcrumbs-wrap .rank-math-breadcrumb a,
.vf-breadcrumbs-wrap .vf-breadcrumb a {
  color: var(--color-brand-electric);
  text-decoration: none;
}
.vf-breadcrumbs-wrap .rank-math-breadcrumb a:hover,
.vf-breadcrumbs-wrap .vf-breadcrumb a:hover { text-decoration: underline; }

/* ── Why Us grid ─────────────────────────────────────────── */
.vf-why-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-6);
}
@media (min-width: 768px) {
  .vf-why-grid { grid-template-columns: repeat(4, 1fr); }
}
.vf-why-item {
  text-align: center;
  padding: var(--space-6);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  transition: box-shadow var(--transition-base), transform var(--transition-base);
}
.vf-why-item:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.vf-why-item__icon {
  width: 48px;
  height: 48px;
  margin: 0 auto var(--space-4);
  background: var(--color-brand-light);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-brand-primary);
}
.vf-why-item__title {
  font-size: var(--text-base);
  font-weight: var(--font-bold);
  color: var(--color-text-primary);
  margin-bottom: var(--space-2);
}
.vf-why-item__desc {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: var(--leading-relaxed);
}

/* ── Footer ───────────────────────────────────────────────── */
.vf-footer {
  background: var(--color-brand-deep);
  color: rgba(255, 255, 255, 0.75);
  padding-top: var(--space-16);
  padding-bottom: var(--space-8);
}

.vf-footer__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-10);
  padding-bottom: var(--space-12);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
@media (min-width: 640px) {
  .vf-footer__grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .vf-footer__grid { grid-template-columns: 2fr 1.2fr 1.4fr 1.6fr; gap: var(--space-8); }
}

.vf-footer__col--brand img { display: block; margin-bottom: var(--space-4); }

.vf-footer__desc {
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: var(--space-5);
  max-width: 280px;
}

.vf-footer__social {
  display: flex;
  gap: var(--space-3);
}
.vf-footer__social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  transition: background var(--transition-fast), color var(--transition-fast);
}
.vf-footer__social-link:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  text-decoration: none;
}

.vf-footer__heading {
  font-size: var(--text-sm);
  font-weight: var(--font-bold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  color: #fff;
  margin-bottom: var(--space-4);
}

.vf-footer__links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.vf-footer__links a {
  font-size: var(--text-sm);
  color: rgba(255, 255, 255, 0.65);
  text-decoration: none;
  transition: color var(--transition-fast);
}
.vf-footer__links a:hover { color: #fff; text-decoration: none; }

.vf-footer__contact-list {
  list-style: none;
  margin: 0 0 var(--space-4);
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.vf-footer__contact-list li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: rgba(255, 255, 255, 0.65);
  line-height: var(--leading-normal);
}
.vf-footer__contact-list svg { color: rgba(255, 255, 255, 0.4); margin-top: 3px; }
.vf-footer__contact-list a {
  color: rgba(255, 255, 255, 0.65);
  text-decoration: none;
}
.vf-footer__contact-list a:hover { color: #fff; text-decoration: none; }

.vf-footer__map-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--color-brand-electric);
  text-decoration: none;
}
.vf-footer__map-link:hover { color: #fff; text-decoration: underline; }

.vf-footer__bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
  padding-top: var(--space-6);
}
.vf-footer__copy {
  font-size: var(--text-sm);
  color: rgba(255, 255, 255, 0.45);
}
.vf-footer__legal-nav {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-sm);
}
.vf-footer__legal-nav a {
  color: rgba(255, 255, 255, 0.45);
  text-decoration: none;
}
.vf-footer__legal-nav a:hover { color: rgba(255,255,255,0.75); }
.vf-footer__legal-nav span { color: rgba(255, 255, 255, 0.2); }

.vf-footer__disclaimer {
  margin-top: var(--space-4);
  font-size: var(--text-xs);
  color: rgba(255, 255, 255, 0.3);
  line-height: var(--leading-relaxed);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: var(--space-4);
}
