/*
 * Header / Footer — Template 1 (FPT Telecom look)
 * Self-contained: every .hf-*-t1 class carries its own values.
 * No dependency on body classes, parent wrappers, or site-level CSS vars.
 *
 * Structure:
 *   ===== HEADER T1 =====
 *     A. Base (reset, brand, nav, CTA, sub-menu, icon-btn, visibility)
 *     B. Drawer defaults (hidden trên desktop)
 *     C. Responsive overrides (@media — desc theo width)
 *   ===== FOOTER T1 =====
 *     A. Base
 *     B. Accordion toggle defaults
 *     C. Responsive overrides
 */

/* ============================================================ */
/* ===================== HEADER T1 ============================ */
/* ============================================================ */

/* ─── A. Base ──────────────────────────────────────────────── */

.hf-header-t1 {
  background: #ffffff;
  color: #3d3d3d;
  font-family: inherit;
  -webkit-font-smoothing: antialiased;
}

/* Sticky modifier — enabled via Customizer theme_mod `hf_header_sticky`. */
.hf-header-t1.hf-header-t1--sticky {
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.hf-header-t1 a {
  color: inherit;
  text-decoration: none;
}

.hf-header-t1 ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.hf-header-t1 li {
  margin: 0;
  padding: 0;
}

.hf-header-t1 button {
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
  color: inherit;
  font: inherit;
}

.hf-header-t1__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-sizing: border-box;
  max-width: var(--iw-container-max);
  height: 70px;
  margin: 0 auto;
  padding: 0 var(--iw-container-pad-x);
}

.hf-header-t1__brand {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  line-height: 0;
  text-decoration: none;
}

.hf-header-t1__site-title {
  font-family: inherit;
  font-weight: 700;
  font-size: 18px;
  line-height: 1.2;
  color: #181d27;
  white-space: nowrap;
}

.hf-header-t1__logo {
  display: block;
  /* Cap height; chiều ngang tự co theo aspect ratio để logo upload (vuông,
     dọc, ngang) đều không méo. Max-width chặn logo quá rộng phá layout. */
  height: auto;
  width: auto;
  max-height: 40px;
  max-width: 200px;
  object-fit: contain;
}

.hf-header-t1__nav {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  /* Default align = flex-end (giữ look cũ: nav đẩy phải). Customizer
     `hf_nav_align` override qua --hf-nav-align (in ở wp_head). */
  justify-content: var(--hf-nav-align, flex-end);
}

/* ----- CTA button (desktop) — follow `.pdh-card-t3__cta` / `.iw-btn--primary`.
   Shared ACF iw_header_cta_* với T2/T3/T4.
   Scope dưới .hf-header-t1 để thắng `.hf-header-t1 a { color: inherit }`
   (specificity 0,1,1) — nếu không, chữ CTA bị inherit màu tối thay vì trắng. */
