/* ============================================================
   HEADER 3 TẦNG - Hệ Thống Luật Việt Nam
   Bố cục: Logo khung trái | Menu 3 tầng phải
   ============================================================ */

:root {
  --hl-red:        #8B0000;
  --hl-red-dark:   #6F0000;
  --hl-red-mid:    #9F0000;
  --hl-gold:       #D4AF37;
  --hl-gold-light: #E5C65C;
  --hl-gold-dim:   rgba(212,175,55,0.18);
  --hl-white:      #FFFFFF;
  --hl-dim:        rgba(255,255,255,0.78);
  --hl-bright:     rgba(255,255,255,0.96);
  --hl-hover:      rgba(255,255,255,0.09);
  --hl-dark-hover: rgba(0,0,0,0.18);
  --hl-shadow:     0 4px 20px rgba(80,0,0,0.30);
  --hl-radius:     10px;
}

/* ── Ẩn header Astra ── */
#masthead,
.site-header,
.main-header-bar,
.ast-primary-header-bar,
.ast-above-header-bar,
.ast-below-header-bar,
.ast-masthead-custom-menu-items,
header.site-header,
.ast-header-break-point .main-header-bar {
  display: none !important;
  height: 0 !important;
  overflow: hidden !important;
}

/* ── Wrapper tổng ── */
#hl-header {
  width: 100%;
  position: sticky;
  top: 0;
  z-index: 9999;
  font-family: "Segoe UI", Tahoma, sans-serif;
  box-shadow: var(--hl-shadow);
}

/* ============================================================
   LAYOUT CHÍNH: Logo box trái + Menu phải
   ============================================================ */
.hl-header-inner {
  background: linear-gradient(135deg, #6F0000 0%, #9F0000 50%, #6F0000 100%);
  display: flex;
  align-items: stretch;
  width: 100%;
}

/* ── LOGO BOX — bọc cả 3 tầng, có viền gold ── */
.hl-logo-box {
  flex-shrink: 0;
  width: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-right: 2px solid var(--hl-gold);
  background: rgba(0,0,0,0.15);
  position: relative;
}
.hl-logo-box::after {
  content: '';
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(212,175,55,0.25);
  border-radius: var(--hl-radius);
  pointer-events: none;
}
.hl-logo-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  z-index: 1;
}
.hl-logo-link img {
  height: 60px;
  width: auto;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.4));
}
.hl-logo-name {
  font-size: 11px;
  font-weight: 700;
  color: var(--hl-gold-light);
  letter-spacing: 1.2px;
  text-transform: uppercase;
  text-align: center;
  line-height: 1.3;
  white-space: nowrap;
}

/* ── MENU COLUMNS — 3 tầng xếp dọc ── */
.hl-menus {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ============================================================
   TẦNG 1 — GIỚI THIỆU
   ============================================================ */
.hl-bar1 {
  background: rgba(0,0,0,0.20);
  border-bottom: 1px solid rgba(212,175,55,0.20);
  height: 36px;
  display: flex;
  align-items: center;
  padding: 0 20px;
}
.hl-bar1 nav { display: flex; width: 100%; }
.hl-bar1-nav {
  display: flex;
  align-items: center;
  list-style: none;
  margin: 0; padding: 0;
  gap: 2px;
}
.hl-bar1-nav li { margin: 0; }
.hl-bar1-nav a {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--hl-dim);
  text-decoration: none;
  border-radius: 4px;
  white-space: nowrap;
  transition: color 0.18s, background 0.18s;
}
.hl-bar1-nav a:hover,
.hl-bar1-nav li.current-menu-item > a {
  color: var(--hl-gold-light);
  background: var(--hl-gold-dim);
  text-decoration: none;
}

/* ============================================================
   TẦNG 2 — DỊCH VỤ
   ============================================================ */
.hl-bar2 {
  height: 52px;
  display: flex;
  align-items: center;
  padding: 0 20px;
  border-bottom: 1px solid rgba(212,175,55,0.15);
}
.hl-bar2 nav { display: flex; width: 100%; }
.hl-bar2-nav {
  display: flex;
  align-items: stretch;
  list-style: none;
  margin: 0; padding: 0;
  height: 52px;
}
.hl-bar2-nav > li { position: relative; margin: 0; }
.hl-bar2-nav > li > a {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 14px;
  height: 52px;
  font-size: 13px;
  font-weight: 600;
  color: var(--hl-bright);
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 3px solid transparent;
  letter-spacing: 0.2px;
  transition: color 0.18s, border-color 0.18s, background 0.18s;
}
.hl-bar2-nav > li > a:hover,
.hl-bar2-nav > li.current-menu-item > a,
.hl-bar2-nav > li.current-menu-ancestor > a,
.hl-bar2-nav > li:hover > a {
  color: var(--hl-gold-light);
  border-bottom-color: var(--hl-gold);
  background: var(--hl-dark-hover);
  text-decoration: none;
}
.hl-chevron {
  width: 10px; height: 10px;
  opacity: 0.55;
  transition: transform 0.2s;
  flex-shrink: 0;
}
.hl-bar2-nav > li:hover .hl-chevron { transform: rotate(180deg); }

