/* Mobile and Tablet Menu Styles (up to 1024px) */

/* Burger menu button - hidden by default, shown only on mobile/tablet */
.burger-menu {
    display: none;
    width: 60px;
    height: 30px;
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid #000;
    cursor: pointer;
    z-index: 9999;
    position: fixed;
    top: 20px;
    right: 15px;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    box-sizing: border-box;
    font-family: 'Helvetica', Arial, sans-serif;
    font-size: 12px;
    font-weight: 600;
    color: #000;
    text-transform: uppercase;
    letter-spacing: 1px;
    transform: translateZ(0); /* Force hardware acceleration */
    backface-visibility: hidden; /* Prevent flickering */
    /* Add pointer events to ensure clicks are registered */
    pointer-events: auto;
}

/* Burger menu button when active - transformed appearance */
.burger-menu.active {
    background: #fff;
    border: 2px solid #000;
    border-radius: 1px;
    box-shadow: none;
    width: 60px;
    height: 30px;
    top: 20px;
    right: 15px;
    transform: translateZ(0); /* Maintain hardware acceleration */
}

/* Mobile sound toggle - positioned to the left of burger menu */
.mobile-sound-toggle-outside {
    display: none;
    position: fixed;
    top: 20px;
    right: 90px; /* 20px (burger menu right) + 80px (burger menu width) + 5px (gap) */
    z-index: 9998;
    align-items: center;
    gap: 10px;
    /* Add pointer events to ensure clicks are registered */
    pointer-events: auto;
}

/* Ensure mobile sound toggle is visible above full-screen menu */
.mobile-sound-toggle-outside.active {
    z-index: 1003;
}

.mobile-sound-label-outside {
    font-size: 18px;
    color: #000;
    font-family: 'Helvetica', Arial, sans-serif;
}

.mobile-sound-switch-outside {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
}

.mobile-sound-option-outside {
    font-size: 14px;
    color: #666;
    cursor: pointer;
    transition: color 0.3s ease;
    font-family: 'Helvetica', Arial, sans-serif;
    /* Add pointer events to ensure clicks are registered */
    pointer-events: auto;
}

.mobile-sound-option-outside.active {
    color: #000;
}

.mobile-sound-dot-outside {
    width: 12px;
    height: 12px;
    background: #000;
    border-radius: 50%;
    transition: transform 0.3s ease;
}

.mobile-sound-switch-outside.off .mobile-sound-dot-outside {
    transform: translateX(20px);
}

.burger-menu:focus {
    outline: none;
}

.burger-menu::before {
    content: "MENU";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Small horizontal bar inside active burger menu */
.burger-menu.active::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 2px;
    background: #000;
}

/* Remove the burger lines */
.burger-line {
    display: none;
}

/* Burger menu active state - hide the MENU text when active */
.burger-menu.active::before {
    content: "";
}

/* Mobile/Tablet Navigation Menu */
.mobile-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #fff;
    z-index: 1001;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    padding: 45px 30px 30px;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateZ(0); /* Force hardware acceleration */
    backface-visibility: hidden; /* Prevent flickering */
    /* Add pointer events to ensure interactions work when visible */
    pointer-events: none;
}

.mobile-nav.active {
    opacity: 1;
    visibility: visible;
    transform: translateZ(0); /* Maintain hardware acceleration */
    /* Enable pointer events when active */
    pointer-events: auto;
}

/* Add logo to mobile menu */
.mobile-nav-logo {
    position: absolute;
    top: 30px;
    left: 30px;
    width: 100px; /* Adjust width as needed */
    height: 40px; /* Fixed height for logo */
    z-index: 1003;
    font-size: 17px;
    font-weight: 700;
    color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Special wrapper for coordinates to reduce spacing */
.mobile-coordinates-wrapper .mobile-nav-item {
    padding: 0;
}

/* Two-column layout for navigation and social links */
.mobile-nav-columns {
    display: flex;
    gap: 30px;
}

.mobile-nav-column {
    display: flex;
    flex-direction: column;
    gap: 0.5px;
    flex: 1;
}

.mobile-nav-column .mobile-nav-item {
    padding: 0px 0;
    margin: 0;
}

/* Horizontal wrapper for main navigation items */
.mobile-nav-horizontal-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.mobile-nav-horizontal-wrapper .mobile-nav-item {
    flex: 1 1 auto;
    padding: 0.5px 0;
}

/* Horizontal wrapper for social links */
.mobile-social-horizontal-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 4px; /* Уменьшено с 8px до 4px для уменьшения вертикального интервала */
}

.mobile-social-horizontal-wrapper .mobile-nav-item {
    flex: 1 1 auto;
    padding: 2px 0;
}

/* Navigation items in mobile menu */
.mobile-nav-content {
    display: flex;
    flex-direction: column;
    gap: 10px; /* Уменьшено с 15px до 10px для уменьшения вертикального интервала */
    margin-top: 10px; /* Reduced space for the logo */
}

.mobile-nav-section {
    margin-bottom: 30px;
}

/* Main navigation section with increased top margin to separate from coordinates */
.mobile-nav-section:nth-child(n+2) {
    margin-top: 60px;
}

