/* ===== Block: header (2 cột) ===== */
.header{
  display:flex; align-items:stretch; /* giúp cột trái cao = tổng chiều cao cột phải */
  color:#ffffff;
  position:relative;
}

/* Cột trái: logo, nền xanh đậm (var(--mainColor)) */
.header__right{
    background:#65B005;
    width:100%;
    padding:1rem 0;
}
.header__logo{width:auto; display:block}

/* Dòng 1 – top links, nền xanh nhạt (#73B91A) */
.header__top{
  padding:8px 0;
  position: absolute;
    top:calc(100% + 12px);
    right: 0;
    z-index: 9999;
    background: #fff;
    border-radius: 10px;
    min-width:240px
}
.header__top{
    display:none;
}
.header__utility a{color:var(--textColor); text-decoration:none; white-space:nowrap;display:block;padding:3px 12px;}
.header__utility{
        text-align: right;
}
.header__utility ul{
flex-direction: column;
}
.header__utility ul li:hover{
    background: linear-gradient(90deg, rgba(242, 255, 226, 0.6) 0%, #65B005 72.12%);
}
.header__utility ul li:hover a{
    color:#fff;
}

/* Dòng 2 – nav, nền xanh vừa (#65B005) */
.header__nav{
  display:flex;
  align-items:center;
  justify-content:right
}
.header__nav-item:not(:first-child){
    margin-left:2rem;
}

/* Bố cục hàng dưới (menu + actions) */
/* ===== Top-level ===== */
.header__menu{
  list-style:none; margin:0; padding:0;
  display:flex; align-items:center; justify-content:center;
  position:relative; /* để z-index hoạt động ổn hơn */
  gap: 1.5rem;       /* thay cho :not(:last-child) */
}
.header__menu-item{ position:relative; }
.header__menu-item > a{
  color:#fff; text-decoration:none; display:block;
  padding:0 12px; line-height:1.2;
  transition:opacity .15s ease, color .15s ease;
  white-space:nowrap;
}
.header__menu-item > a:after{
content: "";
    display: block;
    height: 2px;
    background: transparent;
    position: absolute;
    bottom: -10px;
    width:0;
    transition:all .5s;
}
.header__menu-item.active > a:after,
.header__menu-item:hover > a:after{
    background: #fff;
    width: calc(100% - 24px);
}
.header__menu-item > a:hover{ opacity:.9; }

/* Caret cho item có con (tuỳ thích) */
.header__menu-item.has-child > a::after{
  content:""; display:inline-block; vertical-align:middle;
  width: 6px; height: 6px; margin-left:.4rem;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-1px);
  opacity:.85;
}

/* ===== Dropdown base (áp cho mọi cấp) ===== */
.dropdown-menu{
  position:absolute; inset: auto auto auto 0; /* top sẽ set cụ thể ở từng cấp */
  top:100%; left:0;
  list-style:none; margin:0; padding:8px;
  min-width: 220px;
  background:#fff; color:#1c2430;
  border-radius:10px;
  box-shadow:0 14px 40px rgba(0,0,0,.18), 0 2px 6px rgba(0,0,0,.08);
  /* Ẩn mặc định + hiệu ứng */
  opacity:0; visibility:hidden; transform: translateY(10px);
  transition: opacity .18s ease, transform .18s ease, visibility 0s linear .18s;
  z-index: 999; /* đè lên phần khác */
}

/* Link trong dropdown */
.dropdown-menu .header__menu-item > a{
  color:#1c2430; padding:10px 12px; border-radius:8px;
}
.dropdown-menu .header__menu-item > a:hover{
  background:#f4f7fb; color:#0f1318;
}

/* Hiện dropdown khi hover hoặc focus vào item cha */
.header__menu-item.has-child:hover   > .dropdown-menu,
.header__menu-item.has-child:focus-within > .dropdown-menu{
  opacity:1; visibility:visible; transform: translateY(0);
  transition-delay: 0s;
}

/* ===== Cấp 2 (trong dropdown cấp 1) ===== */
.header__menu-item-lv-2{ position:relative; }
.header__menu-item-lv-2.has-child > a::after{
  content:""; position:absolute; right:10px; top:50%;
  width:6px; height:6px; transform: translateY(-50%) rotate(-45deg);
  border-right:1.5px solid currentColor; border-bottom:1.5px solid currentColor;
  opacity:.6;
}

/* Sub-dropdown (cấp 2 -> hiển thị ngang phải) */
.header__menu-item-lv-2 > .dropdown-menu{
  top: 0; left: 100%;
  margin-left: 8px;
  transform: translateX(8px);
}
.header__menu-item-lv-2.has-child:hover > .dropdown-menu,
.header__menu-item-lv-2.has-child:focus-within > .dropdown-menu{
  opacity:1; visibility:visible; transform: translateX(0);
}

/* ===== Cấp 3 (nếu có) – giữ style đồng nhất ===== */
.header__menu-item-lv-3 > a{ padding:10px 12px; }

