/* ============================================
   КОМПЛЕКСНАЯ АДАПТИВНОСТЬ ДЛЯ ВСЕХ СТРАНИЦ
   Версия: 2025
   ============================================ */

/* ============================================
   ГАРАНТИРОВАННАЯ ВИДИМОСТЬ ШАПКИ
   ============================================ */
header.app-header,
.app-header {
    position: sticky !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 10000 !important;
    width: 100% !important;
    max-width: 100vw !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    visibility: visible !important;
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
    margin: 0 !important;
    padding: 0 !important;
    will-change: auto !important;
}

.app-header .container {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 30px !important;
}

/* ============================================
   БАЗОВЫЕ НАСТРОЙКИ
   ============================================ */

* {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    overflow-x: hidden !important;
    max-width: 100vw !important;
}

body {
    overflow-x: hidden !important;
    width: 100% !important;
    max-width: 100vw !important;
    position: relative;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ============================================
   ГАРАНТИРОВАННАЯ ВИДИМОСТЬ CHATBOT
   ============================================ */

.chatbot-container {
    position: fixed !important;
    bottom: 20px !important;
    right: 20px !important;
    z-index: 9999999 !important; /* Выше всех элементов, включая кнопку "Наверх" */
    transition: bottom 0.3s ease !important;
}

.chatbot-toggle {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
}

/* ============================================
   ВЫРАВНИВАНИЕ ВСЕХ КНОПОК В СТОЛБИК
   ============================================ */

/* Базовое выравнивание всех кнопок по правому краю */
.scroll-to-top {
    right: 20px !important;
}

.floating-radio-btn {
    right: 20px !important;
}

.chatbot-container {
    right: 20px !important;
}

/* На всех разрешениях chatbot должен быть виден */
@media (min-width: 320px) {
    .chatbot-container {
        display: block !important;
    }
    
    .chatbot-toggle {
        display: flex !important;
    }
}

/* ============================================
   КОНТЕЙНЕРЫ И ОБЕРТКИ
   ============================================ */

@media (max-width: 1200px) {
    .container {
        padding: 0 16px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 12px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }
}

/* ============================================
   HEADER И НАВИГАЦИЯ - АДАПТИВНАЯ СИСТЕМА
   ============================================ */

/* Базовые стили для хедера - ВСЕГДА */
.app-header .container {
    overflow: visible !important;
    display: flex !important;
    align-items: center !important;
    gap: 20px !important;
}

.header-actions {
    flex-wrap: nowrap !important;
    overflow: visible !important;
}

/* ============================================
   ПОСЛЕДОВАТЕЛЬНОЕ СКРЫТИЕ ЭЛЕМЕНТОВ (справа налево)
   Логотип 140px фиксированный от 1920px до 768px
   ============================================ */

/* Базовый размер логотипа для больших экранов */
.logo-wrapper {
    order: 1 !important;
    flex-shrink: 0 !important;
    margin-right: auto !important;  /* ПРИЖИМАЕТ К ЛЕВОМУ КРАЮ */
}

.logo-container {
    min-width: 140px !important;
}

.logo-image {
    width: 140px !important;
    min-width: 140px !important;
    max-width: 140px !important;
    height: 40px !important;
    object-fit: contain !important;
}

/* Базовые стили бургера */
.mobile-burger {
    display: none !important;  /* Скрыт по умолчанию */
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    order: 999 !important;
    margin-left: auto !important;
}

.mobile-burger:hover {
    color: var(--color-primary);
}

/* 1200px - ПОКАЗЫВАЕМ БУРГЕР (когда контент не влезает) */
@media (max-width: 1200px) {
    .mobile-burger {
        display: flex !important;
    }
}

/* 1800px - Скрываем ПОИСК */
@media (max-width: 1800px) {
    #searchTrigger {
        display: none !important;
    }
}

/* 1700px - Скрываем ТЕМУ */
@media (max-width: 1700px) {
    #themeToggle {
        display: none !important;
    }
}

/* 1600px - Скрываем ЯЗЫК */
@media (max-width: 1600px) {
    #languageLink {
        display: none !important;
    }
}

/* 1500px - Скрываем РЕЖИМ */
@media (max-width: 1500px) {
    .mode-switcher {
        display: none !important;
    }
}

/* 1400px - Скрываем ГЛАВНОЕ МЕНЮ */
@media (max-width: 1400px) {
    .main-nav {
        display: none !important;
    }
}

/* 1300px - Скрываем КНОПКУ ПЕРЕВОДА */
@media (max-width: 1300px) {
    a[href="/transfer.php"].icon-btn {
        display: none !important;
    }
}

/* 1200px - Скрываем ПРОФИЛЬ и БАЛАНС - остается только ЛОГО и БУРГЕР */
@media (max-width: 1200px) {
    .header-actions,
    .user-info-dropdown,
    .balance-display,
    .header-auth-buttons {
        display: none !important;
    }
    
    /* Layout: лого слева, бургер справа */
    .app-header .container {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 20px !important;
        padding: 12px 16px !important;
    }
    
    .logo-wrapper {
        margin-right: auto;
    }
}

/* 768px - Уменьшаем логотип для планшетов */
@media (max-width: 768px) {
    .app-header {
        height: var(--header-height) !important;
        min-height: var(--header-height) !important;
    }
    
    .app-header .container {
        padding: 12px 16px !important;
        height: 100% !important;
    }
    
    /* Логотип уменьшается до 120px */
    .logo-wrapper {
        min-width: 120px !important;
    }
    
    .logo-container {
        min-width: 120px !important;
    }
    
    .logo-image {
        width: 120px !important;
        min-width: 120px !important;
        max-width: 120px !important;
        height: 40px !important;
    }
}

/* 968px и ниже - уже все скрыто на 1200px, логотип задан на 768px */
@media (max-width: 968px) {
    .app-header .container {
        padding: 12px 14px !important;
        gap: 12px !important;
    }
        align-items: center !important;
        flex-shrink: 0 !important;
    }
    
    .mobile-burger {
        order: 2 !important;
        margin-left: 8px !important;
    }
}

/* Медиа-запрос 768-731px удален - конфликтовал с новыми стилями */

