/* ═══════════════════════════════════════════════
   HEADER WRAP
═══════════════════════════════════════════════ */
.header-wrap {
    transition:
        transform 0.4s ease,
        opacity 0.4s ease,
        background 0.3s ease,
        margin-top 0.3s ease;
    transform: translateY(0);
    opacity: 1;
    background-color: #252a57;
    position: relative;
    z-index: 1000;
}

#body-home .header-wrap {
    position: fixed;
    top: 0;
    z-index: 1000;
    width: 100%;
    margin-top: 38px;
    background-color: transparent;
}

#body-home .header-wrap.header-bg {
    margin-top: 0;
    background: #252a57;
}

/* .header-hide {
    transform: translateY(-30px);
    opacity: 0;
} */

.header-bg {
    background: #252a57;
    margin-top: 0px;
    position: fixed;
    top: 0;
    z-index: 1000;
    width: 100%;
}

#body-home .header-wrap:hover {
    background: #252a57;
}

.header-wrap.header-show {
    margin-top: 0;
}

/* ═══════════════════════════════════════════════
   TOP BAR
═══════════════════════════════════════════════ */
.top-bar {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 32px;
    gap: 28px;
    background: #252a57;
}

.top-bar span {
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.04em;
    color: #fff;
    text-decoration: none;
    transition: color 0.2s;
}

.top-bar a:hover {
    color: #FFF;
}

.top-bar .lang {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s;
    position: relative;
    padding: 10px 0;
}

.top-bar .lang svg {
    width: 10px;
    height: 10px;
    transition: transform 0.3s;
}

.top-bar .lang:hover svg {
    transform: rotate(180deg);
}

/* ═══════════════════════════════════════════════
   NAV BAR
═══════════════════════════════════════════════ */
.nav-bar {
    display: flex;
    align-items: center;
    padding: 0 32px;
    position: relative;
    z-index: 1001;
    /* Stay above mobile menu */
}

.logo {
    display: flex;
}

.logo img {
    max-width: 120px;
    width: 100%;
}

/* ═══════════════════════════════════════════════
   DESKTOP NAV MENU
═══════════════════════════════════════════════ */
.nav-menu {
    display: flex;
    align-items: center;
    list-style: none;
    flex: 1;
    justify-content: center;
}

.nav-item {
    position: relative;
    display: flex;
    align-items: center;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 17px 16px;
    font-size: 17px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #fff;
    position: relative;
    transition: color 0.2s;
}

.nav-link::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    right: 50%;
    height: 2px;
    background: #FFF;
    transition:
        left 0.3s ease,
        right 0.3s ease;
}

.nav-item:hover .nav-link,
.nav-item:focus-within .nav-link {
    color: #ffffff;
}

.nav-item:hover .nav-link::after,
.nav-item:focus-within .nav-link::after {
    left: 13px;
    right: 13px;
}

.nav-link .arrow {
    width: 7px;
    height: 7px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg) translateY(-2px);
    transition: transform 0.3s;
    flex-shrink: 0;
}

/* ─── DROPDOWN flip ─── */
.dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    /* min-width: 220px; */
    width: max-content;
    max-width: 300px;
    list-style: none;
    background: #252a57;
    border: 1px solid rgba(200, 169, 110, 0.25);
    z-index: 1001;
    transform-origin: top center;
    transform: perspective(600px) rotateX(-90deg);
    opacity: 0;
    pointer-events: none;
    transition:
        transform 0.38s cubic-bezier(0.23, 1.08, 0.32, 1),
        opacity 0.25s ease;
}

.nav-item:hover .dropdown,
.nav-item:focus-within .dropdown,
.lang:hover .dropdown,
.lang .dropdown.active {
    transform: perspective(600px) rotateX(0deg);
    opacity: 1;
    pointer-events: auto;
}

.top-bar .lang .dropdown {
    left: auto;
    right: 0;
    min-width: 150px;
}

.dropdown a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 20px;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.04em;
    color: rgba(255, 255, 255, 0.72);
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition:
        background 0.2s,
        color 0.2s,
        padding-left 0.2s;
}

.dropdown li:last-child a {
    border-bottom: none;
}

