/*
 * Header + Footer — Template 2.
 *
 * Auto-loaded via inc/fn-setup-css-js.php glob (assets/css/t2/*.css).
 * Currently glob loads ALL t{N} CSS — when conditional enqueue lands,
 * this file should only load when hf_template_variant === 't2'.
 *
 * Brand color: T2 primary #ff2881 (xanh hồng), exposed via --iw-accent
 * which scheme can override (decoupled from H/F variant).
 *
 * Convention: every class carries its own values — no dependency on
 * body class / parent wrapper / site-level CSS vars (except --iw-accent
 * for theme color tokens).
 */

/* =====================================================================
   HEADER T2
   ===================================================================== */

.hf-header-t4 {
  width: 100%;
  background: #ffffff;
  font-family: inherit;
  color: var(--iw-text-primary, #3d3d3d);
  border-bottom: 1px solid #f0f0f0;
}

.hf-header-t4--sticky {
  position: sticky;
  top: 0;
  z-index: 90;
}

.hf-header-t4__inner {
  max-width: var(--iw-container-max, 1488px);
  margin: 0 auto;
  padding: 10px var(--iw-container-pad-x, 24px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

/* ----- Brand --------------------------------------------------------- */
.hf-header-t4__brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}
.hf-header-t4__logo {
  display: block;
  /* Match T1 header logo sizing — switching variant should not jump logo size.
     height/width auto so logo upload (vuông/dọc/ngang) đều không méo. */
  height: auto;
  width: auto;
  max-height: 40px;
  max-width: 200px;
  object-fit: contain;
}
.hf-header-t4__site-title {
  font-weight: 700;
  font-size: 20px;
  color: var(--iw-text-primary, #3d3d3d);
}

/* ----- Desktop nav --------------------------------------------------- */
.hf-header-t4__nav {
  flex: 1 1 auto;
  display: flex;
  /* Default center; Customizer hf_nav_align override qua --hf-nav-align. */
  justify-content: var(--hf-nav-align, center);
}
.hf-header-t4__nav-list {
  display: flex;
  align-items: center;
  gap: 23px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.hf-header-t4__nav-item {
  margin: 0;
  padding: 0;
  position: relative;
}
.hf-header-t4__nav-item > a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 16px;
  line-height: 22px;
  color: var(--iw-text-primary, #3d3d3d);
  text-decoration: none;
  transition: background-color 0.12s, color 0.12s;
}
.hf-header-t4__nav-item > a:hover,
.hf-header-t4__nav-item > a:focus-visible {
  background: #f3f3f3;
  color: var(--iw-accent, #ff2881);
}
.hf-header-t4__nav-item.is-current > a {
  background: #f3f3f3;
  color: var(--iw-accent, #ff2881);
}

/* Dropdown chevron */
.hf-header-t4__arrow {
  display: inline-block;
  width: 16px;
  height: 16px;
  background: url("../../img/arrow-down.svg") center / 12px 6px no-repeat;
  flex-shrink: 0;
  transition: transform 0.18s ease-out;
}
.hf-header-t4__nav-item:hover > a .hf-header-t4__arrow,
.hf-header-t4__nav-item:focus-within > a .hf-header-t4__arrow {
  transform: rotate(180deg);
}

/* Sub-menu (level 2) — hover/focus reveal, position absolute under parent. */
.hf-header-t4__sub-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 240px;
  margin: 0;
  padding: 0;
  list-style: none;
  background: #ffffff;
  border-radius: 8px;
  overflow: visible;
  box-shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.15);
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition: opacity 0.15s ease-out, transform 0.15s ease-out, visibility 0.15s;
  z-index: 100;
}
.hf-header-t4__nav-item:hover > .hf-header-t4__sub-menu,
.hf-header-t4__nav-item:focus-within > .hf-header-t4__sub-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.hf-header-t4__sub-item {
  position: relative;
  margin: 0;
  padding: 0;
}
.hf-header-t4__sub-item > a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 24px;
  font-size: 16px;
  font-weight: 600;
  line-height: 22px;
  color: var(--iw-text-primary, #3d3d3d);
  white-space: nowrap;
  text-decoration: none;
  transition: background 0.12s, color 0.12s;
}
.hf-header-t4__sub-menu > .hf-header-t4__sub-item:first-child > a {
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
}
.hf-header-t4__sub-menu > .hf-header-t4__sub-item:last-child > a {
  border-bottom-left-radius: 8px;
  border-bottom-right-radius: 8px;
}
.hf-header-t4__sub-item > a:hover,
.hf-header-t4__sub-item > a:focus-visible {
  background: var(--iw-accent-soft, #fff0f6);
  color: var(--iw-accent, #ff2881);
}
.hf-header-t4__sub-item.is-current > a {
  color: var(--iw-accent, #ff2881);
}

/* Level-3 flyout — bay sang phải item level-2. */
.hf-header-t4__sub-menu--level-3 {
  top: 0;
  left: 100%;
  margin-left: 4px;
}
.hf-header-t4__sub-item--has-children:hover > .hf-header-t4__sub-menu--level-3,
.hf-header-t4__sub-item--has-children:focus-within > .hf-header-t4__sub-menu--level-3 {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.hf-header-t4__sub-arrow {
  display: inline-block;
  width: 16px;
  height: 16px;
  background: url("../../img/arrow-down.svg") center / 12px 6px no-repeat;
  transform: rotate(-90deg);
  flex-shrink: 0;
}

/* ----- CTA ----- follow `.pdh-card-t3__cta` / `.iw-btn--primary`.
   Rest: gradient theo template tokens + ring 5px box-shadow.
   Hover: invert → nền trắng, viền + chữ accent, bỏ ring. */
.hf-header-t4__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 24px;
  border: 1px solid transparent;
  border-radius: 999px;
  box-sizing: border-box;
  background: linear-gradient(
    180deg,
    var(--iw-cta-grad-from, var(--iw-accent, #18B446)),
    var(--iw-cta-grad-to,   var(--iw-accent-strong, #329e05))
  );
  color: #ffffff;
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--iw-accent, #18B446) 12%, transparent);
  font-weight: 700;
  font-size: 16px;
  line-height: 22px;
  text-decoration: none;
  transition: background .18s ease, color .18s ease, box-shadow .18s ease, border-color .18s ease, transform .12s;
  flex-shrink: 0;
  white-space: nowrap;
}
.hf-header-t4__cta:hover,
.hf-header-t4__cta:focus-visible {
  border-color: var(--iw-accent, #18B446);
  background: #ffffff;
  color: var(--iw-accent, #18B446);
  box-shadow: none;
}
.hf-header-t4__cta:active { transform: translateY(1px); }

/* ----- Mobile menu trigger ------------------------------------------- */
.hf-header-t4__menu-toggle {
  appearance: none;
  margin: 0;
  padding: 8px;
  background: transparent;
  border: 0;
  cursor: pointer;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.hf-header-t4__menu-toggle img {
  display: block;
  width: 24px;
  height: 24px;
}

/* ----- Drawer (mobile) ----------------------------------------------- */
.hf-header-t4__drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s;
}
.hf-header-t4__drawer-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.hf-header-t4__drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(320px, 90vw);
  background: #ffffff;
  z-index: 110;
  transform: translateX(100%);
  transition: transform 0.22s;
  display: flex;
  flex-direction: column;
}
.hf-header-t4__drawer.is-open { transform: translateX(0); }
.hf-header-t4__drawer[hidden] { display: none; }

.hf-header-t4__drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #f0f0f0;
}
.hf-header-t4__drawer-logo {
  display: block;
  height: 40px;
  width: auto;
}
.hf-header-t4__drawer-close {
  appearance: none;
  margin: 0;
  padding: 0;
  width: 32px;
  height: 32px;
  background: transparent;
  border: 0;
  cursor: pointer;
  font-size: 28px;
  line-height: 1;
  color: var(--iw-text-primary, #3d3d3d);
}

.hf-header-t4__drawer-nav { flex: 1 1 auto; overflow-y: auto; padding: 8px 0 24px; }
.hf-header-t4__drawer-list,
.hf-header-t4__drawer-sub {
  list-style: none;
  margin: 0;
  padding: 0;
}
.hf-header-t4__drawer-item { margin: 0; }

/* Reset Flatsome button uppercase + chrome on drawer-link buttons. */
.hf-header-t4 .hf-header-t4__drawer-link,
.hf-header-t4 .hf-header-t4__drawer-sub-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin: 0;
  padding: 14px 20px;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--iw-text-primary, #3d3d3d);
  text-align: left;
  text-decoration: none;
  text-transform: none;
  letter-spacing: normal;
  min-height: 0;
  cursor: pointer;
}
.hf-header-t4 .hf-header-t4__drawer-link:hover,
.hf-header-t4 .hf-header-t4__drawer-sub-link:hover {
  background: transparent;
  color: var(--iw-accent, #ff2881);
}

/* Item L1 đang expand → highlight accent. */
.hf-header-t4 .hf-header-t4__drawer-link[aria-expanded="true"] {
  color: var(--iw-accent, #ff2881);
}

.hf-header-t4 .hf-header-t4__drawer-sub-link { padding-left: 36px; }
.hf-header-t4 .hf-header-t4__drawer-sub--l3 .hf-header-t4__drawer-sub-link { padding-left: 56px; }

.hf-header-t4__drawer-chevron {
  width: 16px;
  height: 16px;
  background: url("../../img/arrow-down.svg") center / 12px 6px no-repeat;
  transform: rotate(0deg);
  transition: transform 0.18s ease;
  flex-shrink: 0;
}
[aria-expanded="true"] > .hf-header-t4__drawer-chevron {
  transform: rotate(180deg);
}

/* CTA trong mobile drawer ----- follow `.iw-btn--primary` / header CTA. */
.hf-header-t4__drawer-item--cta { padding: 12px 16px; }
.hf-header-t4__drawer-cta {
  display: block;
  padding: 13px 24px;
  border: 1px solid transparent;
  border-radius: 999px;
  box-sizing: border-box;
  background: linear-gradient(
    180deg,
    var(--iw-cta-grad-from, var(--iw-accent, #18B446)),
    var(--iw-cta-grad-to,   var(--iw-accent-strong, #329e05))
  );
  color: #ffffff;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--iw-accent, #18B446) 12%, transparent);
  font-weight: 700;
  font-size: 16px;
  text-align: center;
  text-decoration: none;
  transition: background .18s ease, color .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.hf-header-t4__drawer-cta:hover,
.hf-header-t4__drawer-cta:focus-visible {
  border-color: var(--iw-accent, #18B446);
  background: #ffffff;
  color: var(--iw-accent, #18B446);
  box-shadow: none;
}

/* ----- Header responsive switches ------------------------------------ */
.hf-header-t4__desktop-only { display: flex; }
.hf-header-t4__mobile-only  { display: none; }

@media (max-width: 1280px) {
  .hf-header-t4__nav-list { gap: 16px; }
  .hf-header-t4__nav-item > a { padding: 8px 6px; }
}
@media (max-width: 991px) {
  .hf-header-t4__desktop-only { display: none !important; }
  .hf-header-t4__mobile-only  { display: inline-flex; }

  .hf-header-t4__inner {
    padding: 8px 16px;
    gap: 12px;
  }
  .hf-header-t4__logo { height: 40px; }

  /* CTA mobile — giảm padding/font + ring nhỏ; margin-left: auto đẩy sát
     hamburger menu (cạnh phải), chừa 10px right để cách khỏi nút hamburger. */
  .hf-header-t4__cta {
    margin-left: auto;
    margin-right: 10px;
    padding: 8px 16px;
    font-size: 14px;
    line-height: 18px;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--iw-accent, #18B446) 12%, transparent);
  }
}


/* =====================================================================
   FOOTER T2
   ===================================================================== */

.hf-footer-t4 {
  position: relative;
  width: 100%;
  background: #030409;
  color: var(--hf-footer-text, #ffffff);
  font-family: inherit;
  overflow: hidden;
  isolation: isolate;
}

.hf-footer-t4__bg {
  position: absolute;
  inset: 0;
  background-image: url("../../img/t4/footer-bg.png");
  background-size: cover;
  background-position: center right;
  background-repeat: no-repeat;
  opacity: 0.3;
  z-index: 0;
  pointer-events: none;
}

.hf-footer-t4__inner {
  position: relative;
  z-index: 1;
  max-width: var(--iw-container-max, 1488px);
  margin: 0 auto;
  padding: 56px var(--iw-container-pad-x, 24px) 32px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

/* ----- Top row: brand group + nav ------------------------------------ */
.hf-footer-t4__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
}

.hf-footer-t4__brand-group {
  display: flex;
  align-items: center;
  gap: 24px;
  flex: 1 1 auto;
  min-width: 0;
}

.hf-footer-t4__brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}
.hf-footer-t4__logo {
  display: block;
  /* Match T1 footer logo size (137×44). Color đen → áp `--invert` modifier
     khi rơi về main logo (PHP set conditional). Nếu admin upload light
     variant riêng (`hf_footer_logo_light`), không có modifier → render
     thẳng, không filter. */
  width: 137px;
  height: 44px;
  object-fit: contain;
}
.hf-footer-t4__site-title {
  font-weight: 700;
  font-size: 20px;
  color: var(--hf-footer-text, #ffffff);
}

.hf-footer-t4__tagline {
  margin: 0;
  font-weight: 400;
  font-size: 16px;
  line-height: 26px;
  color: var(--hf-footer-text, #ffffff);
}

/* ----- Top inline nav (Figma 240:6494) ------------------------------- */
.hf-footer-t4__nav { flex-shrink: 0; }
.hf-footer-t4__nav-list {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
  flex-wrap: wrap;
}
.hf-footer-t4__nav-item { margin: 0; padding: 0; }
.hf-footer-t4__nav-item > a {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 14px;
  line-height: 22px;
  color: var(--hf-footer-text, #ffffff);
  text-decoration: none;
  transition: background-color 0.12s;
}
.hf-footer-t4__nav-item > a:hover,
.hf-footer-t4__nav-item > a:focus-visible {
  background: rgba(255, 255, 255, 0.12);
  color: var(--iw-accent, #ff2881);
}
.hf-footer-t4__nav-item.is-current > a {
  background: rgba(255, 255, 255, 0.20);
  backdrop-filter: blur(2.5px);
  -webkit-backdrop-filter: blur(2.5px);
}

/* ----- Divider ------------------------------------------------------- */
.hf-footer-t4__divider {
  height: 1px;
  width: 100%;
  background: rgba(255, 255, 255, 0.20);
}
.hf-footer-t4__divider--bottom {
  margin-top: 24px;
  margin-bottom: 16px;
}

/* ----- Cols (mirror T1 structure) ----------------------------------- */
.hf-footer-t4__cols {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 81px;
  align-items: flex-start;
  width: 100%;
  margin-top: 24px;
}

.hf-footer-t4__col {
  display: flex;
  flex-direction: column;
}

.hf-footer-t4__col--company {
  flex: 0 0 auto;
  width: 708px;
  max-width: 50%;
  gap: 20px;
}

.hf-footer-t4__col-group {
  display: flex;
  flex: 1 1 0;
  min-width: 0;
  gap: 24px;
  align-items: flex-start;
}

.hf-footer-t4__col--links {
  flex: 1 1 0;
  min-width: 0;
  gap: 8px;
}

.hf-footer-t4__heading {
  margin: 0;
  font-weight: 700;
  font-size: 16px;
  line-height: 22px;
  color: var(--hf-footer-text, #ffffff);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.hf-footer-t4__heading-text { display: inline-block; }

.hf-footer-t4__info {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.hf-footer-t4__info-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.hf-footer-t4__icon {
  display: block;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 4px;
  /* Icon tô theo màu chữ footer (--hf-footer-text) qua CSS mask. */
  background-color: var(--hf-footer-text, #ffffff);
  -webkit-mask-repeat: no-repeat;
          mask-repeat: no-repeat;
  -webkit-mask-position: center;
          mask-position: center;
  -webkit-mask-size: 16px 16px;
          mask-size: 16px 16px;
}
.hf-footer-t4__icon--location { -webkit-mask-image: url("../../img/icon-location.png"); mask-image: url("../../img/icon-location.png"); }
.hf-footer-t4__icon--sms      { -webkit-mask-image: url("../../img/icon-sms.png"); mask-image: url("../../img/icon-sms.png"); }
.hf-footer-t4__icon--call     { -webkit-mask-image: url("../../img/icon-call.png"); mask-image: url("../../img/icon-call.png"); }

.hf-footer-t4__info-text {
  flex: 1;
  color: var(--hf-footer-text, #ffffff);
  font-size: 16px;
  line-height: 24px;
  word-break: break-word;
  text-decoration: none;
}
.hf-footer-t4__info-text:is(a):hover {
  text-decoration: underline;
  color: var(--iw-accent, #ff2881);
}

.hf-footer-t4__rep {
  margin: 0;
  color: var(--hf-footer-text, #ffffff);
  font-size: 16px;
  line-height: 24px;
  opacity: 0.8;
}

.hf-footer-t4__links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.hf-footer-t4__links a {
  display: block;
  color: var(--hf-footer-text, #ffffff);
  font-size: 16px;
  line-height: 24px;
  text-decoration: none;
  opacity: 0.85;
  transition: opacity 0.12s;
}
.hf-footer-t4__links a:hover,
.hf-footer-t4__links a:focus-visible {
  opacity: 1;
  text-decoration: underline;
  color: var(--iw-accent, #ff2881);
}

/* ----- Mobile accordion toggle (heading button) ---------------------- */
.hf-footer-t4__heading-toggle {
  appearance: none;
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
  cursor: pointer;
  width: 24px;
  height: 24px;
  display: none;        /* hidden on desktop */
  align-items: center;
  justify-content: center;
  color: inherit;
}
.hf-footer-t4__heading-chevron {
  display: block;
  width: 12px;
  height: 12px;
  border-right: 2px solid #ffffff;
  border-bottom: 2px solid #ffffff;
  transform: rotate(45deg);
  transition: transform 0.18s;
}
.hf-footer-t4__col--links:not(.is-open) .hf-footer-t4__heading-chevron {
  transform: rotate(-45deg);
}

/* ----- Copyright ----------------------------------------------------- */
.hf-footer-t4__copy {
  margin: 0;
  font-weight: 400;
  font-size: 14px;
  line-height: 22px;
  color: var(--hf-footer-text, #ffffff);
  opacity: 0.6;
}

/* ----- Footer responsive --------------------------------------------- */
@media (max-width: 991px) {
  .hf-footer-t4__inner {
    padding: 40px 16px 24px;
    gap: 24px;
  }
  .hf-footer-t4__top {
    flex-direction: column;
    align-items: flex-start;
    gap: 24px;
  }
  .hf-footer-t4__brand-group {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  .hf-footer-t4__logo {
    width: 110px;
    height: auto;
    max-height: 36px;
  }
  .hf-footer-t4__tagline {
    font-size: 14px;
    line-height: 22px;
  }
  .hf-footer-t4__nav-item > a {
    font-size: 13px;
    padding: 4px 10px;
  }

  /* Stack cols vertically on mobile, mirror T1 accordion behavior */
  .hf-footer-t4__cols {
    flex-direction: column;
    gap: 16px;
    margin-top: 16px;
  }
  .hf-footer-t4__col--company {
    width: 100%;
    max-width: none;
    gap: 16px;
  }
  .hf-footer-t4__col-group {
    flex-direction: column;
    gap: 0;
    width: 100%;
  }
  .hf-footer-t4__col--links {
    width: 100%;
    border-top: 1px solid rgba(255, 255, 255, 0.20);
    padding: 16px 0;
    gap: 0;
  }
  .hf-footer-t4__col--links .hf-footer-t4__heading {
    cursor: pointer;
  }
  .hf-footer-t4__heading-toggle { display: inline-flex; }
  .hf-footer-t4__col--links:not(.is-open) .hf-footer-t4__links {
    display: none;
  }
  .hf-footer-t4__col--links.is-open .hf-footer-t4__links {
    margin-top: 12px;
  }

  .hf-footer-t4__heading,
  .hf-footer-t4__info-text,
  .hf-footer-t4__rep,
  .hf-footer-t4__links a {
    font-size: 14px;
    line-height: 22px;
  }
}
