/* ═══════════════════════════════════════════
    MLM NAVBAR STYLES
    Dipindah dari inline <style> di header.php
═══════════════════════════════════════════ */

/* RESET */
.mlm-navbar *,
.mlm-navbar *::before,
.mlm-navbar *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* NAVBAR WRAPPER — sticky + hide-on-scroll-down + frosted glass */
.mlm-navbar {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    position: sticky;
    top: 0;
    z-index: 9999;
    padding: 12px 0;
    width: 100%;
    transition: top 0.38s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.38s ease,
                background 0.3s ease;
}

.mlm-navbar:not(.is-scrolled) {
    background: #fff;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.mlm-navbar.nav-hidden {
    top: -90px;
    box-shadow: none;
}

.navbar-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 40px;
    max-width: 1400px;
    margin: 0 auto;
}

/* LOGO */
.navbar-logo img {
    height: 48px;
    width: auto;
    display: block;
}

/* DESKTOP MENU */
.navbar-menu {
    display: flex;
    align-items: center;
    list-style: none;
}

.navbar-menu > li {
    position: relative;
}

.navbar-menu > li > a {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 10px 18px;
    text-decoration: none;
    color: #333;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 1px;
    transition: color 0.25s ease;
    white-space: nowrap;
    position: relative;
}

.navbar-menu > li > a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 18px;
    right: 18px;
    height: 2px;
    background: #B22222;
    border-radius: 1px;
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.navbar-menu > li > a:hover::after,
.navbar-menu > li > a.active::after {
    transform: scaleX(1);
}

.navbar-menu > li > a:hover,
.navbar-menu > li > a.active {
    color: #B22222;
}

.navbar-menu > li > a .nav-chevron {
    display: inline-flex;
    width: 9px;
    height: 9px;
    transition: transform 0.25s ease;
}

.has-dropdown:hover > a .nav-chevron {
    transform: rotate(180deg);
}

/* MEGA MENU (dropdown desktop) */
.has-dropdown::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    height: 12px;
    background: transparent;
}

.mega-menu {
    position: absolute;
    top: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%) translateY(-6px);
    width: auto;
    min-width: 580px;
    background: #fff;
    box-shadow: 0 12px 32px rgba(0,0,0,0.12);
    border-top: 3px solid #B22222;
    padding: 20px;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.22s ease,
                visibility 0.22s ease,
                transform 0.22s ease;
    transition-delay: 150ms;
    z-index: 9999999999 !important;
    overflow: visible !important;
}

.mega-menu::before {
    content: '';
    position: absolute;
    top: -12px;
    left: 0;
    width: 100%;
    height: 12px;
    background: transparent;
}

.has-dropdown:hover > .mega-menu {
    visibility: visible;
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    transition-delay: 0s;
}

.mega-column > h3 {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: #aaa;
    text-transform: uppercase;
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
    margin-bottom: 12px;
}

.mega-column > ul {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4px 20px;
}

.mega-column > ul > li > a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    text-decoration: none;
    color: #555;
    font-size: 13px;
    font-weight: 500;
    transition: transform 0.22s ease, color 0.22s ease;
}

.mega-column > ul > li > a:hover {
    transform: translateX(4px);
    color: #B22222;
}

.mega-column > ul > li > a img {
    height: auto;
    max-height: 28px;
    width: 75px;
    object-fit: contain;
    object-position: left center;
    flex-shrink: 0;
    background: transparent;
}

/* HAMBURGER BUTTON */
.navbar-hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 38px;
    height: 38px;
    cursor: pointer;
    padding: 6px;
    border: none;
    background: transparent;
}

.navbar-hamburger span {
    display: block;
    width: 100%;
    height: 2px;
    background: #333;
    border-radius: 2px;
    transform-origin: center;
    transition: transform 0.3s ease, opacity 0.3s ease, width 0.3s ease;
}

.navbar-hamburger.is-open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.navbar-hamburger.is-open span:nth-child(2) {
    opacity: 0;
    width: 0;
}
.navbar-hamburger.is-open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* MOBILE DRAWERS & OVERLAY */
.navbar-mobile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 99998;
    opacity: 0;
    transition: opacity 0.15s ease;
}
.navbar-mobile-overlay.open {
    display: block;
    opacity: 1;
}

.navbar-mobile {
    position: fixed;
    top: 0;
    right: -100%;
    width: 82vw;
    max-width: 320px;
    height: 100dvh;
    background: #fff;
    box-shadow: -4px 0 24px rgba(0,0,0,0.12);
    z-index: 99999;
    overflow-y: auto;
    transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    display: none;
    flex-direction: column;
    border-radius: 18px 0 0 18px;
}

.navbar-mobile.open {
    right: 0;
}

.mobile-drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid #f0f0f0;
}

.mobile-drawer-head .mobile-logo img {
    height: 34px;
    width: auto;
}