.dropdown a:hover {
    background: rgba(200, 169, 110, 0.08);
    color: #fff;
}

.dropdown a:hover::before {
    opacity: 1;
}

.nav-item:hover .dropdown li {
    animation: slideIn 0.3s ease forwards;
}

.nav-item:hover .dropdown li:nth-child(1) {
    animation-delay: 0.06s;
    opacity: 0;
}

.nav-item:hover .dropdown li:nth-child(2) {
    animation-delay: 0.1s;
    opacity: 0;
}

.nav-item:hover .dropdown li:nth-child(3) {
    animation-delay: 0.14s;
    opacity: 0;
}

.nav-item:hover .dropdown li:nth-child(4) {
    animation-delay: 0.18s;
    opacity: 0;
}

.nav-item:hover .dropdown li:nth-child(5) {
    animation-delay: 0.22s;
    opacity: 0;
}

.nav-item:hover .dropdown li:nth-child(6) {
    animation-delay: 0.26s;
    opacity: 0;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-8px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ═══════════════════════════════════════════════
   RIGHT CONTROLS
═══════════════════════════════════════════════ */
.nav-right {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

.search-box {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 3px;
    padding: 0 10px;
    height: 30px;
    gap: 7px;
    transition:
        border-color 0.2s,
        background 0.2s;
}

.search-box:focus-within {
    border-color: #FFF;
    background: rgba(255, 255, 255, 0.1);
}

.search-box input {
    background: transparent;
    border: none;
    outline: none;
    color: #fff;
    font-size: 12px;
    width: 150px;
}

.search-box input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.search-box svg {
    color: rgba(255, 255, 255, 0.45);
    flex-shrink: 0;
}

.icon-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    color: rgba(255, 255, 255, 0.65);
    cursor: pointer;
    transition:
        color 0.2s,
        background 0.2s;
    text-decoration: none;
    position: relative;
    background: transparent;
    border: none;
}

.icon-btn:hover {
    color: #FFF;
    background: rgba(255, 255, 255, 0.06);
}

.icon-btn .compare-badge,
.icon-btn .badge {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 15px;
    height: 15px;
    background: #252a57;
    color: #FFF;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    justify-content: center;
    padding: 0 3px;
    pointer-events: none;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.icon-btn:hover .badge {
    transform: scale(1.1);
}

/* ═══════════════════════════════════════════════
   HAMBURGER
═══════════════════════════════════════════════ */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
    flex-shrink: 0;
}

.hamburger span {
    display: block;
    height: 2px;
    width: 22px;
    background: #fff;
    border-radius: 2px;
    transition:
        transform 0.35s cubic-bezier(0.23, 1, 0.32, 1),
        opacity 0.25s,
        width 0.3s;
    transform-origin: center;
}

.hamburger.is-open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.hamburger.is-open span:nth-child(2) {
    opacity: 0;
    width: 0;
}

.hamburger.is-open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ═══════════════════════════════════════════════
   MOBILE FULLSCREEN MENU
═══════════════════════════════════════════════ */
.mobile-menu {
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    height: 100vh;
    background: #252a57;
    overflow-y: auto;
    z-index: 1000;
    pointer-events: none;
    opacity: 0;
    transform: translateY(-100%);
    transition:
        opacity 0.4s ease,
        transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    padding-top: 100px;
    /* Space for the logo and hamburger */
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.mobile-menu.is-open {
    pointer-events: auto;
    opacity: 1;
    transform: translateY(0);
}

/* Stagger animation for menu items */
.mobile-menu.is-open .mob-nav>li {
    animation: mobSlideDown 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
}

.mobile-menu.is-open .mob-nav>li:nth-child(1) {
    animation-delay: 0.1s;
}

.mobile-menu.is-open .mob-nav>li:nth-child(2) {
    animation-delay: 0.15s;
}

.mobile-menu.is-open .mob-nav>li:nth-child(3) {
    animation-delay: 0.2s;
}

.mobile-menu.is-open .mob-nav>li:nth-child(4) {
    animation-delay: 0.25s;
}

.mobile-menu.is-open .mob-nav>li:nth-child(5) {
    animation-delay: 0.3s;
}

.mobile-menu.is-open .mob-nav>li:nth-child(6) {
    animation-delay: 0.35s;
}

.mobile-menu.is-open .mob-nav>li:nth-child(7) {
    animation-delay: 0.4s;
}

@keyframes mobSlideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mob-search {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 20px 10px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 4px;
    padding: 0 16px;
    height: 48px;
    /* Increased height Slightly */
    flex-shrink: 0;
    /* Important: Don't let it shrink */
}

.mob-search input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #fff;
    font-size: 15px;
    /* Slightly larger text */
    font-family: "Barlow", sans-serif;
    height: 100%;
}

.mob-search input::placeholder {
    color: rgba(255, 255, 255, 0.35);
}

.mob-search svg {
    color: rgba(255, 255, 255, 0.4);
    flex-shrink: 0;
}

.mob-nav {
    list-style: none;
    padding: 8px 0 20px;
}

.mob-nav>li {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.mob-nav-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.mob-nav-link {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.85) !important;
    text-decoration: none;
    cursor: pointer;
    background: transparent;
    border: none;
    transition: color 0.2s;
}

.mob-arrow-trigger {
    padding: 15px 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    justify-content: flex-end;
}

.mob-arrow {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform 0.3s;
    flex-shrink: 0;
    color: #fff;
}

.mob-arrow-trigger.active .mob-arrow {
    transform: rotate(-135deg);
}

.mob-submenu {
    list-style: none;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(255, 255, 255, 0.03);
}

.mob-submenu.open {
    max-height: 1000px;
    /* Tăng lên để chứa được nhiều item */
}

.mob-submenu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px 10px 34px;
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    transition:
        color 0.2s,
        padding-left 0.2s;
}

