:root {
    --shared-header-blue: #082f78;
    --shared-header-blue-dark: #05245d;
    --shared-header-yellow: #ffc400;
}

.top_panel {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: 1000;
    max-width: 100vw;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    background: transparent;
    transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

/* Header nền trắng khi cuộn xuống hoặc ở các trang con */
.top_panel.home-header--solid,
.top_panel.header-always-solid {
    border-bottom: 1px solid var(--shared-header-yellow) !important;
    background: rgba(255, 255, 255, .98) !important;
    box-shadow: 0 4px 20px rgba(3, 38, 95, 0.08) !important;
}

/* Chữ màu trắng trên nền trong suốt khi ở đầu trang chủ */
.top_panel:not(.home-header--solid):not(.header-always-solid) .center .menu > ul > li > a,
.top_panel:not(.home-header--solid):not(.header-always-solid) .right .tel a,
.top_panel:not(.home-header--solid):not(.header-always-solid) .right .tel a span {
    color: #ffffff !important;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
    font-family: 'Nunito', sans-serif !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.02em !important;
}

.top_panel:not(.home-header--solid):not(.header-always-solid) .center .menu > ul > li > a:hover,
.top_panel:not(.home-header--solid):not(.header-always-solid) .center .menu > ul > li.active > a {
    color: var(--shared-header-yellow) !important;
}

.top_panel:not(.home-header--solid):not(.header-always-solid) .mobile_btn span {
    background: #ffffff !important;
}

/* Chữ màu xanh khi header có nền trắng (khi cuộn trang hoặc trang con) */
.top_panel.home-header--solid .center .menu > ul > li > a,
.top_panel.home-header--solid .right .tel a,
.top_panel.home-header--solid .right .tel a span,
.top_panel.header-always-solid .center .menu > ul > li > a,
.top_panel.header-always-solid .right .tel a,
.top_panel.header-always-solid .right .tel a span {
    color: var(--shared-header-blue) !important;
    text-shadow: none !important;
    font-family: 'Nunito', sans-serif !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.02em !important;
}

.top_panel.home-header--solid .center .menu > ul > li > a:hover,
.top_panel.header-always-solid .center .menu > ul > li > a:hover {
    color: #0284c7 !important;
}

.top_panel.home-header--solid .mobile_btn span,
.top_panel.header-always-solid .mobile_btn span {
    background: var(--shared-header-blue) !important;
}

.top_panel .center .menu > ul > li.dropdown_li > a span::after {
    content: " ▾";
    font-size: 12px;
    margin-left: 4px;
    display: inline-block;
    transition: transform .2s ease;
}

.top_panel .center .menu > ul > li.dropdown_li:hover > a span::after {
    transform: rotate(180deg);
}

.top_panel .center .menu ul li .dropdown_ul {
    z-index: 1200;
    width: 270px;
    padding: 10px;
    border: 1px solid #e2e8f0;
    border-radius: 0 14px 14px 14px;
    background: #fff;
    box-shadow: 0 18px 45px rgba(3, 35, 86, .2);
}

.top_panel .center .menu ul li .dropdown_ul li,
.top_panel .center .menu ul li .dropdown_ul li:last-child {
    float: none;
    clear: both;
    width: 100%;
    margin: 0;
}

.top_panel .center .menu ul li .dropdown_ul li a,
.top_panel:not(.home-header--solid) .center .menu ul li .dropdown_ul li a,
.top_panel.home-header--solid .center .menu ul li .dropdown_ul li a {
    display: block;
    float: none;
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    color: #243b63 !important;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.35;
    text-shadow: none !important;
    text-transform: none;
    transition: color .2s ease, background .2s ease, padding-left .2s ease;
}

.top_panel .center .menu ul li .dropdown_ul li a:hover {
    padding-left: 16px;
    background: #edf4ff;
    color: #0752b9 !important;
}

@media (min-width: 1201px) {
    .top_panel {
        padding: 7px 0;
    }

    .top_panel .center .menu > ul > li.dropdown_li {
        position: relative;
        padding-top: 6px;
        padding-bottom: 6px;
    }

    .top_panel .center .menu > ul > li.dropdown_li > .dropdown_ul {
        position: absolute;
        top: 100%;
        left: 0;
        display: none;
        opacity: 0;
        visibility: hidden;
        transition: opacity .15s ease, visibility .15s ease;
        z-index: 1200;
        width: 250px;
        padding: 10px;
        border: 1px solid #e2e8f0;
        border-radius: 0 14px 14px 14px;
        background: #ffffff;
        box-shadow: 0 18px 45px rgba(3, 35, 86, .18);
        margin-top: 0;
    }

    .top_panel .center .menu > ul > li.dropdown_li > .dropdown_ul::before {
        content: "";
        position: absolute;
        top: -16px;
        left: 0;
        right: 0;
        height: 16px;
        display: block;
        background: transparent;
    }

    .top_panel .center .menu > ul > li.dropdown_li:hover > .dropdown_ul,
    .top_panel .center .menu > ul > li.dropdown_li > .dropdown_ul:hover {
        display: block !important;
        opacity: 1 !important;
        visibility: visible !important;
    }

    .top_panel .wrap {
        box-sizing: border-box;
        width: 100%;
        max-width: 1760px;
        padding: 0 34px;
    }

    .top_panel .wrap_float {
        display: flex;
        float: none;
        width: 100%;
        min-width: 0;
        align-items: center;
        padding: 0 !important;
    }

    .top_panel .currency {
        position: static;
        flex: 0 0 112px;
        width: 112px;
        height: 40px;
        margin: 0 26px 0 0;
    }

    .top_panel .left {
        flex: 0 0 auto;
        width: auto;
        padding: 0;
        margin-right: clamp(34px, 4vw, 72px);
    }

    .top_panel .close {
        display: none !important;
    }

    .top_panel .left .logo {
        float: none;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        height: auto;
        max-height: 58px !important;
        width: auto;
        max-width: 260px !important;
        margin: 4px 0 !important;
        padding: 0 !important;
        background: #ffffff !important;
        border: 1.5px solid #cbd5e1 !important;
        border-radius: 12px !important;
        overflow: hidden !important;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05) !important;
        position: relative;
        transition: all 0.2s ease !important;
    }

    .top_panel .left .logo:hover {
        border-color: #082f78 !important;
        box-shadow: 0 4px 12px rgba(8, 47, 120, 0.12) !important;
    }

    .top_panel .left .logo img {
        position: static;
        top: 0;
        height: 56px !important;
        max-height: 56px !important;
        width: auto !important;
        max-width: 100% !important;
        display: block !important;
        object-fit: contain !important;
        border-radius: 10px !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .top_panel .menu_wrap {
        display: block !important;
        float: none;
        flex: 1 1 auto;
        width: auto !important;
        min-width: 0;
    }

    .top_panel .menu_wrap > .scroll {
        display: flex;
        float: none;
        width: 100%;
        min-width: 0;
        align-items: center;
        justify-content: space-between;
    }

    .top_panel .center,
    .top_panel .center .menu,
    .top_panel .center .menu > ul {
        display: flex;
        float: none;
        width: auto;
        min-width: 0;
        align-items: center;
    }

    .top_panel .center .menu > ul > li {
        float: none;
        flex: 0 0 auto;
        width: auto;
        margin-right: clamp(20px, 2.2vw, 48px) !important;
    }

    .top_panel .center .menu > ul > li:last-child {
        margin-right: 0 !important;
    }

    .top_panel .right {
        display: flex;
        float: none;
        flex: 0 0 auto;
        width: auto;
        align-items: center;
        margin-left: clamp(28px, 3vw, 58px);
    }

    .top_panel .center .menu > ul > li > .dropdown_ul {
        top: calc(100% + 7px);
    }
}

@media (max-width: 1200px) {
    .top_panel {
        top: 0 !important;
        padding: 2px 0 3px !important;
    }

    .top_panel .wrap {
        padding: 0 10px !important;
    }

    .top_panel .wrap_float {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        min-height: 46px !important;
    }

    .top_panel .wrap_float > .currency {
        display: none !important;
    }

    .top_panel .left {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: auto !important;
        flex: 1 1 auto !important;
        margin: 0 !important;
        padding: 0 !important;
        text-align: center !important;
    }

    .top_panel .left .logo {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: auto !important;
        max-width: clamp(160px, 60vw, 240px) !important;
        height: auto !important;
        max-height: 48px !important;
        margin: 0 auto !important;
        padding: 0 !important;
        background: #ffffff !important;
        border: 1.5px solid #cbd5e1 !important;
        border-radius: 10px !important;
        overflow: hidden !important;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05) !important;
        position: static !important;
        float: none !important;
    }

    .top_panel .left .logo img {
        display: block !important;
        width: auto !important;
        height: 46px !important;
        max-height: 46px !important;
        max-width: 100% !important;
        object-fit: contain !important;
        object-position: center !important;
        position: static !important;
        top: 0 !important;
        left: 0 !important;
        float: none !important;
        aspect-ratio: auto !important;
        border-radius: 8px !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .top_panel .mobile_btn {
        display: flex !important;
        align-items: center;
        justify-content: center;
        flex-direction: column;
        gap: 5px;
        width: 44px;
        height: 44px;
        padding: 0;
        border: 0;
        border-radius: 10px;
        background: transparent;
        cursor: pointer;
        z-index: 1001;
    }

    .top_panel .mobile_btn span {
        display: block;
        width: 24px;
        height: 2.5px;
        background: var(--shared-header-blue);
        border-radius: 2px;
        transition: all .25s ease;
    }

    .top_panel .menu_wrap {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100vh;
        background: #ffffff;
        z-index: 10000;
        overflow-y: auto;
        padding: 60px 24px 30px;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    }

    .top_panel .menu_wrap.is-open {
        display: block !important;
    }

    .top_panel .close {
        display: flex !important;
        position: absolute;
        top: 20px;
        right: 20px;
        width: 40px;
        height: 40px;
        align-items: center;
        justify-content: center;
        border: 0;
        border-radius: 50%;
        background: #f1f5f9;
        color: #10213f;
        font-size: 24px;
        font-weight: 700;
        cursor: pointer;
        z-index: 10001;
    }

    .top_panel .center .menu > ul {
        display: flex;
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
        width: 100%;
        padding: 0;
        margin: 0;
        list-style: none;
    }

    .top_panel .center .menu > ul > li {
        width: 100%;
        margin: 0 !important;
    }

    .top_panel .center .menu > ul > li > a {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 12px 14px;
        border-radius: 10px;
        color: #10213f !important;
        font-size: 15px !important;
        font-weight: 700 !important;
        text-transform: uppercase;
        text-decoration: none;
    }

    .top_panel .center .menu > ul > li > a:hover,
    .top_panel .center .menu > ul > li.active > a {
        background: #edf4ff;
        color: #082f78 !important;
    }

    .top_panel .center .menu ul li .dropdown_ul {
        width: 100%;
        padding: 5px 0 5px 16px;
        border: 0;
        border-radius: 0;
        background: #f6f8fc;
        box-shadow: none;
        position: static;
        display: none;
    }

    .top_panel .center .menu ul li.submenu-open .dropdown_ul {
        display: block;
    }

    .top_panel .center .menu ul li .dropdown_ul li a {
        padding: 9px 12px;
    }
}
