/* Desktop большие экраны */
@media (max-width: 1100px) {
    .hero h1 {
        font-size: 42px;
    }

    .hero-content {
        flex-direction: column;
        text-align: center;
    }

    .hero p {
        margin: 0 auto 40px;
        max-width: 100%;
    }

    .footer-content {
        grid-template-columns: 1fr 1fr;
    }
    
    .legal-section {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Планшеты */
@media (max-width: 768px) {
    .section-gap {
        padding: 80px 0;
    }

    /* Отступ бургер-меню от логотипа */
    .header-content {
        position: relative;
    }

    .mobile-menu-toggle {
        display: block;
        background: none;
        border: none;
        cursor: pointer;
        color: var(--text-color);
        padding: 8px;
        margin-left: 15px;
        order: -1;
    }

    /* Скрываем десктопное меню */
    .header-content > div nav {
        display: none;
    }

    /* Показываем кнопку бургер-меню */
    @media (min-width: 769px) {
        .mobile-menu-toggle {
            display: none;
        }
    }

    /* Затемнение фона - НИЗКИЙ z-index */
    .overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 999; /* Ниже чем у меню */
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .overlay.show {
        display: block;
        opacity: 1;
    }

    /* Мобильное меню - ВЫСОКИЙ z-index */
    header nav {
        position: fixed;
        top: 0;
        left: -100%;
        width: 280px;
        height: 100vh;
        background-color: var(--light-bg);
        transition: left 0.3s ease;
        z-index: 1001; /* Выше чем overlay */
        padding: 20px;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
        display: flex;
        flex-direction: column;
    }

    .dark-mode header nav {
        background-color: var(--dark-bg);
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
    }

    header nav.show {
        left: 0;
        display: flex;
    }

    /* Кнопка закрытия меню */
    header nav::before {
        content: '×';
        position: absolute;
        top: 20px;
        right: 20px;
        font-size: 30px;
        color: var(--text-color);
        cursor: pointer;
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        transition: background-color 0.3s ease;
        z-index: 10; /* Локальный z-index внутри nav */
    }

    header nav::before:hover {
        background-color: var(--border-color);
    }

    header nav ul {
        flex-direction: column;
        gap: 0;
        margin-top: 60px;
        padding: 0;
        list-style: none;
        position: relative;
        z-index: 5; /* Локальный z-index внутри nav */
    }

    header nav ul li {
        margin: 0;
        position: relative;
        z-index: 5; /* Локальный z-index внутри nav */
    }

    header nav ul li a {
        font-size: 18px;
        display: block;
        padding: 15px 0;
        color: var(--text-color);
        text-decoration: none;
        border-bottom: 1px solid var(--border-color);
        transition: color 0.3s ease;
        position: relative;
        z-index: 5; /* Локальный z-index внутри nav */
    }

    header nav ul li a:hover {
        color: var(--primary-color);
    }

    /* Последний пункт меню - кнопка "Войти" */
    header nav ul li:last-child a {
        background-color: var(--primary-color);
        color: white;
        padding: 12px 20px;
        border-radius: var(--border-radius);
        text-align: center;
        border: none;
        margin-top: 10px;
    }

    /* Скрываем кнопку "Войти" из header на мобильных */
    .header-buttons .btn {
        display: none;
    }

    .feature-item, .feature-item:nth-child(even) {
        flex-direction: column;
        text-align: center;
        gap: 40px;
    }

    .feature-list li {
        justify-content: center;
    }

    .section-title h2 {
        font-size: 36px;
    }

    .service-card {
        text-align: center;
    }

    .service-icon {
        margin: 0 auto 25px;
    }

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .footer-column h3::after {
        left: 50%;
        transform: translateX(-50%);
    }
    
    .social-icons {
        justify-content: center;
    }
    
    .footer-links a svg {
        display: none;
    }
    
    .legal-links {
        flex-direction: column;
        gap: 15px;
        width: 100%;
        text-align: center;
    }
    
    .copyright {
        text-align: center;
        width: 100%;
    }
}

/* Мобильные устройства */
@media (max-width: 480px) {
    .hero {
        padding-top: 150px;
    }

    .hero h1 {
        font-size: 32px;
    }

    .btn {
        width: 100%;
        margin-right: 0;
        margin-bottom: 15px;
    }

    .section-title h2 {
        font-size: 28px;
    }

    .cta h2 {
        font-size: 28px;
    }

    /* Уменьшаем ширину меню на маленьких экранах */
    header nav {
        width: 250px;
    }
}