header {
    font-family: 'Urbanist', sans-serif;
    margin: 0;
    padding: 0;
    background: transparent;
    color: #fff;
    overflow: visible;
    width: 100%;
}

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: auto;
    min-height: 80px;
    z-index: 1000;
    backdrop-filter: blur(32px);
    background-color: #020818;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.navbar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to right, #020818 0%, rgba(2, 8, 24, 0.4) 40%, rgba(2, 8, 24, 0.2) 60%, transparent 80%);
    z-index: -1;
    pointer-events: none;
    height: 100%;
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 120px;
    max-width: 100%;
    margin: 0 auto;
    height: 80px;
    min-height: 80px;
    position: relative;
    z-index: 1;
    box-sizing: border-box;
    overflow: visible;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.logo-section h1 {
    font-size: 24px;
    letter-spacing: 0.02em;
    color: white;
    font-weight: 600;
    margin: 20px 0;
}

.logo-img {
    width: 50px;
    height: 50px;
    object-fit: contain;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 60px;
}

.nav-links a {
    color: #FFFFFF;
    font-size: 24px;
    font-weight: 300;
    letter-spacing: 0.02em;
    text-decoration: none;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: #00bfff;
}

/* ============================================
   MOBILE-FIRST: Бургер виден по умолчанию
   ============================================ */

.end-section {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 10001;
    pointer-events: auto;
}

.menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    background: none;
    border: none;
    border-radius: 0;
    color: white;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    padding: 0;
    position: relative;
    z-index: 10002;
    pointer-events: auto;
    -webkit-tap-highlight-color: transparent;
    box-sizing: border-box;
    line-height: 1;
}

.menu-toggle:hover {
    background: none;
}

/* Мобильное меню */
.nav-menu-wrapper {
    position: fixed;
    top: 0;
    right: -100%;
    width: 70%;
    max-width: 320px;
    height: 100vh;
    min-height: 100vh;
    background-color: #020818;
    backdrop-filter: blur(20px);
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.5);
    transition: right 0.3s ease;
    z-index: 10000;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    visibility: visible;
    opacity: 1;
}

.nav-menu-wrapper.show {
    right: 0 !important;
    visibility: visible !important;
    opacity: 1 !important;
    display: flex !important;
    position: fixed !important;
    top: 0 !important;
    width: 70% !important;
    max-width: 320px !important;
    height: 100vh !important;
    z-index: 10000 !important;
}

/* Скрываем бургер когда меню открыто */
.nav-menu-wrapper.show ~ .end-section .menu-toggle {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

/* Альтернативный способ - через родительский контейнер */
.nav-container:has(.nav-menu-wrapper.show) .end-section .menu-toggle {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

.nav-menu-wrapper .close-menu {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: #ffffff;
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    transition: background 0.3s ease;
    z-index: 10001;
}

.nav-menu-wrapper.show .close-menu {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.nav-menu-wrapper .close-menu:hover {
    background: rgba(255, 255, 255, 0.2);
}

.nav-menu-wrapper .nav-links-mobile {
    list-style: none;
    display: flex;
    flex-direction: column;
    padding: 80px 30px 30px;
    gap: 30px;
    margin: 0;
    visibility: visible;
    opacity: 1;
}

.nav-menu-wrapper.show .nav-links-mobile {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.nav-menu-wrapper .nav-links-mobile a {
    display: block;
    padding: 12px 0;
    color: #FFFFFF !important;
    font-size: 18px;
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: color 0.3s ease;
    visibility: visible;
    opacity: 1;
}

.nav-menu-wrapper .nav-links-mobile li:last-child a {
    border-bottom: none;
}

.nav-menu-wrapper .nav-links-mobile a:hover {
    color: #00bfff;
}

/* ============================================
   DESKTOP: Скрываем бургер, показываем меню
   ============================================ */

@media (min-width: 1025px) {
    .navbar {
        background-image: url('https://trading-botback-storage.s3.us-east-1.amazonaws.com/landing/phone-charts-background.webp');
        background-size: cover;
        background-position: center top;
        background-repeat: no-repeat;
        background-attachment: fixed;
    }
    
    .navbar::before {
        display: block;
    }
    
    .end-section {
        display: none !important;
    }
    
    .menu-toggle {
        display: none !important;
    }
    
    .nav-links {
        display: flex !important;
    }
    
    .nav-menu-wrapper {
        display: none !important;
    }
    
    .nav-menu-wrapper.show {
        display: none !important;
    }
}

/* ============================================
   TABLET & MOBILE: Показываем бургер
   ============================================ */

@media (max-width: 1024px) {
    .navbar {
        background-image: none;
    }
    
    .navbar::before {
        display: none;
    }
    
    .nav-container {
        padding: 0 40px;
        height: 70px;
        min-height: 70px;
    }
    
    .navbar {
        min-height: 70px;
    }
    
    .logo-section h1 {
        font-size: 20px;
        margin: 15px 0;
    }
    
    .logo-img {
        width: 45px;
        height: 45px;
    }
    
    .nav-links {
        display: none;
    }
    
    .end-section {
        display: flex;
    }
    
    .menu-toggle {
        display: flex;
    }
    
    .nav-menu-wrapper {
        display: flex !important;
        width: 65%;
        max-width: 300px;
    }
    
    .nav-menu-wrapper.show {
        right: 0 !important;
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
}

@media (max-width: 768px) {
    .nav-container {
        padding: 0 20px;
        height: 60px;
        min-height: 60px;
    }
    
    .navbar {
        min-height: 60px;
    }
    
    .logo-section h1 {
        font-size: 18px;
        margin: 12px 0;
    }
    
    .logo-img {
        width: 40px;
        height: 40px;
    }
    
    .nav-menu-wrapper {
        width: 70%;
        max-width: 300px;
    }
    
    .nav-menu-wrapper .nav-links-mobile {
        padding: 80px 25px 25px;
        gap: 25px;
    }
    
    .nav-menu-wrapper .nav-links-mobile a {
        font-size: 16px;
        padding: 10px 0;
    }
}

@media (max-width: 480px) {
    .nav-container {
        padding: 0 16px;
        height: 56px;
        min-height: 56px;
    }
    
    .navbar {
        min-height: 56px;
    }
    
    .logo-section h1 {
        font-size: 16px;
        margin: 10px 0;
    }
    
    .logo-img {
        width: 36px;
        height: 36px;
    }
    
    .nav-menu-wrapper {
        width: 75%;
        max-width: 280px;
    }
    
    .nav-menu-wrapper .nav-links-mobile {
        padding: 70px 20px 20px;
    }
    
    .nav-menu-wrapper .nav-links-mobile a {
        font-size: 15px;
    }
}
