/* ============================================================
   media.css — полная переработка мобильной версии ege-drive.ru
   Breakpoints:
     ≤1420px  — средние десктопы
     ≤1179px  — планшеты (горизонт) / мобильный хедер включается
     ≤991px   — планшеты (вертикаль)
     ≤767px   — большие телефоны
     ≤479px   — маленькие телефоны
   ============================================================ */

/* ----------------------------------------------------------
   1420px — Средний десктоп
   ---------------------------------------------------------- */
@media (max-width: 1420px) {
    .cont {
        max-width: 1200px;
    }

    .footer {
        padding: 45px 0 35px;
    }

    .menu__item-link {
        padding: 25px 15px;
        font-size: 18px;
    }
}


/* ----------------------------------------------------------
   1179px — Переключение на мобильный хедер
   ---------------------------------------------------------- */
@media (max-width: 1179.98px) {
    /* --- Контейнер --- */
    .cont {
        max-width: none;
    }

    /* --- Хедер: десктоп скрыт, мобильный показан --- */
    .header {
        padding: 0;
        height: auto;
        min-height: 64px;
    }

    .header__desktop {
        display: none !important;
    }

    .header__mobile {
        display: block;
    }

    /* Отступ для page под fixed-хедер */
    .page {
        padding-top: 80px;
    }

    /* === НОВЫЙ МОБИЛЬНЫЙ ХЕДЕР === */
    .mobile-header-bar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 10px 16px;
        min-height: 64px;
    }

    .mobile-header-bar .logo {
        margin-right: 0;
        width: auto;
        flex-shrink: 0;
    }

    .mobile-header-bar .logo img {
        height: 48px;
        width: auto;
    }

    .mobile-header-actions {
        display: flex;
        align-items: center;
        gap: 10px;
    }

    /* Кнопка телефона */
    .mobile-phone-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        border-radius: 50%;
        background-color: #4c84ff;
        color: #fff;
        transition: background-color 0.2s;
    }

    .mobile-phone-btn:hover {
        background-color: #3668d9;
    }

    /* Мини-иконки соцсетей в хедере */
    .mobile-social-btn {
        display: flex;
        width: 34px;
        height: 34px;
        border-radius: 50%;
        background-color: #4c84ff;
        background-repeat: no-repeat;
        background-position: center;
        background-size: 60%;
        transition: background-color 0.2s;
    }

    .mobile-social-btn:hover {
        background-color: #3668d9;
    }

    .mobile-social-vk {
        background-image: url(/assets/main/img/icon/vk.svg);
    }

    .mobile-social-max {
        background-image: url(/assets/main/img/icon/max.svg);
    }

    /* === БУРГЕР === */
    .mobile-burger {
        position: relative;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        padding: 0;
        background: none;
        border: none;
        cursor: pointer;
        z-index: 201;
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }

    .mobile-burger span {
        display: block;
        width: 24px;
        height: 2.5px;
        background-color: #4c84ff;
        border-radius: 2px;
        transition: transform 0.3s, opacity 0.3s;
    }

    .mobile-burger span:nth-child(1) { margin-bottom: 6px; }
    .mobile-burger span:nth-child(2) { margin-bottom: 6px; }

    .mobile-burger.active span:nth-child(1) {
        transform: translateY(8.5px) rotate(45deg);
    }
    .mobile-burger.active span:nth-child(2) {
        opacity: 0;
    }
    .mobile-burger.active span:nth-child(3) {
        transform: translateY(-8.5px) rotate(-45deg);
    }

    /* === МОБИЛЬНОЕ МЕНЮ OVERLAY === */
    .mobile-menu-overlay {
        position: fixed;
        top: 64px;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: #fff;
        z-index: 200;
        opacity: 0;
        visibility: hidden;
        transform: translateY(-10px);
        transition: opacity 0.3s, visibility 0.3s, transform 0.3s;
        overflow: hidden;
    }

    .mobile-menu-overlay.active {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    .mobile-menu-scroll {
        height: 100%;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 20px 20px 40px;
        display: flex;
        flex-direction: column;
        gap: 24px;
    }

    /* Быстрые действия */
    .mobile-menu-quick {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .mobile-menu-cta {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        padding: 14px 24px;
        background-color: #4c84ff;
        color: #fff;
        border-radius: 30px;
        font-family: 'Gilroy-Semibold', sans-serif;
        font-size: 16px;
        line-height: 1.2;
        text-align: center;
        transition: background-color 0.2s;
        text-decoration: none;
    }

    .mobile-menu-cta:hover {
        background-color: #3668d9;
    }

    .mobile-menu-cta svg {
        flex-shrink: 0;
    }

    .mobile-menu-phone {
        font-family: 'Gilroy-Semibold', sans-serif;
        font-size: 20px;
        color: #252525;
        text-align: center;
        text-decoration: none;
        padding: 4px 0;
    }

    /* Навигация */
    .mobile-menu-nav {
        display: flex;
        flex-direction: column;
    }

    .mobile-menu-link {
        display: block;
        padding: 14px 0;
        font-family: 'Gilroy-Semibold', sans-serif;
        font-size: 18px;
        color: #252525;
        text-decoration: none;
        border-bottom: 1px solid #e8eaf0;
        transition: color 0.2s;
        cursor: pointer;
        -webkit-tap-highlight-color: rgba(76, 132, 255, 0.1);
        touch-action: manipulation;
    }

    .mobile-menu-link:hover,
    .mobile-menu-link:active {
        color: #4c84ff;
    }

    /* Аккордеон «О нас» */
    .mobile-menu-group {
        border-bottom: 1px solid #e8eaf0;
    }

    .mobile-menu-group-toggle {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        padding: 14px 0;
        font-family: 'Gilroy-Semibold', sans-serif;
        font-size: 18px;
        color: #252525;
        background: none;
        border: none;
        cursor: pointer;
        text-align: left;
        -webkit-tap-highlight-color: rgba(76, 132, 255, 0.1);
        touch-action: manipulation;
    }

    .mobile-menu-chevron {
        transition: transform 0.3s;
        flex-shrink: 0;
    }

    .mobile-menu-group.open .mobile-menu-chevron {
        transform: rotate(180deg);
    }

    .mobile-menu-sublist {
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.35s ease;
        list-style: none;
        padding: 0;
        margin: 0;
    }

    .mobile-menu-group.open .mobile-menu-sublist {
        max-height: 600px;
    }

    .mobile-menu-sublist li {
        margin: 0;
    }

    .mobile-menu-sublist a {
        display: block;
        padding: 10px 0 10px 16px;
        font-size: 16px;
        color: #4c84ff;
        text-decoration: none;
        border-left: 2px solid #4c84ff;
        transition: background-color 0.2s;
        cursor: pointer;
        -webkit-tap-highlight-color: rgba(76, 132, 255, 0.1);
        touch-action: manipulation;
    }

    .mobile-menu-sublist a:hover,
    .mobile-menu-sublist a:active {
        background-color: #f0f4ff;
    }

    /* Хештег-ссылки */
    .mobile-menu-tags {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

    .mobile-tag {
        display: inline-block;
        padding: 8px 14px;
        background-color: #f0f4ff;
        color: #4c84ff;
        border-radius: 20px;
        font-size: 14px;
        font-family: 'Gilroy-Semibold', sans-serif;
        text-decoration: none;
        transition: background-color 0.2s, color 0.2s;
    }

    .mobile-tag:hover {
        background-color: #4c84ff;
        color: #fff;
    }

    /* Соцсети внизу меню */
    .mobile-menu-social {
        display: flex;
        justify-content: center;
        gap: 16px;
        padding-top: 8px;
    }

    .mobile-menu-social .btn_circle {
        width: 44px;
        height: 44px;
    }

    /* Старое мобильное меню — полностью скрыто */
    .header__mobile > .fflex > .header__right > .burger,
    .header__mobile > .fflex,
    .header__mobile > ul.menu[data-menu="mobile-menu"] {
        display: none !important;
    }

    /* === VK НОВОСТИ (секция vknews) === */
    .vknews {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x mandatory;
        gap: 12px;
        padding-bottom: 8px;
    }

    .vknews_item {
        flex: 0 0 220px;
        scroll-snap-align: start;
    }

    .vknews_title {
        font-size: 14px;
    }

    /* === СЛАЙДЕР (main) === */
    .main .swiper-slide .container {
        padding: 0 16px;
    }

    .main__content.flex {
        flex-direction: column;
        gap: 20px;
    }

    .main__info {
        width: 100%;
        text-align: center;
    }

    .main__title {
        font-size: 24px;
        line-height: 1.2;
    }

    .main__description {
        font-size: 14px;
        line-height: 1.5;
    }

    .main__description br {
        display: none;
    }

    .main__img {
        width: 100%;
        display: flex;
        justify-content: center;
    }

    .main__img img {
        max-width: 80%;
        height: auto;
        margin: 0 auto;
    }

    .main__img .video-wrapper img {
        margin-left: 0 !important;
    }

    .btn-wrapper {
        justify-content: center;
    }

    /* === НАПРАВЛЕНИЯ === */
    .directions__wrapper.flex {
        flex-direction: column;
        gap: 20px;
    }

    .direcrions__content {
        width: 100%;
        font-size: 15px;
        line-height: 1.6;
    }

    .direcrions__content ul {
        padding-left: 20px;
    }

    .direcrions__content ul li {
        list-style: disc;
        margin-bottom: 8px;
    }

    .direcrions__image {
        width: 100%;
    }

    .direcrions__image img {
        width: 100%;
        height: auto;
        border-radius: 12px;
    }

    /* === ПРЕИМУЩЕСТВА === */
    .advantages__items.flex {
        flex-direction: column;
        align-items: center;
        gap: 16px;
    }

    .advantages__img {
        display: none;
    }

    .advantage {
        width: 100%;
        max-width: 400px;
    }

    .advantages__separator {
        display: none;
    }

    /* === РЕЗУЛЬТАТЫ === */
    .res__content.flex {
        flex-direction: column;
        gap: 20px;
    }

    .res__img {
        display: none;
    }

    .res__items.flex {
        flex-direction: column;
        gap: 16px;
        width: 100%;
    }

    .res__item {
        width: 100%;
    }

    /* === КУРСЫ === */
    .courses__links-wrapper.flex {
        justify-content: center;
    }

    .courses__links.flex {
        gap: 0;
    }

    /* === ПОЧЕМУ МЫ ЛУЧШЕ === */
    .why__content.flex {
        flex-direction: column;
        gap: 20px;
    }

    .why__item {
        width: 100%;
    }

    .why__icon_desktop {
        display: none;
    }

    .why__icon_mobile {
        display: block;
    }

    /* === ОТЗЫВЫ === */
    .testimonials__slider {
        overflow: hidden;
    }

    /* === ПАРТНЁРЫ === */
    .partners__slider .swiper-slide {
        width: auto;
    }

    .partners__slider .swiper-slide img {
        max-height: 60px;
        width: auto;
    }

    /* === КАРТА === */
    .map__block {
        height: 300px;
        position: relative;
    }

    /* === ФУТЕР === */
    .footer {
        padding: 35px 0 30px;
    }

    .footer__wrapper {
        flex-wrap: wrap;
        gap: 24px;
    }

    .footer__col {
        width: 100%;
    }

    .footer__col:nth-child(1) {
        order: 1;
        align-items: center;
        text-align: center;
    }

    .footer__col:nth-child(1) .logo {
        margin: 0 auto;
    }

    .footer__paragraph {
        width: 100%;
        max-width: none;
        margin: 10px 0 0;
        font-size: 12px;
        text-align: center;
    }

    .footer__col:nth-child(2) {
        order: 4;
        text-align: center;
    }

    .footer__col:nth-child(3) {
        order: 3;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: space-around;
    }

    .footer__col:nth-child(4) {
        order: 2;
    }

    .footer__contacts {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }

    .footer__contacts a {
        text-align: center;
    }

    .footer__social {
        justify-content: center;
        gap: 12px;
    }

    .footer__social > a {
        margin-left: 0;
    }

    .footer__info-wrapper {
        justify-content: center;
        margin-top: 16px;
    }

    .footer .block_desk {
        display: none;
    }

    .footer .block_mob {
        display: flex;
        order: 5;
        padding-top: 16px;
    }

    .footer .menu-sublist__item-link {
        padding: 0 4px 12px;
        font-size: 14px;
    }

    .footer__menu-sublist {
        width: 50%;
    }

    .footer__heading {
        font-size: 16px;
        margin-bottom: 10px;
    }

    /* === ОБЩИЕ СТИЛИ === */
    .title {
        font-size: 24px;
    }

    .bbtn {
        font-size: 14px;
        padding: 10px 20px;
        line-height: 1;
    }

    .btn_circle {
        width: 36px;
        height: 36px;
        padding: 0;
    }

    .btn-social {
        background-size: 60%;
    }

    .link {
        font-size: 16px;
    }

    /* Пагинация */
    .pagination__item {
        padding: 8px 14px;
        font-size: 16px;
    }
}


/* ----------------------------------------------------------
   991px — Планшет (вертикальный)
   ---------------------------------------------------------- */
@media (max-width: 991.98px) {
    .mobile-header-bar .logo img {
        height: 42px;
    }

    .mobile-burger {
        width: 36px;
        height: 36px;
    }

    .mobile-burger span {
        width: 22px;
    }

    .mobile-header-actions {
        gap: 8px;
    }

    .mobile-phone-btn {
        width: 36px;
        height: 36px;
    }

    .mobile-phone-btn svg {
        width: 18px;
        height: 18px;
    }

    .mobile-social-btn {
        width: 30px;
        height: 30px;
    }

    /* Слайдер */
    .main__title {
        font-size: 22px;
    }

    .main__img img {
        max-width: 90%;
    }

    /* Преимущества — 2 колонки */
    .advantages__items.flex {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }

    .advantage {
        width: calc(50% - 8px);
    }

    /* Партнёры */
    .partners__slider .swiper-slide img {
        max-height: 50px;
    }

    /* Курсы */
    .courses__link-one,
    .courses__link-two {
        font-size: 16px;
        padding: 10px 20px;
    }

    /* Футер */
    .footer__col:nth-child(3) {
        flex-direction: column;
        align-items: center;
    }

    .footer__menu-sublist {
        width: 100%;
        text-align: center;
    }

    .footer__menu-sublist .menu-sublist__item-link {
        justify-content: center;
    }

    .footer__info {
        margin-left: 6px;
        max-width: 68px;
        height: 23px;
    }

    .footer .link_no-decor {
        font-size: 14px;
        padding-top: 5px;
    }
}


/* ----------------------------------------------------------
   767px — Телефон (большой)
   ---------------------------------------------------------- */
@media (max-width: 767.98px) {
    .cont {
        padding: 0 16px;
    }

    .page {
        padding-top: 72px;
    }

    .mobile-menu-overlay {
        top: 56px;
    }

    /* VK Новости */
    .vknews_item {
        flex: 0 0 180px;
    }

    /* Слайдер */
    .main__title {
        font-size: 20px;
    }

    .main__description {
        font-size: 13px;
    }

    .main__img img {
        max-width: 100%;
    }

    /* Преимущества — одна колонка */
    .advantage {
        width: 100%;
        max-width: none;
    }

    /* Почему мы лучше */
    .why__item-title {
        font-size: 18px;
    }

    .why__list li {
        font-size: 14px;
        line-height: 1.5;
    }

    /* Результаты */
    .res__percent p {
        font-size: 28px;
    }

    .res__title {
        font-size: 16px;
    }

    .res__info p {
        font-size: 13px;
    }

    /* Партнёры */
    .partners__slider .swiper-slide img {
        max-height: 40px;
    }

    /* Карта */
    .map__block {
        height: 250px;
    }

    /* Футер */
    .footer {
        padding: 28px 0 24px;
    }

    .footer__col:nth-child(3) {
        gap: 16px;
    }

    .footer .block_mob .link_min {
        font-size: 11px;
    }

    /* Общие */
    .title {
        font-size: 22px;
        margin-bottom: 16px;
    }

    .pagination__item {
        padding: 6px 10px;
        font-size: 14px;
        margin: 0 3px;
    }
}


/* ----------------------------------------------------------
   479px — Телефон (маленький)
   ---------------------------------------------------------- */
@media (max-width: 479.98px) {
    .mobile-header-bar {
        padding: 8px 12px;
    }

    .mobile-header-bar .logo img {
        height: 36px;
    }

    .mobile-social-btn {
        width: 28px;
        height: 28px;
    }

    .mobile-phone-btn {
        width: 32px;
        height: 32px;
    }

    .mobile-phone-btn svg {
        width: 16px;
        height: 16px;
    }

    .mobile-menu-scroll {
        padding: 16px 16px 32px;
        gap: 20px;
    }

    .mobile-menu-link {
        font-size: 16px;
        padding: 12px 0;
    }

    .mobile-menu-group-toggle {
        font-size: 16px;
        padding: 12px 0;
    }

    .mobile-menu-sublist a {
        font-size: 14px;
        padding: 8px 0 8px 14px;
    }

    .mobile-menu-phone {
        font-size: 18px;
    }

    .mobile-menu-cta {
        font-size: 15px;
        padding: 12px 20px;
    }

    .mobile-tag {
        font-size: 13px;
        padding: 6px 12px;
    }

    /* VK Новости */
    .vknews_item {
        flex: 0 0 160px;
    }

    .vknews_title {
        font-size: 12px;
    }

    /* Слайдер */
    .main__title {
        font-size: 18px;
    }

    .main .btn {
        font-size: 14px;
        padding: 10px 24px;
    }

    /* Направления */
    .direcrions__content {
        font-size: 14px;
    }

    /* Преимущества */
    .advantage__description {
        font-size: 13px;
    }

    /* Общие */
    .title {
        font-size: 20px;
    }

    .container {
        padding: 0 12px;
    }

    /* Карта */
    .map__block {
        height: 200px;
    }
}


/* ----------------------------------------------------------
   Хедер при скролле (уменьшенный)
   ---------------------------------------------------------- */
@media (max-width: 1179.98px) {
    .header--small {
        height: auto;
        min-height: 52px;
    }

    .header--small .mobile-header-bar {
        min-height: 52px;
        padding-top: 6px;
        padding-bottom: 6px;
    }

    .header--small .mobile-header-bar .logo img {
        height: 36px;
    }

    .header--small .mobile-menu-overlay {
        top: 52px;
    }
}


/* ----------------------------------------------------------
   Safe-area для iPhone с «чёлкой»
   ---------------------------------------------------------- */
@supports (padding: env(safe-area-inset-bottom)) {
    .mobile-menu-scroll {
        padding-bottom: calc(40px + env(safe-area-inset-bottom));
    }

    .footer {
        padding-bottom: calc(24px + env(safe-area-inset-bottom));
    }
}


/* ----------------------------------------------------------
   Скрытие scrollbar для vknews
   ---------------------------------------------------------- */
.vknews {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.vknews::-webkit-scrollbar {
    display: none;
}


/* ----------------------------------------------------------
   Print
   ---------------------------------------------------------- */
@media print {
    .header,
    .footer,
    .mobile-menu-overlay,
    .support-btn,
    #scrollToTop {
        display: none !important;
    }

    .page {
        padding-top: 0 !important;
    }
}