/* --- 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;
    }
}
/* FORCE HIDE ON MOBILE INITIAL STATE *
@media screen and (max-width: 991px) {
    /* Hide the mega menu panel entirely by default on mobile *
    .n2s-mega-menu {
        display: none !important; 
        visibility: hidden !important;
        opacity: 0 !important;
        height: 0;
        overflow: hidden;
    }

    /* Show only when the parent nav-item is toggled/active */
    /* Note: Check if your theme adds a class like '.open' or '.active' to the li *
    .nav-item.active .n2s-mega-menu,
    .nav-item.open .n2s-mega-menu {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        height: auto;
        overflow: visible;
    }

    /* Right Panel Tab Contents (Accordion items) *
    .n2s-content {
        display: none !important; /* Keep hidden until JS toggles it *
    }
    
    .n2s-content.mobile-expanded {
        display: block !important;
    }
}*/

@media screen and (max-width: 991px) {
    /* FORCE HIDE: Use a very specific selector to override your theme */
    .n2s-dropdown-wrapper .n2s-mega-menu {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        position: relative !important;
        width: 100% !important;
        height: 0 !important;
        overflow: hidden !important;
    }

    /* SHOW ONLY ON CLICK: This class will be added by JS */
    .n2s-dropdown-wrapper .n2s-mega-menu.n2s-mobile-show {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        height: auto !important;
        overflow: visible !important;
    }

    /* Ensure sub-content starts hidden inside the menu */
    .n2s-mega-menu.n2s-mobile-show .n2s-content {
        display: none !important;
    }

    /* Show sub-content when the + is clicked */
    .n2s-mega-menu.n2s-mobile-show .n2s-content.mobile-expanded {
        display: block !important;
    }
}
/* 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-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;
    }
}


/* ✅ FINAL MOBILE OVERRIDE */
@media screen and (max-width: 991px) {

  /* show Services link so it can be clicked */
  .n2s-main-link {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    width: 100%;
  }

  /* hide mega menu by default */
  .n2s-dropdown-wrapper .n2s-mega-menu {
    display: none !important;
    position: static !important;
    width: 100% !important;
    box-shadow: none !important;
    border-top: none !important;
    flex-direction: column !important;
  }

  /* show when JS toggles */
  .n2s-dropdown-wrapper .n2s-mega-menu.n2s-mobile-show {
    display: block !important;
  }

  /* accordion behavior */
  .n2s-content {
    display: none !important;
  }

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

  .mobile-toggle {
    display: inline-block !important;
  }
}

/* ✅ FIX: Scroll inside mobile menu (not page) */
@media (max-width: 991.98px) {
  .navbar-collapse.show {
    max-height: calc(100vh - 90px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* ✅ FIX: Services link align like other nav links */
@media (max-width: 991.98px) {
  .navbar-nav .nav-link {
    padding: 12px 0 !important;
  }

  .n2s-main-link {
    padding: 12px 0 !important;
    margin: 0 !important;
    width: 100% !important;
    display: flex !important;
    justify-content: space-between;
    align-items: center;
  }
}

/* ✅ Optional: make mega menu look clean on mobile */
@media (max-width: 991.98px) {
  .n2s-dropdown-wrapper .n2s-mega-menu.n2s-mobile-show {
    width: 100% !important;
    border-radius: 10px;
  }
}
/* ✅ FIX: Remove big white gap inside Services on mobile */
@media (max-width: 991.98px) {

  /* Right panel should NOT reserve space on mobile */
  .n2s-right-panel {
    min-height: auto !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
  }

  /* Also remove extra padding from mega menu container */
  .n2s-mega-menu.n2s-mobile-show {
    padding: 0 !important;
  }

  /* Put tab contents directly below tabs */
  .n2s-content {
    margin: 0 !important;
    width: 100% !important;
  }

  /* Improve spacing when expanded */
  .n2s-content.mobile-expanded {
    padding: 12px 12px !important;
    background: #fff !important;
    border-top: 1px solid #eee;
  }
}

