/* Modern 2026 design layer — tier: header */

/* ============================================================================
   HEADER — keeps the ORIGINAL light-green background (#ecf6e7 + bg-page-head.png
   from template.css), per request. We deliberately DON'T override the background
   here so the legacy fill shows through; only the nav / dropdown / mobile drawer
   below are modernised. jquery.tint.js still toggles .page-header-sticky
   (shrink + shadow) on scroll — that legacy behaviour is left intact; we layer
   a subtle glass blur + elevated shadow onto the sticky state on top of it.
   ============================================================================ */

.page-header {
  transition: min-height var(--t-slow), box-shadow var(--t), backdrop-filter var(--t);
}

/* Sticky state: legacy JS already shrinks min-height to 60px + adds a flat
   box-shadow inline; we layer a soft frosted-glass blur + a richer, layered
   shadow on top of the light-green fill (fill itself is untouched). */
.page-header.page-header-sticky {
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  backdrop-filter: saturate(180%) blur(16px);
  box-shadow: 0 2px 32px rgba(16, 40, 28, 0.14) !important;
  border-bottom: 1px solid rgba(16, 40, 28, 0.06);
}

/* Desktop nav links — modern uppercase with an animated gold underline.
   993px matches the legacy breakpoint where template.css stops collapsing the
   navbar (.navbar-collapse hidden ≤992 → hamburger drawer). */
@media (min-width: 993px) {
  .page-header ul.navbar-nav li {
    padding: 0 15px;
  }
  .page-header ul.navbar-nav li,
  .page-header ul.navbar-nav li:hover,
  .page-header ul.navbar-nav li.active,
  .page-header ul.navbar-nav li.dropdown.open {
    background: transparent !important;
  }
  .page-header ul.navbar-nav li > a {
    position: relative;
    color: var(--c-ink) !important;
    background: none !important;
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.04em;
    transition: color var(--t);
  }
  .page-header ul.navbar-nav li > a::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 2px;
    width: 72%;
    height: 2.5px;
    border-radius: 2px;
    background: var(--c-gold);
    transform: translateX(-50%) scaleX(0);
    transition: transform var(--t);
  }
  .page-header ul.navbar-nav li:hover > a,
  .page-header ul.navbar-nav li.active > a,
  .page-header ul.navbar-nav li.active > a:hover {
    color: var(--c-teal) !important;
  }
  .page-header ul.navbar-nav li:hover > a::after,
  .page-header ul.navbar-nav li.active > a::after {
    transform: translateX(-50%) scaleX(1);
  }
  /* Home icon link keeps its glyph but loses the dark active block */
  .page-header .navbar-nav li.home:hover a,
  .page-header .navbar-nav li.home.active a {
    background-color: transparent !important;
  }

  /* Modern dropdown card ("Dự án") */
  .page-header ul.navbar-nav ul.dropdown-menu {
    background: #fff;
    border: 1px solid var(--c-line);
    border-radius: var(--r);
    box-shadow: var(--sh-2);
    padding: 8px;
    margin-top: 6px;
    min-width: 230px;
    overflow: hidden;
  }
  .page-header ul.navbar-nav ul.dropdown-menu li {
    border: 0 !important;
  }
  .page-header ul.navbar-nav ul.dropdown-menu li a {
    background: none !important;
    color: var(--c-ink) !important;
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
    padding: 12px 16px !important;
    border-radius: var(--r-sm);
    transition: background var(--t), color var(--t);
  }
  .page-header ul.navbar-nav ul.dropdown-menu li a:hover,
  .page-header ul.navbar-nav ul.dropdown-menu li.active a {
    background: var(--c-teal-050) !important;
    color: var(--c-teal-700) !important;
  }
}

/* Language switcher → subtle pill */
.page-header .language a.en,
.header-sm .language a.en {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid var(--c-line-strong);
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.6);
  transition: border-color var(--t), background var(--t);
}

.page-header .language a.en:hover {
  border-color: var(--c-teal);
  background: #fff;
}

/* ---- Mobile header bar + drawer ---- */
/* Mobile bar keeps the original light-green background (#ecf6e7, template.css);
   only the hamburger button is modernised below. */

