/* =================================================================
   NYUMBANI NAV SYSTEM (ISOLATED)
   Targeting #nmp-nav-system ensures theme styles are overridden.
   ================================================================= */

/* 1. CONTAINER & RESET */
#nmp-nav-system {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    height: 100%;
    flex-grow: 1;
    font-family: 'Helvetica Neue', Arial, sans-serif;
}

#nmp-nav-system ul,
#nmp-nav-system li,
#nmp-nav-system a {
    margin: 0;
    padding: 0;
    list-style: none;
    text-decoration: none;
    box-sizing: border-box;
    border: none;
    background: transparent;
    line-height: 1;
}

/* 2. TOP LEVEL ITEMS */
#nmp-nav-system .nmp-menu-ul {
    display: flex;
    gap: 35px;
    height: 100%;
    align-items: center;
}

#nmp-nav-system .nmp-menu-ul > li {
    height: 100%;
    display: flex;
    align-items: center;
    position: relative;
    /* Important for hover targeting */
}

/* Link Styling (Force White) */
#nmp-nav-system .nmp-menu-ul > li > a {
    color: #ffffff !important;
    font-weight: 700 !important;
    font-size: 0.95rem !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    padding: 0 10px;
    position: relative;
    display: flex;
    align-items: center;
    height: 100%;
    transition: color 0.3s ease;
}

/* Hover State */
#nmp-nav-system .nmp-menu-ul > li:hover > a {
    color: #f90403 !important; /* Primary Red */
}

/* Active Underline */
#nmp-nav-system .nmp-menu-ul > li > a::after {
    content: '';
    position: absolute;
    bottom: 30px;
    left: 0;
    width: 0%;
    height: 3px;
    background: #f90403;
    transition: width 0.3s ease-in-out;
}

#nmp-nav-system .nmp-menu-ul > li:hover > a::after {
    width: 100%;
}

/* 3. SMOOTH SUBMENU SYSTEM */
/* Instead of display:none, we use visibility/opacity for smooth transitions */

#nmp-nav-system .nmp-submenu {
    /* Layout & Positioning */
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 240px;
    background: #000;
    z-index: 9999;
    padding: 15px 0;
    border-top: 3px solid #f90403;
    box-shadow: 0 20px 50px rgba(0,0,0,0.8);
    
    /* INITIAL STATE (Hidden) */
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px); /* Start 20px lower */
    
    /* SMOOTH TRANSITION */
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    pointer-events: none; /* Cannot click when hidden */
    
    /* Ensure Layout exists */
    display: block; 
}

/* HOVER STATE (Show) */
#nmp-nav-system li:hover > .nmp-submenu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0); /* Slide up to position */
    pointer-events: auto;
}

/* Standard Submenu Items */
#nmp-nav-system .nmp-submenu li a {
    display: block;
    color: #ccc !important;
    padding: 12px 25px;
    font-size: 0.9rem !important;
    font-weight: 400 !important;
    text-transform: none !important;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    transition: all 0.2s ease;
}

#nmp-nav-system .nmp-submenu li a:hover {
    color: #fff !important;
    background: rgba(255,255,255,0.05);
    padding-left: 30px; /* Slight slide right */
    border-left: 3px solid #f90403;
}

/* 4. MEGA GRID OVERRIDE (Smooth) */

#nmp-nav-system .nmp-submenu.nmp-mega-grid {
    /* Dimensions */
    width: 900px;
    max-width: 90vw;
    left: 50%;
    
    /* Grid Layout */
    display: grid; /* Always grid layout */
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    padding: 30px;
    background: rgba(5,5,5,0.98); /* Cinematic Dark */
    
    /* Hiding Logic Overrides (Must account for centering) */
    transform: translateX(-50%) translateY(20px); 
}

/* Mega Menu Hover State */
#nmp-nav-system li:hover > .nmp-submenu.nmp-mega-grid {
    transform: translateX(-50%) translateY(0); /* Keep centered + slide up */
}