/* Dropdown bar2 */
.hl-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%; left: 0;
  background: var(--hl-white);
  min-width: 220px;
  border-top: 3px solid var(--hl-gold);
  box-shadow: 0 10px 30px rgba(80,0,0,0.18);
  border-radius: 0 0 8px 8px;
  z-index: 10000;
  list-style: none;
  margin: 0; padding: 5px 0;
}
.hl-bar2-nav > li:hover .hl-dropdown-menu { display: block; }
.hl-dropdown-menu li { margin: 0; }
.hl-dropdown-menu a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 18px;
  font-size: 13px;
  color: #333;
  text-decoration: none;
  border-bottom: 0.5px solid #F5EDED;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.hl-dropdown-menu li:last-child a { border-bottom: none; }
.hl-dropdown-menu a:hover {
  background: #FFF4F4;
  color: var(--hl-red);
  text-decoration: none;
}
.hl-law-badge {
  font-size: 10px;
  background: var(--hl-red);
  color: var(--hl-white);
  padding: 1px 7px;
  border-radius: 8px;
  flex-shrink: 0;
  font-weight: 600;
}

/* ============================================================
   TẦNG 3 — TRA CỨU
   ============================================================ */
.hl-bar3 {
  height: 40px;
  display: flex;
  align-items: center;
  padding: 0 20px;
  background: rgba(0,0,0,0.12);
}
.hl-bar3-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--hl-gold);
  white-space: nowrap;
  flex-shrink: 0;
  padding-right: 12px;
  margin-right: 4px;
  border-right: 1px solid rgba(212,175,55,0.3);
}
.hl-bar3 nav { display: flex; flex: 1; overflow: hidden; }
.hl-bar3-nav {
  display: flex;
  align-items: stretch;
  list-style: none;
  margin: 0; padding: 0;
  height: 40px;
  overflow-x: auto;
  scrollbar-width: none;
  flex: 1;
}
.hl-bar3-nav::-webkit-scrollbar { display: none; }
.hl-bar3-nav li { margin: 0; flex-shrink: 0; }
.hl-bar3-nav > li { position: relative; }
.hl-bar3-nav > li > a {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 12px;
  height: 40px;
  font-size: 12px;
  font-weight: 500;
  color: rgba(255,255,255,0.82);
  text-decoration: none;
  white-space: nowrap;
  position: relative;
  transition: color 0.18s, background 0.18s;
}
.hl-bar3-nav > li > a:hover,
.hl-bar3-nav li.current-menu-item > a {
  color: var(--hl-white);
  background: var(--hl-dark-hover);
  text-decoration: none;
}
.hl-bar3-nav li.current-menu-item > a::after {
  content: '';
  position: absolute;
  bottom: 0; left: 50%;
  transform: translateX(-50%);
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-bottom: 4px solid var(--hl-gold);
}

/* Dropdown bar3 */
.hl-bar3-nav > li:hover .hl-dropdown-menu { display: block; }

/* ============================================================
   MOBILE
   ============================================================ */
.hl-ham-btn {
  display: none;
  background: none;
  border: 2px solid rgba(255,255,255,0.45);
  border-radius: 8px;
  color: var(--hl-white);
  font-size: 1.1rem;
  padding: 6px 11px;
  cursor: pointer;
  flex-shrink: 0;
  margin-left: auto;
}
.hl-mobile-logo {
  display: none;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  flex: 1;
}
.hl-mobile-logo img { height: 38px; width: auto; }
.hl-mobile-logo span {
  font-size: 13px; font-weight: 700;
  color: var(--hl-white);
}
.hl-mobile-bar {
  display: none;
  background: linear-gradient(135deg,#6F0000,#9F0000);
  padding: 0 16px;
  height: 52px;
  align-items: center;
  gap: 12px;
  border-bottom: 2px solid var(--hl-gold);
}

.hl-mobile-nav {
  display: none;
  background: #6F0000;
  overflow-y: auto;
  max-height: 80vh;
}
.hl-mobile-nav.hl-open { display: block; }
.hl-mob-sep { height: 1px; background: rgba(255,255,255,0.08); }
.hl-mob-label {
  padding: 10px 20px 4px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.6px;
  color: var(--hl-gold);
  font-weight: 700;
}
.hl-mob-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  font-size: 13.5px;
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  transition: background 0.15s;
}
.hl-mob-link:hover {
  background: rgba(255,255,255,0.07);
  color: var(--hl-gold-light);
  text-decoration: none;
}
.hl-mob-link .hl-law-badge { background: var(--hl-gold); color: var(--hl-red-dark); }