.hf-header-t1 .hf-header-t1__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, #4564ed)),
    var(--iw-cta-grad-to,   var(--iw-accent-strong, #3a52c4))
  );
  color: #ffffff;
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--iw-accent, #4564ed) 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;
  margin-left: 24px;
}
.hf-header-t1 .hf-header-t1__cta:hover,
.hf-header-t1 .hf-header-t1__cta:focus-visible {
  border-color: var(--iw-accent, #4564ed);
  background: #fff;
  color: var(--iw-accent, #4564ed);
  box-shadow: none;
}
.hf-header-t1 .hf-header-t1__cta:active { transform: translateY(1px); }

/* ----- CTA trong mobile drawer ----- follow `.iw-btn--primary` / header CTA.
   `display: block` full-width trong drawer; ring 3px box-shadow (nhỏ hơn
   desktop 5px) + wrapper padding 12px để ring không tràn cạnh drawer panel. */
/* Specificity bump (`.hf-header-t1` prefix) để thắng `.hf-header-t1 li {
   padding: 0 }` reset ở đầu file. */
.hf-header-t1 .hf-header-t1__drawer-item--cta { padding: 12px 16px; }
.hf-header-t1 .hf-header-t1__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, #4564ed)),
    var(--iw-cta-grad-to,   var(--iw-accent-strong, #3a52c4))
  );
  color: #ffffff;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--iw-accent, #4564ed) 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-t1 .hf-header-t1__drawer-cta:hover,
.hf-header-t1 .hf-header-t1__drawer-cta:focus-visible {
  border-color: var(--iw-accent, #4564ed);
  background: #ffffff;
  color: var(--iw-accent, #4564ed);
  box-shadow: none;
}

.hf-header-t1__nav-list {
  display: flex;
  align-items: center;
}

.hf-header-t1__nav-item > a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 16px 32px;
  font-size: 16px;
  font-weight: 600;
  line-height: 22px;
  color: #3d3d3d;
  white-space: nowrap;
}

.hf-header-t1__nav-item > a:hover,
.hf-header-t1__nav-item > a:focus-visible {
  color: var(--iw-accent, #4564ed);
}

/* Active state — current page (WP `current-menu-item` chuyển thành `.is-current`). */
.hf-header-t1__nav-item.is-current > a {
  color: var(--iw-accent, #4564ed);
}

.hf-header-t1__arrow {
  display: inline-block;
  width: 20px;
  height: 20px;
  background: url("../../img/arrow-down.svg") center / 12px 6px no-repeat;
  flex-shrink: 0;
  transition: transform 0.18s ease-out;
}

.hf-header-t1__nav-item {
  position: relative;
}

.hf-header-t1__nav-item:hover > a .hf-header-t1__arrow,
.hf-header-t1__nav-item:focus-within > a .hf-header-t1__arrow {
  transform: rotate(180deg);
}

/* Sub-menu (level 2) — hover/focus reveal, position absolute under parent. */
.hf-header-t1__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 để level-3 flyout không bị clip; corners của hover bg
     được round qua border-radius trên anchor đầu/cuối ở dưới. */
  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-t1__nav-item:hover > .hf-header-t1__sub-menu,
.hf-header-t1__nav-item:focus-within > .hf-header-t1__sub-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.hf-header-t1__sub-item {
  position: relative;
}

.hf-header-t1__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: #3d3d3d;
  white-space: nowrap;
  transition: background 0.12s, color 0.12s;
}

/* Round hover bg ở góc menu (replace overflow:hidden cũ). */
.hf-header-t1__sub-menu > .hf-header-t1__sub-item:first-child > a {
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
}
.hf-header-t1__sub-menu > .hf-header-t1__sub-item:last-child > a {
  border-bottom-left-radius: 8px;
  border-bottom-right-radius: 8px;
}

.hf-header-t1__sub-item > a:hover,
.hf-header-t1__sub-item > a:focus-visible {
  background: var(--iw-accent-soft, #f5f7ff);
  color: var(--iw-accent, #4564ed);
}

/* Active state cho sub-item L2 + L3 (current page) — chữ + nền theo accent. */
.hf-header-t1__sub-item.is-current > a {
  color: var(--iw-accent, #4564ed);
}

/* Level-3 flyout — bay sang phải item level-2, ẩn/hiện qua hover/focus. */
.hf-header-t1__sub-menu--level-3 {
  top: 0;
  left: 100%;
  margin-left: 4px;
}

.hf-header-t1__sub-item--has-children:hover > .hf-header-t1__sub-menu--level-3,
.hf-header-t1__sub-item--has-children:focus-within > .hf-header-t1__sub-menu--level-3 {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Chevron phải cho item level-2 có grandchildren. */
.hf-header-t1__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;
}

.hf-header-t1__icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  flex-shrink: 0;
}

.hf-header-t1__icon-btn img {
  display: block;
  width: 24px;
  height: 24px;
}

.hf-header-t1__desktop-only {
  display: flex;
}

.hf-header-t1__mobile-only {
  display: none;
}

/* ─── B. Drawer defaults (hidden trên desktop) ─────────────── */

/* Default state: hidden trên desktop. Drawer/overlay chỉ render mobile. */
.hf-header-t1__drawer-overlay {
  display: none;
}
.hf-header-t1__drawer {
  display: none;
}

body.hf-drawer-open {
  overflow: hidden;
}

/* ─── C. HEADER responsive overrides ───────────────────────── */
/* Cascade order: rộng → hẹp. */

@media (max-width: 1280px) {
  .hf-header-t1__nav-item > a {
    gap: 8px;
    padding: 16px 16px;
  }
}

/* ≤991: visibility toggle + drawer (mobile menu). */
@media (max-width: 991px) {
  /* Visibility + header layout reset. */
  .hf-header-t1 {
    border-bottom: 1px solid #e7e7e7;
  }
  .hf-header-t1__inner {
    max-width: none;
    padding: 0 16px;
  }
  .hf-header-t1__desktop-only {
    display: none;
  }
  .hf-header-t1__mobile-only {
    display: flex;
  }

  /* 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-t1 .hf-header-t1__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, #4564ed) 12%, transparent);
  }

  /* Drawer overlay (backdrop). */
  .hf-header-t1__drawer-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 998;
  }
  .hf-header-t1__drawer-overlay.is-open {
    opacity: 1;
    visibility: visible;
  }

  /* Drawer panel. */
  .hf-header-t1__drawer {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    right: 0;
    width: min(420px, 90vw);
    height: 100dvh;
    background: #ffffff;
    box-shadow: -8px 0 24px rgba(0, 0, 0, 0.12);
    transform: translateX(100%);
    transition: transform 0.25s ease;
    z-index: 999;
    overflow: hidden;
  }
  .hf-header-t1__drawer.is-open {
    transform: translateX(0);
  }
  .hf-header-t1__drawer[hidden] {
    display: none;
  }

  /* Drawer head (logo + close). */
  .hf-header-t1__drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e7e7e7;
    flex-shrink: 0;
  }
  .hf-header-t1__drawer-logo {
    display: block;
    height: 32px;
    width: auto;
  }
  .hf-header-t1 .hf-header-t1__drawer-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    min-height: 0;
    margin: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 28px;
    font-weight: 400;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    color: #3d3d3d;
    padding: 0;
  }
  .hf-header-t1 .hf-header-t1__drawer-close:hover {
    background: transparent;
    color: var(--iw-accent, #4564ed);
  }
  .hf-header-t1__drawer-close:hover { color: var(--iw-accent, #4564ed); }

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

  /* Specificity bump: .hf-header-t1 prefix để win với reset
     `.hf-header-t1 button { padding:0; font:inherit }` ở đầu file. */
  .hf-header-t1 .hf-header-t1__drawer-link,
  .hf-header-t1 .hf-header-t1__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: #3d3d3d;
    text-align: left;
    text-decoration: none;
    text-transform: none;     /* override Flatsome button uppercase */
    letter-spacing: normal;
    min-height: 0;
    cursor: pointer;
  }
  .hf-header-t1 .hf-header-t1__drawer-link:hover,
  .hf-header-t1 .hf-header-t1__drawer-sub-link:hover {
    background: transparent;
    color: #3d3d3d;
  }

  /* Item L1 đang expand → highlight cam (theo screenshot reference). */
  .hf-header-t1 .hf-header-t1__drawer-link[aria-expanded="true"] {
    color: var(--iw-accent, #4564ed);
  }

  /* L2/L3 đồng bộ font-size/weight/color với L1, chỉ khác indent. */
  .hf-header-t1 .hf-header-t1__drawer-sub-link {
    padding-left: 36px;
  }
  .hf-header-t1 .hf-header-t1__drawer-sub--l3 .hf-header-t1__drawer-sub-link {
    padding-left: 56px;
  }

  /* Chevron — mặc định mũi xuống, xoay 180° (lên) khi expanded. */
  .hf-header-t1__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-t1__drawer-chevron {
    transform: rotate(180deg);
  }
}

/* ============================================================ */
/* ===================== FOOTER T1 ============================ */
/* ============================================================ */

/* ─── A. Base ──────────────────────────────────────────────── */

.hf-footer-t1 {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background: #f8f9fa;
  color: var(--hf-footer-text, #3d3d3d);
  font-family: inherit;
  -webkit-font-smoothing: antialiased;
  font-size: 16px;
  line-height: 24px;
}

/* Lớp ảnh nền tùy chọn (Customizer bg_mode=image). T1 KHÔNG có ảnh mặc định —
   background-image chỉ set qua inline style khi admin upload. */
.hf-footer-t1__bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center right;
  background-repeat: no-repeat;
  opacity: 0.3;
  z-index: 0;
  pointer-events: none;
}

.hf-footer-t1 a {
  color: inherit;
  text-decoration: none;
}

.hf-footer-t1 a:hover,
.hf-footer-t1 a:focus-visible {
  color: var(--iw-accent, #4564ed);
}

.hf-footer-t1 ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.hf-footer-t1 li {
  margin: 0;
  padding: 0;
}

.hf-footer-t1 p {
  margin: 0;
}

.hf-footer-t1__inner {
  position: relative;
  z-index: 1;
  max-width: var(--iw-container-max);
  margin: 0 auto;
  padding: 40px var(--iw-container-pad-x) 80px;
  box-sizing: border-box;
}

.hf-footer-t1__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.hf-footer-t1__brand {
  display: inline-block;
  line-height: 0;
}

.hf-footer-t1__logo {
  display: block;
  width: 137px;
  height: 44px;
}

.hf-footer-t1__divider {
  height: 1px;
  background: #e7e7e7;
  margin: 40px 0;
}

.hf-footer-t1 .hf-footer-t1__cols {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 81px;
  align-items: flex-start;
  width: 100%;
}

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

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

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

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

.hf-footer-t1__heading {
  font-weight: 700;
  font-size: 16px;
  line-height: 22px;
  color: var(--hf-footer-text, #3d3d3d);
  margin: 0;
}

.hf-footer-t1__info {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hf-footer-t1__info-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.hf-footer-t1__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, #3d3d3d);
  -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-t1__icon--location { -webkit-mask-image: url("../../img/icon-location.png"); mask-image: url("../../img/icon-location.png"); }
.hf-footer-t1__icon--sms      { -webkit-mask-image: url("../../img/icon-sms.png"); mask-image: url("../../img/icon-sms.png"); }
.hf-footer-t1__icon--call     { -webkit-mask-image: url("../../img/icon-call.png"); mask-image: url("../../img/icon-call.png"); }

.hf-footer-t1__info-text {
  flex: 1;
  color: var(--hf-footer-text, #3d3d3d);
  font-size: 16px;
  line-height: 24px;
  word-break: break-word;
}

.hf-footer-t1__rep {
  margin: 0;
  color: var(--hf-footer-text, #3d3d3d);
  font-size: 16px;
  line-height: 24px;
}

.hf-footer-t1__links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hf-footer-t1__links a {
  display: block;
  color: var(--hf-footer-text, #3d3d3d);
  font-size: 16px;
  line-height: 24px;
}

/* ─── B. Accordion toggle defaults (hidden trên desktop) ──── */

/* Toggle button ẩn trên desktop — heading luôn plain text. */
.hf-footer-t1__heading-toggle {
  display: none;
}

/* ─── C. FOOTER responsive overrides ───────────────────────── */

/* ≤991: stack columns + accordion toggle hiện. */
@media (max-width: 991px) {
  .hf-footer-t1 {
    font-size: 14px;
    line-height: 20px;
  }
  /* Stack top → cols với gap 20px (theo Figma 407:41522). */
  .hf-footer-t1__inner {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: none;
    padding: 20px var(--iw-container-pad-x);
  }
  .hf-footer-t1__divider {
    display: none;
  }
  .hf-footer-t1 .hf-footer-t1__cols,
  .hf-footer-t1__col-group {
    flex-direction: column;
    gap: 24px;
    align-items: stretch;   /* override desktop flex-start để children full width */
    width: 100%;
  }
  .hf-footer-t1 .hf-footer-t1__col--links,
  .hf-footer-t1 .hf-footer-t1__col-group {
    width: 100%;
  }
  .hf-footer-t1 .hf-footer-t1__col--company {
    width: 100%;
    max-width: none;
    gap: 20px;
  }
  /* Heading bold 14/20, font-weight 700 theo Figma SF Pro Bold. */
  .hf-footer-t1__heading {
    font-size: 14px;
    line-height: 20px;
    font-weight: 700;
  }
  .hf-footer-t1__info-text,
  .hf-footer-t1__rep,
  .hf-footer-t1__links a {
    font-size: 14px;
    line-height: 20px;
  }
  /* Links list: gap 8px giữa các item, 8px giữa heading và list. */
  .hf-footer-t1 .hf-footer-t1__col--links {
    gap: 8px;
  }
  .hf-footer-t1__col--links .hf-footer-t1__links {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 0;
  }

  /* Accordion toggle (mobile only). */
  .hf-footer-t1__col--links .hf-footer-t1__heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0;
    cursor: default;
  }
  .hf-footer-t1__heading-text {
    flex: 1;
  }
  .hf-footer-t1__heading-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    min-height: 0;
    margin: 0 -8px 0 0;     /* reset Flatsome margin-bottom: 1em */
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    cursor: pointer;
    padding: 0;
    text-transform: none;
    letter-spacing: normal;
    line-height: 1;
  }
  .hf-footer-t1__heading-toggle:hover {
    background: transparent;
  }
  .hf-footer-t1__heading-chevron {
    width: 14px;
    height: 14px;
    background: url("../../img/arrow-down.svg") center / 12px 6px no-repeat;
    transition: transform 0.18s ease;
  }
  .hf-footer-t1__heading-toggle[aria-expanded="true"] .hf-footer-t1__heading-chevron {
    transform: rotate(180deg);
  }

  /* Default expanded (markup khởi tạo `is-open` + aria-expanded="true"
     match Figma 407:42848). Khi user collapse → bỏ `is-open` → ẩn list. */
  .hf-footer-t1__col--links:not(.is-open) .hf-footer-t1__links {
    display: none;
  }
}
