/* ===== Mega Menu Styles ===== */



/* user-account: ensure full height on desktop for red background */
header #user-account {
    height: 100%;
}

/* Hide old menu */
header #main-menu {
    display: none !important;
}

/* Mega Menu Navigation */
.mega-menu-nav {
    display: flex;
    align-items: center;
    flex: 1;
    margin-right: 104px;
}

.mega-menu-list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    align-items: center;
    width: 100%;
}

.mega-menu-item {
    position: relative;
}

.mega-menu-item > a {
    display: block;
    padding: 22.5px 12px;
    font-size: 14px;
    font-weight: 400;
    color: #000;
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.2s ease;
    cursor: pointer;
}

.mega-menu-item > a:hover {
    color: #DA291C;
}

.mega-menu-item.has-dropdown > a::after {
    content: '';
    display: inline-block;
    width: 0;
    height: 0;
    margin-left: 6px;
    vertical-align: middle;
    border-top: 4px solid;
    border-right: 4px solid transparent;
    border-left: 4px solid transparent;
}

/* Language item - push to right, match original #language style */
.mega-menu-lang {
    margin-left: auto;
}

.mega-menu-lang > a {
    color: #FFC600 !important;
    background-color: #F9F9F9;
    padding: 22.5px 11px !important;
}

.mega-menu-lang > a:hover {
    color: #e6b200 !important;
}

.mega-menu-lang > a::after {
    border-top-color: #FFC600 !important;
}

/* Dropdown */
.mega-menu-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    min-width: 220px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    border-radius: 0 0 8px 8px;
    padding: 8px 0;
    z-index: 1050;
}

.mega-menu-dropdown ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mega-menu-dropdown ul li a {
    display: block;
    padding: 10px 20px;
    font-size: 13px;
    color: #292929;
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease;
}

.mega-menu-dropdown ul li a:hover {
    background: #f5f5f5;
    color: #DA291C;
}

/* Language dropdown - match trigger width, align right */
.mega-menu-lang-dropdown {
    min-width: 0 !important;
    width: 100%;
    left: auto;
    right: 0;
}

.mega-menu-lang-dropdown ul li.active a {
    color: #FFC600;
    font-weight: 500;
}

/* Desktop: hover to show dropdown */
@media (min-width: 992px) {
    .mega-menu-item.has-dropdown:hover > .mega-menu-dropdown {
        display: block;
    }

    .mega-menu-item.has-dropdown:hover > a {
        color: #DA291C;
    }

    .mega-menu-lang.has-dropdown:hover > a {
        color: #e6b200 !important;
    }

    .mega-menu-hamburger {
        display: none;
    }
}

/* ===== Mobile ===== */
@media (max-width: 991px) {
    .mega-menu-nav {
        display: none;
        position: fixed;
        top: 65px;
        left: 0;
        width: 100vw;
        height: calc(100vh - 65px);
        background: #fff;
        z-index: 1040;
        overflow-y: auto;
        flex-direction: column;
        padding: 0;
    }

    .mega-menu-nav.is-open {
        display: flex;
    }

    .mega-menu-list {
        flex-direction: column;
        width: 100%;
    }

    .mega-menu-item {
        width: 100%;
        border-bottom: 1px solid #f0f0f0;
    }

    .mega-menu-item > a {
        padding: 15px 20px;
        font-size: 16px;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    .mega-menu-item.has-dropdown > a::after {
        transition: transform 0.3s ease;
    }

    .mega-menu-item.has-dropdown.is-expanded > a::after {
        transform: rotate(180deg);
    }

    /* Language on mobile - border top for separation */
    .mega-menu-lang {
        margin-left: 0;
        border-top: 2px solid #f0f0f0;
    }

    .mega-menu-lang > a {
        background-color: transparent !important;
    }

    /* Dropdown: accordion style on mobile */
    .mega-menu-dropdown {
        position: static;
        box-shadow: none;
        border-radius: 0;
        background: #f9f9f9;
        padding: 0;
        display: none;
        min-width: 0;
        width: 100%;
    }

    .mega-menu-item.has-dropdown.is-expanded > .mega-menu-dropdown {
        display: block;
    }

    .mega-menu-dropdown ul li a {
        padding: 12px 20px 12px 36px;
        font-size: 14px;
    }

    /* Hamburger button */
    .mega-menu-hamburger {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 30px;
        height: 30px;
        cursor: pointer;
        padding: 5px;
        margin: 17.5px 15px;
        flex-direction: column;
        gap: 5px;
    }

    .mega-menu-hamburger span {
        display: block;
        width: 20px;
        height: 2px;
        background: #292929;
        border-radius: 2px;
        transition: all 0.3s ease;
    }

    .mega-menu-hamburger.is-active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .mega-menu-hamburger.is-active span:nth-child(2) {
        opacity: 0;
    }

    .mega-menu-hamburger.is-active span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }

    header .navbar-toggle {
        display: none !important;
    }
}