.mob-submenu li:last-child a {
    border-bottom: none;
}

.mob-submenu a::before {
    content: "";
    width: 4px;
    height: 1px;
    background: #FFF;
    flex-shrink: 0;
    transition: width 0.2s;
}

.mob-submenu a:hover {
    color: #fff;
    padding-left: 38px;
}

.mob-submenu a:hover::before {
    width: 8px;
}

.mob-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 14px 20px;
    padding: 20px;
    margin-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.mob-footer span,
.mob-footer a {
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.04em;
    color: rgba(255, 255, 255, 0.4);
    text-decoration: none;
    transition: color 0.2s;
}

/* ═══════════════════════════════════════════════
   DEMO CONTENT
═══════════════════════════════════════════════ */
.demo-content {
    padding: 80px 40px;
    text-align: center;
    color: #555;
    font-size: 15px;
}

.demo-content h1 {
    font-size: 28px;
    margin-bottom: 12px;
    color: #333;
}

.demo-content p {
    color: #777;
}


/* ═══════════════════════════════════════════════
   SEARCH POPUP
═══════════════════════════════════════════════ */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgb(37 42 87 / 80%);
    backdrop-filter: blur(12px);
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.search-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: #252a57;
    z-index: 10001;
    transform: translateY(-100%);
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);

    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.search-popup.active {
    transform: translateY(0);
}

.search-container-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 60px 40px;
    position: relative;
}

.search-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
    opacity: 0;
    transform: translateY(-20px);
    transition:
        opacity 0.4s ease 0.2s,
        transform 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.2s;
}

.search-popup.active .search-container {
    opacity: 1;
    transform: translateY(0);
}

.search-form-full {
    flex: 1;
    display: flex;
    align-items: center;
    position: relative;
    max-width: 900px;
}

.search-form-full input {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 26px;
    font-weight: 400;
    letter-spacing: 0.05em;
    padding: 15px 60px 15px 0;
    outline: none;
    transition: border-color 0.4s ease;
    font-family: inherit;
}

.search-form-full input::placeholder {
    color: rgba(255, 255, 255, 0.671);
    font-weight: 300;
}

.search-form-full input:focus {
    border-color: #FFF;
}

.search-form-full .search-submit {
    position: absolute;
    right: 0;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    padding: 10px;
    transition: color 0.3s ease, transform 0.3s ease;
}

.search-popup.active .search-submit {
    color: #FFF;
}

.search-form-full .search-submit:hover {
    transform: scale(1.1);
}

