/* ==========================================
   HEADER MAIN STYLES (PURE HTML/CSS)
   ========================================== */

.site-header {
    width: 100%;
    position: sticky;
    top: 0;
    left: 0;
    z-index: 999;
    background-color: rgba(10, 10, 10, 0.95);
    padding: 10px 0;
    transition: padding 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease;
}

.site-header.sticky {
    background-color: rgba(10, 10, 10, 0.98);
    padding: 5px 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

.header-container {
    /* padding: 0 15px; */
    display: flex;
    align-items: center;
    /* Căn giữa dọc: menu ngang hàng phần giữa logo */
    position: relative;
    /* Container cho hotline (absolute) */
}

/* ==========================================
   1. LOGO AREA
   ========================================== */
.header-logo {
    display: flex;
    align-items: center;
    margin-right: 40px;
    /* Cách menu ra một chút */
    height: 100%;
    flex-shrink: 0;
}

.logo-link {
    display: flex;
    align-items: center;
    height: 100%;
    text-decoration: none;
}

.logo-img {
    height: 100px;
    /* Kích thước logo vừa vặn */
    width: auto;
    object-fit: contain;
    transition: height 0.3s ease;
}

.site-header.sticky .logo-img {
    height: 85px;
}

.mobile-menu-logo {
    display: none;
}

/* ==========================================
   2. HOTLINE (Góc trên bên phải)
   ========================================== */
.header-hotline {
    position: absolute;
    top: 0px;
    /* Nằm bên trên so với menu */
    right: 15px;
    z-index: 10;
}

.hotline-link {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    color: #ffffff;
    font-size: 16px;
    font-weight: 500;
    transition: color 0.3s ease;
}

.hotline-link:hover {
    color: #dfac40;
}

.hotline-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background-color: #dfac40;
    border-radius: 50%;
    margin-right: 8px;
    color: #1a1a1c;
}

.hotline-icon img {
    width: 15px;
    height: 15px;
    fill: currentColor;
    filter: brightness(0) invert(1);
}

/* ==========================================
   3. NAVIGATION MENU
   ========================================== */
.header-nav {
    flex-grow: 1;
    position: relative;
    display: flex;
    align-items: center;
    /* Căn giữa khối menu theo trục dọc */
    justify-content: flex-start;
    border-bottom: 1px solid rgba(223, 172, 64, 0.3);
    /* Đường viền mờ chạy dài */
}

.menu-list {
    display: flex;
    align-items: center;
    list-style: none;
    justify-content: space-between;
    margin: 0;
    padding: 0;
    width: 100%;
    margin-top: 5px;
}

.menu-item {
    display: flex;
    align-items: center;
    /* Chữ nằm giữa theo chiều dọc */
    position: relative;
    margin: 0 16px;
    /* Khoảng cách giữa các mục menu */
}

.menu-item:first-child {
    margin-left: 0;
}

.menu-link {
    display: flex;
    align-items: center;
    color: #ffffff;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
    position: relative;
    transition: color 0.3s ease;
    padding-bottom: 10px;
    /* Đẩy đường line ra xa chữ bằng kích thước thật */
    padding-top: 10px;
    /* Thêm padding trên để chữ vẫn là trung tâm của khối menu */
}

.menu-link:hover,
.menu-item.active .menu-link {
    color: #dfac40;
}

/* Hiệu ứng gạch dưới vàng gold (đè lên viền dưới của header-nav) */
.menu-link::after {
    content: '';
    position: absolute;
    bottom: -1px;
    /* Đè lên chính xác viền border-bottom của header-nav */
    left: 0;
    width: 0;
    height: 2px;
    background-color: #dfac40;
    transition: width 0.3s ease;
    z-index: 1;
}

.menu-item:hover .menu-link::after,
.menu-item.active .menu-link::after {
    width: 100%;
}

/* Mũi tên chỉ xuống cho menu có cấp con */
.submenu-arrow {
    display: inline-block;
    width: 0;
    height: 0;
    margin-left: 5px;
    vertical-align: middle;
    border-top: 4px solid currentColor;
    border-right: 4px solid transparent;
    border-left: 4px solid transparent;
}

.submenu-arrow-right {
    display: inline-block;
    width: 0;
    height: 0;
    margin-left: auto;
    vertical-align: middle;
    border-left: 4px solid currentColor;
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
}

/* ==========================================
   4. DROPDOWN SUBMENU (Level 2 & 3)
   ========================================== */
.submenu-list {
    position: absolute;
    top: 100%;
    /* Thả từ dưới đáy menu-item */
    left: 0;
    z-index: 100;
    background-color: rgba(17, 17, 19, 0.98);
    min-width: 90px;
    width: max-content;
    max-width: 230px;
    list-style: none;
    padding: 10px 0;
    margin: 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    visibility: hidden;
    opacity: 0;
    transform: translateY(15px);
    transition: all 0.3s ease;
}

.menu-item:hover>.submenu-list {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
}

.submenu-item {
    position: relative;
    /* Để chứa submenu level 3 */
    padding: 0;
    margin: 0;
}

.submenu-link {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    color: #e0e0e0;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s ease;
}

