/* ============================================================
   TPA — LAYOUT
   ============================================================ */

/* Container */
.container {
  width: min(100%, var(--container-max));
  margin-inline: auto;
  padding-inline: var(--container-gutter);
}

/* Section */
.section {
  padding-block: var(--section-py);
}
.section--soft { background: var(--bg-soft); }
.section--warm { background: var(--bg-warm); }
.section--brand { background: var(--brand-700); color: #fff; }
.section--brand h2, .section--brand h3 { color: #fff; }

/* Section header */
.section-hd {
  margin-bottom: var(--sp-12);
  text-align: center;
}
.section-hd--left { text-align: left; }
.section-hd p { max-width: 600px; margin-inline: auto; color: var(--slate-500); }
.section-hd--left p { margin-inline: 0; }

/* Grid utilities */
.grid { display: grid; gap: var(--sp-6); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1023px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 767px) {
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
}

/* Flex utilities */
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-2 { gap: var(--sp-2); }
.gap-4 { gap: var(--sp-4); }
.gap-6 { gap: var(--sp-6); }
.gap-8 { gap: var(--sp-8); }

/* Two-col split (text + media) */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-16);
  align-items: center;
}
.split--reverse .split__media { order: -1; }

@media (max-width: 767px) {
  .split { grid-template-columns: 1fr; gap: var(--sp-8); }
  .split--reverse .split__media { order: 0; }
}

/* ── TOP BAR ── */
.top-bar {
  background: var(--brand-700);
  color: rgba(255,255,255,.85);
  font-size: 0.8125rem;
  padding: var(--sp-2) 0;
  position: relative;
  z-index: 200;
}
.top-bar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  flex-wrap: wrap;
}
.top-bar__info { display: flex; align-items: center; gap: var(--sp-6); flex-wrap: wrap; }
.top-bar__info a { color: rgba(255,255,255,.85); }
.top-bar__info a:hover { color: #fff; }
.top-bar__social { display: flex; align-items: center; gap: var(--sp-3); }
.top-bar__social a {
  color: rgba(255,255,255,.7);
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  transition: background var(--ease), color var(--ease);
}
.top-bar__social a:hover { background: rgba(255,255,255,.15); color: #fff; }

/* ── HEADER ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  transition: box-shadow var(--ease), padding var(--ease);
}
.site-header.scrolled {
  box-shadow: var(--shadow-md);
}
.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-6);
  padding-block: var(--sp-4);
  transition: padding-block var(--ease);
}
.site-header.scrolled .header__inner { padding-block: var(--sp-2); }

.header__logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  text-decoration: none;
}
.header__logo img {
  height: 52px;
  width: auto;
  max-width: 180px;
  display: block;
  object-fit: contain;
  transition: height var(--ease);
}
.site-header.scrolled .header__logo img { height: 40px; }

/* Nav */
.header__nav { display: flex; align-items: center; gap: 0; }
.nav__list { display: flex; align-items: center; gap: 0; }
.nav__item { position: relative; }

.nav__link {
  display: block;
  padding: var(--sp-2) var(--sp-4);
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--ink-900);
  white-space: nowrap;
  transition: color var(--ease);
  border-radius: var(--r-sm);
}
.nav__link:hover, .nav__link.active { color: var(--brand-500); }

/* Dropdown */
.nav__dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 220px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-md);
  padding: var(--sp-2);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity var(--ease), transform var(--ease), visibility var(--ease);
  z-index: 50;
}
.nav__item:hover .nav__dropdown,
.nav__item:focus-within .nav__dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.nav__dropdown a {
  display: block;
  padding: var(--sp-2) var(--sp-4);
  font-size: 0.9rem;
  color: var(--ink-700);
  border-radius: var(--r-sm);
  transition: background var(--ease), color var(--ease);
}
.nav__dropdown a:hover { background: var(--bg-soft); color: var(--brand-500); }

