/* ==========================================================================
   header.css — THANH ĐẦU TRANG (logo, menu, đổi ngôn ngữ, menu di động)
   Dùng ở mọi trang. Script điều khiển: js/common.js
   ========================================================================== */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(251, 250, 246, .88);
  -webkit-backdrop-filter: saturate(1.4) blur(12px); backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s ease, box-shadow .25s ease;
}
.site-header.is-scrolled { border-bottom-color: var(--line); box-shadow: 0 6px 24px -16px rgba(11, 51, 32, .35); }

.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; height: var(--header-h); }
.brand { display: inline-flex; flex: none; }
.brand img { height: 40px; width: auto; }

/* ---------- Menu ---------- */
.nav { display: flex; align-items: center; gap: 28px; }
.nav__list { display: flex; gap: 4px; }
.nav__list a {
  display: block; padding: .55rem .95rem; border-radius: 999px;
  font-weight: 500; font-size: .96rem; color: var(--ink);
  transition: background-color .2s ease, color .2s ease;
}
.nav__list a:hover { background: var(--green-50); }
.nav__list a[aria-current="page"] { background: var(--green-100); color: var(--green-700); font-weight: 600; }
.nav__actions { display: flex; align-items: center; gap: 14px; }

/* ---------- Đổi ngôn ngữ VI | EN ---------- */
.lang-switch {
  display: inline-flex; padding: 3px; gap: 2px;
  background: #fff; border: 1px solid var(--line); border-radius: 999px;
}
.lang-switch a {
  padding: .28rem .7rem; border-radius: 999px;
  font-size: .8rem; font-weight: 700; letter-spacing: .04em; color: var(--muted);
  transition: background-color .2s ease, color .2s ease;
}
.lang-switch a:hover { color: var(--ink); }
.lang-switch a.is-active { background: var(--forest); color: #fff; }

/* ---------- Nút mở menu (di động) ---------- */
.nav-toggle {
  display: none; width: 44px; height: 44px; border-radius: 12px;
  border: 1px solid var(--line); background: #fff; place-items: center;
}
.nav-toggle__bars { position: relative; width: 20px; height: 14px; }
.nav-toggle__bars i {
  position: absolute; left: 0; width: 100%; height: 2px; border-radius: 2px; background: var(--ink);
  transition: transform .25s ease, opacity .2s ease, top .25s ease;
}
.nav-toggle__bars i:nth-child(1) { top: 0; }
.nav-toggle__bars i:nth-child(2) { top: 6px; }
.nav-toggle__bars i:nth-child(3) { top: 12px; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars i:nth-child(1) { top: 6px; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars i:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars i:nth-child(3) { top: 6px; transform: rotate(-45deg); }

@media (max-width: 960px) {
  .nav-toggle { display: grid; }
  .nav {
    position: absolute; left: 0; right: 0; top: var(--header-h);
    display: none; flex-direction: column; align-items: stretch; gap: 18px;
    padding: 12px 24px 24px; background: #fff;
    border-bottom: 1px solid var(--line); box-shadow: 0 24px 40px -24px rgba(11, 51, 32, .35);
  }
  .nav.is-open { display: flex; }
  .nav__list { flex-direction: column; gap: 2px; }
  .nav__list a { padding: .8rem 1rem; font-size: 1.02rem; }
  .nav__actions { justify-content: space-between; }
}
