/* ==========================================================================
   Header v2 — giao diện mới (logo trái, menu ngang, social phải, có dropdown)
   Scope: .header-v2 (không ảnh hưởng layout cũ)
   ========================================================================== */

.header-v2 {
    position: relative;
    z-index: 1000;
    background: #ffffff;
    border-bottom: 1px solid #ececec;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.02);
    font-family: var(--cms-font-family, 'Roboto', 'Helvetica Neue', Arial, sans-serif);
}

.header-v2-inner {
    display: flex;
    align-items: center;
    gap: 24px;
    width: 100%;
    max-width: 1350px;
    margin: 0 auto;
    padding: 14px 24px;
}

/* ----- Logo ----- */
.header-v2-logo {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.header-v2-logo img {
    display: block;
    height: 45px;
    width: auto;
    max-width: 240px;
    object-fit: contain;
}

.header-v2-logo-fallback {
    font-size: 28px;
    font-weight: 800;
    color: #0a5d8a;
    letter-spacing: 1px;
}

/* ----- Nav (desktop) ----- */
.header-v2-nav {
    flex: 1 1 auto;
    min-width: 0;
}

.header-v2-nav-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 6px 18px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.header-v2-nav-list > li {
    position: relative;
    list-style: none;
    margin-bottom: 0;
}

.header-v2-nav-list > li > a {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 10px 4px;
    color: #2b2f33;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-decoration: none;
    text-transform: uppercase;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.header-v2-nav-list > li > a:hover,
.header-v2-nav-list > li.active > a,
.header-v2-nav-list > li:hover > a {
    color: #1a73e8;
}

.header-v2-nav-list > li.active > a {
    border-bottom-color: #1a73e8;
}

/* ----- Submenu Toggle ----- */
.header-v2-nav-list .sub-toggle {
    display: none;
    font-size: 10px;
    color: inherit;
    transition: transform 0.2s ease;
}

.header-v2-nav-list > li:hover .sub-toggle {
    transform: rotate(180deg);
}

/* ----- Dropdown Submenu ----- */
.header-v2-nav-list .sub-menu {
    display: none;
    position: absolute;
    top: 100%;
    min-width: 220px;
    background: #ffffff;
    border: 1px solid #ececec;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    padding: 8px 0;
    margin: 0;
    list-style: none;
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.header-v2-nav-list > li:hover > .sub-menu {
    display: block;
    opacity: 1;
    visibility: visible;
}

.header-v2-nav-list .sub-menu li {
    list-style: none;
    margin-bottom: 0;
}

.header-v2-nav-list .sub-menu a {
    display: block;
    padding: 10px 20px;
    color: #2b2f33;
    font-size: 15px;
    font-weight: 500;
    text-transform: none;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.2s ease, color 0.2s ease;
}

.header-v2-nav-list .sub-menu a:hover {
    background: #f7f9fc;
    color: #1a73e8;
}

/* Products submenu - 2 columns */
.header-v2-nav-list .sub-menu-products {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    min-width: 220px;
    gap: 0;
    padding: 0;
}

.header-v2-nav-list .sub-menu-products a {
    border-bottom: 1px solid #f3f3f3;
}

.header-v2-nav-list .sub-menu-products li:nth-child(odd) a {
    border-right: 1px solid #f3f3f3;
}

/* ----- Social Icons ----- */
.header-v2-social {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.header-v2-social a.icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: #3b5998;
    color: #fff;
    font-size: 16px;
    text-decoration: none;
    transition: transform 0.2s ease, opacity 0.2s ease, background-color 0.2s ease;
    border: none;
}

.header-v2-social a.icon:hover {
    transform: translateY(-2px);
    opacity: 0.9;
    background-color: #2d4373;
}

.header-v2-social a.icon.youtube {
    background-color: #c4302b;
}

.header-v2-social a.icon.youtube:hover {
    background-color: #a12925;
}

.header-v2-social a.icon.tiktok {
    background-color: #000;
}

.header-v2-social a.icon.tiktok:hover {
    background-color: #333;
}

.header-v2-social a.icon img {
    display: block;
    width: 18px;
    height: 18px;
    object-fit: contain;
}

.header-v2-social i[class^="icon-"] {
    display: inline-block;
}

/* ----- Burger (ẩn trên desktop) ----- */
.header-v2-burger {
    display: none;
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    padding: 0;
    margin-left: auto;
    background: transparent;
    border: 0;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
}

.header-v2-burger span {
    display: block;
    width: 24px;
    height: 2px;
    background: #2b2f33;
    transition: background 0.2s ease, transform 0.2s ease;
}

.header-v2-burger:hover span {
    background: #1a73e8;
}

.header-v2-burger.is-active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.header-v2-burger.is-active span:nth-child(2) {
    opacity: 0;
}

.header-v2-burger.is-active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ----- Mobile menu ----- */
.header-v2-mobile {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    border-top: 1px solid #ececec;
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    z-index: 999;
}

.header-v2-mobile ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.header-v2-mobile > ul {
    padding: 8px 0;
}

.header-v2-mobile li {
    list-style: none;
    border-bottom: 1px solid #f3f3f3;
}

.header-v2-mobile li:last-child {
    border-bottom: 0;
}

.header-v2-mobile > ul > li {
    border-bottom: 1px solid #ececec;
}

.header-v2-mobile a,
.header-v2-mobile .mobile-menu-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    color: #2b2f33;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    text-decoration: none;
    letter-spacing: 0.3px;
    cursor: pointer;
}

.header-v2-mobile a:hover,
.header-v2-mobile li.active > a,
.header-v2-mobile .mobile-menu-toggle:hover,
.header-v2-mobile li.has-sub.active > .mobile-menu-toggle {
    color: #1a73e8;
    background: #f7f9fc;
}

.header-v2-mobile .mobile-menu-toggle i {
    font-size: 12px;
    transition: transform 0.2s ease;
}

.header-v2-mobile .mobile-menu-toggle.is-open i {
    transform: rotate(180deg);
}

/* Mobile Submenu */
.header-v2-mobile .mobile-sub-menu {
    display: none;
    background: #fafafa;
}

.header-v2-mobile .mobile-sub-menu.is-open {
    display: block;
}

.header-v2-mobile .mobile-sub-menu a {
    padding: 12px 20px 12px 40px;
    font-size: 13px;
    text-transform: none;
    font-weight: 500;
    border-bottom: 1px solid #f0f0f0;
}

.header-v2-mobile .mobile-sub-menu li:last-child a {
    border-bottom: 0;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1199.98px) {
    .header-v2-inner {
        gap: 16px;
        padding: 12px 20px;
    }

    .header-v2-nav-list > li > a {
        font-size: 13px;
    }

    .header-v2-nav-list {
        gap: 4px 12px;
    }

    .header-v2-nav-list .sub-menu-products {
        min-width: 360px;
    }
}

@media (max-width: 991.98px) {
    .header-v2-logo img {
        height: 60px;
    }

    .header-v2-nav-list {
        gap: 4px 8px;
    }

    .header-v2-nav-list > li > a {
        font-size: 12.5px;
    }

    .header-v2-nav-list .sub-menu-products {
        grid-template-columns: 1fr;
        min-width: 200px;
    }

    .header-v2-nav-list .sub-menu-products li:nth-child(odd) a {
        border-right: none;
    }
}

@media (max-width: 767.98px) {
    .header-v2 {
        position: relative;
    }

    .header-v2-inner {
        flex-wrap: wrap;
        gap: 10px;
        padding: 10px 16px;
    }

    .header-v2-nav,
    .header-v2-social {
        display: none;
    }

    .header-v2-burger {
        display: flex;
    }

    .header-v2-mobile[hidden] {
        display: none;
    }

    .header-v2-mobile:not([hidden]) {
        display: block;
    }
}