/* ===== Mobile Header Layout — match reference (logo left, hamburger red right) ===== */
@media (max-width: 991px) {
    header .navbar-header {
        display: flex !important;
        align-items: stretch;
        width: 100%;
        height: 65px;
    }

    /* header-left: white, left side, logo at left */
    header .header-left {
        flex: 1 !important;
        width: auto !important;
        height: 65px !important;
        display: flex !important;
        align-items: center;
        background-color: #fff;
        padding: 0;
        order: 0;
        overflow: visible;
    }

    /* brand: order 0 = leftmost, user-account: order 1 = pushed right */
    header .header-left .navbar-brand {
        padding: 11px 17px;
        margin: 0;
        flex-shrink: 0;
        order: 0;
    }

    header .header-left #user-account {
        float: none !important;
        display: flex !important;
        margin: 0 0 0 auto;
        height: 65px;
        order: 1;
    }

    /* hamburger: red box, right side */
    header .mega-menu-hamburger {
        order: 1;
        flex-shrink: 0;
        width: 65px;
        height: 65px;
        background-color: #D0021B;
        border-bottom-right-radius: 6px;
        display: flex !important;
        align-items: center;
        justify-content: center;
        margin: 0;
        padding: 0;
        cursor: pointer;
        position: relative;
        z-index: 10;
    }

    header .mega-menu-hamburger span {
        background: #FFC600;
    }
}
/* ===== End Mobile Header Layout ===== */

/* ===== Fix: user-account li grey background on mobile ===== */
@media (max-width: 991px) {
    header #user-account > li {
        background-color: transparent !important;
    }
}
/* ===== End Fix ===== */

/* ===== Fix: on mobile, hide only #member (non-logged-in), show #profile + #cart (logged-in) ===== */
@media (max-width: 991px) {
    header #user-account > li.nonLogin {
        display: none !important;
    }
    header #user-account > li #member {
        display: none !important;
    }
}
/* ===== End Fix ===== */

/* ===== Mobile Bottom Bar: user icon + language ===== */
.mega-menu-mobile-bottom {
    display: none; /* hidden on desktop */
}

@media (max-width: 991px) {
    .mega-menu-mobile-bottom {
        display: flex;
        align-items: center;
        position: sticky;
        bottom: 0;
        left: 0;
        right: 0;
        background: #fff;
        border-top: 1px solid #f0f0f0;
        height: 65px;
        z-index: 10;
        margin-top: auto;
        flex-shrink: 0;
    }

    /* User icon: red box, left side */
    .mega-menu-mobile-user {
        width: 65px;
        height: 65px;
        background-color: #D0021B;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }

    .mega-menu-mobile-user-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        height: 100%;
    }

    .mega-menu-mobile-user .member-logo {
        width: 20px;
        height: auto;
        filter: brightness(0) invert(1); /* make icon white */
    }

    /* Language: right side */
    .mega-menu-mobile-lang {
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: flex-start;
        gap: 0;
        padding-left: 15px;
    }

    .mega-menu-mobile-lang .lang-item {
        padding: 0 20px;
        font-size: 15px;
        color: #292929;
        text-decoration: none;
        border-right: 1px solid #e0e0e0;
        line-height: 1;
    }

    .mega-menu-mobile-lang .lang-item:last-child {
        border-right: none;
    }

    .mega-menu-mobile-lang .lang-item.active {
        color: #292929;
        font-weight: 600;
    }

    /* Make mega-menu-nav flex column so bottom bar sticks to bottom */
    .mega-menu-nav.is-open {
        display: flex !important;
        flex-direction: column;
    }

    /* Hide language item from menu list on mobile */
    .mega-menu-lang {
        display: none !important;
    }
}
/* ===== End Mobile Bottom Bar ===== */

