/* adaptive.css - Версия 4.0: Сетка 2 колонки на планшете, 1 на мобильном */

/* ========================================= */
/* БУРГЕР МЕНЮ */
/* ========================================= */
.mobile-menu-toggle {
    display: none; 
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 1001;
    padding: 0;
    margin-right: 0;
}

.mobile-menu-toggle span {
    width: 100%;
    height: 3px;
    background-color: #ffffff;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.mobile-menu-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 6px); }
.mobile-menu-toggle.active span:nth-child(2) { opacity: 0; }
.mobile-menu-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -6px); }


/* ========================================= */
/* АДАПТИВ (Планшеты и Мобильные - до 1024px) */
/* ========================================= */
@media (max-width: 1024px) {
    
    /* 1. ГЛОБАЛЬНЫЙ СБРОС И ФОН */
    html, body {
        overflow-y: auto !important;
        overflow-x: hidden !important;
        width: 100% !important;
        min-height: 100vh !important;
        position: relative !important;
        margin: 0 !important;
        
        background: linear-gradient(180deg, #0f084e 0%, #3d005e 100%) !important;
        background-attachment: fixed !important;
        background-repeat: no-repeat !important;
        background-size: cover !important;
    }

    .horizontal-wrapper {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        height: auto !important;
        white-space: normal !important;
    }

    .vertical-wrapper {
        display: block !important;
        height: auto !important;
    }

    .section {
        min-width: 100% !important;
        width: 100% !important;
        height: auto !important;
        min-height: auto !important;
        padding-bottom: 40px;
        padding-top: 40px;
        display: flex !important;
        flex-direction: column !important;
        overflow: visible !important;
        background: transparent !important;
    }

    .container {
        width: 100% !important;
        padding: 0 20px !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        margin: 0 auto !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
    }

    /* 2. ШАПКА */
    header {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 60px !important;
        background-color: rgba(15, 8, 78, 0.95) !important;
        z-index: 1000 !important;
        transform: none !important;
        padding: 0 15px !important;
        justify-content: space-between !important;
        box-sizing: border-box !important;
        display: flex !important;
        align-items: center !important;
        margin-top: 0 !important;
        opacity: 1 !important;
        box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    }
    
    .mobile-menu-toggle {
        display: flex !important;
        order: 3;
    }

    nav {
        position: absolute;
        top: 60px;
        left: 0;
        width: 100%;
        background-color: #0f084e;
        padding: 20px 0;
        transform: translateY(-150%);
        transition: transform 0.3s ease-in-out;
        z-index: 999;
        border-bottom: 1px solid rgba(255,255,255,0.1);
        box-shadow: 0 10px 20px rgba(0,0,0,0.5);
    }

    nav.menu-open { transform: translateY(0); }

    .menu {
        flex-direction: column !important;
        gap: 15px !important;
        width: 100% !important;
        padding: 0 !important;
        align-items: center !important;
    }
    
    .menu li a {
        font-size: 18px !important;
        display: block;
        padding: 10px;
    }

    header > a[href^="tel:"] {
        font-size: 13px !important;
        margin: 0 !important;
        order: 1;
        font-weight: 600;
    }
    
    header > .header_button {
        font-size: 11px !important;
        padding: 8px 12px !important;
        margin: 0 10px !important;
        order: 2;
        white-space: nowrap;
        text-overflow: ellipsis;
    }

    /* 3. ГЛАВНАЯ СЕКЦИЯ (MAIN) */
    .section.main {
        padding-top: 100px;
    }

    .main_logo_section {
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        margin-top: 0 !important;
        width: 100%;
    }

    .text_logo_block {
        margin-top: 0 !important;
        align-items: center !important;
        width: 100%;
    }

    .text_image {
        max-width: 90% !important;
        height: auto !important;
    }

    .logo-text {
        margin: 20px 0 !important;
        font-size: 16px !important;
        line-height: 1.4 !important;
        max-width: 100% !important;
        text-align: center !important;
        margin-left: 0 !important;
    }

    .logo_gif {
        margin: 20px auto !important;
        max-width: 220px !important;
        margin-left: 0 !important;
    }

    /* --- БЛОК КАЧЕСТВ (Сетка 2x2) --- */
    .sectors {
        margin-top: 30px !important;
        position: static !important;
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        gap: 15px !important;
        width: 100% !important;
        padding: 0 5px;
    }
    
    .sectors img { display: none !important; }

    .our_plus_text {
        margin: 0 !important; 
        font-size: 14px !important;
        text-align: center !important;
        display: flex !important;
        justify-content: center;
        align-items: center;
        width: auto !important;
        font-weight: 600 !important;
        text-transform: uppercase;
        background: rgba(255, 255, 255, 0.1);
        border: 1px solid rgba(255, 255, 255, 0.3);
        border-radius: 8px;
        padding: 15px 5px;
        min-height: 50px;
        box-shadow: 0 4px 6px rgba(0,0,0,0.1);
        text-shadow: none !important;
    }
    
    .our_plus_text:active {
        background: rgba(255, 255, 255, 0.2);
    }


    /* 4. СЕКЦИЯ КОМПЕТЕНЦИЙ (ПЛАШКИ) */
    .all_comp > img { display: none !important; }

    .competencies__title {
        top: 0 !important;
        margin: 0 0 30px 0 !important;
        font-size: 24px !important;
        line-height: 1.2 !important;
        text-align: center !important;
        width: 100%;
        text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    }

    .all_comp {
        margin-top: 0 !important;
        /* Используем Grid для адаптивности */
        display: grid !important;
        /* На планшете (до 1024px) будет 2 колонки */
        grid-template-columns: 1fr 1fr; 
        gap: 20px !important;
        width: 100% !important;
    }

    /* Стиль карточки-плашки - ВЕРТИКАЛЬНЫЙ */
    .competencies__block {
        position: relative !important;
        margin: 0 !important;
        left: auto !important;
        top: auto !important;
        display: flex !important;
        flex-direction: column !important; /* Вертикально */
        align-items: center !important;    /* Центр */
        justify-content: flex-start !important; /* Чтобы при разной высоте контента верх был ровным */
        width: 100% !important;
        padding: 20px 0 !important;
        background: rgba(255,255,255,0.07) !important;
        border-radius: 16px;
        backdrop-filter: blur(10px);
        border: 1px solid rgba(255,255,255,0.15);
        box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    }

    /* Псевдоэлемент для картинки */
    .competencies__block::before {
        content: '';
        display: block;
        /* Уменьшили размер, чтобы влезало в 2 колонки на планшете */
        width: 100%; 
        height: 160px; 
        background-size: contain;
        background-repeat: no-repeat;
        background-position: center;
        margin-bottom: 15px;
        flex-shrink: 0;
    }

    /* Картинки */
    .competencies__block:nth-of-type(1)::before { background-image: url('../images/graf_des_much.png'); }
    .competencies__block:nth-of-type(2)::before { background-image: url('../images/prez_much.png'); }
    .competencies__block:nth-of-type(3)::before { background-image: url('../images/video_much.png'); }
    .competencies__block:nth-of-type(4)::before { background-image: url('../images/digital_much.png'); }

    /* Заголовок плашки */
    .competencies__block h3.visually-hidden {
        position: static !important;
        width: auto !important;
        height: auto !important;
        clip: auto !important;
        margin: 0 0 10px 0 !important;
        font-size: 16px !important;
        font-weight: 800 !important;
        color: #fff !important;
        text-transform: uppercase !important;
        text-align: center !important;
        display: block !important;
        line-height: 1.2;
        letter-spacing: 0.5px;
    }

    /* Описание плашки */
    .competencies__block-description {
        text-align: center !important;
        font-size: 14px;
        line-height: 1.4;
        margin: 0;
        color: #e0e0e0;
    }
    

    /* 5. СЕКЦИИ УСЛУГ (ТЕКСТЫ) */
    .competencies__blocks.competition {
        margin-top: 0 !important;
        flex-direction: column !important;
        gap: 30px !important;
        display: flex !important;
        width: 100% !important;
    }

    .competitions_big_image {
        width: 100% !important;
        max-width: 350px !important; /* Чуть увеличили для планшетов */
        height: auto !important;
        object-fit: contain !important;
        margin: 0 auto !important;
        display: block !important;
    }

    /* Блок с текстом - ПОДЛОЖКА */
    .right_text_section {
        max-width: 100% !important;
        padding: 30px !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 20px !important;
        align-items: flex-start !important; 
        text-align: left !important;
        
        /* Улучшенный стиль "стекла" */
        background: rgba(20, 10, 60, 0.4); 
        backdrop-filter: blur(10px);
        border-radius: 20px;
        border: 1px solid rgba(255, 255, 255, 0.1);
        box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    }
    
    .right_text_section > div {
        width: 100% !important;
        display: flex;
        flex-direction: column;
        gap: 15px;
        align-items: flex-start !important;
    }

    .title_compet_about {
        font-size: 22px !important;
        line-height: 1.4 !important;
        text-align: center !important;
        width: 100%;
        margin-bottom: 10px;
        font-style: normal !important;
        font-weight: 700 !important;
        color: #ff9ef4;
        border-bottom: 1px solid rgba(255,255,255,0.15);
        padding-bottom: 15px;
    }

    .text_compet_about {
        font-size: 17px !important;
        text-align: left !important;
        line-height: 1.6 !important;
        margin-bottom: 5px !important;
        color: #f5f5f5;
    }
    
    /* Списки */
    .compet_about_list {
        text-align: left !important;
        padding-left: 0 !important;
        margin-top: 10px;
        display: flex;
        flex-direction: column;
        gap: 12px;
        width: 100%;
    }
    
    .compet_about_elem {
        font-size: 17px !important;
        line-height: 1.5 !important;
        padding-left: 25px !important;
        position: relative;
        list-style: none !important;
        text-align: left !important;
        color: #fff;
    }

    .compet_about_elem::before {
        content: "";
        display: block;
        width: 8px;
        height: 8px;
        background-color: #ff00de;
        position: absolute;
        left: 0;
        top: 9px;
        border-radius: 2px;
        box-shadow: 0 0 5px #ff00de;
    }
    .compet_about_elem::marker { content: none !important; }

    /* Отключаем параллакс и фоновые картинки у секций */
    .bg_1, .bg_2, .bg_3, .bg_4, .bg_5 {
        background: transparent !important;
    }

    /* Modal Mobile */
    .modal-container {
        margin: 15% auto !important;
        padding: 25px 20px !important;
        width: 85% !important;
    }
    .modal-title { font-size: 22px; }
    .close-modal-btn { top: 10px; right: 15px; }
}

/* ========================================= */
/* ТЕЛЕФОНЫ (до 600px) */
/* ========================================= */
@media (max-width: 600px) {
    /* Перестраиваем плашки в 1 колонку на мобильных */
    .all_comp {
        grid-template-columns: 1fr !important;
    }

    .sectors {
        gap: 10px !important;
    }
    
    .right_text_section {
        padding: 20px !important;
    }
    
    .title_compet_about {
        font-size: 20px !important;
    }
    
    .text_compet_about, .compet_about_elem {
        font-size: 15px !important;
    }

    /* Modal */
    .modal-container { margin: 20% auto !important; }
}

/* ========================================= */
/* ОЧЕНЬ МАЛЕНЬКИЕ ЭКРАНЫ (до 380px) */
/* ========================================= */
@media (max-width: 380px) {
    header > .header_button {
        font-size: 10px !important;
        padding: 6px 10px !important;
    }
    .logo-text { font-size: 14px !important; }
    .competencies__title { font-size: 20px !important; }
    
    .our_plus_text { font-size: 12px !important; padding: 10px 5px; }
}