/* =================== */
/* АДАПТИВНЫЕ СТИЛИ */
/* =================== */

/* Большие десктопы (меньше 1200px) */
@media (max-width: 1650px) {
    .main-banner__col:first-child .main-banner__item {
        max-width: 75%;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
    h1.main-banner__title {
        font-size: 35px;
        line-height: 35px;
    }
}
@media (max-width: 1400px) {
    .main-banner__col:first-child .main-banner__item {
        max-width: 80%;
        margin: auto;
    }
    .main-banner__item {
        width: 100%;
        height: 100%;
    }
    p.main-banner__text {
        font-size: 16px;
        line-height: 22px;
        margin-top: 15px;
    }
    h1.main-banner__title {
        font-size: 32px;
        line-height: 32px;
}

    .service-stages-content img {
        max-height: unset;
        height: 100%;
    }
}

@media (max-width: 1200px) {
    .consultation-col:first-child {
        padding: 0px 40px 0px 40px;
    }
    
    .service-advantage.big {
        padding: 35px 150px 50px 70px;
    }

    .main-banner__col:first-child .flex.mt-12 {
        margin-top: 1.5rem;
    }

    .main-banner__item button, .main-banner__item a {
        height: 50px;
        display: flex;
        align-items: center;
    }
    .main-banner__col:first-child .main-banner__item {
        max-width: 85%;
    }
}

/* Планшеты (ландшафт) и маленькие десктопы (меньше 992px) */
@media (max-width: 992px) {
    /* Основной баннер */
    .main-banner__row {
        flex-direction: column;
        gap: 20px;
    }
    
    .main-banner__col {
        width: 100%;
        height: auto;
        min-height: 400px;
    }
    
    .main-banner__col:first-child .main-banner__item {
        max-width: 80%;
    }
    
    .main-banner__info {

    }
    
    .main-banner__info p:first-child {
        font-size: 28px;
    }
    
    /* Почему выбирают нас */
    .why-us__row {
        flex-wrap: wrap;
    }
    
    .why-us__col-sm {
        width: calc(50% - 10px);
        margin-bottom: 20px;
    }
    
    .why-us__col-big {
        width: 100%;
        margin-top: 20px;
    }
    
    .why-us__col-big:first-child,
    .why-us__col-big:last-child
    {
        height: 400px;
    }
    
    /* Консультация */
    .consultation-row {
        flex-direction: column;
    }
    
    .consultation-col:first-child,
    .consultation-col:last-child {
        width: 100%;
        padding: 30px;
    }
    
    /* Секция услуг на главной */
    #services_section .container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    /* Кейсы */
    .case-item-image {
        height: 300px;
    }
    
    .case-item .row {
        flex-direction: column;
    }
    
    .case-item-content {
        padding-left: 0;
        padding-top: 30px;
    }
    
    /* Сервис страница */
    .service-advantage.big {
        padding: 35px 50px 50px 70px;
    }
    
    .service-advantage__icon {
        width: 150px;
        height: 150px;
        bottom: -15px;
        right: -15px;
    }
    
    .page-title-head {
        padding-right: 0;
    }
    
    .service-head-icon {
        width: 75px;
        height: 75px;
        padding: 18px;
        top: 0;
    }
    
    .service-cost-wrapper {
        padding: 40px 40px;
    }
    
}

/* Планшеты (портрет) и большие телефоны (меньше 768px) */
@media (max-width: 768px) {
    /* Общие */
    h1.main-banner__title {
        font-size: 28px;
        line-height: 30px;
    }

    footer#footer ul li a {
        font-size: 16px;
    }

    section.py-20 {
        padding-top: 2rem;
        padding-bottom: 2rem;
    }

    #request-modal .modal-box {
        width: 100%;
        height: 100vh !important;
        margin: 0 !IMPORTANT;
        transform: none;
        max-width: unset;
        max-height: unset;
    }
    
    .modal-title {
        font-size: 24px;
        line-height: 28px;
    }
    
    /* Баннер */

    .main-banner__col {
        min-height: unset;
    }

    .main-banner__col:first-child .main-banner__item {
        max-width: 90%;
        padding-top: 30px;
        padding-bottom: 40px;
    }
    
    .main-banner__info {

    }
    
    /* Почему выбирают нас */
    .why-us__col-sm {
        width: 100%;
    }
    
    .why-us__col-form {
        max-width: 90%;
        padding: 30px;
    }

    p.why-us__title {
        margin-bottom: 30px;
    }

    .why-us__col-big video {
        height: 100%;
        object-fit: cover;
    }
    
    /* Свайперы */
    #reviews_slider,
    #licenses_slider,
    #clients_slider {
        padding: 30px 0px 40px 0px;
    }
    
    .review-slide {
        padding: 25px 25px 30px 25px;
    }
    
    .clients-slide {
        padding: 10px;
    }
    
    /* Консультация */
    #consultation_section {
        margin: 0px 15px;
    }
    
    .consultation-row.bg-primary-2 {
        padding: 20px;
    }
    
    p.consultation-title {
        font-size: 26px;
        line-height: 30px;
    }
    
    /* Сервис страница */
    .service-advantage {
        padding: 25px 25px 25px 50px;
    }
    
    .service-advantage.big {
        padding: 30px 30px 40px 50px;
    }
    
    .service-stage-item__info {
        padding: 15px;
    }
    
    #service_stages .col-md-6:first-child .service-stages-content {
        padding: 15px;
    }

    section#service_stages a {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .service-description .col-md-6 {
        margin-bottom: 15px;
    }
    
    /* Тарифы */
    .tariffs-bottom-col button {
        width: 90%;
    }
    
    /* Кейсы */
    .case-selector-wrapper .row {
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: 10px;
        padding-bottom: 10px;
    }
    
    .case-selector-wrapper .col-md-3 {
        flex: 0 0 auto;
        width: auto;
        margin-bottom: 0;
    }
    
    .case-selector {
        white-space: nowrap;
        padding: 0px 15px;
        font-size: 14px;
    }

    .case-item-content {
        padding-top: 15px;
    }
    .case-item__title {
        font-size: 20px;
    }
    
    /* Список услуг */
    #services_list .col-md-3 {
        width: 50%;
    }
    
    .services-card {
        padding: 20px;
    }
    
    /* Стоимость на странице услуги */
    .service-cost {
        padding: 12px 30px;
        font-size: 18px;
    }

    #service_callback button {
        width: 70%;
    }

    #service_callback .bg-primary-2 {
        height: auto;              /* убираем фиксированную высоту */
        padding: 24px 18px;        /* даём нормальные внутренние отступы */
    }

    #service_callback .service-callback-title {
        font-size: 22px;
        line-height: 1.3;
        margin-bottom: 12px;
    }

    #service_callback .service-callback-text {
        font-size: 14px;
        line-height: 1.5;
        text-align: left;
        margin-bottom: 10px;
    }

    #service_callback button {
        width: 100%;       /* кнопка во всю ширину на мобильных */
        max-width: 100%;
        min-width: 0;      /* переопределяем min-width: 250px */
        margin-top: 14px;
    }
}