.submenu-link:hover {
    color: #dfac40;
    background-color: rgba(223, 172, 64, 0.1);
    padding-left: 25px;
    /* Hiệu ứng lùi vào 1 chút */
}

/* Submenu Level 3 (bay sang phải) */
.submenu-list.level-3 {
    top: -2px;
    /* Ngang hàng với item hiện tại, bù lại viền */
    left: 100%;
}

.submenu-item:hover>.submenu-list.level-3 {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
    /* Bỏ translate Y vì nó trượt từ bên trái ra thì hay hơn, nhưng giữ thống nhất */
}

/* Nút ẩn dùng cho Mobile Toggle Submenu */
.submenu-toggle {
    display: none;
}

/* ==========================================
   5. MOBILE MENU TOGGLE BUTTON
   ========================================== */
.header-toggle {
    display: none;
    /* Ẩn trên desktop */
    flex-direction: column;
    justify-content: space-between;
    width: 25px;
    height: 18px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1100;
}

.toggle-line {
    width: 100%;
    height: 2px;
    background-color: #dfac40;
    transition: all 0.3s ease;
}

.header-toggle.active .toggle-line:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

.header-toggle.active .toggle-line:nth-child(2) {
    opacity: 0;
}

.header-toggle.active .toggle-line:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ==========================================
   6. RESPONSIVE (Màn hình Tablet & Mobile)
   ========================================== */
@media (max-width: 1150px) {
    .menu-item {
        margin: 0 10px;
    }
}

@media (max-width: 991px) {
    .header-container {
        justify-content: space-between;
        /* Giãn cách Logo, Hotline, Toggle */
    }

    .header-logo {
        margin-right: auto;
    }

    .logo-img {
        height: 55px;
    }

    .site-header.sticky .logo-img {
        height: 45px;
    }

    /* Đưa Hotline và Toggle về sát nhau bên phải */
    .header-hotline {
        position: relative;
        /* Không absolute nữa */
        top: auto;
        right: auto;
        margin-right: 20px;
        /* Cách toggle ra 1 khoảng */
        z-index: 1;
    }


    .header-toggle {
        display: flex;
        /* Hiện nút hamburger */
        position: relative;
    }

    /* Mobile Menu Style */
    .header-nav {
        position: fixed;
        top: 0;
        left: -100%;
        width: 300px;
        height: 100vh;
        background-color: #0b0b0d;
        flex-direction: column;
        align-items: flex-start;
        padding: 25px 20px;
        transition: left 0.4s cubic-bezier(0.77, 0.2, 0.05, 1);
        z-index: 1000;
        border-bottom: none;
        overflow-y: auto;
    }

    .mobile-menu-logo {
        display: block;
        width: 100%;
        padding-bottom: 15px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        text-align: left;
    }

    .mobile-menu-logo .logo-img {
        height: 50px !important;
        width: auto !important;
        display: block;
    }

    .header-nav.active {
        left: 0;
    }

    .menu-list {
        flex-direction: column;
        align-items: flex-start;
        height: auto;
        width: 100%;
    }

    .menu-item {
        width: 100%;
        height: auto;
        margin: 0;
        flex-direction: column;
        align-items: flex-start;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }

    .menu-link {
        width: 100%;
        padding: 10px 0;
        font-size: 14px;
    }

    .menu-link::after {
        display: none;
        /* Bỏ gạch dưới trên mobile */
    }

    /* Submenu trên Mobile (Accordion style) */
    .menu-item.has-submenu {
        position: relative;
    }

    .submenu-toggle {
        display: block;
        /* Hiện nút mũi tên bấm trên mobile */
        position: absolute;
        top: 0;
        right: 0;
        width: 50px;
        height: 50px;
        z-index: 10;
        cursor: pointer;
    }

    .submenu-arrow,
    .submenu-arrow-right {
        display: none;
        /* Ẩn mũi tên gốc của link */
    }

    /* Tạo hình mũi tên cho nút toggle */
    .submenu-toggle::after {
        content: '';
        position: absolute;
        top: 14px;
        right: 15px;
        width: 6px;
        height: 6px;
        border-bottom: 2px solid #e0e0e0;
        border-right: 2px solid #e0e0e0;
        transform: rotate(45deg);
        transition: transform 0.3s ease;
    }

    .menu-item.open>.submenu-toggle::after {
        transform: rotate(-135deg);
        border-color: #dfac40;
    }

    .submenu-list {
        position: static;
        width: 100%;
        visibility: visible;
        opacity: 1;
        transform: none;
        background-color: transparent;
        border-top: none;
        box-shadow: none;
        padding: 0;
        min-width: 100%;
        display: none;
        list-style: disc;
        margin-left: 20px;
        /* Ẩn mặc định, hiển thị khi open */
    }

    .submenu-list.level-3 {
        position: static;
    }

    .menu-item.open>.submenu-list {
        display: block;
    }

    .submenu-link {
        padding: 10px 0 10px 0px;
        border-bottom: 1px dashed rgba(255, 255, 255, 0.05);
    }

    .submenu-list.level-3 .submenu-link {
        padding-left: 40px;
        /* Thụt vào sâu hơn cho cấp 3 */
    }
}

/* Background overlay khi mở menu trên mobile */
body.menu-open::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(3px);
    z-index: 998;
}