/* Navigation System v2.0 */


.main-navigation {
    background: var(--color-primary, #D32F2F);
    position: relative;
    overflow: visible;
}

.main-navigation .container {
    position: relative;
}

.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    align-items: center;
    flex-wrap: nowrap;
}

.nav-item {
    position: relative;
    white-space: nowrap;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    color: white;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
}

.nav-link.is-active {
    background: rgba(255, 255, 255, 0.14);
    border-bottom-color: rgba(255, 255, 255, 0.6);
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    border-bottom-color: rgba(255, 255, 255, 0.3);
}

.nav-link i {
    margin-right: 8px;
    font-size: 16px;
}


.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    min-width: 220px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-radius: 6px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1001;
    overflow: hidden;
    border-top: 3px solid var(--color-primary, #D32F2F);
}

.nav-item:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu li {
    list-style: none;
}

.dropdown-menu li a {
    display: block;
    padding: 12px 20px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
    border-bottom: 1px solid #f0f0f0;
}

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

.dropdown-menu li a:hover {
    background: #f8f9fa;
    color: var(--color-primary, #D32F2F);
    padding-left: 25px;
}

.dropdown-menu li a.is-active {
    background: var(--color-primary-50, #FFEBEE);
    color: var(--color-primary, #D32F2F);
    font-weight: 600;
}

/* Desktop dropdown arrows - hidden by default */
.arr-d {
    display: none;
}


.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 12px;
    border-radius: 4px;
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1002;
    transition: all 0.3s ease;
    min-width: 44px;
    min-height: 44px;
}

.hamburger-line {
    display: block;
    width: 22px;
    height: 3px;
    background: #333;
    margin: 3px 0;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.mobile-menu-toggle:hover .hamburger-line {
    background: var(--color-primary, #D32F2F);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
    background: white;
}

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

.mobile-menu-toggle.active .hamburger-line:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
    background: white;
}


.navigation-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(2px);
}

.navigation-backdrop.active {
    opacity: 1;
    visibility: visible;
}


@media (max-width: 768px) {
    
    .mobile-menu-toggle {
        display: block;
    }
    

    .search-container {
        display: none;
    }
    

    .main-navigation {
        display: none !important;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: var(--color-primary, #D32F2F);
        z-index: 1000;
        overflow-y: auto;
        padding-top: 80px;
    }
    

    .main-navigation.mobile-open {
        display: block !important;
    }
    

    .nav-menu {
        flex-direction: column;
        align-items: stretch;
        padding: 20px 0;
    }
    

    .menu-header {
        display: block;
        padding: 20px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.2);
        text-align: center;
    }
    
    .menu-header .home-logo a {
        color: white;
        text-decoration: none;
        font-size: 18px;
        font-weight: bold;
    }
    
    .close-button {
        position: absolute;
        right: 20px;
        top: 20px;
        color: white;
        font-size: 24px;
        cursor: pointer;
        padding: 10px;
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    

    .nav-item {
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        position: relative;
    }
    
    .nav-link {
        padding: 16px 20px;
        border-bottom: none;
        justify-content: flex-start;
    }
    
    .nav-link:hover {
        background: rgba(255, 255, 255, 0.1);
        border-bottom: none;
    }

    .nav-link.is-active {
        background: rgba(255, 255, 255, 0.12);
        border-left: 3px solid rgba(255, 255, 255, 0.6);
    }
    

    .has-dropdown .arr-d {
        display: block;
        position: absolute;
        right: 20px;
        top: 50%;
        transform: translateY(-50%);
        color: white;
        cursor: pointer;
        font-size: 12px;
        padding: 12px;
        min-width: 44px;
        min-height: 44px;
        transition: transform 0.3s ease;
    }
    
    .has-dropdown .arr-d:hover {
        color: rgba(255, 255, 255, 0.8);
    }
    
    .has-dropdown .arr-d.active {
        transform: translateY(-50%) rotate(180deg);
        border: 1px solid;
        border-radius: 50px;
    }
    

    .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        background: rgba(255, 255, 255, 0.1);
        border-radius: 0;
        border-top: none;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
        margin-left: 20px;
        border-left: 3px solid rgba(255, 255, 255, 0.3);
    }
    
    .has-dropdown.dropdown-open .dropdown-menu {
        max-height: 300px !important;
        display: block !important;
    }
    
    .dropdown-menu li a {
        color: white;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        padding: 12px 20px;
        font-size: 14px;
    }
    
    .dropdown-menu li a:hover {
        background: rgba(255, 255, 255, 0.1);
        color: white;
        padding-left: 25px;
    }

    .dropdown-menu li a.is-active {
        background: rgba(255, 255, 255, 0.12);
        color: #fff;
        font-weight: 700;
    }
    
    .dropdown-menu li:last-child a {
        border-bottom: none;
    }
    

    body.navigation-open {
        overflow: hidden;
    }
}


@media (max-width: 480px) {
    .mobile-menu-toggle {
        right: 15px;
    }
    
    .nav-link {
        padding: 14px 15px;
    }
    
    .dropdown-menu {
        margin-left: 15px;
    }
    
    .has-dropdown .arr-d {
        right: 15px;
        z-index: 1002;
    }
}

@media (max-width: 360px) {
    .mobile-menu-toggle {
        right: 10px;
    }
    
    .nav-link {
        padding: 12px 12px;
        font-size: 13px;
    }
    
    .dropdown-menu {
        margin-left: 12px;
    }
    
    .dropdown-menu li a {
        padding: 10px 15px;
        font-size: 13px;
    }
    
    .has-dropdown .arr-d {
        right: 12px;
    }
}


.dsp-mobile {
    display: none;
}

@media (max-width: 768px) {
    .dsp-mobile {
        display: block;
    }
}

.xl-hidden {
    display: none;
}

@media (max-width: 768px) {
    .xl-hidden {
        display: inline-block;
    }
}


.nav-link:focus,
.mobile-menu-toggle:focus,
.arr-d:focus {
    outline: 2px solid rgba(255, 255, 255, 0.8);
    outline-offset: 2px;
}

.dropdown-menu li a:focus {
    outline: 2px solid var(--color-primary, #D32F2F);
    outline-offset: -2px;
}


@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

.dropdown-menu {
    animation: slideDown 0.3s ease;
}

@media (max-width: 768px) {
    .main-navigation.mobile-open {
        animation: slideDown 0.3s ease;
    }
}

/* Desktop override to keep main navigation sticky (aligns with Nebula Prime pattern) */
@media (min-width: 769px) {
    .main-navigation {
        position: -webkit-sticky !important;
        position: sticky !important;
        top: 0 !important;
        width: 100% !important;
        z-index: 1000 !important;
        display: block !important;
    }
}
