/* Simple Custom Mobile Menu - Clean & Working Solution */

/* Fix mobile/tablet header to be full width */
@media (max-width: 1024px) {
    /* Force mobile header section to full width */
    section.elementor-hidden-desktop {
        width: 100% !important;
        max-width: 100vw !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
    }

    section.elementor-hidden-desktop .elementor-container {
        width: 100% !important;
        max-width: 100% !important;
    }

    /* Make the audit button section super thin */
    section.elementor-hidden-desktop .elementor-element-5e63b87 {
        margin: 0 !important;
        padding: 0 !important;
    }

    section.elementor-hidden-desktop .elementor-element-5e63b87 .elementor-widget-container {
        padding: 0 !important;
        margin: 0 !important;
    }

    section.elementor-hidden-desktop .elementor-element-5e63b87 .elementor-button-wrapper {
        margin: 0 !important;
    }

    section.elementor-hidden-desktop .elementor-element-5e63b87 .elementor-button {
        padding: 8px 20px !important;
        font-size: 12px !important;
    }

    /* Make the logo and nav section compact */
    section.elementor-hidden-desktop .elementor-element-3ec1ab5,
    section.elementor-hidden-desktop .elementor-inner-section {
        margin: 0 !important;
        min-height: auto !important;
    }

    section.elementor-hidden-desktop .elementor-element-3ec1ab5 .elementor-container,
    section.elementor-hidden-desktop .elementor-inner-section .elementor-container {
        padding: 0 15px !important;
        min-height: auto !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
    }

    /* Ensure inner columns are visible and properly arranged */
    section.elementor-hidden-desktop .elementor-inner-section .elementor-column,
    section.elementor-hidden-desktop .elementor-inner-column {
        display: flex !important;
        align-items: center !important;
        width: auto !important;
    }

    section.elementor-hidden-desktop .elementor-inner-section .elementor-column .elementor-widget-wrap,
    section.elementor-hidden-desktop .elementor-inner-section .elementor-column .elementor-element-populated {
        display: flex !important;
        align-items: center !important;
    }

    section.elementor-hidden-desktop .elementor-inner-section .elementor-column:first-child {
        flex: 0 0 auto !important;
    }

    section.elementor-hidden-desktop .elementor-inner-section .elementor-column:last-child {
        flex: 1 !important;
        justify-content: flex-end !important;
    }

    section.elementor-hidden-desktop .elementor-inner-section .elementor-column:last-child .elementor-widget-wrap,
    section.elementor-hidden-desktop .elementor-inner-section .elementor-column:last-child .elementor-element-populated {
        justify-content: flex-end !important;
    }

    /* Reduce logo height - make sure logo is visible on all pages */
    section.elementor-hidden-desktop .elementor-widget-image img,
    section.elementor-hidden-desktop .elementor-widget-theme-site-logo img {
        max-height: 40px !important;
        width: auto !important;
        height: auto !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        min-height: 30px !important;
    }

    /* Force lazy-loaded images to show */
    section.elementor-hidden-desktop img[data-lazy-src] {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        content: attr(data-lazy-src) !important;
    }

    /* Ensure logo containers are visible */
    section.elementor-hidden-desktop .elementor-widget-image,
    section.elementor-hidden-desktop .elementor-widget-theme-site-logo {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        min-width: 100px !important;
    }

    section.elementor-hidden-desktop .elementor-widget-image .elementor-widget-container,
    section.elementor-hidden-desktop .elementor-widget-theme-site-logo .elementor-widget-container {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    section.elementor-hidden-desktop .elementor-widget-image a,
    section.elementor-hidden-desktop .elementor-widget-theme-site-logo a {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    /* Specific fix for team page logo */
    section.elementor-hidden-desktop .elementor-element-d0f870c,
    section.elementor-hidden-desktop .elementor-element-d0f870c .elementor-widget-container,
    section.elementor-hidden-desktop .elementor-element-d0f870c a,
    section.elementor-hidden-desktop .elementor-element-d0f870c img {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    /* Fix for logo column */
    section.elementor-hidden-desktop .elementor-element-88e2cc2 {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        flex: 0 0 auto !important;
    }

    section.elementor-hidden-desktop .elementor-element-88e2cc2 .elementor-widget-wrap {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    /* Ensure sticky header is full width */
    .elementor-sticky--active.elementor-hidden-desktop,
    .elementor-sticky.elementor-hidden-desktop {
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
    }



    /* Fix any overflow issues */
    body {
        overflow-x: hidden !important;
    }

    /* Ensure header wrapper is full width */
    header.elementor-location-header {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
    }

    /* Hide broken Elementor dropdown */
    .elementor-nav-menu--dropdown.elementor-nav-menu__container {
        display: none !important;
    }

    /* Ensure nav menu widget is visible */
    section.elementor-hidden-desktop .elementor-widget-nav-menu {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    section.elementor-hidden-desktop .elementor-widget-nav-menu .elementor-widget-container {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    /* Custom Hamburger Icon */
    .elementor-menu-toggle__icon--open.eicon-menu-bar,
    .elementor-menu-toggle__icon--close.eicon-close {
        display: none !important;
    }

    .elementor-menu-toggle {
        position: relative !important;
        width: 30px !important;
        height: 24px !important;
        cursor: pointer !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        z-index: 100000 !important;
        visibility: visible !important;
        opacity: 1 !important;
        flex-shrink: 0 !important;
        margin-left: auto !important;
    }

    .elementor-menu-toggle::before,
    .elementor-menu-toggle::after {
        content: '' !important;
        position: absolute !important;
        width: 28px !important;
        height: 3px !important;
        background-color: #1E3A8A !important;
        border-radius: 2px !important;
        transition: all 0.3s ease !important;
        left: 50% !important;
        display: block !important;
    }

    .elementor-menu-toggle::before {
        top: 3px !important;
        transform: translateX(-50%) !important;
        box-shadow: 0 8px 0 0 #1E3A8A !important;
    }

    .elementor-menu-toggle::after {
        bottom: 3px !important;
        transform: translateX(-50%) !important;
    }

    /* Active/Open State - X icon */
    .elementor-menu-toggle[aria-expanded="true"]::before {
        top: 50% !important;
        transform: translate(-50%, -50%) rotate(45deg) !important;
        box-shadow: none !important;
    }

    .elementor-menu-toggle[aria-expanded="true"]::after {
        bottom: 50% !important;
        transform: translate(-50%, 50%) rotate(-45deg) !important;
    }

    /* Overlay */
    .mobile-menu-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0, 0, 0, 0.5);
        z-index: 99998;
        display: none;
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .mobile-menu-overlay.active {
        display: block;
        opacity: 1;
    }

    /* Custom Mobile Menu */
    #custom-mobile-menu {
        position: fixed;
        top: 60px;
        right: -100%;
        width: 85%;
        max-width: 400px;
        height: calc(100vh - 60px);
        background: white;
        z-index: 99999;
        overflow-y: auto;
        transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: -4px 0 20px rgba(0, 0, 0, 0.2);
    }

    #custom-mobile-menu.active {
        right: 0;
    }

    .custom-mobile-menu-content {
        padding: 30px 0;
    }

    .custom-mobile-nav {
        list-style: none;
        margin: 0;
        padding: 0;
    }

    .custom-mobile-nav > li {
        border-bottom: 1px solid #f0f0f0;
    }

    .custom-mobile-nav > li > a,
    .custom-mobile-nav > li > span {
        display: block;
        padding: 18px 30px;
        color: #1a1a1a;
        font-size: 17px;
        font-weight: 500;
        text-decoration: none;
        transition: all 0.3s ease;
        border-left: 4px solid transparent;
    }

    .custom-mobile-nav > li > a:active,
    .custom-mobile-nav > li > a:hover {
        background: linear-gradient(90deg, #f0f7ff 0%, #ffffff 100%);
        color: #1E3A8A;
        border-left-color: #1E3A8A;
        padding-left: 35px;
    }

    /* Submenu styling */
    .submenu-toggle {
        cursor: pointer;
        user-select: none;
    }

    .submenu {
        display: none;
        list-style: none;
        margin: 0;
        padding: 8px 0;
        background: #f8f9fa;
    }

    .submenu li {
        border-bottom: 1px solid #e9ecef;
    }

    .submenu li:last-child {
        border-bottom: none;
    }

    .submenu a {
        display: block;
        padding: 14px 30px 14px 50px;
        color: #555;
        font-size: 15px;
        text-decoration: none;
        transition: all 0.3s ease;
    }

    .submenu a:active,
    .submenu a:hover {
        background: #e9ecef;
        color: #1E3A8A;
        padding-left: 55px;
    }
}

/* Tablet specific fixes (landscape) */
@media (min-width: 768px) and (max-width: 1024px) {
    /* Make sure logo is properly sized on tablet */
    .elementor-hidden-desktop .elementor-widget-image img {
        max-width: 180px !important;
        height: auto !important;
    }


}

/* Desktop - ensure nothing breaks */
@media (min-width: 1025px) {
    #custom-mobile-menu,
    .mobile-menu-overlay {
        display: none !important;
    }
}