/* 730px и ниже - стабильный 120px логотип */
@media (max-width: 730px) {
    .app-header .container {
        padding: 12px !important;
        gap: 10px !important;
        order: 2 !important;
    }
    
    /* Скрываем кнопки регистрации и авторизации на мобильных */
    .header-auth-buttons,
    .desktop-auth-btn {
        display: none !important;
    }
    
    .mobile-burger {
        order: 2 !important;
        margin-left: 8px !important;
    }
    
    .icon-btn {
        width: 40px;
        height: 40px;
        min-width: 40px;
        min-height: 40px;
    }
    
    .user-avatar {
        width: 36px;
        height: 36px;
    }
    
    .mode-switcher {
        margin-right: 0;
    }
    
    .mode-btn {
        font-size: 0.75rem;
        padding: 6px 10px;
    }
    
    .mode-btn span {
        display: none;
    }
    
    .header-balance-btn {
        font-size: 0.75rem;
        padding: 8px 12px;
    }
    
    .balance-amount {
        font-size: 0.6875rem;
    }
}

/* 480px - Логотип уменьшается до 100px для телефонов */
@media (max-width: 480px) {
    .app-header .container {
        padding: 10px 12px !important;
        gap: 8px !important;
    }
    
    /* Логотип 100px */
    .logo-wrapper {
        min-width: 100px !important;
    }
    
    .logo-container {
        min-width: 100px !important;
    }
    
    .logo-image {
        width: 100px !important;
        min-width: 100px !important;
        max-width: 100px !important;
        height: 40px !important;
    }
    
    .icon-btn {
        width: 36px;
        height: 36px;
        min-width: 36px;
        min-height: 36px;
        font-size: 0.875rem;
    }
    
    .user-avatar {
        width: 32px;
        height: 32px;
    }
    
    .header-balance-btn {
        padding: 6px 10px;
        font-size: 0.6875rem;
    }
    
    .balance-amount {
        display: none;
    }
}

/* ============================================
   МОБИЛЬНОЕ МЕНЮ
   ============================================ */

/* Базовые стили для мобильного меню (работают на всех разрешениях ≤1600px) */
.mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 9998;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-overlay.active,
.mobile-overlay.open {
    display: block !important;
    opacity: 1;
}

.mobile-nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    max-width: 360px;
    height: 100vh;
    background: var(--bg-surface);
    padding: 30px 25px;
    padding-top: 80px;
    overflow-y: auto;
    z-index: 9999;
    transition: right 0.3s ease;
    box-shadow: -2px 0 20px rgba(0, 0, 0, 0.2);
    border-left: 1px solid var(--border-color);
}

.mobile-overlay.active .mobile-nav,
.mobile-overlay.open .mobile-nav {
    right: 0 !important;
}

.mobile-link {
    display: block;
    padding: 14px 18px;
    color: var(--text-main);
    text-decoration: none;
    border-radius: var(--radius-card);
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 15px;
}

.mobile-link:hover {
    background: var(--bg-secondary);
    color: var(--color-primary);
}

.mobile-menu-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
    z-index: 10000;
}

.mobile-menu-close:hover {
    color: var(--color-primary);
}

/* Предотвращаем скролл body когда меню открыто */
body.menu-open {
    overflow: hidden;
}

/* ============================================
   МОБИЛЬНОЕ МЕНЮ - ИСПРАВЛЕНИЯ
   ============================================ */

/* Скрываем бургер и мобильное меню только на больших экранах (>1600px) */
@media (min-width: 1201px) {
    .mobile-overlay {
        display: none !important;
    }
    
    .mobile-burger {
        display: none !important;
    }
}

@media (max-width: 968px) {
    /* Бургер уже показан на 1500px, здесь ничего не делаем */
    
    .mobile-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 9998;
        display: none;
        opacity: 0;
        transition: opacity 0.3s ease;
    }
    
    .mobile-overlay.active,
    .mobile-overlay.open {
        display: block !important;
        opacity: 1;
    }
    
    .mobile-nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 320px;
        height: 100vh;
        background: var(--bg-surface);
        padding: 20px;
        padding-top: 70px;
        overflow-y: auto;
        transition: right 0.3s ease;
        z-index: 9999;
        box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    }
    
    .mobile-menu-close {
        position: absolute;
        top: 20px;
        right: 20px;
        width: 40px;
        height: 40px;
        border-radius: 50%;
        background: var(--bg-body);
        border: 1px solid var(--border-color);
        color: var(--text-main);
        font-size: 1.125rem;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.2s;
        z-index: 10000;
    }
    
    .mobile-menu-close:hover {
        background: var(--color-primary);
        color: white;
        border-color: var(--color-primary);
        transform: rotate(90deg);
    }
    
    .mobile-overlay.active .mobile-nav,
    .mobile-overlay.open .mobile-nav {
        right: 0 !important;
    }
    
    /* Закрытие меню при клике на overlay */
    /* Предотвращаем скролл body когда меню открыто */
    body.menu-open {
        overflow: hidden;
    }
    
    .mobile-link {
        display: block;
        padding: 14px 16px;
        margin-bottom: 8px;
        border-radius: 10px;
        color: var(--text-main);
        font-size: 1rem;
        transition: background 0.2s;
        text-decoration: none;
    }
    
    .mobile-link:hover {
        background: var(--bg-body);
    }
    
    .mobile-link i {
        margin-right: 10px;
        width: 20px;
        display: inline-block;
    }
}

@media (max-width: 480px) {
    .mobile-nav {
        width: 85%;
        max-width: 280px;
        padding: 20px;
        padding-top: 70px;
    }
    
    .mobile-link {
        padding: 12px 14px;
        font-size: 0.9375rem;
    }
}

/* ============================================
   HERO СЕКЦИИ
   ============================================ */

@media (max-width: 768px) {
    .hero-split {
        padding: 40px 0 !important;
        overflow: visible !important;
        display: block !important;
        width: 100% !important;
        position: relative !important;
    }
    
    .hero-split .container {
        max-width: 100% !important;
        width: 100% !important;
        padding: 0 16px !important;
        position: relative !important;
        z-index: 1 !important;
    }
    
    .hero-title {
        font-size: 1.75rem !important;
        line-height: 1.2;
    }
    
    .hero-single {
        text-align: center;
    }
    
    .hero-search-container {
        flex-direction: row !important;
        max-width: 500px !important;
        padding: 4px !important;
        gap: 0 !important;
    }
    
    .hero-search-input {
        flex: 1 !important;
        min-width: 0 !important;
        font-size: 0.9375rem !important;
        padding: 10px 16px !important;
    }
    
    .hero-search-btn {
        width: 44px !important;
        height: 44px !important;
        min-width: 44px !important;
        padding: 0 !important;
        flex-shrink: 0 !important;
        border-radius: 50% !important;
        font-size: 1rem !important;
    }
    
    .split-wrapper {
        grid-template-columns: 1fr !important;
        gap: 16px;
        display: grid !important;
    }
    
    .split-card {
        padding: 30px 20px;
        height: auto;
        min-height: 280px;
        width: 100% !important;
    }
    
    .split-content h2 {
        font-size: 1.5rem;
    }
    
    .split-content p {
        font-size: 0.875rem;
    }
}

