/* ============================================
   MEGA MENU - EXACT CODE FROM PREVIEW
   Copied from https://salesnexus.com/preview/?v=3#
   December 1, 2025
   ============================================ */

/* Navigation Menu Base Styles */
nav {
    display: flex;
    align-items: center;
    gap: 10px;
}

nav ul {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 5px;
    margin: 0;
}

nav ul li {
    position: relative !important;
}

nav ul li > a {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 10px 16px;
    color: #142033;
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

nav ul li > a:hover {
    background: #f6f9fc;
    color: #246db5;
}

nav ul li > a .arrow {
    font-size: 10px;
    margin-left: 2px;
    transition: transform 0.2s ease;
}

nav ul li:hover > a .arrow {
    transform: rotate(180deg);
}

/* Dropdown Menu - FIXED: Centered to prevent overflow */
.dropdown {
    position: absolute !important;
    top: 100%;
    /* FIX: Center dropdown under menu item */
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 20px;
    margin-top: 8px;
    border: 1px solid #e6ecf3;
    z-index: 9999;
}

nav ul li:hover .dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* Multi-column layout for Products dropdown */
.dropdown-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    min-width: 750px;
    max-width: 850px; /* Prevent excessive width */
}

.dropdown-section {
    display: block;
    background: white;
    border-radius: 8px;
    padding: 12px;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 12px;
}

.dropdown-section:not(:last-child) {
    border-bottom: none;
}

.dropdown-section > a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    color: #142033;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s ease;
    border-radius: 8px;
    margin-bottom: 8px;
}

.dropdown-section > a:hover {
    background: #f6f9fc;
    color: #246db5;
}

.dropdown-section > a .icon {
    font-size: 18px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #246db5, #0e4f8c);
    color: white;
    border-radius: 6px;
    flex-shrink: 0;
}

.dropdown-submenu {
    padding-left: 0;
    margin-top: 4px;
    display: block;
    width: 100%;
}

.dropdown-submenu a {
    display: block;
    padding: 12px 10px;
    font-size: 14px;
    width: 100%;
    box-sizing: border-box;
    margin: 0;
    color: #142033;
    text-decoration: none;
    transition: all 0.2s ease;
}

.dropdown-submenu a:hover {
    color: #246db5;
    background: #f6f9fc;
}