.mobile-nav-title {
    font-size: 14px;
    font-weight: 600;
    color: #666;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.mobile-nav-items {
    display: flex;
    flex-direction: column;
    gap: 10px; /* Уменьшено с 15px до 10px для уменьшения вертикального интервала */
}

.mobile-nav-item {
    font-size: 16px;
    color: #000;
    cursor: pointer;
    transition: color 0.3s ease;
    padding: 0;
}

.mobile-nav-item a {
    color: inherit;
    text-decoration: none;
    display: block;
    width: 100%;
    height: 100%;
    /* Add pointer events to ensure clicks are registered */
    pointer-events: auto;
}

.mobile-nav-item:hover,
.mobile-nav-item.active {
    color: #000;
}

/* Sound toggle in mobile menu - hidden since we moved it outside */
.mobile-sound-toggle {
    display: none;
}

.mobile-sound-label {
    font-size: 14px;
    color: #000;
}

.mobile-sound-switch {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
}

.mobile-sound-option {
    font-size: 14px;
    color: #666;
    cursor: pointer;
    transition: color 0.3s ease;
}

.mobile-sound-option.active {
    color: #000;
}

.mobile-sound-dot {
    width: 12px;
    height: 12px;
    background: #000;
    border-radius: 50%;
    transition: transform 0.3s ease;
}

.mobile-sound-switch.off .mobile-sound-dot {
    transform: translateX(20px);
}

/* Contact info section with reduced gap */
.mobile-nav-section.contact-info .mobile-nav-items {
    gap: 2px !important;
}

/* Additional specificity for contact info spacing */
.mobile-nav-section.contact-info .mobile-nav-items .mobile-nav-item {
    padding: 0 !important;
    margin: 0 !important;
}

/* Even more specific rule for contact info spacing in mobile menu */
nav.mobile-nav .mobile-nav-section.contact-info .mobile-nav-items {
    gap: 2px !important;
}

nav.mobile-nav .mobile-nav-section.contact-info .mobile-nav-items .mobile-nav-item {
    padding: 0 !important;
    margin: 0 !important;
    line-height: 1 !important;
}

/* Bottom logo in mobile menu */
.mobile-nav-bottom-logo {
    position: absolute;
    bottom: 100px;
    left: calc(50% - 15px);
    transform: translateX(-50%);
    width: 300px; /* Increased width */
    height: 100px; /* Increased height */
    background: url('../png/iphone-logo.png') no-repeat center center;
    background-size: contain;
    text-indent: -9999px; /* Hide text */
    overflow: hidden;
}

/* Close button for mobile menu */
.mobile-menu-close {
    position: absolute;
    top: 30px;
    right: 30px;
    font-size: 24px;
    background: none;
    border: none;
    cursor: pointer;
    color: #000;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1002;
    /* Add pointer events to ensure clicks are registered */
    pointer-events: auto;
}

/* Overlay for mobile menu */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    opacity: 0;
    visibility: hidden;
    transform: translateZ(0); /* Force hardware acceleration */
    /* Add pointer events to ensure clicks are registered */
    pointer-events: none;
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
    transform: translateZ(0); /* Maintain hardware acceleration */
    /* Enable pointer events when active */
    pointer-events: auto;
}

/* Media queries - show burger menu on mobile and tablet devices */
@media (max-width: 1024px) {
    .burger-menu {
        display: block;
        transform: translateZ(0); /* Force hardware acceleration */
        will-change: transform; /* Optimize for animation */
    }
    
    .mobile-sound-toggle-outside {
        display: flex;
    }
    
    /* Hide desktop navigation including logo on mobile/tablet */
    .nav-content {
        display: none;
    }
    
    /* Hide the main logo on mobile devices */
    .logo {
        display: none;
    }
    
    /* Ensure mobile menu and overlay are visible */
    .mobile-nav, .mobile-menu-overlay {
        transform: translateZ(0); /* Force hardware acceleration */
    }
}

/* Extra small devices (phones, 480px and down) */
@media (max-width: 480px) {
    .text-left {

        display: none;

    }

    .text-right{

        display: none;

    }

    .burger-menu {
        right: 10px;
        width: 50px;
    }
    
    .burger-menu.active {
        right: 10px;
    }
    
    .mobile-sound-toggle-outside {
        font-size: 18px;
        right: 158px; /* 10px (burger menu right) + 50px (burger menu width) + 5px (gap) */
    }
}

/* Extra small devices (phones, 320px and down) */
@media (max-width: 320px) {
    .burger-menu {
        right: 5px;
        width: 45px;
        height: 25px;
        top: 15px;
    }
    
    .burger-menu.active {
        right: 5px;
        top: 15px;
    }
    
    .mobile-sound-toggle-outside {
        left: 5px;
        top: 15px;
    }
    
    .mobile-menu-close {
        top: 20px;
        right: 20px;
    }
}

/* Desktop - hide mobile elements */
@media (min-width: 1025px) {
    .burger-menu {
        display: none !important;
    }
    
    .mobile-nav {
        display: none !important;
    }
    
    .mobile-menu-overlay {
        display: none !important;
    }
    
    .mobile-nav-logo {
        display: none !important;
    }
}