.header-sm .navbar-toggle {
  width: 46px;
  height: 46px;
  margin: 9px 0;
  padding: 0;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: var(--c-teal) !important;
  border: 0;
  border-radius: 13px;
  box-shadow: var(--sh-1);
  transition: background var(--t), box-shadow var(--t), transform var(--t);
}
.header-sm .navbar-toggle:hover {
  background: var(--c-teal-600) !important;
  box-shadow: var(--sh-2);
}
.header-sm .navbar-toggle:active {
  transform: translateY(1px);
}

.header-sm .navbar-toggle .icon-bar {
  display: block;
  width: 22px;
  height: 2.5px;
  border-radius: 2px;
  background: #fff !important;
  margin: 0 !important;
}

@media (max-width: 992px) {
  .page-header {
    background: transparent !important;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    border: 0;
    box-shadow: none;
    min-height: 0;
  }
  .page-header .navbar-collapse {
    background: #fff;
    border-top: 1px solid var(--c-line);
    box-shadow: var(--sh-2);
  }
  .page-header ul.navbar-nav {
    height: auto;
    margin: 0;
  }
  .page-header ul.navbar-nav > li {
    padding: 0;
    border-bottom: 1px solid var(--c-line);
    background: transparent !important;
  }
  .page-header ul.navbar-nav > li > a {
    display: flex;
    align-items: center;
    min-height: 54px;
    height: auto;
    margin: 0;
    padding: 14px 22px !important;
    color: var(--c-ink) !important;
    background: none !important;
    font-family: var(--font-sans);
    font-size: 16px;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
    transition: background var(--t), color var(--t);
  }
  .page-header ul.navbar-nav > li.active > a,
  .page-header ul.navbar-nav > li:hover > a {
    color: var(--c-teal) !important;
    background: var(--c-teal-050) !important;
  }
  .page-header ul.navbar-nav ul.dropdown-menu {
    background: var(--c-bg-alt);
    box-shadow: none;
  }
  .page-header ul.navbar-nav ul.dropdown-menu li a {
    padding: 12px 22px 12px 38px !important;
    color: var(--c-text) !important;
    background: none !important;
  }
}

/* ============================================================================
   HEADER — right-side actions (hotline + CTA), logo-teal accent, responsive.
   The layout splits at 993px to match the legacy navbar-collapse breakpoint.
   ============================================================================ */

/* Desktop (≥993): one flex row — logo · nav · actions — vertically centred,
   replacing the legacy tall-li top-padding mechanism with flex centring. */
@media (min-width: 993px) {
  .page-header .navbar-collapse > .container > .row.gutter-0 {
    display: flex;
    align-items: center;
    min-height: 104px;
    transition: min-height var(--t-slow);
  }
  .page-header.page-header-sticky .navbar-collapse > .container > .row.gutter-0 {
    min-height: 60px;
  }
  .page-header .dh-header-logo {
    flex: 0 0 auto;
    width: auto;
  }
  /* logo is position:absolute;top:13px in the legacy sheet — bring it into the
     flex flow so align-items:center vertically centres it (and re-centres when
     it shrinks on sticky) instead of overflowing below the bar. */
  .page-header .dh-header-logo .logo {
    position: static;
    top: auto;
    margin: 0;
    width: 210px;
    background-size: contain;
    background-position: left center;
    transition: width var(--t-slow);
  }
  .page-header .dh-header-main {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: clamp(8px, 0.8vw, 18px);
  }
  .page-header .dh-header-main > ul.navbar-nav {
    float: none;
    width: auto;
    height: auto;
    margin: 0;
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
  }
  .page-header .dh-header-main > ul.navbar-nav > li {
    float: none;
    padding: 0 clamp(4px, 0.5vw, 12px);
  }
  .page-header .dh-header-main > ul.navbar-nav > li.dropdown {
    position: relative;
  }
  .page-header .dh-header-main > ul.navbar-nav > li > a {
    height: auto;
    padding: 8px 0;
    margin-bottom: 0;
    display: inline-block;
    white-space: nowrap;
    font-size: 13px;
  }
  .page-header .dh-header-main > ul.navbar-nav > li > a::after {
    bottom: -3px;
  }

  .dh-header-actions {
    display: flex;
    align-items: center;
    gap: clamp(7px, 0.5vw, 13px);
    flex: 0 0 auto;
  }
  .dh-header-actions .language {
    margin: 0;
  }
}