/* ===== Fix: bottom bar position fixed at bottom of screen ===== */
@media (max-width: 991px) {
    .mega-menu-mobile-bottom {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        top: auto !important;
        margin-top: 0 !important;
    }

    /* Add padding-bottom to nav so content not hidden behind bottom bar */
    .mega-menu-nav.is-open {
        padding-bottom: 65px;
    }
}
/* ===== End Fix ===== */

/* ===== Fix: bottom bar only visible when menu is open ===== */
@media (max-width: 991px) {
    /* Hide bottom bar by default */
    .mega-menu-mobile-bottom {
        display: none !important;
    }

    /* Show only when nav is open */
    .mega-menu-nav.is-open ~ .mega-menu-mobile-bottom,
    .mega-menu-nav.is-open .mega-menu-mobile-bottom {
        display: flex !important;
    }
}
/* ===== End Fix ===== */

/* ===== Fix: bottom bar show only when is-visible class added by JS ===== */
@media (max-width: 991px) {
    .mega-menu-mobile-bottom {
        display: none !important;
    }
    .mega-menu-mobile-bottom.is-visible {
        display: flex !important;
    }
}
/* ===== End Fix ===== */

/* ===== Fix: force bottom bar to bottom of screen ===== */
@media (max-width: 991px) {
    .mega-menu-mobile-bottom.is-visible {
        position: fixed !important;
        top: auto !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        z-index: 1050 !important;
    }
}
/* ===== End Fix ===== */


/* ===== Language Bar (bottom of mobile menu) ===== */
/* Desktop: hide lang bar (language is in mega-menu-nav as ENG dropdown) */
.mega-menu-lang-bar {
    display: none;
}

/* Also hide old mega-menu-lang item on desktop (already removed from HTML) */

/* Mobile: show lang bar at bottom of menu overlay */
@media (max-width: 991px) {
    .mega-menu-lang-bar {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 16px;
        padding: 15px 20px 15px 85px; /* 85px offset = 65px user-icon + 20px padding */
        background: #f5f5f5;
        border-top: 1px solid #e0e0e0;
        flex-shrink: 0;
    }

    .mega-menu-lang-bar .lang-item {
        font-size: 15px;
        color: #333;
        text-decoration: none;
        cursor: pointer;
    }

    .mega-menu-lang-bar .lang-item.active {
        font-weight: 600;
        color: #000;
    }

    .mega-menu-lang-bar .lang-item:not(.active)::before {
        content: '|';
        margin-right: 16px;
        color: #999;
    }
}
/* ===== End Language Bar ===== */

/* ===== Language: desktop dropdown visible, mobile hidden ===== */
@media (max-width: 991px) {
    .mega-menu-lang-desktop {
        display: none !important;
    }
}
/* ===== End Language Desktop ===== */

/* ===== Fix: lang-bar inside header hidden on mobile (use bottom bar instead) ===== */
@media (max-width: 991px) {
    .mega-menu-lang-bar {
        display: none !important;
    }
}

/* ===== Fix: remove dark top border on header (mobile) ===== */
@media (max-width: 991px) {
    header {
        border-top: none !important;
        box-shadow: none !important;
    }

    header .header-container {
        box-shadow: 0 2px 8px rgba(0,0,0,0.1) !important;
        border-top: none !important;
    }

    header .header-container .navbar-header {
        box-shadow: none !important;
    }
}
/* ===== End Fixes ===== */