/* Телефоны (меньше 576px) */
@media (max-width: 576px) {
    /* Общие */
    .container, 
    .container-fluid {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    h1.main-banner__title {
        font-size: 28px;
        line-height: 32px;
    }
    
    h2 {
        font-size: 28px !important;
    }
    
    .main-banner__row {
        padding: 0;
    }

    section#services_section .text-4xl {
        font-size: 28px;
    }
    
    /* Кнопки */
    .button-bordered,
    .button-white,
    .button-transparent {
        padding: 0.75rem 1rem;
        width: 100%;
        justify-content: center;
        text-align: center;
    }

    .main-banner__item button, .main-banner__item a {
        width: 50%;
        font-size: 14px;
    }
    
    .flex.mt-12.gap-6 {
        /* flex-direction: column; */
        gap: 15px !important;
    }
    
    /* Преимущества в баннере */
    .flex.mt-12.gap-12 {
        flex-direction: column;
        gap: 15px !important;
    }
    
    /* Почему выбирают нас */
    .why-us__col-form {
        max-width: 100%;
        padding: 20px;
    }
    
    /* Отзывы и лицензии */
    .review-slide,
    .licenses-slide,
    .clients-slide {
        padding: 20px;
    }
    
    /* Консультация */
    p.consultation-title {
        font-size: 22px;
        line-height: 26px;
    }
    #consultation_section {
        margin: 0px 0px;
    }
    #consultation_section .consultation-col {
        padding: 10px;
    }
    .consultation-video {
        height: 400px;
    }
    .consultation-video video {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    
    /* Модальные окна */
    .modal-box {
        margin: 10px;
        padding: 30px 20px;
    }
    
    #request-form button[type="submit"] {
        min-width: 100%;
    }
    
    /* Сервис страница */
    .service-advantage {
        padding: 20px 20px 20px 45px;
    }
    
    .service-advantage.big {
        padding: 25px 25px 35px 45px;
    }
    
    .service-advantage__title::before {
        left: -30px;
    }

    .service-head-icon {
        width: 60px;
        height: 60px;
        padding: 14px;
        top: 0;
    }
    
    /* Кейсы */
    .case-item {
        padding: 15px;
        margin-bottom: 30px;
    }
    
    .case-item-image {
        height: 250px;
    }
    
    .case-item button {
        max-width: unset;
        margin-top: 30px;
    }

    .case-item__purpose {
        margin-top: 15px;
        margin-bottom: 30px;
        padding: 15px;
    }

    .case-card__desc-item {
        margin-bottom: 15px;
    }

    .case-item__purpose-desc span{
        display: none;
    }
    
    .case-item__purpose-img {
        margin-right: 10px;
        margin-bottom: 15px;
        width: 35px;
        height: 35px;
    }
    
    
    /* Список услуг */
    #services_list .col-md-3 {
        width: 100%;
    }
    
    .services-card a {
        min-width: 100%;
    }

    #service_callback .container {
        padding-left: 12px;
        padding-right: 12px;
    }

    #service_callback .bg-primary-2 {
        padding: 20px 14px;
    }
    
    /* Видео */
    .video-info {
        width: calc(100% - 30px);
        font-size: 16px;
        padding: 10px 15px;
    }
    
    /* Стоимость на странице услуги */
    .service-cost-wrapper {
        padding: 30px 20px;
    }
    
    .service-cost {
        width: 100%;
        padding: 12px 20px;
    }
    
    /* Формы */

    .swiper-container {
        padding: 0 10px;
    }

    .review-slide img {
        width: 60px;
        height: 60px;
    }

    .video-button-wrapper {
        display: none !important;
    }

    #service_stages .col-md-6:last-child .service-stages-content{
        height: 250px !important;
        margin-top: 10px;
    }
}