.badge {
    display: inline-block;
    padding: 2px 8px;
    background: linear-gradient(135deg, #E85124, #ff6b3d);
    color: white;
    font-size: 11px;
    font-weight: 700;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-left: 8px;
}

/* Mobile CTA Wrapper */
.mobile-cta-wrapper {
    display: none; /* Hidden on desktop */
}

/* Tablet & Mobile Styles */
@media (max-width: 1024px) {
    /* Hide desktop nav items, show mobile toggle */
    nav > ul {
        display: none;
    }

    /* Mobile menu overlay */
    nav {
        position: static;
    }

    nav.active > ul {
        display: flex;
        position: fixed;
        top: 80px;
        left: 0;
        right: 0;
        bottom: 0;
        background: white;
        overflow-y: auto;
        z-index: 999;
        box-shadow: 2px 0 8px rgba(0,0,0,0.1);
        flex-direction: column;
        align-items: stretch;
        padding: 20px;
        padding-bottom: 20px;
        gap: 0;
    }

    /* Show mobile CTA wrapper */
    nav.active > ul > .mobile-cta-wrapper {
        display: block;
        margin-top: 20px;
        padding-top: 20px;
        border-top: 2px solid #e6ecf3;
        border-bottom: none;
    }

    nav ul li {
        border-bottom: 1px solid #e6ecf3;
    }

    nav ul li:last-child {
        border-bottom: none;
    }

    nav ul li > a {
        padding: 16px 12px;
        font-size: 16px;
        justify-content: space-between;
        width: 100%;
    }

    /* Mobile Dropdown - FIXED: Full width, no wasted space */
    .dropdown {
        position: static;
        opacity: 1;
        visibility: visible;
        max-height: 0;
        overflow: hidden;
        transform: none;
        box-shadow: none;
        border: none;
        padding: 0;
        margin: 0;
        transition: max-height 0.4s ease, padding 0.3s ease;
        background: #f6f9fc;
        border-radius: 0;
        /* FIX: Use full width */
        width: 100% !important;
        left: auto !important;
        right: auto !important;
    }

    nav.active ul li.dropdown-open .dropdown {
        max-height: 3000px;
        padding: 16px 0;  /* Remove horizontal padding */
        margin-bottom: 8px;
    }

    /* Disable hover on mobile */
    nav.active ul li:hover .dropdown {
        max-height: 0;
    }

    nav.active ul li.dropdown-open:hover .dropdown {
        max-height: 3000px;
    }

    /* Mobile: Disable grid, use simple vertical stack */
    .dropdown-grid {
        display: block !important;
        grid-template-columns: none !important;
        gap: 0;
        min-width: auto;
    }

    .dropdown-section {
        background: white;
        border-radius: 8px;
        padding: 12px;
    }

    .dropdown-section > a {
        padding: 12px;
        font-size: 15px;
        margin-bottom: 8px;
    }

    .dropdown-submenu a {
        padding: 10px 12px;
        font-size: 14px;
    }

    /* Mobile CTA Buttons */
    .mobile-cta-wrapper .cta-buttons {
        flex-direction: column;
        width: 100%;
        padding: 0;
        margin: 0;
        gap: 12px;
    }

    .mobile-cta-wrapper .btn {
        width: 100%;
        text-align: center;
        padding: 14px 20px;
        font-size: 15px;
        margin-left: 0;
    }
}

/* Mobile Portrait: 320px - 480px */
@media (max-width: 480px) {
    /* Mobile dropdown adjustments */
    .dropdown-section > a {
        font-size: 14px;
        padding: 12px 10px; /* Increased from 10px for better tap target */
    }

    .dropdown-section > a .icon {
        font-size: 16px;
        width: 24px;
        height: 24px;
    }

    .dropdown-submenu a {
        font-size: 13px; /* Increased from 12px for readability */
        padding: 12px 10px; /* Increased from 8px for 44px minimum tap target */
    }

    .badge {
        font-size: 9px;
        padding: 2px 6px;
    }

    /* Mobile Submenu Fix: Prevent left overflow, use full width */
    .dropdown-submenu a {
        margin-left: 0; /* Remove the 8px left margin */
        padding-left: 20px; /* Indent from left edge */
        width: 100%; /* Use full width */
        box-sizing: border-box;
    }

    .dropdown-section {
        width: 100%;
        margin: 0;
        padding: 12px;
    }

    .dropdown {
        width: calc(100% - 24px); /* Full width minus padding */
        max-width: none;
        left: 12px;
        right: 12px;
        margin: 0;
    }
}

/* Mobile Landscape: 568px - 812px (phones in landscape) */
@media (min-width: 481px) and (max-width: 812px) and (orientation: landscape) {
    /* Compact dropdown for landscape */
    .dropdown-grid {
        gap: 12px;
    }

    .dropdown-section {
        padding: 8px;
    }

    .dropdown-section > a {
        padding: 8px 10px;
        font-size: 13px;
        margin-bottom: 6px;
    }

    .dropdown-submenu a {
        padding: 5px 10px;
        font-size: 12px;
    }
}

/* Tablet Portrait: 600px - 768px */
@media (min-width: 600px) and (max-width: 768px) and (orientation: portrait) {
    .dropdown-section {
        padding: 12px;
    }

    .dropdown-section > a {
        font-size: 14px;
    }

    .dropdown-submenu a {
        font-size: 13px;
    }
}
/* ============================================
   RESOURCES DROPDOWN STYLING - VERSION 2
   Updated: December 1, 2025
   Higher specificity to override defaults
   ============================================ */

/* Target Resources dropdown specifically with higher specificity */
.site-header .main-navigation > ul > li .dropdown {
    position: absolute !important;
    top: 100% !important;
    left: 50% !important;
    transform: translateX(-50%) translateY(-10px) !important;
    
    /* Styling */
    background: white !important;
    border-radius: 12px !important;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15) !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    padding: 16px !important;
    margin-top: 8px !important;
    border: 1px solid #e6ecf3 !important;
    z-index: 9999 !important;
    
    min-width: 220px !important;
    width: auto !important;
}

/* Show dropdown on parent hover - higher specificity */
.site-header .main-navigation > ul > li:hover .dropdown {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateX(-50%) translateY(0) !important;
}

/* Style each dropdown section */
.site-header .main-navigation .dropdown .dropdown-section {
    padding: 0 !important;
    margin: 0 !important;
    list-style: none !important;
}