@media (max-width: 480px) {
    .hero-split {
        padding: 30px 0 !important;
        overflow: visible !important;
        display: block !important;
        width: 100% !important;
    }
    
    .hero-split .container {
        max-width: 100% !important;
        width: 100% !important;
        padding: 0 12px !important;
    }
    
    .hero-title {
        font-size: 1.5rem !important;
    }
    
    /* Hero search - еще более компактная форма на маленьких экранах */
    .hero-search-container {
        flex-direction: row !important;
        max-width: 100% !important;
        padding: 3px !important;
        gap: 0 !important;
    }
    
    .hero-search-input {
        flex: 1 !important;
        min-width: 0 !important;
        font-size: 0.875rem !important;
        padding: 8px 12px !important;
    }
    
    .hero-search-btn {
        width: 40px !important;
        height: 40px !important;
        min-width: 40px !important;
        padding: 0 !important;
        flex-shrink: 0 !important;
        border-radius: 50% !important;
        font-size: 0.9375rem !important;
    }
    
    .split-card {
        padding: 24px 16px;
        width: 100% !important;
    }
    
    .split-content h2 {
        font-size: 1.25rem;
    }
}

/* ============================================
   СЕКЦИИ И ЗАГОЛОВКИ
   ============================================ */

@media (max-width: 768px) {
    .section-2025 {
        padding: 40px 0 !important;
    }
    
    .section-title,
    .ds-title-lg {
        font-size: 1.75rem !important;
        margin-bottom: 24px;
    }
    
    .section-header-flex {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .link-view-all {
        align-self: flex-end;
        font-size: 0.875rem;
    }
}

@media (max-width: 480px) {
    .section-2025 {
        padding: 30px 0 !important;
    }
    
    .section-title,
    .ds-title-lg {
        font-size: 1.5rem !important;
        margin-bottom: 20px;
    }
}

/* ============================================
   КАРТОЧКИ ПРОЕКТОВ
   ============================================ */

@media (max-width: 1200px) {
    .projects-grid-modern {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 20px;
    }
}

@media (max-width: 968px) {
    .projects-grid-modern {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 18px;
    }
}

@media (max-width: 768px) {
    .projects-grid-modern {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .projects-list-modern {
        gap: 16px;
    }
    
    .project-row-modern,
    .paid-project-card {
        padding: 16px !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        min-width: 0 !important;
    }
    
    .p-top-badge {
        width: 28px;
        height: 28px;
        font-size: 0.75rem;
    }
    
    .p-title-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        width: 100%;
        margin-bottom: 8px;
    }
    
    .p-title {
        font-size: 1rem;
        line-height: 1.4;
        width: 100%;
        margin: 0;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    .p-urgent-badge-title {
        font-size: 0.75rem;
        padding: 4px 8px;
        margin-top: 0;
        margin-bottom: 0;
        align-self: flex-start;
        width: auto;
        max-width: 100%;
        position: relative;
        z-index: 1;
    }
    
    .p-description-row {
        flex-direction: column;
        gap: 12px;
    }
    
    .p-description {
        font-size: 0.875rem;
        line-height: 1.5;
    }
    
    .p-info {
        margin-top: 12px !important;
        padding-top: 0 !important;
    }
    
    .p-budget {
        font-size: 1rem;
        font-weight: 700;
        text-align: center !important;
        margin: 10px 0 !important;
        width: 100% !important;
        justify-content: center !important;
        display: flex !important;
    }
    
    .p-employer-row {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }
    
    .p-employer-link {
        width: 100%;
    }
    
    .p-employer-avatar {
        width: 32px !important;
        height: 32px !important;
        min-width: 32px !important;
        min-height: 32px !important;
        max-width: 32px !important;
        max-height: 32px !important;
        aspect-ratio: 1 / 1 !important;
    }
    
    .p-employer-avatar-placeholder {
        width: 32px !important;
        height: 32px !important;
        min-width: 32px !important;
        min-height: 32px !important;
        max-width: 32px !important;
        max-height: 32px !important;
        aspect-ratio: 1 / 1 !important;
        font-size: 0.875rem;
    }
    
    .p-freelancer-avatar {
        width: 32px !important;
        height: 32px !important;
        min-width: 32px !important;
        min-height: 32px !important;
        max-width: 32px !important;
        max-height: 32px !important;
        aspect-ratio: 1 / 1 !important;
    }
    
    .p-freelancer-avatar-placeholder {
        width: 32px !important;
        height: 32px !important;
        min-width: 32px !important;
        min-height: 32px !important;
        max-width: 32px !important;
        max-height: 32px !important;
        aspect-ratio: 1 / 1 !important;
        font-size: 0.875rem;
    }
    
    .p-employer-link > div[style*="position: relative"],
    .p-freelancer-link > div[style*="position: relative"] {
        width: 32px !important;
        height: 32px !important;
        min-width: 32px !important;
        min-height: 32px !important;
        max-width: 32px !important;
        max-height: 32px !important;
        aspect-ratio: 1 / 1 !important;
    }
    
    .p-meta-center {
        flex-wrap: wrap;
        gap: 8px;
        justify-content: flex-start;
    }
    
    .p-meta-item {
        font-size: 0.75rem;
        padding: 4px 8px;
    }
    
    .p-respond-btn {
        width: 100%;
        justify-content: center;
        padding: 12px;
    }
}

@media (max-width: 480px) {
    .project-row-modern,
    .paid-project-card {
        padding: 12px !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        min-width: 0 !important;
    }
    
    .p-top-badge {
        width: 24px;
        height: 24px;
        font-size: 0.625rem;
    }
    
    .p-title {
        font-size: 0.9375rem;
        width: 100%;
        margin: 0;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    .p-title-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        width: 100%;
        margin-bottom: 12px;
    }
    
    .p-urgent-badge-title {
        font-size: 0.6875rem;
        padding: 4px 8px;
        margin-top: 0;
        align-self: flex-start;
        width: auto;
        max-width: 100%;
    }
    
    .p-info {
        margin-top: 12px !important;
        padding-top: 0 !important;
    }
    
    .p-description {
        font-size: 0.8125rem;
    }
    
    .p-budget {
        font-size: 0.875rem;
    }
    
    .p-info {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
        margin-top: 8px !important;
        padding-top: 8px !important;
    }
    
    .p-meta-center {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .p-meta-item {
        width: 100%;
        padding: 6px 8px;
    }
    
    .p-employer-name {
        font-size: 0.8125rem;
    }
}

/* ============================================
   КАРТОЧКИ ФРИЛАНСЕРОВ
   ============================================ */

@media (max-width: 1200px) {
    .freelancers-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

@media (max-width: 768px) {
    .freelancers-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .freelancer-card-2025 {
        padding: 20px;
    }
    
    .f-avatar-large {
        width: 80px;
        height: 80px;
    }
    
    .f-name-large {
        font-size: 1.125rem;
    }
    
    .f-spec-large {
        font-size: 0.875rem;
    }
    
    .f-rating-large {
        font-size: 0.875rem;
    }
    
    .top-freelancer-list {
        flex-direction: column;
    }
    
    .freelancer-list-card {
        flex-direction: column;
        text-align: center;
    }
    
    .f-info-list {
        width: 100%;
    }
    
    .f-stats-list {
        flex-wrap: wrap;
        justify-content: center;
        gap: 16px;
    }
    
    .f-action-list {
        width: 100%;
    }
    
    .f-action-list .btn {
        width: 100%;
    }
    
    .scroll-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }
    
    .scroll-container .freelancer-card-2025 {
        min-width: 250px;
        flex-shrink: 0;
    }
}

@media (max-width: 480px) {
    .freelancer-card-2025 {
        padding: 16px;
    }
    
    .f-avatar-large {
        width: 60px;
        height: 60px;
    }
    
    .f-name-large {
        font-size: 1rem;
    }
    
    .f-stats-list {
        flex-direction: column;
        gap: 12px;
    }
    
    .stat-item-list {
        width: 100%;
        justify-content: center;
    }
}

/* ============================================
   КАРТОЧКИ РАБОТОДАТЕЛЕЙ
   ============================================ */

@media (max-width: 768px) {
    .employers-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .employer-card {
        padding: 20px;
    }
}

/* ============================================
   КАТЕГОРИИ
   ============================================ */

@media (max-width: 768px) {
    .categories-icons-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 16px;
    }
    
    .cat-icon-card {
        padding: 16px 12px;
    }
    
    .cat-icon-circle {
        width: 50px;
        height: 50px;
    }
    
    .cat-name {
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .categories-icons-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 12px;
    }
    
    .cat-icon-card {
        padding: 12px 8px;
    }
    
    .cat-icon-circle {
        width: 40px;
        height: 40px;
        font-size: 1.125rem;
    }
}

/* ============================================
   НОВОСТИ / БЛОГ
   ============================================ */

@media (max-width: 768px) {
    .news-grid-modern {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .news-card-modern {
        flex-direction: column;
    }
    
    .news-image {
        width: 100%;
        height: 200px;
    }
    
    .news-content {
        padding: 16px;
    }
    
    .news-title {
        font-size: 1.125rem;
    }
    
    .news-excerpt {
        font-size: 0.875rem;
    }
}

/* ============================================
   ФОРМЫ
   ============================================ */

@media (max-width: 768px) {
    .form-group {
        margin-bottom: 16px;
    }
    
    .form-input,
    .form-textarea,
    .form-select {
        width: 100%;
        padding: 12px 16px;
        font-size: 1rem; /* Предотвращает зум на iOS */
        min-height: 44px;
    }
    
    .form-row {
        flex-direction: column;
        gap: 16px;
    }
    
    .form-row .form-group {
        width: 100%;
    }
    
    .form-actions {
        flex-direction: column;
        gap: 12px;
    }
    
    .form-actions .btn {
        width: 100%;
    }
}

/* ============================================
   КНОПКИ
   ============================================ */

@media (max-width: 768px) {
    .btn {
        min-height: 44px;
        min-width: 44px;
        padding: 12px 20px;
        font-size: 0.875rem;
        touch-action: manipulation;
    }
    
    .btn-sm {
        padding: 10px 16px;
        font-size: 0.8125rem;
        min-height: 40px;
    }
    
    .btn-lg {
        padding: 14px 28px;
        font-size: 1rem;
        min-height: 48px;
    }
}

@media (max-width: 480px) {
    .btn {
        padding: 12px 16px;
        font-size: 0.875rem;
    }
}

/* ============================================
   МОДАЛЬНЫЕ ОКНА
   ============================================ */

@media (max-width: 768px) {
    .modal {
        width: 95%;
        max-width: 95%;
        margin: 20px auto;
        padding: 16px;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .modal-content {
        padding: 20px 16px;
    }
    
    .modal-header {
        padding: 16px;
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .modal-title {
        font-size: 1.25rem;
    }
    
    .modal-close {
        position: absolute;
        top: 16px;
        right: 16px;
    }
    
    .search-modal {
        padding: 20px 12px;
        align-items: flex-start;
        padding-top: 80px;
    }
    
    .search-modal-content {
        width: 100%;
        max-width: 100%;
        padding: 0;
    }
    
    .search-modal-input-wrapper {
        padding: 14px 20px;
    }
    
    .search-modal-input {
        font-size: 1rem;
    }
    
    .search-modal-close {
        top: -45px;
        right: 0;
    }
}

/* ============================================
   ТАБЛИЦЫ
   ============================================ */

@media (max-width: 768px) {
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        display: block;
        width: 100%;
    }
    
    table {
        min-width: 600px;
        font-size: 0.875rem;
    }
    
    th, td {
        padding: 10px 8px;
    }
    
    th {
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    table {
        min-width: 500px;
        font-size: 0.75rem;
    }
    
    th, td {
        padding: 8px 6px;
    }
}

/* ============================================
   ПАГИНАЦИЯ
   ============================================ */

@media (max-width: 768px) {
    .pagination {
        flex-wrap: wrap;
        gap: 8px;
        justify-content: center;
    }
    
    .pagination-btn,
    .page-number {
        min-width: 40px;
        min-height: 40px;
        padding: 8px 12px;
        font-size: 0.875rem;
    }
}

@media (max-width: 480px) {
    .pagination {
        gap: 4px;
    }
    
    .pagination-btn,
    .page-number {
        min-width: 36px;
        min-height: 36px;
        padding: 6px 10px;
        font-size: 0.75rem;
    }
}

/* ============================================
   ФИЛЬТРЫ И САЙДБАР
   ============================================ */

@media (max-width: 968px) {
    .content-wrapper {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        order: -1;
        margin-bottom: 24px;
    }
    
    .filter-content {
        flex-direction: column;
    }
    
    .filter-group {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .sidebar {
        padding: 16px;
    }
    
    .filter-options {
        flex-direction: column;
        gap: 12px;
    }
    
    .checkbox-option,
    .radio-option {
        min-height: 44px;
        padding: 12px;
    }
}

/* ============================================
   ПОИСК
   ============================================ */

@media (max-width: 768px) {
    .main-search-wrapper {
        width: 100%;
        max-width: 100%;
    }
    
    .main-search {
        flex-direction: column;
    }
    
    .main-search-input {
        width: 100%;
        font-size: 1rem;
        padding: 14px 20px;
    }
    
    .search-submit-btn {
        width: 100%;
        padding: 14px;
    }
    
    .projects-search-wrapper {
        margin-bottom: 20px;
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 10px !important;
        box-sizing: border-box !important;
    }

    .projects-search-wrapper .main-search {
        flex-direction: column;
        gap: 12px;
    }
}

/* ============================================
   ПРОФИЛЬ ФРИЛАНСЕРА
   ============================================ */

@media (max-width: 968px) {
    .prof-hero {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }
    
    .prof-avatar-section {
        margin: 0 auto;
    }
    
    .prof-info {
        width: 100%;
    }
    
    .prof-stats {
        flex-wrap: wrap;
        gap: 16px;
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .freelancer-profile-header,
    .prof-hero {
        flex-direction: column;
        text-align: center;
        gap: 20px;
        padding: 20px;
    }
    
    .freelancer-avatar-large,
    .profile-avatar,
    .profile-avatar img {
        width: 100px;
        height: 100px;
    }
    
    .freelancer-info,
    .prof-info {
        width: 100%;
    }
    
    .freelancer-stats,
    .prof-stats {
        flex-wrap: wrap;
        gap: 16px;
        justify-content: center;
    }
    
    .freelancer-works-grid,
    .prof-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .prof-public-links {
        flex-direction: column;
        width: 100%;
    }
    
    .prof-public-link {
        width: 100%;
        justify-content: center;
    }
    
    .prof-categories-list {
        flex-direction: column;
    }
    
    .prof-category-checkbox {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .prof-hero {
        padding: 16px;
    }
    
    .freelancer-avatar-large,
    .profile-avatar,
    .profile-avatar img {
        width: 80px;
        height: 80px;
    }
    
    .prof-stats {
        flex-direction: column;
        gap: 12px;
    }
    
    .prof-stat-box {
        padding: 16px;
    }
    
    .prof-stat-box-value {
        font-size: 1.5rem;
    }
}

/* ============================================
   СТРАНИЦА ПРОЕКТА
   ============================================ */

@media (max-width: 968px) {
    .project-detail-content {
        grid-template-columns: 1fr;
    }
    
    .project-detail-sidebar {
        order: -1;
        margin-bottom: 24px;
    }
}

@media (max-width: 768px) {
    .project-detail-main {
        padding: 20px 0;
    }
    
    .project-detail-header {
        flex-direction: column;
        gap: 16px;
    }
    
    .project-detail-title {
        font-size: 1.5rem;
    }
    
    .project-detail-meta {
        flex-wrap: wrap;
        gap: 12px;
    }
}

/* ============================================
   СООБЩЕНИЯ
   ============================================ */

@media (max-width: 968px) {
    .msg-container {
        grid-template-columns: 1fr !important;
        height: auto !important;
        min-height: 600px;
        margin: 0 16px;
    }
    
    .msg-sidebar {
        order: -1;
        border-right: none;
        border-bottom: 2px solid rgba(0, 0, 0, 0.06);
        max-height: 400px;
        overflow-y: auto;
    }
    
    .msg-content {
        min-height: 500px;
    }
    
    .messages-layout {
        grid-template-columns: 1fr;
    }
    
    .messages-sidebar {
        order: -1;
        margin-bottom: 20px;
    }
}

@media (max-width: 768px) {
    .msg-page {
        padding: 20px 0;
    }
    
    .msg-container {
        border-radius: 12px;
        margin: 0 12px;
        height: auto !important;
    }
    
    .msg-sidebar-header {
        padding: 16px;
    }
    
    .msg-tabs {
        flex-direction: column;
        gap: 8px;
    }
    
    .msg-tab {
        width: 100%;
    }
    
    .msg-list {
        max-height: 300px;
    }
    
    .msg-item {
        padding: 12px 16px;
    }
    
    .conversation-message {
        margin-left: 10% !important;
        margin-right: 10% !important;
        padding: 12px;
    }
    
    .conversation-reply-form {
        padding: 12px;
    }
    
    .conversation-message-input {
        font-size: 1rem;
        min-height: 60px;
    }
    
    .messages-list {
        max-height: 300px;
    }
    
    .message-item {
        padding: 12px;
    }
    
    .message-content {
        padding: 12px;
    }
}

/* ============================================
   FOOTER
   ============================================ */

@media (max-width: 768px) {
    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
        text-align: center;
    }
    
    .footer-section {
        margin-bottom: 24px;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 12px;
    }
    
    .footer-bottom-content {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
}

/* ============================================
   РАДИО
   ============================================ */

@media (max-width: 768px) {
    .radio-card-2025 {
        flex-direction: column;
        padding: 20px;
        gap: 20px;
    }
    
    .radio-visualizer {
        width: 100%;
        justify-content: center;
    }
    
    .radio-info {
        text-align: center;
    }
    
    .radio-controls-modern {
        width: 100%;
        justify-content: center;
    }
}

/* ============================================
   СПЕЦИАЛЬНЫЕ КОМПОНЕНТЫ
   ============================================ */

@media (max-width: 768px) {
    .view-toggle {
        gap: 8px;
    }
    
    .view-btn {
        width: 40px;
        height: 40px;
        min-width: 40px;
        min-height: 40px;
    }
    
    .stats-grid {
        flex-wrap: wrap;
        gap: 12px;
    }
    
    /* Chatbot и Scroll-to-top - ОДИНАКОВЫЙ РАЗМЕР 56px КАК НА ДЕСКТОПЕ */
    .scroll-to-top {
        width: min(56px, 12vw) !important;
        height: min(56px, 12vw) !important;
        min-width: min(56px, 12vw) !important;
        min-height: min(56px, 12vw) !important;
        font-size: 1.25rem !important;
        bottom: 96px !important;
        right: 20px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    .chatbot-toggle {
        width: min(56px, 12vw) !important;
        height: min(56px, 12vw) !important;
        min-width: min(56px, 12vw) !important;
        min-height: min(56px, 12vw) !important;
        font-size: 1.25rem !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    .chatbot-container.has-scroll-button {
        bottom: 20px !important;
        right: 20px !important;
    }
    
    /* Радио - выровнено по правому краю */
    .floating-radio-btn {
        right: 20px !important;
    }
    
    /* Scroll-to-top - выровнено по правому краю */
    .scroll-to-top {
        right: 20px !important;
    }
    
    /* Workspaces */
    .ws-stats {
        grid-template-columns: 1fr;
    }
    
    .ws-stat-card {
        flex-direction: column;
        text-align: center;
    }
    
    /* Top freelancers/employers list */
    .top-freelancer-list {
        flex-direction: column;
    }
    
    .top-badge-number-list {
        position: static;
        margin-bottom: 12px;
    }
    
    .freelancer-list-card {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }
    
    .f-avatar-list {
        margin: 0 auto 16px;
    }
    
    .f-info-list {
        width: 100%;
    }
    
    .f-stats-list {
        flex-wrap: wrap;
        justify-content: center;
        gap: 16px;
    }
    
    .f-action-list {
        width: 100%;
        margin-top: 16px;
    }
    
    .scroll-container.top-others {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 10px;
    }
    
    .scroll-container.top-others .freelancer-card-2025 {
        min-width: 220px;
        flex-shrink: 0;
    }
    
    /* Projects list header */
    .projects-list-header {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
    }
    
    .projects-list-header-left,
    .projects-list-header-right {
        width: 100%;
    }
    
    .projects-list-header-right {
        justify-content: flex-start;
    }
    
    /* Breadcrumbs */
    .breadcrumbs {
        flex-wrap: wrap;
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    /* Chatbot и Scroll-to-top - ОДИНАКОВЫЙ РАЗМЕР 56px КАК НА ДЕСКТОПЕ */
    .scroll-to-top {
        width: min(56px, 12vw) !important;
        height: min(56px, 12vw) !important;
        min-width: min(56px, 12vw) !important;
        min-height: min(56px, 12vw) !important;
        font-size: 1.25rem !important;
        bottom: 96px !important;
        right: 20px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    .chatbot-toggle {
        width: min(56px, 12vw) !important;
        height: min(56px, 12vw) !important;
        min-width: min(56px, 12vw) !important;
        min-height: min(56px, 12vw) !important;
        font-size: 1.25rem !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    .chatbot-container.has-scroll-button {
        bottom: 20px !important;
        right: 20px !important;
    }
    
    /* Радио - выровнено по правому краю */
    .floating-radio-btn {
        right: 20px !important;
    }
    
    /* Scroll-to-top - выровнено по правому краю */
    .scroll-to-top {
        right: 20px !important;
    }
    
    .chatbot-toggle {
        width: min(50px, 10vw) !important;
        height: 50px !important;
        min-width: min(50px, 10vw) !important;
        min-height: 50px !important;
        font-size: 1.25rem !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    .top-badge-number-list {
        font-size: 1.5rem;
        width: 50px;
        height: 50px;
    }
    
    .top-badge-small {
        font-size: 0.875rem;
        width: 30px;
        height: 30px;
    }
}

/* ============================================
   УТИЛИТЫ ДЛЯ МОБИЛЬНЫХ
   ============================================ */

@media (max-width: 768px) {
    /* Предотвращение горизонтального скролла */
    body {
        overflow-x: hidden;
        width: 100%;
        position: relative;
    }
    
    /* Улучшение touch-интерфейса */
    button,
    a.btn,
    .btn,
    input[type="submit"],
    input[type="button"],
    .nav-link,
    .icon-btn {
        -webkit-tap-highlight-color: rgba(124, 58, 237, 0.2);
        touch-action: manipulation;
    }
    
    /* Улучшение читаемости текста */
    p, span, div {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    /* Улучшение для длинных слов */
    h1, h2, h3, h4, h5, h6 {
        word-wrap: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
    }
}

/* ============================================
   ДОПОЛНИТЕЛЬНЫЕ КОМПОНЕНТЫ
   ============================================ */

@media (max-width: 768px) {
    /* Paid placement empty state */
    .paid-placement-empty {
        padding: 40px 20px !important;
    }
    
    .paid-placement-empty h3 {
        font-size: 1.25rem !important;
    }
    
    .paid-placement-empty p {
        font-size: 0.875rem !important;
    }
    
    .paid-placement-empty .btn {
        width: 100%;
        margin-bottom: 12px;
    }
    
    /* Radio card */
    .radio-card-2025 {
        flex-direction: column;
        padding: 20px;
        gap: 20px;
    }
    
    .radio-visualizer {
        width: 100%;
        justify-content: center;
    }
    
    .radio-info {
        text-align: center;
    }
    
    .radio-controls-modern {
        width: 100%;
        justify-content: center;
    }
    
    /* Chatbot, Radio и Scroll-to-top - ВЫРОВНЕНЫ В СТОЛБИК */
    /* Все кнопки выровнены по правому краю (right: 20px) */
    /* Когда scroll-to-top видна: Chatbot (20px) -> Radio (90px) -> Scroll-to-top (160px) */
    /* Когда scroll-to-top скрыта: Chatbot (20px) -> Radio (90px) - подтягиваются вверх */
    
    .chatbot-container {
        bottom: 20px !important;
        right: 20px !important;
        z-index: 9997 !important;
        transition: bottom 0.3s ease !important;
    }
    
    .chatbot-container.has-scroll-button {
        bottom: 20px !important;
        right: 20px !important;
    }
    
    /* Когда scroll-to-top скрыта, chatbot и radio остаются на своих местах */
    /* Но можно подтянуть их выше, если нужно */
    
    .chatbot-toggle {
        width: min(56px, 12vw) !important;
        height: min(56px, 12vw) !important;
        min-width: min(56px, 12vw) !important;
        min-height: min(56px, 12vw) !important;
        font-size: 1.25rem !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        visibility: visible !important;
        opacity: 1 !important;
        position: relative !important;
        margin: 0 auto !important;
    }
    
    .chatbot-window {
        width: calc(100vw - 20px) !important;
        max-width: calc(100vw - 20px) !important;
        height: calc(100vh - 100px) !important;
        bottom: 86px !important;
        right: 0 !important;
        border-radius: 20px 20px 0 0 !important;
        z-index: 9996 !important;
    }
    
    /* Радио - между chatbot и scroll-to-top, выровнено по правому краю */
    .floating-radio-btn {
        bottom: 90px !important;
        right: 20px !important;
        z-index: 9996 !important;
        transition: bottom 0.3s ease !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    /* Scroll to top - САМАЯ ВЫСОКАЯ КНОПКА, выровнена по правому краю */
    .scroll-to-top {
        width: min(56px, 12vw) !important;
        height: min(56px, 12vw) !important;
        min-width: min(56px, 12vw) !important;
        min-height: min(56px, 12vw) !important;
        font-size: 1.25rem !important;
        bottom: 160px !important;
        right: 20px !important;
        z-index: 999999 !important; /* Высокий z-index, но ниже чатбота */
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        transition: bottom 0.3s ease, opacity 0.3s ease, visibility 0.3s ease !important;
    }
    
    .scroll-to-top.visible {
        z-index: 999999 !important; /* Высокий z-index, но ниже чатбота */
        opacity: 1 !important;
        visibility: visible !important;
    }
    
    /* Когда scroll-to-top скрыта, остальные кнопки остаются на своих местах */
    /* Если нужно подтягивание, используйте JavaScript (уже реализовано в main-2025-final.js) */
    
    /* Auth pages */
    .auth-container {
        padding: 20px 12px;
    }
    
    .auth-box {
        width: 100%;
        max-width: 100%;
        padding: 24px 20px;
    }
    
    /* Help/FAQ pages */
    .help-categories-grid,
    .faq-categories-list {
        grid-template-columns: 1fr;
        flex-direction: column;
    }
    
    .help-category-card,
    .faq-category-btn {
        width: 100%;
    }
    
    /* Rules/Terms pages */
    .rules-content,
    .terms-content {
        grid-template-columns: 1fr;
    }
    
    .rules-toc {
        position: static;
        margin-bottom: 24px;
    }
    
    /* Workspaces */
    .ws-stats {
        grid-template-columns: 1fr;
    }
    
    .ws-stat-card {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    /* Chatbot, Radio и Scroll-to-top - ВЫРОВНЕНЫ В СТОЛБИК */
    /* Все кнопки выровнены по правому краю (right: 20px) */
    .chatbot-container {
        bottom: 20px !important;
        right: 20px !important;
        z-index: 9997 !important;
        transition: bottom 0.3s ease !important;
    }
    
    .chatbot-container.has-scroll-button {
        bottom: 20px !important;
        right: 20px !important;
    }
    
    .chatbot-toggle {
        width: min(56px, 12vw) !important;
        height: min(56px, 12vw) !important;
        min-width: min(56px, 12vw) !important;
        min-height: min(56px, 12vw) !important;
        font-size: 1.25rem !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .chatbot-window {
        width: calc(100vw - 20px) !important;
        max-width: calc(100vw - 20px) !important;
        height: calc(100vh - 100px) !important;
        bottom: 86px !important;
        right: 0 !important;
        border-radius: 20px 20px 0 0 !important;
        z-index: 9996 !important;
    }
    
    /* Радио - между chatbot и scroll-to-top, выровнено по правому краю */
    .floating-radio-btn {
        bottom: 90px !important;
        right: 20px !important;
        z-index: 9996 !important;
        transition: bottom 0.3s ease !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    /* Scroll to top - САМАЯ ВЫСОКАЯ КНОПКА, выровнена по правому краю */
    .scroll-to-top {
        width: min(56px, 12vw) !important;
        height: min(56px, 12vw) !important;
        min-width: min(56px, 12vw) !important;
        min-height: min(56px, 12vw) !important;
        font-size: 1.25rem !important;
        bottom: 160px !important;
        right: 20px !important;
        z-index: 999999 !important; /* Высокий z-index, но ниже чатбота */
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        transition: bottom 0.3s ease, opacity 0.3s ease, visibility 0.3s ease !important;
    }
    
    .scroll-to-top.visible {
        z-index: 999999 !important; /* Высокий z-index, но ниже чатбота */
        opacity: 1 !important;
        visibility: visible !important;
    }
    
    .auth-box {
        padding: 20px 16px;
    }
}

/* ============================================
   ОЧЕНЬ МАЛЕНЬКИЕ ЭКРАНЫ (320px)
   ============================================ */

@media (max-width: 320px) {
    .container {
        padding: 0 8px;
    }
    
    .app-header {
        height: var(--header-height) !important;
        min-height: var(--header-height) !important;
    }
    
    .app-header .container {
        padding: 8px !important;
        gap: 6px !important;
    }
    
    /* Логотип остается 100px */
    .logo-image {
        width: 100px !important;
        min-width: 100px !important;
        max-width: 100px !important;
    }
    
    .section-2025 {
        padding: 24px 0 !important;
    }
    
    .section-title,
    .ds-title-lg {
        font-size: 1.25rem !important;
    }
    
    .btn {
        padding: 10px 14px;
        font-size: 0.8125rem;
        min-height: 40px;
    }
    
    .project-row-modern,
    .paid-project-card,
    .freelancer-card-2025 {
        padding: 12px;
    }
    
    /* Chatbot и Scroll-to-top - ОДИНАКОВЫЙ РАЗМЕР 56px КАК НА ДЕСКТОПЕ */
    .chatbot-container {
        bottom: 20px !important;
        right: 20px !important;
        z-index: 9997 !important;
    }
    
    .chatbot-container.has-scroll-button {
        bottom: 20px !important;
        right: 20px !important;
    }
    
    /* Радио - между chatbot и scroll-to-top */
    .floating-radio-btn {
        bottom: 90px !important;
        right: 20px !important;
        z-index: 9996 !important;
    }
    
    .chatbot-toggle {
        width: min(56px, 12vw) !important;
        height: min(56px, 12vw) !important;
        min-width: min(56px, 12vw) !important;
        min-height: min(56px, 12vw) !important;
        font-size: 1.25rem !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .chatbot-window {
        width: 100vw !important;
        max-width: 100vw !important;
        height: calc(100vh - 100px) !important;
        bottom: 86px !important;
        right: 0 !important;
        border-radius: 16px 16px 0 0 !important;
        z-index: 100000 !important; /* Выше всех кнопок */
    }
    
    /* Радио - между chatbot и scroll-to-top */
    .floating-radio-btn {
        bottom: 90px !important;
        right: 20px !important;
        z-index: 9996 !important;
    }
    
    .scroll-to-top {
        width: min(56px, 12vw) !important;
        height: min(56px, 12vw) !important;
        min-width: min(56px, 12vw) !important;
        min-height: min(56px, 12vw) !important;
        font-size: 1.25rem !important;
        bottom: 160px !important;
        right: 20px !important;
        z-index: 999999 !important; /* Высокий z-index, но ниже чатбота */
        display: flex !important;
    }
    
    .scroll-to-top.visible {
        z-index: 999999 !important; /* Высокий z-index, но ниже чатбота */
        opacity: 1 !important;
        visibility: visible !important;
    }
    
    .mobile-nav {
        width: 90%;
        max-width: 260px;
    }
}

/* ============================================
   РАЗРЕШЕНИЕ 1024px - ПЛАНШЕТЫ И МАЛЫЕ НОУТБУКИ
   (Элементы уже скрыты на 1200px, здесь ничего не делаем)
   ============================================ */

@media (max-width: 1024px) {
    .app-header {
        height: var(--header-height) !important;
        min-height: var(--header-height) !important;
    }
    
    .app-header .container {
        padding: 12px 16px !important;
    }
    
    /* Убеждаемся, что кнопки видны */
    .chatbot-container {
        display: block !important;
        position: fixed !important;
        bottom: 20px !important;
        right: 20px !important;
        z-index: 9997 !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .chatbot-toggle {
        display: flex !important;
        width: min(56px, 12vw) !important;
        height: min(56px, 12vw) !important;
        min-width: min(56px, 12vw) !important;
        min-height: min(56px, 12vw) !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    .floating-radio-btn {
        display: flex !important;
        position: fixed !important;
        bottom: 90px !important;
        right: 20px !important;
        z-index: 9996 !important;
        width: min(56px, 12vw) !important;
        height: min(56px, 12vw) !important;
        min-width: min(56px, 12vw) !important;
        min-height: min(56px, 12vw) !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .scroll-to-top {
        position: fixed !important;
        bottom: 160px !important;
        right: 20px !important;
        z-index: 999999 !important; /* Высокий z-index, но ниже чатбота */ /* Выше всех кнопок */
        width: min(56px, 12vw) !important;
        height: min(56px, 12vw) !important;
        min-width: min(56px, 12vw) !important;
        min-height: min(56px, 12vw) !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    .scroll-to-top.visible {
        visibility: visible !important;
        opacity: 1 !important;
        z-index: 999999 !important; /* Высокий z-index, но ниже чатбота */ /* Всегда выше при видимости */
    }
    
    /* Меню - показываем мобильное меню */
    .main-nav {
        display: none !important;
    }

    /* Элементы уже управляются базовыми медиа-запросами */
    /* Логотип управляется базовыми медиа-запросами (768px и 480px) */
    /* header-actions, main-nav скрыты на 1200px */
    /* mobile-burger показан на 1500px */
    
    .icon-btn {
        width: min(40px, 8vw) !important;
        height: 40px !important;
        min-width: min(40px, 8vw) !important;
        min-height: 40px !important;
    }
}

/* ============================================
   ЛАНДШАФТНАЯ ОРИЕНТАЦИЯ ПЛАНШЕТОВ
   ============================================ */

@media (min-width: 769px) and (max-width: 1024px) and (orientation: landscape) {
    .app-header {
        height: 90px;
        position: sticky !important;
        top: 0 !important;
        z-index: 10000 !important;
        width: 100% !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        transform: none !important;
    }
    
    /* Логотип остается 40px после 730px */
    .logo-image {
        min-width: 120px !important;
        height: 40px;
    }
    
    .section-2025 {
        padding: 50px 0;
    }
    
    /* Кнопки в ландшафтной ориентации */
    .chatbot-container {
        bottom: 20px !important;
        right: 20px !important;
    }
    
    .floating-radio-btn {
        bottom: 90px !important;
        right: 20px !important;
    }
    
    .scroll-to-top {
        bottom: 160px !important;
        right: 20px !important;
    }
}

/* ============================================
   БОЛЬШИЕ ЭКРАНЫ (от 1920px до 8k)
   ============================================ */
/* Медиа-запросы для больших экранов - это нормально для адаптивности */

@media (min-width: 1920px) {
    .container {
        max-width: 1400px;
    }
    
    .app-header .container {
        max-width: 1400px;
    }
}

@media (min-width: 2560px) {
    .container {
        max-width: 1600px;
    }
    
    .app-header .container {
        max-width: 1600px;
    }
    
    .section-2025 {
        padding: 100px 0;
    }
    
    .section-title,
    .ds-title-lg {
        font-size: 3rem;
    }
}

@media (min-width: 3840px) {
    .container {
        max-width: 2000px;
    }
    
    .app-header .container {
        max-width: 2000px;
    }
    
    .section-2025 {
        padding: 120px 0;
    }
    
    .section-title,
    .ds-title-lg {
        font-size: 3.5rem;
    }
    
    /* Chatbot, Radio и Scroll-to-top - ВЫРОВНЕНЫ В СТОЛБИК */
    .chatbot-container {
        bottom: 20px;
        right: 20px;
    }
    
    .chatbot-container.has-scroll-button {
        bottom: 20px;
        right: 20px;
    }
    
    /* Радио - выровнено по правому краю */
    .floating-radio-btn {
        right: 20px !important;
    }
    
    .chatbot-toggle {
        width: min(56px, 12vw) !important;
        height: min(56px, 12vw) !important;
        min-width: min(56px, 12vw) !important;
        min-height: min(56px, 12vw) !important;
        font-size: 1.25rem !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    .scroll-to-top {
        width: min(56px, 12vw) !important;
        height: min(56px, 12vw) !important;
        min-width: min(56px, 12vw) !important;
        min-height: min(56px, 12vw) !important;
        font-size: 1.25rem !important;
        bottom: 160px;
        right: 20px;
    }
}

@media (min-width: 7680px) {
    .container {
        max-width: 2400px;
    }
    
    .app-header .container {
        max-width: 2400px;
    }
    
    .section-2025 {
        padding: 150px 0;
    }
    
    .section-title,
    .ds-title-lg {
        font-size: 4rem;
    }
    
    /* Chatbot, Radio и Scroll-to-top - ВЫРОВНЕНЫ В СТОЛБИК */
    .chatbot-container {
        bottom: 20px;
        right: 20px;
    }
    
    .chatbot-container.has-scroll-button {
        bottom: 20px;
        right: 20px;
    }
    
    /* Радио - выровнено по правому краю */
    .floating-radio-btn {
        right: 20px !important;
    }
    
    .chatbot-toggle {
        width: min(56px, 12vw) !important;
        height: min(56px, 12vw) !important;
        min-width: min(56px, 12vw) !important;
        min-height: min(56px, 12vw) !important;
        font-size: 1.25rem !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    .scroll-to-top {
        width: min(56px, 12vw) !important;
        height: min(56px, 12vw) !important;
        min-width: min(56px, 12vw) !important;
        min-height: min(56px, 12vw) !important;
        font-size: 1.25rem !important;
        bottom: 160px;
        right: 20px;
    }
}

/* ============================================
   ВЫСОКИЕ ЭКРАНЫ (RETINA)
   ============================================ */

@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .logo-image {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* ============================================
   ПЕЧАТЬ
   ============================================ */

@media print {
    .app-header,
    .mobile-burger,
    .mobile-overlay,
    .header-actions,
    .main-nav,
    .btn,
    .pagination,
    .scroll-to-top {
        display: none !important;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .container {
        max-width: 100%;
        padding: 0;
    }
}