/* Mega Item Styling */
#nmp-nav-system .nmp-mega-grid li a {
    display: flex;
    flex-direction: column;
    padding: 15px;
    border: 1px solid transparent;
    border-radius: 6px;
    height: 100%;
    transition: transform 0.3s ease, background 0.3s ease;
}

#nmp-nav-system .nmp-mega-grid li a:hover {
    background: rgba(255,255,255,0.05);
    padding: 15px; /* No slide padding for grid items */
    border-color: rgba(255,255,255,0.1);
    transform: translateY(-5px); /* Lift Card */
}

/* Mega Content */
#nmp-nav-system .nmp-mm-img {
    width: 100%;
    height: 120px;
    background-size: cover;
    background-position: center;
    border-radius: 4px;
    margin-bottom: 12px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    transition: box-shadow 0.3s ease;
}

#nmp-nav-system li a:hover .nmp-mm-img {
    box-shadow: 0 8px 25px rgba(249, 4, 3, 0.2); /* Red Glow */
}

#nmp-nav-system .nmp-mm-title {
    color: #fff !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    font-size: 1rem !important;
    margin-bottom: 6px;
    display: block;
    transition: color 0.3s;
}

#nmp-nav-system .nmp-mm-desc {
    color: #888 !important;
    font-size: 0.85rem !important;
    line-height: 1.4;
    display: block;
}

#nmp-nav-system li a:hover .nmp-mm-title { color: #f90403 !important; }

/* 5. MOBILE TOGGLE & RESPONSIVENESS */
#nmp-mobile-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    flex-direction: column;
    gap: 6px;
    z-index: 10001;
    padding: 10px;
}

.nmp-bar { width: 30px; height: 3px; background: #fff; display: block; transition: 0.3s; }

/* Hamburger Animation */
#nmp-mobile-toggle.active .nmp-bar:nth-child(1) { transform: rotate(45deg) translate(5px, 6px); }
#nmp-mobile-toggle.active .nmp-bar:nth-child(2) { opacity: 0; }
#nmp-mobile-toggle.active .nmp-bar:nth-child(3) { transform: rotate(-45deg) translate(5px, -6px); }

@media (max-width: 992px) {
    #nmp-mobile-toggle { display: flex; }
    
    #nmp-nav-system .nmp-main-nav {
        position: fixed;
        top: 0; right: -100%;
        width: 85%; max-width: 320px; height: 100vh;
        background: #000;
        padding-top: 80px;
        transition: right 0.4s cubic-bezier(0.77, 0, 0.175, 1);
        box-shadow: -10px 0 50px rgba(0,0,0,0.8);
        z-index: 10000;
    }

    #nmp-nav-system.nmp-mobile-open .nmp-main-nav { right: 0; }

    #nmp-nav-system .nmp-menu-ul {
        flex-direction: column;
        align-items: flex-start;
        height: auto;
        gap: 0;
    }

    #nmp-nav-system .nmp-menu-ul > li {
        width: 100%;
        height: auto;
        display: block;
        border-bottom: 1px solid #1a1a1a;
    }

    #nmp-nav-system .nmp-menu-ul > li > a {
        padding: 20px;
        width: 100%;
        color: #fff !important;
        font-size: 1.1rem !important;
    }

    /* Mobile Reset for Submenus (No fancy transitions) */
    #nmp-nav-system .nmp-submenu.nmp-mega-grid,
    #nmp-nav-system .nmp-submenu {
        position: static;
        width: 100%;
        max-width: 100%;
        opacity: 1; /* Always visible in logic flow */
        visibility: visible;
        display: none; /* Toggle display instead */
        transform: none;
        box-shadow: none;
        background: #0a0a0a;
        grid-template-columns: 1fr;
        padding: 0;
        border-top: none;
        pointer-events: auto;
    }

    #nmp-nav-system li:hover > .nmp-submenu,
    #nmp-nav-system li:hover > .nmp-submenu.nmp-mega-grid {
        display: block; /* Vertical stack */
        transform: none;
    }
    
    #nmp-nav-system .nmp-mm-img { display: none; } /* Simplified mobile view */
}