/**
 * Nirja Mega Menu Frontend Styles
 */

/* =========================================================================
 * 1. MENU BADGE & ICON
 * ========================================================================= */
.nirja-nav-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    color: #ffffff;
    background-color: #f7941d;
    padding: 2px 7px;
    border-radius: 12px;
    line-height: 1.2;
    vertical-align: middle;
    margin-left: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.nirja-nav-icon {
    display: inline-block;
    vertical-align: middle;
    margin-right: 6px;
    font-size: 14px;
}

/* =========================================================================
 * 2. DESKTOP MEGA MENU POSITIONING & CONTAINER
 * ========================================================================= */
@media (min-width: 1025px) {

    /* Make sure parent header allows mega menu breakout */
    .nj-main-header,
    .nj-header-wrapper,
    .nj-main-header-inner,
    .elementor-widget-nj-hf-header,
    .nj-hf-header,
    #nj-hf-header,
    .site-header {
        position: relative !important;
    }

    /* Flatten all menu intermediate wrappers so mega menu calculates against header */
    .nj-header-col.nj-header-nav-col,
    .nj-header-desktop-nav,
    .nj-header-desktop-nav ul.nj-menu-list,
    .nj-header-desktop-nav ul.menu,
    .nj-header-desktop-nav > ul,
    .nj-header-desktop-nav ul.nj-menu-list > li.nirja-has-mega-menu,
    .nj-header-desktop-nav ul.menu > li.nirja-has-mega-menu,
    .nj-header-desktop-nav > ul > li.nirja-has-mega-menu,
    li.nirja-has-mega-menu {
        position: static !important;
    }

    /* Mega Dropdown Box - Hidden by default using display:none to prevent layout overflow */
    .nirja-mega-dropdown {
        display: none;
        position: absolute !important;
        top: 100% !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        background: #ffffff !important;
        border-radius: 14px !important;
        box-shadow: 0 20px 50px rgba(0, 0, 0, 0.16) !important;
        border: 1px solid rgba(0, 0, 0, 0.08) !important;
        padding: 28px 32px !important;
        z-index: 999999 !important;
        box-sizing: border-box !important;
    }

    /* Container Width (Default / Recommended - 1180px) */
    .nirja-mega-dropdown.nirja-mega-container {
        width: 1180px !important;
        max-width: calc(100vw - 40px) !important;
    }

    /* Full Width */
    .nirja-mega-dropdown.nirja-mega-full {
        width: 100vw !important;
        max-width: 100vw !important;
        border-radius: 0 0 14px 14px !important;
    }

    /* Custom Width */
    .nirja-mega-dropdown.nirja-mega-custom {
        max-width: calc(100vw - 40px) !important;
    }

    /* Hover & Active Display State */
    li.nirja-has-mega-menu:hover > .nirja-mega-dropdown,
    li.nirja-has-mega-menu:focus-within > .nirja-mega-dropdown {
        display: block !important;
        animation: nirjaMegaFade 0.25s cubic-bezier(0.165, 0.84, 0.44, 1) forwards;
    }

    @keyframes nirjaMegaFade {
        from {
            opacity: 0;
            margin-top: 10px;
        }
        to {
            opacity: 1;
            margin-top: 0;
        }
    }

    /* Hide standard sub-menu if mega menu is active */
    li.nirja-has-mega-menu > ul.sub-menu {
        display: none !important;
    }
}

/* =========================================================================
 * 3. INNER ELEMENTOR CONTENT TWEAKS
 * ========================================================================= */
.nirja-mega-content {
    width: 100%;
}

.nirja-mega-content .elementor-section {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

.nirja-mega-content a {
    text-decoration: none;
}

/* =========================================================================
 * 4. MOBILE DRAWER COMPATIBILITY (<= 1024px)
 * ========================================================================= */
@media (max-width: 1024px) {
    .nirja-mega-dropdown {
        position: static !important;
        width: 100% !important;
        max-width: 100% !important;
        transform: none !important;
        box-shadow: none !important;
        border: none !important;
        background: #f8fafc;
        border-radius: 8px;
        padding: 16px 12px;
        margin-top: 10px;
        display: none;
    }

    li.nirja-has-mega-menu.nj-mobile-open > .nirja-mega-dropdown {
        display: block;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }
}
