/* Mobile Menu Styles */
.mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    padding: 30px 20px 180px 30px;
    z-index: 9999;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    will-change: opacity, visibility;
    -webkit-overflow-scrolling: touch;
    backface-visibility: hidden;
    transform: translateZ(0);
    text-align: center;
}

.mobile-menu.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.mobile-menu-inner {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
    padding-top: 60px;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    backface-visibility: hidden;
    position: relative;
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
    padding-bottom: 100px;
    left: -15px;
}

/* Mobile Menu Links and Dropdowns */
.mobile-menu a,
.mobile-menu .has-dropdown {
    display: flex;
    justify-content: center;
    align-items: center;
    color: #fff;
    text-decoration: none;
    font-size: 20px;
    padding: 12px 0;
    font-family: var(--si-font-primary);
    letter-spacing: 2px;
    transition: color 0.3s ease;
    width: 100%;
    text-align: center;
}

.mobile-menu a:hover,
.mobile-menu .has-dropdown:hover {
    color: #e63422;
}

/* Mobile Dropdown Styles */
.mobile-menu .menu-dropdown-wrapper {
    width: 100%;
    position: relative;
}

.mobile-menu .has-dropdown {
    cursor: pointer;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

/* Dropdown arrow styling */
.mobile-menu .has-dropdown .dropdown-arrow {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-right: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: rotate(45deg);
    transition: transform 0.2s ease;
    margin-bottom: 3px;
}

/* Mobile Submenu Overlay */
.mobile-submenu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.98);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    padding: 80px 20px 80px 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
    overflow-y: auto;
    transform: translateY(10px);
    text-align: center;
}

.mobile-submenu-overlay.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.submenu-header {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin-bottom: 25px;
    padding: 0 20px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    width: 100%;
}

.back-button {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(30, 30, 30, 0.7);
    border-radius: 4px;
    border: none;
    color: #fff;
    font-size: 16px;
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 8px 12px;
    font-family: var(--si-font-primary);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    transition: color 0.3s ease, background-color 0.3s ease;
}

.back-button:hover,
.back-button:active {
    color: #e63422;
    background-color: rgba(50, 50, 50, 0.7);
}

.back-button::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-left: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    margin-right: 8px;
    transition: transform 0.3s ease;
}

.back-button:hover::before {
    transform: rotate(45deg) scale(1.2);
}

.submenu-title {
    font-family: var(--si-font-primary);
    font-size: 20px;
    color: #fff;
    text-align: center;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-weight: 700;
    padding: 0 40px;
}

.submenu-items {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
    padding-bottom: 40px;
}

.submenu-item {
    color: #fff;
    text-decoration: none;
    font-size: 18px;
    padding: 10px 0;
    font-family: var(--si-font-primary);
    letter-spacing: 2px;
    width: 100%;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: color 0.3s ease, transform 0.3s ease;
    text-transform: uppercase;
}

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

.submenu-item:hover,
.submenu-item:active {
    color: #e63422;
    transform: translateY(-2px);
}

/* Mobile Menu Close Button */
.mobile-menu-close {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 30px;
    height: 30px;
    background: rgba(30, 30, 30, 0.7);
    border-radius: 50%;
    border: none;
    cursor: pointer;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
}

.mobile-menu-close::before,
.mobile-menu-close::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 2px;
    background-color: #fff;
    transition: transform 0.3s ease, background-color 0.3s ease;
}

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

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

.mobile-menu-close:hover::before,
.mobile-menu-close:hover::after {
    background-color: #e63422;
}

/* Ensure text appears centered by positioning the text content */
.mobile-menu .has-dropdown span.dropdown-text {
    display: inline;
    text-align: center;
}