.mobile-drawer-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #eee;
    border-radius: 50%;
    cursor: pointer;
    color: #555;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
    flex-shrink: 0;
}
.mobile-drawer-close svg {
    width: 14px;
    height: 14px;
}
.mobile-drawer-close:hover {
    background: #B22222;
    color: #fff;
    border-color: #B22222;
}

.mobile-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 24px;
}

.mobile-nav-list {
    list-style: none;
}

.mobile-nav-list > li > a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 22px;
    text-decoration: none;
    color: #222;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.8px;
    border-bottom: 1px solid #f4f4f4;
    transition: color 0.2s, background 0.2s;
    position: relative;
}

.mobile-nav-list > li > a:hover,
.mobile-nav-list > li > a.active {
    color: #B22222;
    background: #fff8f8;
}

.mobile-nav-list > li > a.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 3px;
    background: #B22222;
    border-radius: 0 2px 2px 0;
}

.mobile-nav-list > li > a .mobile-arrow {
    width: 10px;
    height: 10px;
    color: #bbb;
    transition: transform 0.28s ease, color 0.28s ease;
    flex-shrink: 0;
}

.mobile-nav-list > li.is-open > a .mobile-arrow {
    transform: rotate(180deg);
    color: #B22222;
}

.mobile-sub-list {
    list-style: none;
    background: #fafafa;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
}
.mobile-sub-list.open {
    max-height: 800px;
}

.mobile-sub-list > li > a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px 10px 30px;
    text-decoration: none;
    color: #666;
    font-size: 12px;
    font-weight: 500;
    border-bottom: 1px solid #efefef;
    transition: color 0.2s, background 0.2s;
}
.mobile-sub-list > li > a:hover {
    color: #B22222;
    background: #fff5f5;
}
.mobile-sub-list > li:last-child > a {
    border-bottom: none;
}

.mobile-sub-list > li > a img {
    height: 18px;
    width: 52px;
    object-fit: contain;
    object-position: center center;
    flex-shrink: 0;
}

.mobile-cta {
    padding: 20px 20px 8px;
}
.mobile-cta a {
    display: block;
    text-align: center;
    padding: 13px;
    background: #B22222;
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 1px;
    border-radius: 4px;
    transition: background 0.2s;
}
.mobile-cta a:hover {
    background: #8B0000;
}

/* RESPONSIVE */
@media (max-width: 991px) {
    .navbar-menu      { display: none; }
    .navbar-hamburger { display: flex; }
    .navbar-mobile    { display: flex; }
    .navbar-container { padding: 0 20px; }

    .navbar-mobile {
        position: fixed !important;
        top: 0 !important;
        right: -100% !important;
        left: auto !important;
        width: 82vw !important;
        max-width: 320px !important;
        height: 100dvh !important;
        background: #fff !important;
        border-radius: 18px 0 0 18px;
        overflow: hidden;
        z-index: 1000000001 !important;
    }

    .navbar-mobile.open {
        right: 0 !important;
    }

    .mobile-drawer-head {
        position: static !important;
        width: 100% !important;
        height: auto !important;
        padding: 18px 20px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        border-bottom: 1px solid #f0f0f0;
        background: #fff !important;
    }

    .mobile-drawer-head .mobile-logo img {
        height: 38px !important;
        width: auto !important;
        display: block;
    }

    .mobile-drawer-close {
        margin-left: auto;
    }

    .navbar-mobile-overlay {
        z-index: 1000000000 !important;
    }

    .navbar-mobile-overlay.open {
        display: block !important;
        opacity: 1 !important;
    }

    body.mlm-menu-open .mlm-navbar {
        visibility: hidden !important;
        pointer-events: none !important;
    }

    body.mlm-menu-open #mlmNavbar {
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;
        transition: none !important;
    }

    body.mlm-menu-open #mlmNavbar * {
        transition: none !important;
    }

    body.mlm-menu-open .joinchat,
    body.mlm-menu-open .wa__btn_popup,
    body.mlm-menu-open .whatsapp,
    body.mlm-menu-open .whatsapp-button,
    body.mlm-menu-open .floating-whatsapp,
    body.mlm-menu-open [class*="whatsapp"],
    body.mlm-menu-open [id*="whatsapp"] {
        display: none !important;
    }
}

@media (max-width: 480px) {
    .navbar-logo img { height: 40px; }
}

.mobile-products-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #f4f4f4;
}

.mobile-products-header > a {
    flex: 1;
    padding: 14px 22px;
    text-decoration: none;
    color: #222;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: .8px;
}

.mobile-products-arrow {
    width: 52px;
    height: 48px;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-products-arrow .mobile-arrow {
    width: 10px;
    height: 10px;
    transition: transform .3s;
}

#mobileProductsItem.is-open .mobile-products-arrow .mobile-arrow {
    transform: rotate(180deg);
}