.close-search {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: color 0.3s ease, transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-search:hover {
    color: #fff;
    transform: rotate(180deg);
}

@media (max-width: 900px) {
    .search-container-wrap {
        padding: 50px 30px;
    }

    .search-form-full input {
        font-size: 24px;
    }
}

@media (max-width: 768px) {
    .search-container-wrap {
        padding: 40px 20px;
    }

    .search-form-full input {
        font-size: 20px;
        padding-bottom: 10px;
    }

    .search-container {
        gap: 15px;
    }
}

/* ═══════════════════════════════════════════════
   MEGA MENU (Product only)
   ═══════════════════════════════════════════════ */
.nav-item.has-mega {
    position: static;
}

.mega-menu {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: #252a57;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
    z-index: 1001;
    opacity: 0;
    pointer-events: none;
    transform: perspective(600px) rotateX(-15deg);
    transform-origin: top center;
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1),
        opacity 0.3s ease,
        visibility 0.3s;
    visibility: hidden;
    padding: 60px 0;
}

.nav-item.has-mega:hover .mega-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: perspective(600px) rotateX(0deg);
}

.mega-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
}

.mega-row {
    display: flex;
    gap: 60px;
    align-items: flex-start;
}

.mega-col {
    flex: 1;
}

.mega-info {
    flex: 0 0 330px;
}

.mega-info .mega-title {
    font-size: 26px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    position: relative;
    padding-bottom: 15px;
}

.mega-info .mega-title::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 2px;
    background: #FFF;
}

.mega-info .mega-desc {
    font-size: 14px;
    color: rgba(255, 255, 255, 1);
    line-height: 1.8;
    font-weight: 400;
}

.mega-links {
    flex: 1;
}

.mega-links .mega-list {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px 30px;
    padding: 0;
    margin: 0;
}

.mega-list li a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.mega-list li a::before {
    content: "";
    width: 0;
    height: 1px;
    background: #FFF;
    transition: width 0.3s ease;
}

.mega-list li a:hover {
    color: #FFF;
    transform: translateX(5px);
}

.mega-list li a:hover::before {
    width: 15px;
}

.mega-image {
    flex: 0 0 350px;
}

.mega-image img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 10px;
    filter: grayscale(20%);
    transition: filter 0.5s ease, transform 0.5s ease;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.has-mega:hover .mega-image img {
    filter: grayscale(0%);
    transform: scale(1.02);
}

.mega-image-placeholder {
    width: 100%;
    height: 240px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px dashed rgba(255, 255, 255, 0.1);
}

/* Clear mobile interference */
@media (max-width: 991px) {
    .mega-menu {
        display: none !important;
    }
}

/* Disable scroll when mega menu is open */
body.mega-menu-open {
    overflow: hidden !important;
    padding-right: 0px;
    /* Optional: adjust if scrollbar causes shift */
}

@media (max-width: 1500px) { 
    .nav-link {
            padding: 17px 12px;
    }
}

@media (max-width: 1350px) {
    .nav-bar {
        padding: 0 12px;
    }

    .top-bar {
        padding: 0 12px;
        gap: 18px;
    }

    .nav-link {
        font-size: 14px;
    }
}

/* ═══════════════════════════════════════════════
   MOBILE  ≤ 768px — hamburger + fullscreen menu
═══════════════════════════════════════════════ */
@media (max-width: 1200px) {
    .nav-bar {
        padding: 12px;
    }

    /* Ẩn desktop menu & search */
    .nav-menu {
        display: none;
    }

    .nav-right .icon-btn {
        display: flex !important;
    }

    .search-trigger {
        display: flex !important;
    }

    /* Hiện hamburger */
    .hamburger {
        display: flex;
    }

    .nav-right {
        gap: 4px;
    }

    /* Mobile menu top bắt đầu ngay dưới nav */
    .mobile-menu {
        padding-top: 70px;
    }

    .demo-content {
        padding: 40px 20px;
    }

    .demo-content h1 {
        font-size: 20px;
    }
}

@media (max-width: 575px) {
    .search-popup.active .search-submit svg {
        width: 20px;
        height: 20px;
    }

    .search-form-full input {
        font-size: 16px;
    }
}

@media (max-width: 375px) {
    .top-bar span:not(:last-child) {
        display: none;
    }
}