/* Header Styles */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    /* background-color: var(--bg-white); */
    z-index: 1000;
    transition: var(--transition);
}

.header.scroll {
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow);
}

.header-container {
    max-width: 1440px;
    position: relative;
    margin: 0 auto;
    padding: 0 5vw;
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    height: 80px;
}

.logo {
    display: flex;
    justify-content: center;
    flex-direction: column;
}

.logo img {
    filter: brightness(0) invert(1);
    transition: var(--transition);
}

.logo img.scroll {
    filter: brightness(1);
}

.logo a {
    font-size: 28px;
    font-weight: 700;
    height: 60px;
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

.logo a:hover {
    color: var(--primary-dark);
}

.nav-menu ul {
    display: flex;
    height: 100%;
    list-style: none;
    gap: 50px;
    align-items: center;
}

.nav-menu ul li {
    display: flex;
    justify-content: center;
    flex-direction: column;
    height: 100%;
}

.nav-menu a,
.nav-menu .dropdown-toggle{
    color: white;
    text-decoration: none;
    font-weight: 500;
    font-size: 18px;
    transition: var(--transition);
    position: relative;
    transition: var(--transition);
}
.nav-menu .dropdown-toggle{
    font-family: 'TitilliumWeb-Light';
}
.nav-menu a.scroll,
.header.scroll .nav-menu .dropdown-toggle{
    color: var(--text-dark);
}

.nav-menu .mega-product-link {
    color: var(--text-dark);
}

.nav-menu a::after,
.nav-menu .dropdown-toggle::after{
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: var(--transition);
}
.nav-menu>ul>li>a{
    font-family: 'TitilliumWeb-Light';
}
.nav-menu>ul>li>a::after,
.nav-menu .dropdown-toggle::after{
    background-color: white;
}
.header.scroll .nav-menu>ul>li>a::after,
.header.scroll .nav-menu .dropdown-toggle::after{
    background-color: var(--primary-color);
}
.nav-menu a:hover::after,
.nav-menu a:focus::after,
.nav-menu .dropdown-toggle:hover::after,
.nav-menu .dropdown-toggle:focus::after{
    width: 100%;
}
.nav-menu a::after
.nav-menu a:hover {
    color: var(--primary-color);
    transform: translateX(2px);
}
.nav-menu>ul>li>a:hover{
    color: white;
    transform: translateX(2px);
}
.header.scroll .nav-menu>ul>li>a:hover{
    color: var(--primary-color);
    transform: translateX(2px);
}
.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.search-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: var(--transition);
}
.header.scroll .search-toggle{
    color: var(--primary-color);
}
.search-toggle:hover {
    background-color: var(--bg-light);
    color: var(--primary-dark);
}

.search-toggle svg {
    width: 20px;
    height: 20px;
}

.header-cta-btn {
    padding: 10px 20px;
    background-color: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.header-cta-btn:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}
.header .header-cta-btn:hover{
    background-color: white;
    color: var(--primary-color);
}
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background-color: var(--primary-color);
    transition: var(--transition);
    border-radius: 2px;
}

/* Search Bar Styles – Desktop & Base */
.search-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: var(--bg-white);
    box-shadow: var(--shadow-lg);
    z-index: 1001;
    transform: translateY(-100%);
    transition: transform 0.3s ease;
}

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

.search-bar-container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 5vw;
}

.search-bar-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 20px 0;
    height: 80px;
}

.search-form {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 15px;
    max-width: 800px;
}

.search-input {
    flex: 1;
    padding: 12px 20px;
    font-size: 16px;
    border: 2px solid var(--border-color);
    border-radius: 30px;
    outline: none;
    transition: var(--transition);
    font-family: inherit;
}

.search-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(31, 46, 127, 0.1);
}

.search-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background-color: var(--primary-color);
    color: var(--bg-white);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
    padding: 0;
}

.search-submit:hover {
    background-color: var(--primary-dark);
    transform: scale(1.05);
}

.search-submit svg {
    width: 20px;
    height: 20px;
}

.search-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    color: var(--text-dark);
    cursor: pointer;
    border-radius: 50%;
    transition: var(--transition);
    padding: 0;
}

.search-close:hover {
    background-color: var(--bg-light);
    color: var(--primary-color);
    transform: rotate(90deg);
}

.search-close svg {
    width: 24px;
    height: 24px;
}

/* Megamenu base */
/* .nav-item-has-mega {
    position: relative;
} */

.megamenu {
    position: absolute;
    max-width: calc(1440px - 10vw);
    top: 85%;
    left: 5vw;
    right: 5vw;
    background: var(--bg-white);
    box-shadow: var(--shadow-lg);
    padding: 10px;
    border-radius: 16px;
    display: grid;
    grid-template-rows: repeat(2, minmax(0, 1fr));
    gap: 24px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: var(--transition);
    z-index: 900;
}

.nav-item-has-mega:hover .megamenu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.mega-section {
    display: grid;
    grid-template-columns: 1fr 4fr;
    gap: 20px;
    align-items: stretch;
    min-width: 0;
}