/* Style the dropdown links with higher specificity */
.site-header .main-navigation .dropdown .dropdown-section a {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 12px 16px !important;
    color: #142033 !important;
    text-decoration: none !important;
    font-weight: 500 !important;
    font-size: 14px !important;
    transition: all 0.2s ease !important;
    border-radius: 8px !important;
    margin-bottom: 4px !important;
}

.site-header .main-navigation .dropdown .dropdown-section a:hover {
    background: #f6f9fc !important;
    color: #246db5 !important;
}

.site-header .main-navigation .dropdown .dropdown-section:last-child a {
    margin-bottom: 0 !important;
}

/* Responsive: Stack on mobile/tablet */
@media (max-width: 1024px) {
    .site-header .main-navigation > ul > li .dropdown {
        left: 20px !important;
        right: 20px !important;
        transform: translateX(0) translateY(-10px) !important;
        width: calc(100% - 40px) !important;
    }
    
    .site-header .main-navigation > ul > li:hover .dropdown {
        transform: translateX(0) translateY(0) !important;
    }
}
/* ============================================
   MOBILE MENU FIX - VERSION 2
   Updated: December 1, 2025
   Fix display: none issue with WordPress menu
   ============================================ */

/* Force WordPress primary menu to display when mobile panel is active */
.site-header .mobile-menu-panel.active .mobile-navigation #menu-primary-1,
.site-header .mobile-menu-panel.active .mobile-navigation .menu-primary-container > ul,
.site-header .mobile-menu-panel.active .mobile-navigation .mobile-menu-list,
.site-header .mobile-menu-panel.active .mobile-navigation nav > ul {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Target WordPress default menu classes */
.site-header .mobile-menu-panel.active .menu,
.site-header .mobile-menu-panel.active #menu-primary-1,
.site-header .mobile-menu-panel.active .menu-primary-container {
    display: block !important;
}

/* Ensure all list items are visible */
.site-header .mobile-menu-panel.active .mobile-navigation ul li {
    display: list-item !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Ensure all links are visible with proper color */
.site-header .mobile-menu-panel.active .mobile-navigation ul li a {
    display: block !important;
    visibility: visible !important;
    color: #3d3d3d !important;
}

/* Make absolutely sure the navigation container is visible */
.site-header .mobile-menu-panel.active .mobile-navigation {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Force override any conflicting display:none rules */
.mobile-menu-panel.active nav ul {
    display: block !important;
}
/* ============================================
   RESOURCES DROPDOWN HOVER FIX
   Added: December 1, 2025
   Ensure hover works with existing selector
   ============================================ */

/* Add hover trigger that matches existing selector pattern */
nav ul li:hover .dropdown,
.main-navigation ul li:hover .dropdown,
.site-header .main-navigation ul li:hover .dropdown {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateX(-50%) translateY(0) !important;
}

/* ============================================
   MOBILE MENU FIX - AGGRESSIVE OVERRIDES
   Added: December 1, 2025 - 14:30 EST
   Forces menu visibility on mobile without cache clearing
   ============================================ */

@media (max-width: 1023px) {
    /* Force mobile menu panel and all children to be visible */
    .mobile-menu-panel.active,
    .mobile-menu-panel.active * {
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    /* Force navigation display */
    .mobile-menu-panel.active nav,
    .mobile-menu-panel.active .mobile-navigation,
    .mobile-menu-panel.active nav ul,
    .mobile-menu-panel.active nav ul.menu,
    .mobile-menu-panel.active nav ul#menu-primary-1,
    .mobile-menu-panel.active .menu-primary-container {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        position: relative !important;
        background: white !important;
    }
    
    /* Force all list items to display */
    .mobile-menu-panel.active nav ul li,
    .mobile-menu-panel.active nav ul li.menu-item,
    .mobile-menu-panel.active nav ul li.menu-item-has-children {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        position: relative !important;
        list-style: none !important;
    }
    
    /* Force all links to be visible */
    .mobile-menu-panel.active nav ul li a {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        color: #333 !important;
        padding: 12px 20px !important;
        text-decoration: none !important;
        background: white !important;
        border-bottom: 1px solid #eee !important;
    }
    
    /* Override any height restrictions */
    .mobile-menu-panel.active,
    .mobile-menu-panel.active nav,
    .mobile-menu-panel.active .mobile-navigation {
        max-height: none !important;
        height: auto !important;
        overflow: visible !important;
    }
}
