/* ==============================================
   MOBILE NAVIGATION
   ============================================== */

/* Mobile Menu Toggle Button */
.mobile-menu-icon {
    display: none;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
    padding: 8px;
    background: transparent;
    border: none;
    z-index: 1001;
}

.mobile-menu-icon span {
    width: 25px;
    height: 3px;
    background: var(--buildex-dark);
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* Hamburger Animation */
.mobile-menu-icon.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-icon.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-icon.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

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

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

/* Mobile Menu Panel */
.main-menu.mobile-active {
    transform: translateX(0);
}

/* Mobile Menu Styles */
@media (max-width: 991px) {
    .mobile-menu-icon {
        display: flex;
    }

    .navigation-menu {
        position: relative;
    }

    .main-menu {
        position: fixed !important;
        top: 0;
        right: 0;
        width: 300px;
        max-width: 85vw;
        height: 100vh;
        background: white;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
        z-index: 1000;
        transform: translateX(100%);
        transition: transform 0.3s ease;
        display: flex !important;
        flex-direction: column;
        padding: 80px 0 20px;
        overflow-y: auto;
    }

    .main-menu .menu-item {
        width: 100%;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    }

    .main-menu .menu-item>a {
        padding: 15px 25px;
        display: block;
        font-size: 16px;
        color: var(--buildex-dark);
        font-weight: 500;
    }

    .main-menu .menu-item>a:hover,
    .main-menu .menu-item>a.active {
        color: var(--buildex-primary-color);
        background: rgba(217, 119, 6, 0.05);
    }

    /* Mobile Dropdown */
    .menu-item.has-dropdown {
        position: relative;
    }

    .menu-item.has-dropdown>a::after {
        content: '';
        position: absolute;
        right: 25px;
        top: 50%;
        transform: translateY(-50%);
        width: 0;
        height: 0;
        border-left: 5px solid transparent;
        border-right: 5px solid transparent;
        border-top: 5px solid var(--buildex-dark);
        transition: transform 0.3s ease;
    }

    .menu-item.has-dropdown.active>a::after {
        transform: translateY(-50%) rotate(180deg);
    }

    .sub-menu {
        display: none;
        position: static;
        width: 100%;
        background: rgba(0, 0, 0, 0.02);
        box-shadow: none;
        padding: 0;
        margin: 0;
    }

    .menu-item.has-dropdown.active .sub-menu {
        display: block;
    }

    .sub-menu li {
        width: 100%;
    }

    .sub-menu li a {
        padding: 12px 25px 12px 40px;
        font-size: 15px;
        color: var(--buildex-grey-color);
    }

    .sub-menu li a:hover {
        color: var(--buildex-primary-color);
        background: rgba(217, 119, 6, 0.05);
    }

    /* Hide desktop search and CTA on mobile menu */
    .main-menu .dl-search-icon,
    .main-menu .default-btn {
        display: none;
    }

    /* Mobile Menu Close Button */
    .mobile-menu-close {
        position: absolute;
        top: 20px;
        right: 20px;
        width: 40px;
        height: 40px;
        background: transparent;
        border: none;
        cursor: pointer;
        padding: 0;
        z-index: 1001;
    }

    .mobile-menu-close::before,
    .mobile-menu-close::after {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        width: 20px;
        height: 2px;
        background: var(--buildex-dark);
    }

    .mobile-menu-close::before {
        transform: translate(-50%, -50%) rotate(45deg);
    }

    .mobile-menu-close::after {
        transform: translate(-50%, -50%) rotate(-45deg);
    }

    /* Show overlay when menu is active */
    .mobile-menu-overlay {
        display: block;
    }
}

/* Touch-Friendly Tap Targets */
@media (max-width: 991px) {

    .main-menu .menu-item>a,
    .sub-menu li a {
        min-height: 44px;
        display: flex;
        align-items: center;
    }
}

/* Sticky Header on Mobile */
@media (max-width: 991px) {
    .navigation-wrapper.sticky .mobile-menu-icon span {
        background: white;
    }
}