.mega-section-left {
    background: linear-gradient(135deg, rgba(31, 46, 127, 0.9), rgba(31, 46, 127, 0.7));
    color: #fff;
    border-radius: 12px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    justify-content: center;
    box-shadow: var(--shadow);
}

.mega-flag {
    width: 42px;
    height: 28px;
    border-radius: 4px;
    background-size: cover;
    background-position: center;
    box-shadow: var(--shadow);
}

.flag-korea {
    background-image: url('https://flagcdn.com/w40/kr.png');
}

.flag-china {
    background-image: url('https://flagcdn.com/w40/cn.png');
}

.mega-title {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.mega-subtitle {
    font-size: 13px;
    opacity: 0.9;
}

.mega-section-right {
    background: var(--bg-light);
    border-radius: 12px;
    /* padding: 14px 16px; */
    min-width: 0;
    box-shadow: var(--shadow);
}

.mega-carousel {
    padding: 0 60px;
}

.mega-product-card {
    background: var(--bg-white);
    border-radius: 10px;
    box-shadow: var(--shadow);
    overflow: hidden;
    /*width: 25% !important;*/
    min-width: 0;
    flex: 0 0 auto;
}

.mega-product-image {
    height: 100px;
    background-size: cover;
    background-position: center;
    /*transform: scaleX(-1)*/
}

.mega-product-info {
    padding: 12px;
    display: flex;
    flex-direction: column;
    height: calc(100% - 100px);
    justify-content: space-between;
}

.mega-product-name {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--primary-color);
}
.mega-product-name a{
        font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--primary-color) !important;
}
.mega-product-link {
    font-size: 13px;
    color: var(--primary-dark);
    text-decoration: none;
    font-weight: 600;
}
.mega-korea .carousel-btn{
    display: none;
}
.mega-korea-1 {
    background: linear-gradient(135deg, #1f2e7f, #4f7ddc);
}

.mega-korea-2 {
    background: linear-gradient(135deg, #233b8c, #6b9df0);
}

.mega-korea-3 {
    background: linear-gradient(135deg, #1b346e, #5f86e5);
}

.mega-korea-4 {
    background: linear-gradient(135deg, #223a7a, #7aa7ff);
}

.mega-china-1 {
    background: linear-gradient(135deg, #b22222, #ff7b7b);
}

.mega-china-2 {
    background: linear-gradient(135deg, #c83a3a, #ff9a9a);
}

.mega-china-3 {
    background: linear-gradient(135deg, #a52a2a, #ff8b8b);
}

.mega-china-4 {
    background: linear-gradient(135deg, #b83d3d, #ffadad);
}

/* Standard Dropdown Menu */
.nav-item-has-dropdown {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: var(--bg-white);
    box-shadow: var(--shadow-lg);
    border-radius: 8px;
    padding: 10px 0;
    min-width: 180px;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 1000;
}

.nav-item-has-dropdown:hover .dropdown-menu {
    flex-direction: column;
    opacity: 1;
    visibility: visible;
    height: fit-content;
    gap: 20px;
    transform: translateX(-50%) translateY(0);
}

.dropdown-menu li {
    display: block;
    width: 100%;
    /* height: 100%; */
    padding: 0;
}

.dropdown-menu a {
    display: block;
    padding: 10px 20px;
    font-size: 15px;
    color: var(--text-dark);
    white-space: nowrap;
}

.dropdown-menu a:hover {
    background-color: var(--bg-light);
    color: var(--primary-color);
}

.dropdown-menu a::after {
    display: none;
}

/* Tablet Styles */
@media (max-width: 1024px) {
    .header-container {
        padding: 0 4vw;
        height: 70px;
    }

    .nav-menu ul {
        gap: 20px;
    }

    .nav-menu a {
        font-size: 15px;
    }

    .search-bar-container {
        padding: 0 4vw;
    }

    .search-bar-content {
        height: 70px;
        padding: 15px 0;
    }

    .search-input {
        font-size: 15px;
        padding: 10px 18px;
    }

    .search-submit {
        width: 40px;
        height: 40px;
    }

    .search-submit svg {
        width: 18px;
        height: 18px;
    }

    .megamenu {
        position: static;
        box-shadow: none;
        padding: 16px 0 0;
    }

    .mega-section {
        grid-template-columns: 1fr;
    }

    .mega-section-right {
        padding: 12px 10px;
    }

    .mega-carousel {
        padding: 0 40px;
    }

    .mega-product-card {
        width: 180px;
    }
}

/* Mobile Styles */
@media (max-width: 1025px) {
    .header-container {
        padding: 0 3vw;
        height: 65px;
    }
.nav-menu .dropdown-toggle{
        color: var(--text-dark) !important;
    text-align: left;
    display: block;
    width: 100%;
}
    .logo a {
        font-size: 24px;
    }

    .header-actions {
        gap: 10px;
    }

    .search-toggle {
        width: 36px;
        height: 36px;
        padding: 6px;
        order: 1;
    }

    .search-toggle svg {
        width: 18px;
        height: 18px;
    }

    .mobile-menu-toggle {
        display: flex;
        order: 2;
    }

    .search-bar-container {
        padding: 0 3vw;
    }

    .search-bar-content {
        height: 65px;
        padding: 12px 0;
        gap: 12px;
    }

    .search-form {
        gap: 10px;
    }

    .search-input {
        font-size: 14px;
        padding: 10px 16px;
    }

    .search-submit {
        width: 38px;
        height: 38px;
        flex-shrink: 0;
    }

    .search-submit svg {
        width: 16px;
        height: 16px;
    }

    .search-close {
        width: 36px;
        height: 36px;
        flex-shrink: 0;
    }

    .search-close svg {
        width: 20px;
        height: 20px;
    }

    .nav-menu {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: var(--bg-white);
        box-shadow: var(--shadow-lg);
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }

    .nav-menu.active {
        max-height: fit-content;
    }

    .nav-menu ul {
        width: 100%;
        flex-direction: column;
        padding: 20px 3vw;
        gap: 0;
        align-items: flex-start;
    }

    .nav-menu li {
        width: 100%;
        padding: 12px 0;
        border-bottom: 1px solid var(--border-color);
    }

    .nav-menu a {
        display: block;
        width: 100%;
        font-size: 16px;
        color: var(--text-dark) !important;
    }

    .nav-menu a::after {
        display: none;
    }

    /* Mobile Dropdown */
    .nav-item-has-dropdown {
        display: block;
        height: auto;
    }

    .dropdown-menu {
        position: static;
        transform: none;
        box-shadow: none;
        opacity: 1;
        visibility: visible;
        padding: 0 0 0 20px;
        min-width: auto;
        display: none;
        /* Hidden by default on mobile until toggled or just show all? Usually simpler to just show for now or make it always visible if easy */
        /* Let's make it always visible for simplicity as requested "restructure", or just list them. */
        display: block;
        background: transparent;
    }

    .nav-item-has-dropdown:hover .dropdown-menu {
        transform: none;
    }

    .dropdown-menu a {
        padding: 8px 0;
        font-size: 15px;
        color: var(--text-light);
    }

    .dropdown-toggle {
        pointer-events: none;
        /* Disable click on mobile for the parent if it's just a label */
        font-weight: 600;
    }

    .mobile-menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(8px, 8px);
    }

    .mobile-menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .mobile-menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -7px);
    }

    /* Search Bar Styles */
    .search-bar {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        background-color: var(--bg-white);
        box-shadow: var(--shadow-lg);
        z-index: 1001;
        transform: translateY(-100%);
        transition: transform 0.3s ease;
    }

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

    .search-bar-container {
        max-width: 1440px;
        margin: 0 auto;
        padding: 0 5vw;
    }

    .search-bar-content {
        display: flex;
        align-items: center;
        gap: 20px;
        padding: 20px 0;
        height: 80px;
    }

    .search-form {
        flex: 1;
        display: flex;
        align-items: center;
        gap: 15px;
        max-width: 800px;
    }

    .search-input {
        flex: 1;
        padding: 12px 20px;
        font-size: 16px;
        border: 2px solid var(--border-color);
        border-radius: 30px;
        outline: none;
        transition: var(--transition);
        font-family: inherit;
    }

    .search-input:focus {
        border-color: var(--primary-color);
        box-shadow: 0 0 0 3px rgba(31, 46, 127, 0.1);
    }

    .search-submit {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        background-color: var(--primary-color);
        color: var(--bg-white);
        border: none;
        border-radius: 50%;
        cursor: pointer;
        transition: var(--transition);
        padding: 0;
    }

    .search-submit:hover {
        background-color: var(--primary-dark);
        transform: scale(1.05);
    }

    .search-submit svg {
        width: 20px;
        height: 20px;
    }

    .search-close {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        background: none;
        border: none;
        color: var(--text-dark);
        cursor: pointer;
        border-radius: 50%;
        transition: var(--transition);
        padding: 0;
    }

    .search-close:hover {
        background-color: var(--bg-light);
        color: var(--primary-color);
    }

    .search-close svg {
        width: 24px;
        height: 24px;
    }

    /* Megamenu mobile */
    .megamenu {
        position: static;
        width: 100%;
        top: auto;
        left: auto;
        right: auto;
        box-shadow: none;
        padding: 12px 0 0;
        border-radius: 0;
        display: none;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    /* Only show when toggled via JS (mega-open class) */
    .megamenu.mega-open {
        display: none;
    }

    .megamenu-products {
        gap: 16px;
    }

    .mega-section {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .mega-section-left {
        padding: 14px;
    }

    .mega-section-right {
        padding: 10px 6px;
    }

    .mega-carousel {
        padding: 0 30px;
    }

    .mega-product-card {
        width: 160px;
    }

    .mega-product-image {
        height: 110px;
    }

    .mega-product-name {
        font-size: 14px;
    }

    .mega-product-link {
        font-size: 12px;
    }
}
.mega-category-link {
    width: fit-content;
    color: white !important;
    font-size: 14px !important;
}
.mega-category-link::after{
    background-color: white !important;
}
.nav-menu .mega-product-link{
    font-size: 14px !important;
    color: var(--text-dark);
    width: fit-content;
}