/* Очень маленькие телефоны (меньше 375px) */
@media (max-width: 375px) {
    h1.main-banner__title {
        font-size: 24px;
        line-height: 28px;
    }
    
    p.main-banner__text {
        font-size: 16px;
        line-height: 20px;
    }
    
    .main-banner__info p:first-child {
        font-size: 24px;
    }
    
    .main-banner__info p:last-child {
        font-size: 14px;
    }
    
    .why-us__title {
        font-size: 16px;
    }
    
    .why-us__text {
        font-size: 14px;
    }
    
    .service-stage-item__number {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }
    
    .case-item__title {
        font-size: 20px;
    }
    
    .video-button {
        width: 50px;
        height: 50px;
        padding: 16px 14px 16px 18px;
    }
}

/* =================== */
/* МЕЛКИЕ УЛУЧШЕНИЯ */
/* =================== */

/* Плавные переходы */
.main-banner__col,
.why-us__col-sm,
.services-card,
.case-item,
.service-advantage {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.main-banner__col:hover,
.why-us__col-sm:hover,
.services-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(24, 108, 235, 0.15);
}

/* Улучшение touch-опыта на мобильных */
@media (hover: none) {
    .why-us__col-sm:hover .why-us__img,
    .why-us__col-sm.active .why-us__img {
        background: var(--main-color);
    }
    
    .why-us__col-sm:hover svg,
    .why-us__col-sm.active svg {
        filter: none;
    }
    
    .case-selector:hover {
        background: #F7F7F7;
        color: inherit;
    }
    
    .case-selector.active {
        background: var(--main-color);
        color: white;
    }
}

/* Улучшение доступности фокуса */
button:focus,
a:focus,
input:focus {
    outline: 2px solid var(--main-color);
    outline-offset: 2px;
}

/* Улучшение читаемости текста на маленьких экранах */
@media (max-width: 768px) {
    body {
        -webkit-font-smoothing: antialiased;
        text-size-adjust: 100%;
    }
    
    p, span, div {
        line-height: 1.5;
    }
}

/* Фикс для iOS input zoom */
@media (max-width: 576px) {
    input, textarea, select {
        font-size: 16px !important; /* Предотвращает зум в iOS */
    }
}

/* Адаптивные изображения */
img {
    max-width: 100%;
    height: auto;
}

/* Адаптивные iframe и видео */
video, iframe {
    max-width: 100%;
}

/* Адаптивные таблицы */
table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
}

/* Адаптивная типографика */
@media (max-width: 768px) {
    h1 { font-size: clamp(1.75rem, 5vw, 2.5rem); }
    h2 { font-size: clamp(1.5rem, 4vw, 2rem) !important; }
    h3 { font-size: clamp(1.25rem, 3vw, 1.75rem); }
    .modal-title { font-size: clamp(1.25rem, 4vw, 1.75rem); }
}

/* Скрытие элементов на мобильных */
@media (max-width: 576px) {
    .desktop-only {
        display: none !important;
    }
}

@media (min-width: 577px) {
    .mobile-only {
        display: none !important;
    }
}

/* Улучшение свайперов на мобильных */
@media (max-width: 576px) {

}

/* Фикс для меню (если есть) */
@media (max-width: 768px) {
    .navbar-collapse {
        max-height: 70vh;
        overflow-y: auto;
    }
}

/* Анимация появления элементов при скролле */
.wow {
    visibility: hidden;
}

/* Оптимизация производительности на мобильных */
@media (max-width: 768px) {
    .main-banner__canvas,
    .service-advantage__icon,
    .expertise-icon {
        transform: translateZ(0); /* Аппаратное ускорение */
        will-change: transform;
    }
}

/* Фикс для fixed-элементов на iOS */
@supports (-webkit-touch-callout: none) {
    .fixed-element {
        position: sticky;
    }
}