@media (max-width: 960px) {
  .hl-logo-box { width: 140px; padding: 8px 12px; }
  .hl-logo-link img { height: 50px; }
  .hl-logo-name { font-size: 10px; }
  .hl-bar2-nav > li > a { padding: 0 10px; font-size: 12px; }
  .hl-bar3-nav > li > a { padding: 0 9px; font-size: 11.5px; }
  .hl-bar3-label { display: none; }
}

@media (max-width: 768px) {
  .hl-header-inner { display: none !important; }
  .hl-mobile-bar { display: flex !important; }
  .hl-mobile-nav.hl-open { display: block; }
}

/* Bỏ vạch vàng ngăn logo */
.hl-logo-box { border-right: none !important; }

/* Menu giới thiệu căn giữa */
.hl-bar1 { justify-content: center; }
.hl-bar1 nav { justify-content: center; width: 100%; }
.hl-bar1-nav { justify-content: center; }

/* Menu dịch vụ căn giữa */
.hl-bar2 nav { justify-content: center; }
.hl-bar2-nav { justify-content: center; width: 100%; }

/* Menu tra cứu căn phải */
.hl-bar3 nav { justify-content: flex-end; margin-left: auto; }
.hl-bar3-nav { justify-content: flex-end; }

/* Bỏ tên "Hệ thống Luật" dưới logo */
.hl-logo-name { display: none !important; }

/* Nhãn tên cho từng tầng menu */
.hl-bar1::before {
  content: 'GIỚI THIỆU';
  font-size: 10px; font-weight: 700;
  letter-spacing: 1.5px; color: var(--hl-gold);
  padding: 0 14px 0 4px;
  border-right: 1px solid rgba(212,175,55,0.3);
  margin-right: 8px; white-space: nowrap;
  flex-shrink: 0;
}
.hl-bar2::before {
  content: 'DỊCH VỤ';
  font-size: 10px; font-weight: 700;
  letter-spacing: 1.5px; color: var(--hl-gold);
  padding: 0 14px 0 4px;
  border-right: 1px solid rgba(212,175,55,0.3);
  margin-right: 8px; white-space: nowrap;
  flex-shrink: 0;
}

/* 1. Nhãn menu chuyển sang góc phải */
.hl-bar1::before, .hl-bar2::before {
  margin-left: auto !important;
  order: 999;
  border-right: none !important;
  border-left: 1px solid rgba(212,175,55,0.3);
  padding: 0 4px 0 14px !important;
  margin-right: 0 !important;
  margin-left: 8px !important;
}
.hl-bar1 { flex-direction: row; }
.hl-bar1-nav { order: 1; }
.hl-bar3-label { order: 999; margin-left: auto; border-left: 1px solid rgba(212,175,55,0.3); border-right: none !important; padding: 0 4px 0 14px !important; margin-right: 0 !important; }
.hl-bar3 nav { order: 1; margin-left: 0; }

/* 2. Ẩn tầng dư thứ 4 */
.hl-menus > div:nth-child(4) { display: none !important; }

/* 3. Mobile/tablet fix — hiện hamburger từ 1024px */
@media (max-width: 1024px) {
  .hl-header-inner { display: none !important; }
  .hl-mobile-bar { display: flex !important; }
}
@media (min-width: 1025px) {
  .hl-mobile-bar { display: none !important; }
  .hl-header-inner { display: flex !important; }
}

/* Ẩn tầng dư thứ 4 */
.hl-menus > div:nth-child(4),
.hl-menus > div:nth-child(5) { display: none !important; }

/* Ẩn tầng Astra thừa bên dưới header */
#hl-header ~ .main-header-bar,
#hl-header + div,
#hl-header ~ #masthead,
.ast-below-header-section,
.ast-below-header-bar,
[class*="ast-below"],
.main-header-bar-wrap { display: none !important; }

/* Ẩn ast-above-header-bar của Astra */
.ast-above-header-bar,
.ast-above-header,
#ast-above-header { display: none !important; }

/* Fix submenu bị che */
.hl-dropdown-menu {
  z-index: 99999 !important;
  position: absolute !important;
}
.hl-bar2-nav > li,
.hl-bar3-nav > li {
  position: relative !important;
  z-index: 99999 !important;
}
#hl-header {
  z-index: 99999 !important;
}
