/* ==========================================================================
   STANDALONE ISC MEGA MENU LAYOUT ENGINE (FIXED ALIGNMENT RESETS)
   ========================================================================== */
.isc-mega-header-wrapper {
    width: 100%;
    font-family: inherit;
    position: relative;
    z-index: 99999 !important; /* Forces total dominance over lower sections */
    box-sizing: border-box;
}

.isc-mega-header-wrapper *, 
.isc-mega-header-wrapper *::before, 
.isc-mega-header-wrapper *::after {
    box-sizing: border-box; /* Protects grid widths from theme padding breaks */
}

/* The true anchor container for the Mega Dropdown */
.isc-header-bar {
    display: flex;
    align-items: center; /* Perfect vertical alignment for logo, links, and search */
    justify-content: space-between;
    padding: 15px 30px;
    background-color: #ffffff;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    position: relative; /* Anchor point for full-width panels */
}

.isc-header-logo {
    display: flex;
    align-items: center;
}

.isc-header-logo a {
    display: inline-block;
    line-height: 0;
}

.isc-header-logo img {
    max-width: 160px;
    height: auto;
    display: block;
}

.isc-mobile-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    color: #333333;
    padding: 0;
}

/* --- THE NAVIGATION FLEXBAR --- */
.isc-header-nav {
    display: flex;
    align-items: center;
}

.isc-nav-list {
    list-style: none !important; /* Force overrides theme bullet injections */
    margin: 0 !important;
    padding: 0 !important;
    display: flex;
    gap: 30px;
    align-items: center;
}

/* DO NOT give position:relative here; allows mega menu to align to the outer header box */
.isc-nav-item {
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}

/* ONLY anchor classic small dropdowns to their text links */
.isc-nav-item.has-standard-dropdown {
    position: relative; 
}

.isc-nav-item > a {
    text-decoration: none !important;
    color: #333333;
    font-weight: 600;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 15px 0;
    transition: color 0.25s ease;
}

/* --- FIXED INLINE SEARCH BAR ALIGNMENT --- */
.isc-header-search {
    display: flex;
    align-items: center;
}

.isc-header-search form {
    display: flex;
    align-items: center;
    background: #f4f6f8;
    border-radius: 6px;
    padding: 4px 12px;
    border: 1px solid transparent;
    margin: 0;
}

.isc-header-search input {
    border: none !important;
    background: transparent !important;
    padding: 6px !important;
    outline: none !important;
    width: 220px;
    font-size: 14px;
    color: #333333;
    box-shadow: none !important;
}

.isc-header-search button {
    background: none !important;
    border: none !important;
    cursor: pointer;
    color: #666666;
    display: flex;
    align-items: center;
    padding: 0 !important;
    margin: 0 !important;
}

/* ==========================================================================
   DESKTOP OVERLAY VISUAL PLANE (ALIGNMENT CORRECTION FIXED HERE)
   ========================================================================== */
.isc-mega-dropdown {
    position: absolute;
    top: 100%; /* Sits flush under the white header bar line */
    left: 0;
    right: 0;
    width: 100%; /* Spans exactly across the header container bounds */
    background: #ffffff;
    box-shadow: 0 15px 40px rgba(0,0,0,0.12);
    opacity: 0;
    visibility: hidden;
    transform: translateY(15px);
    transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s;
    z-index: 100000 !important;
    padding: 40px 30px;
    border-top: 3px solid #0056b3;
    pointer-events: none;
}

/* Safe Activation Stage */
.isc-nav-item.has-mega-menu:hover .isc-mega-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

/* Multi-Column Alignment Architecture Grid */
.isc-mega-grid {
    display: flex;
    justify-content: flex-start;
    align-items: flex-start;
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto; /* Centers your content inside a safe standard reading row box */
}

.isc-mega-col {
    flex: 1;
    min-width: 200px;
    text-align: left; /* Guards column strings against global theme center alignments */
}

.isc-mega-col h4 {
    margin: 0 0 20px 0 !important;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #1a1a1a;
    font-weight: 700;
}

/* Clean Info Row Containers */
.isc-mega-link-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 20px;
}

.isc-mega-link-item:last-child {
    margin-bottom: 0;
}

.isc-mega-link-item a {
    text-decoration: none !important;
    color: #0056b3;
    font-weight: 600;
    font-size: 14px;
    display: inline-block;
    margin-bottom: 2px;
}

.isc-mega-link-item p {
    margin: 0 !important;
    font-size: 13px;
    color: #666666;
    line-height: 1.4;
}

/* Special Treatment for Knowledgebase list styles */
.isc-mega-learn .isc-mega-link-item a {
    color: #333333;
    font-weight: 500;
}

.isc-mega-learn .isc-mega-link-item a:hover {
    color: #0056b3;
}

.isc-view-all {
    display: inline-block;
    margin-top: 8px;
    color: #0056b3;
    font-weight: 700;
    text-decoration: none !important;
    font-size: 13px;
}

/* --- CLASSIC COMPACT DROPDOWN ENGINE --- */
.isc-standard-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: #ffffff;
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
    list-style: none !important;
    margin: 0 !important;
    padding: 10px 0 !important;
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.25s ease;
    border-top: 2px solid #0056b3;
}

.isc-nav-item.has-standard-dropdown:hover .isc-standard-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.isc-standard-dropdown-menu li {
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}

.isc-standard-dropdown-menu li a {
    display: block;
    padding: 10px 20px;
    text-decoration: none !important;
    color: #333333;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s ease;
    text-align: left;
}

.isc-standard-dropdown-menu li a:hover {
    background: #f4f6f8;
    color: #0056b3;
}

/* ==========================================================================
   RESPONSIVE MOBILE ENGINE (SMOOTH PUSH COMPRESSION CONTROLS)
   ========================================================================== */
@media (max-width: 991px) {
    .isc-header-bar {
        flex-wrap: wrap;
        padding: 15px 20px;
    }
    
    .isc-mobile-toggle {
        display: block;
    }

    .isc-header-search {
        display: none; /* Keeps navigation items clean on small viewport screens */
    }

    .isc-header-nav {
        width: 100%;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    }

    .isc-menu-active .isc-header-nav {
        max-height: 1500px; /* Expands smoothly and pushes page content downward */
    }

    .isc-nav-list {
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
        padding: 15px 0 0 0 !important;
    }

    .isc-nav-item {
        width: 100%;
        border-bottom: 1px solid #f0f0f0;
    }

    .isc-nav-item > a {
        padding: 14px 0;
        justify-content: space-between;
    }

    /* Convert desktop overhead layout cards to basic block items */
    .isc-mega-dropdown {
        position: static;
        width: 100%;
        transform: none !important;
        box-shadow: none;
        padding: 15px 10px;
        border-top: none;
        display: none;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        background: #fdfdfd;
    }

    .isc-nav-item.has-mega-menu:hover .isc-mega-dropdown {
        display: block;
    }

    .isc-mega-grid {
        flex-direction: column;
        gap: 25px;
    }
    
    .isc-mega-col h4 {
        margin-bottom: 12px !important;
        padding-bottom: 5px;
        border-bottom: 1px solid #eeeeee;
    }
}