/* --- Net2Secure Main Wrapper & Link --- */
.n2s-dropdown-wrapper {
    position: relative; /* Essential for alignment */
    display: inline-block;
    font-family: 'Segoe UI', sans-serif;
}

.n2s-main-link {
    text-decoration: none;
    color: #333;
    font-weight: 600;
    padding: 15px 20px;
    display: block;
    font-size: 16px;
    cursor: pointer;
}

.n2s-main-link i {
    font-size: 12px;
    margin-left: 5px;
    color: #2c8f28; /* Net2Secure Green */
}

/* --- The Mega Menu Panel (Hidden by default) --- 
.n2s-mega-menu {
    display: none; /* KEY FIX: Hides menu initially 
    position: absolute; /* KEY FIX: Floats over content 
    top: 100%; /* Positions it right below the 'Services' text 
    left: 0;
    width: 900px; /* Fixed width for the panel 
    background: #fff;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    border-top: 3px solid #2c8f28;
    z-index: 9999; /* Ensures it sits on top of everything *
    flex-direction: row;
}

/* DESKTOP POSITION FIX */
.n2s-mega-menu {
    display: none;
    position: absolute;
    top: 100%;
    /* Pulls the menu to the left so the right side stays on screen */
    right: -500px;
    width: 950px;
    background: #fff;
    z-index: 9999;
    flex-direction: row;
    border-top: 3px solid #f07c33;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

/* Ensure links look like the original design */
.n2s-item-link {
    text-decoration: none;
    color: inherit;
    display: block;
    transition: transform 0.2s;
}

.n2s-item-link:hover {
    transform: translateX(5px);
}

/* MOBILE FIXES */
@media screen and (max-width: 991px) {
    .n2s-mega-menu {
        position: static;
        width: 100% !important;
        display: block !important; /* Keep container block */
        box-shadow: none;
        overflow: visible !important; /* Allows page scrolling */
    }

    /* Fix: Hide contents by default on mobile so it's not "already open" */
    .n2s-content {
        display: none !important;
        height: auto !important;
        max-height: none !important;
        overflow: visible !important; /* Fixes the scroll issue */
    }

    .n2s-content.mobile-expanded {
        display: block !important;
    }

    .n2s-right-panel {
        background: transparent;
        min-height: auto;
    }
}
/* 1. Hide the panel by default 
.n2s-mega-menu {
    display: flex;             /* Keep flex so internal layout works 
    visibility: hidden;        /* Hide it from view 
    opacity: 0;               /* Make it transparent 
    position: absolute;
    top: 100%;
    left: 0;
    transition: all 0.3s ease; /* Smooth fade in 
    z-index: 9999;
    pointer-events: none;      /* Prevent accidental clicks when hidden */

    /* Look and feel from your screenshots 
    background: #ffffff;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border-top: 3px solid #2c8f28;
    width: 900px;
}
.nav-item:hover .n2s-mega-menu {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;      /* Re-enable clicks when visible 
}

/* 3. Ensure the parent container doesn't cut off the menu 
.nav-item.contain-sub-1 {
    position: relative !important;
    overflow: visible !important;
}

/* --- Left Panel (Tabs) --- */
.n2s-left-panel {
    width: 250px; /* Fixed width */
    background: #fff;
    border-right: 1px solid #eee;
    flex-shrink: 0;
}

.n2s-left-panel ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.n2s-left-panel li.n2s-tab {
    padding: 15px 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    color: #333;
    border-left: 4px solid transparent;
    transition: all 0.2s;
    font-size: 14px;
}

.n2s-left-panel li.n2s-tab i {
    width: 20px;
    text-align: center;
    color: #666;
}

.n2s-left-panel li.n2s-tab.active,
.n2s-left-panel li.n2s-tab:hover {
    background: #ff9f62;
    border-left: 4px solid #f07c33;
    color: #000;
}

.mobile-toggle { display: none; }

/* --- Right Panel (Content) --- */
.n2s-right-panel {
    flex-grow: 1;
    background: #ffebdf;
    padding: 30px;
    min-height: 400px;
}

.n2s-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.n2s-content.active {
    display: block;
}

/* --- Grid Items --- */
.n2s-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
}

.n2s-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.n2s-item i {
    font-size: 20px;
    color: #222;
    margin-top: 3px;
}

.n2s-item h4 {
    margin: 0 0 4px 0;
    font-size: 14px;
    font-weight: 700;
    color: #222;
}

.n2s-item p {
    margin: 0;
    font-size: 12px;
    color: #666;
    line-height: 1.4;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- DESKTOP HOVER LOGIC --- */
@media screen and (min-width: 992px) {
    /* Show menu when hovering over the Wrapper */
    .n2s-dropdown-wrapper:hover .n2s-mega-menu {
        display: flex;
    }
}

/* --- MOBILE RESPONSIVENESS --- */
@media screen and (max-width: 991px) {
    .n2s-dropdown-wrapper {
        display: block;
        width: 100%;
    }
    
    .n2s-main-link {
        display: none; /* Hide main trigger link on mobile if integrated into existing menu */
    }

    .n2s-mega-menu {
        position: static; /* No floating on mobile */
        width: 100%;
        display: flex; /* Always visible in flow (or controlled by JS) */
        flex-direction: column;
        box-shadow: none;
        border-top: none;
    }

    .n2s-left-panel {
        width: 100%;
        border-right: none;
    }

    .n2s-left-panel li.n2s-tab {
        justify-content: space-between;
        border-bottom: 1px solid #eee;
        border-left: none;
    }

    .mobile-toggle {
        display: block;
        font-size: 18px;
        color: #f07c33;
    }

    .n2s-right-panel {
        padding: 0;
        background: #fff;
    }

    .n2s-content {
        display: none !important;
        padding: 15px;
        background: #f9f9f9;
        border-bottom: 1px solid #ddd;
    }

    .n2s-content.mobile-expanded {
        display: block !important;
    }

    .n2s-grid {
        grid-template-columns: 1fr;
    }
}