/* iOS-specific styles */
.ios-device .mobile-menu .has-dropdown,
.ios-device .back-button {
    cursor: pointer;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

.ios-device .mobile-submenu-overlay {
    -webkit-overflow-scrolling: touch;
}

.ios-device .mobile-menu a,
.ios-device .submenu-item {
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

/* Desktop Navigation and Dropdown Styles */
@media (min-width: 992px) {
    .desktop-menu {
        display: flex;
        align-items: center;
        gap: 33px;
    }

    .desktop-menu.left-menu {
        justify-content: flex-end;
    }

    .desktop-menu.right-menu {
        justify-content: flex-start;
    }

    .menu-dropdown-wrapper {
        position: relative;
    }

    .nav-button {
        color: #fff;
        text-decoration: none;
        font-size: 18px;
        padding: 8px 16px;
        transition: all 0.3s ease;
        white-space: nowrap;
        border: 2px solid transparent;
        border-radius: 4px;
        position: relative;
        text-transform: uppercase;
        font-family: var(--si-font-primary);
        letter-spacing: 2px;
    }

    .nav-button.has-dropdown {
        padding-right: 30px;
    }

    .nav-button.has-dropdown::after {
        content: '';
        position: absolute;
        right: 12px;
        top: 50%;
        width: 8px;
        height: 8px;
        border-right: 2px solid #fff;
        border-bottom: 2px solid #fff;
        transform: translateY(-75%) rotate(45deg);
        transition: transform 0.3s ease;
    }

    .nav-button:hover {
        border-color: #fff;
        /* transform: translateY(-2px); */
    }

    .menu-dropdown {
        position: absolute;
        top: calc(100% + 10px);
        left: 50%;
        transform: translateX(-50%);
        background: linear-gradient(to bottom, #006EB3, #00263A);
        min-width: 220px;
        padding: 10px 0;
        border-radius: 4px;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        pointer-events: none;
        z-index: 1000;
    }

    .menu-dropdown::before {
        content: '';
        position: absolute;
        top: -8px;
        left: 50%;
        transform: translateX(-50%) rotate(45deg);
        width: 16px;
        height: 16px;
        background: #006EB3;
    }

    .menu-dropdown-wrapper:hover .menu-dropdown {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    /* Add padding to create hover space */
    .menu-dropdown-wrapper::after {
        content: '';
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        height: 20px;
        background: transparent;
    }

    .dropdown-item {
        display: block;
        padding: 12px 20px;
        color: #fff;
        text-decoration: none;
        transition: all 0.3s ease;
        text-align: center;
        white-space: nowrap;
        font-size: 16px;
        text-transform: uppercase;
        font-family: var(--si-font-primary);
        letter-spacing: 1.5px;
    }

    .dropdown-item:hover {
        background-color: rgba(255, 255, 255, 0.1);
    }

    .hamburger {
        display: none !important;
    }
    
    .mobile-menu {
        display: none !important;
    }
    
    .mobile-submenu-overlay {
        display: none !important;
    }
}

/* Mobile Styles */
@media (max-width: 991px) {
    .hamburger {
        display: flex !important;
        flex-direction: column;
        justify-content: center;
        gap: 6px;
        width: 30px;
        height: 24px;
        padding: 0;
        background: none;
        border: none;
        cursor: pointer;
        z-index: 10000;
        position: relative;
    }

    .hamburger span {
        display: block;
        width: 30px;
        height: 2px;
        background: #fff;
        transition: all 0.3s ease;
        transform-origin: center;
    }

    .hamburger.active span:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .hamburger.active span:nth-child(2) {
        opacity: 0;
        transform: translateX(-20px);
    }

    .hamburger.active span:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    body.menu-open {
        overflow: hidden;
        position: fixed;
        width: 100%;
        height: 100%;
    }
    
    .desktop-menu {
        display: none !important;
    }
    
    /* Hide original dropdown menu */
    .mobile-menu .menu-dropdown {
        display: none;
    }
}

@media (max-width: 480px) {
    .mobile-menu {
        padding: 20px 15px 60px 15px;
    }

    .mobile-menu-inner {
        padding-top: 40px;
        gap: 10px;
        max-width: 260px;
        padding-bottom: 30px;
    }
    
    .mobile-menu a,
    .mobile-menu .has-dropdown {
        font-size: 18px;
        padding: 8px 0;
    }
    
    .mobile-submenu-overlay {
        padding: 60px 15px 60px 15px;
    }
    
    .submenu-header {
        margin-bottom: 15px;
        padding: 0 10px 10px;
    }
    
    .back-button {
        font-size: 14px;
        padding: 8px;
    }
    
    .back-button::before {
        width: 6px;
        height: 6px;
        margin-right: 6px;
    }
    
    .submenu-title {
        font-size: 18px;
        padding: 0 30px;
    }
    
    .submenu-items {
        max-width: 260px;
        gap: 8px;
    }
    
    .submenu-item {
        font-size: 16px;
        padding: 8px 0;
    }

    .mobile-menu .has-dropdown .dropdown-arrow {
        width: 6px;
        height: 6px;
    }
    
    .mobile-menu-close {
        top: 15px;
        left: 15px;
        width: 28px;
        height: 28px;
    }
    
    .mobile-menu-close::before,
    .mobile-menu-close::after {
        width: 16px;
    }
} 