/* Hotline */
.dh-hotline {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--c-ink) !important;
  text-decoration: none !important;
  white-space: nowrap;
}
.dh-hotline .dh-ic-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--c-teal-050);
  color: var(--c-teal);
  flex: none;
  transition: background var(--t), color var(--t), transform var(--t), width var(--t), height var(--t);
}
.dh-ic {
  display: block;
  width: 19px;
  height: 19px;
}
.dh-hotline-txt {
  display: inline-flex;
  flex-direction: column;
  line-height: 1.12;
}
.dh-hotline-label {
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--c-muted);
}
.dh-hotline-num {
  font-family: var(--font-sans);
  font-size: 17px;
  font-weight: 700;
  color: var(--c-teal);
  transition: font-size var(--t);
}
.dh-hotline:hover .dh-ic-wrap {
  background: var(--c-teal);
  color: #fff;
  transform: scale(1.06);
}

/* CTA pill */
.dh-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border-radius: var(--r-pill);
  background: var(--c-primary);
  color: #fff !important;
  font-family: var(--font-sans);
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none !important;
  white-space: nowrap;
  border: 1px solid transparent;
  box-shadow: 0 6px 16px rgba(27, 122, 75, 0.28);
  transition: background var(--t), transform var(--t), box-shadow var(--t), padding var(--t);
}
.dh-cta:hover,
.dh-cta:focus-visible {
  background: var(--c-primary-600);
  color: #fff !important;
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(27, 122, 75, 0.34);
}
.dh-cta:focus-visible {
  outline: 2px solid var(--c-gold);
  outline-offset: 2px;
}
.dh-cta:active {
  transform: translateY(0);
}

/* Sticky condenses the actions with the bar */
.page-header.page-header-sticky .dh-cta {
  padding: 8px 18px;
}
.page-header.page-header-sticky .dh-hotline .dh-ic-wrap {
  width: 32px;
  height: 32px;
}
.page-header.page-header-sticky .dh-hotline-num {
  font-size: 15px;
}

/* Medium desktop (993–1199): the Bootstrap container is only 970px — not enough
   for logo + 7-item nav + hotline + CTA + flag on one row. Drop the hotline here
   (still reachable in the footer and via the mobile quick-call) and tighten the
   logo/nav/CTA so everything fits without crowding the logo. */
@media (min-width: 993px) and (max-width: 1199px) {
  .dh-header-actions .dh-hotline {
    display: none;
  }
  .page-header .dh-header-logo .logo {
    width: 200px;
  }
  .page-header .dh-header-main > ul.navbar-nav > li {
    padding: 0 clamp(3px, 0.35vw, 9px);
  }
  .page-header .dh-header-main > ul.navbar-nav > li > a {
    font-size: 12.5px;
  }
  .dh-cta {
    padding: 9px 15px;
    font-size: 12.5px;
  }
}

/* Mobile bar quick-call (always visible beside the hamburger) */
.dh-mobile-call-wrap {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}
.dh-mobile-call {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  margin: 9px 0;
  border-radius: 13px;
  background: var(--c-teal);
  color: #fff;
  box-shadow: var(--sh-1);
  transition: background var(--t), box-shadow var(--t), transform var(--t);
}
.dh-mobile-call:hover {
  background: var(--c-teal-600);
  box-shadow: var(--sh-2);
}
.dh-mobile-call:active {
  transform: translateY(1px);
}
.dh-mobile-call .dh-ic {
  width: 22px;
  height: 22px;
}

/* Drawer (≤992): stack the actions full-width below the menu */
@media (max-width: 992px) {
  .dh-header-actions {
    display: block;
    padding: 16px 22px 8px;
    border-top: 1px solid var(--c-line);
  }
  .dh-header-actions .dh-cta {
    display: flex;
    width: 100%;
    padding: 14px 22px;
    font-size: 16px;
    margin: 0 0 12px;
  }
  .dh-header-actions .dh-hotline {
    justify-content: center;
    margin-bottom: 6px;
  }
  .dh-header-actions .language {
    width: 100%;
    text-align: center;
  }
}

/* Dropdown open/close animation — safer approach: opacity+pointer-events only,
   Bootstrap's display:none/block toggle is left untouched. */
@media (prefers-reduced-motion: no-preference) {
  .page-header ul.navbar-nav ul.dropdown-menu {
    opacity: 0;
    transform: translateY(-8px) scale(0.97);
    transform-origin: top center;
    transition: opacity var(--t-fast), transform var(--t-fast);
    pointer-events: none;
  }
  .page-header ul.navbar-nav li.dropdown.open ul.dropdown-menu {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
  }
}