/* ===== Tinh chỉnh va chạm mép màn hình (tùy chọn) ===== */
/* Nếu dropdown gần mép phải, bạn có thể thêm class .drop-start để đảo hướng:
.header__menu-item.has-child.drop-start > .dropdown-menu{ left:auto; right:0; }
.header__menu-item-lv-2.drop-start > .dropdown-menu{ left:auto; right:100%; margin-left:0; margin-right:8px; transform: translateX(-8px); }
.header__menu-item-lv-2.drop-start:hover > .dropdown-menu{ transform: translateX(0); }
*/

/* ===== Mobile lưu ý (nếu có menu off-canvas) ===== */
/* Trên mobile, hover không hữu dụng; bạn có thể bật theo click bằng JS.
   Nếu vẫn cần hiển thị theo hover khi dùng chuột giả lập, giữ nguyên CSS trên. */


.header__actions{
  display:flex; align-items:center; gap:2rem;
  justify-content: right;
}
.header__lang{
  gap: 6px;
    background: #fff;
    padding: 0 0.5rem;
    border-radius: 3px;
    display: flex
;
    align-items: center;
}
.header__flag{
        height: 25px;
        display: flex
;
    align-items: center;
}
.header__caret{
    display:flex;
    align-items:center;
}
.header__caret svg{
    width:15px;
    height:15px;
}
.header__cta{
  background:#ffffff; color:var(--mainColor); border:0; padding:0.5rem 1rem;
  border-radius:6px; text-decoration:none; 
  box-shadow:0 2px 10px rgba(0,0,0,.08);
  line-height:100%;
  display:inline-block;
}
.header__cta:hover{
    background:var(--mainColor);
    color:#fff;
}

/* Lang switcher */
.header__lang {
  position: relative;
  display: inline-block;
}

.header__lang-trigger {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  border-radius: 6px;
  padding: 0;
  cursor: pointer;
  line-height: 1;
}


.header__flag img {
  display: block;
  width: 25px;
  height: 16px;
}

.header__caret {
  display: inline-flex;
}

.header__caret svg {
  width: 14px;
  height: 14px;
}

/* Dropdown */
.header__lang-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 200px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, .12);
  padding: 8px;
  z-index: 9999;
}

.header__lang-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  padding: 8px;
  border-radius: 6px;
  cursor: pointer;
  line-height: 1.2;
}

.header__lang-item img {
  width: 20px;
  height: 13px;
}

.header__lang-item:hover,
.header__lang-item:focus {
  background: #f3f4f6;
  outline: none;
}

.header__lang-item[aria-selected="true"] {
  font-weight: 600;
}
.header__toggle{
        width: 55px;
    background: #fff;
    text-align: center;
    display: flex
;
    align-items: center;
    justify-content: center;
    padding: 7px 12px;
    border-radius:3px;
    position:relative;
    }
@media (min-width:992px){
    .header__top{
        font-size:18px;line-height:28px;   
    }
    .header__nav > .row{
        align-items:center;
    }
    .header__left{
        position: absolute;
    top: 50%;
    transform: translateY(-50%);
    max-width: 200px;
    display: flex
;
    align-items: center;
    padding-left: 20px;
    }
    .header__logo{
        max-height:64px;
    }
}
@media (min-width:1500px){
    .header__menu-item a{
        font-size:20px;
        line-height:100%;
    }
}
/* ===== Responsive ===== */
@media (max-width:991px){
    .header{
            flex-direction: column;
    }
    .header__top{
        min-width:120px;
    }
    .header__left{
        width:100%;
                justify-content: space-between;
    }
    .header__toggle{
        width:auto;
    }
    .header__left{
      background:var(--mainColor);
      display:flex; 
      align-items:center; 
      padding: 12px 20px; 
      text-decoration:none; 
      color:#fff;
    }
    .header__left.not-lang{
       justify-content: center; 
    }
    .header__right{
        position:relative;
        padding:0;
    }
    .header__logo{
        max-width:100px;
    }
    .header__caret svg{
        width:10px;
        height:10px;
    }
    .header__flag img{
        width:20px;
        height:13px;
    }
    .header__lang-item{
        font-size:14px;
    }
    .header__menu{
        gap:12px
    }
    .header__utility{
        padding:0;
    }
    .header__utility ul li:not(:first-child){
        padding:0;
        border:none;
        margin:0;
    }
    .header__menu{
            width: calc(100% - 40px);
    justify-content: left;
    }
    .header__utility ul li{
        width:100%;
    }
    .header__utility a{
        color:#000;
        padding:2px 6px;
    }
    .header__utility a:hover{
          background: linear-gradient(90deg, rgba(255, 255, 255, 0) 14.92%, #65B005 100%);
    color: #fff;
    }
    .header__toggle{
        padding:4px 6px;
    }
    .header__toggle svg{
        width:16px;
        height:11px;
    }
    .header__nav-item:not(:first-child){
        margin-left:0;
    }
    .header__nav{
        height:28px;
    }
}
@media (max-width:767px){
    .header__menu-item > a{
        font-size:12px;
        padding:0;
    }
    
    .header__top{
    font-size: 10px;
    }
    .header__menu{
        gap:8px
    }
}