/* Header CTA */
.header__cta { flex-shrink: 0; }

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  border: none;
  background: none;
  cursor: pointer;
  padding: 4px;
  border-radius: var(--r-sm);
}
.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--ink-900);
  border-radius: 2px;
  transition: transform var(--ease), opacity var(--ease);
}
.hamburger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.hamburger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── MOBILE NAV ── */
@media (max-width: 1023px) {
  .hamburger { display: flex; }
  .header__nav {
    position: fixed;
    inset: 0 0 0 auto;
    width: min(80vw, 320px);
    background: var(--bg);
    flex-direction: column;
    align-items: stretch;
    padding: var(--sp-8) var(--sp-6);
    box-shadow: var(--shadow-lg);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    z-index: 99;
  }
  .header__nav.open { transform: translateX(0); }
  .nav__list { flex-direction: column; align-items: stretch; gap: 0; }
  .nav__link { padding: var(--sp-3) var(--sp-2); border-bottom: 1px solid var(--line); }
  .nav__dropdown {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: none;
    border-radius: 0;
    padding-left: var(--sp-4);
    display: none;
  }
  .nav__item.open .nav__dropdown { display: block; }
  .header__cta { margin-top: var(--sp-6); }
}

/* Nav overlay */
.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 98;
}
.nav-overlay.active { display: block; }

/* ── FOOTER ── */
.site-footer {
  background: var(--brand-700);
  color: rgba(255,255,255,.8);
  padding-top: var(--sp-24);
  padding-bottom: var(--sp-8);
}
.footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: var(--sp-12);
  margin-bottom: var(--sp-12);
}
.footer__brand img { display: block; height: 48px; width: auto; max-width: 160px; object-fit: contain; margin-bottom: var(--sp-4); }
.footer__brand p { font-size: 0.9rem; line-height: 1.7; }
.footer__col h4 {
  color: #fff;
  font-size: 0.9375rem;
  font-weight: 700;
  margin-bottom: var(--sp-4);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.footer__col ul li + li { margin-top: var(--sp-2); }
.footer__col a { color: rgba(255,255,255,.7); font-size: 0.9rem; transition: color var(--ease); }
.footer__col a:hover { color: #fff; }
.footer__contact li { display: flex; gap: var(--sp-2); align-items: flex-start; margin-bottom: var(--sp-3); font-size: 0.9rem; }
.footer__contact li svg { flex-shrink: 0; margin-top: 3px; }

.footer__bottom {
  border-top: 1px solid rgba(255,255,255,.12);
  padding-top: var(--sp-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--sp-4);
  font-size: 0.875rem;
  color: rgba(255,255,255,.6);
}
.footer__policies { display: flex; gap: var(--sp-4); flex-wrap: wrap; }
.footer__policies a { color: rgba(255,255,255,.6); }
.footer__policies a:hover { color: #fff; }

.footer__bct {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
}
.footer__bct img { height: 36px; opacity: .85; }

.footer__social { display: flex; gap: var(--sp-3); margin-top: var(--sp-4); }
.footer__social a {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: rgba(255,255,255,.1);
  color: rgba(255,255,255,.8);
  transition: background var(--ease);
}
.footer__social a:hover { background: var(--accent-500); color: #fff; }

@media (max-width: 1023px) {
  .footer__grid { grid-template-columns: 1fr 1fr; gap: var(--sp-8); }
}
@media (max-width: 639px) {
  .footer__grid { grid-template-columns: 1fr; gap: var(--sp-8); }
  .footer__bottom { flex-direction: column; align-items: flex-start; }
}

/* ── FLOATING BUTTONS ── */
.float-actions {
  position: fixed;
  bottom: var(--sp-6);
  right: var(--sp-4);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  z-index: 50;
}
.float-btn {
  width: 48px; height: 48px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-md);
  transition: transform var(--ease), box-shadow var(--ease);
  color: #fff;
  border: none;
  cursor: pointer;
  text-decoration: none;
}
.float-btn:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); color: #fff; }
.float-btn--messenger { background: #0084ff; }
.float-btn--zalo { background: #0068FF; }
.float-btn--phone { background: #22c55e; }
.float-btn--top { background: var(--brand-700); }
.float-btn--top.hidden { opacity: 0; pointer-events: none; }
