/* ========== АДАПТИВ ДЛЯ ШАПКИ ========== */
@media (max-width: 1100px) {
    .social-network {
        display: none;
    }

    .header-left {
        order: 1;
        text-align: center;
    }

    .header-row {
        text-align: center;
        justify-content: center;
    }

    .site-logo {
        max-height: 24px;
        margin: 0 auto;
        /* Чуть меньше на телефонах */
    }

    .theme-toggle {
        order: 0;
        position: absolute;
        left: 4px;
    }

    .search-form {
        order: 2;
        margin-top: 4px;
    }

}

/* Планшеты и маленькие ноутбуки (до 900px) */
@media (max-width: 900px) {

    .header-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        text-align: center;
        position: relative;
    }

    .header-left {
        order: 1;
        flex: 1;
        text-align: center;
    }

    .theme-toggle {
        order: 0;
        position: absolute;
        left: 4px;
    }

    .header-nav-wrapper {
        margin-top: 15px;
    }

    .header-nav {
        justify-content: center;
    }

    .site-header-small .header-row {
        flex-direction: row;
    }
}

@media (min-width: 769px) {
    #theme-toggle-mobile {
        display: none;
    }
}

@media (max-width: 768px) {
    .site-logo {
        max-height: 24px;
        margin: 0 auto;
        /* Чуть меньше на телефонах */
    }
}

/* Мобильные телефоны (до 600px) */
@media (max-width: 600px) {
    .site-title {
        font-size: 22px;
    }

    .header-nav {
        gap: 16px;
    }

    .header-nav a {
        font-size: 14px;
        white-space: normal;
    }

    .theme-toggle {
        width: 36px;
        height: 36px;
        font-size: 20px;
    }

    .site-header-small .site-title {
        font-size: 14px;
    }

    .site-header-small .header-nav {
        gap: 10px;
    }

    .site-header-small .header-nav a {
        font-size: 10px;
    }

    .search-small {
        display: none;
    }

    .search-form {
        order: 2;
        margin-top: 4px;
    }
}

/* Очень маленькие телефоны (до 480px) */
@media (max-width: 480px) {
    .header-inner {
        padding: 10px 8px;
    }

    .site-header-small .header-inner {
        padding: 10px 8px;
    }

    .site-subtitle {
        display: none;
    }


    .site-header-small .header-nav {
        gap: 8px;
    }

    .site-header-small .header-nav a {
        font-size: 9px;
    }

    .theme-toggle {
        width: 30px;
        height: 30px;
        font-size: 16px;
    }
}



/* ========== БУРГЕР-МЕНЮ ========== */
.burger-menu {
    display: none;
    order: 3;
}

@media (max-width: 768px) {
    .burger-menu {
        display: block;
    }

    /* Скрываем обычное меню */
    .header-nav-wrapper,
    .header-nav-wrapper-scrolled {
        display: none !important;
    }

    .burger-btn {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        width: 30px;
        height: 21px;
        background: transparent;
        border: none;
        cursor: pointer;
        padding: 0;
        z-index: 1001;
    }

    .burger-btn span {
        width: 100%;
        height: 3px;
        background: var(--text);
        border-radius: 3px;
        transition: all 0.3s ease;
    }

    .burger-nav {
        position: fixed;
        top: 0;
        left: -100%;
        width: auto;
        max-width: 300px;
        height: 100vh;
        background: var(--bg);
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.2);
        transition: left 0.3s ease;
        z-index: 1000;
        padding: 80px 20px 20px;
        overflow-y: auto;
    }

    .burger-nav.active {
        left: 0;
    }

    .burger-nav .header-nav {
        display: flex !important;
        flex-direction: column;
        gap: 20px;
    }

    .burger-nav .header-nav a {
        font-size: 18px;
        padding: 10px 0;
        display: block;
    }

    .burger-btn.active span:nth-child(1) {
        transform: rotate(45deg) translate(6px, 6px);
    }

    .burger-btn.active span:nth-child(2) {
        opacity: 0;
    }

    .burger-btn.active span:nth-child(3) {
        transform: rotate(-45deg) translate(6px, -6px);
    }
}