/**
 * BSL PRO - Mobile Responsive Styles
 * Единые стили для мобильной и планшетной версий
 * Все секции и кнопки адаптированы для всех устройств
 */

/* ==========================================================================
   ГЛОБАЛЬНЫЕ НАСТРОЙКИ ДЛЯ МОБИЛЬНЫХ
   ========================================================================== */

* {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

body {
    overflow-x: hidden;
    max-width: 100vw;
}

img {
    max-width: 100%;
    height: auto;
}

/* ==========================================================================
   УЛУЧШЕННЫЕ КНОПКИ - ЕДИНЫЙ СТИЛЬ
   ========================================================================== */

/* Все кнопки с активным состоянием и hover эффектами */
button,
.btn,
.t-btn,
.t228__cta-btn,
.tmenu-mobile__cta-btn,
a[class*="btn"],
a[class*="button"] {
    cursor: pointer;
    touch-action: manipulation;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

/* Эффект нажатия для мобильных */
button:active,
.btn:active,
.t-btn:active,
a[class*="btn"]:active,
a[class*="button"]:active {
    transform: scale(0.97);
    transition-duration: 0.1s;
}

/* Ripple эффект при клике */
button::before,
.btn::before,
.t-btn::before,
a[class*="btn"]::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

button:active::before,
.btn:active::before,
.t-btn:active::before,
a[class*="btn"]:active::before {
    width: 300px;
    height: 300px;
}

/* Кнопки призыва к действию (CTA) */
.t228__cta-btn,
.tmenu-mobile__cta-btn,
.btn-primary,
.btn-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 12px 28px;
    font-weight: 600;
    font-size: 15px;
    text-decoration: none;
    border-radius: 8px;
    border: none;
    box-shadow: 0 4px 12px rgba(26, 72, 112, 0.15);
    transition: all 0.3s ease;
}

/* Вторичные кнопки */
.btn-secondary,
.btn-outline {
    background: transparent;
    border: 2px solid currentColor;
    min-height: 48px;
    padding: 12px 28px;
}

/* Улучшенные состояния фокуса для доступности */
button:focus-visible,
.btn:focus-visible,
a[class*="btn"]:focus-visible {
    outline: 3px solid #34465a;
    outline-offset: 3px;
}

/* ==========================================================================
   АДАПТАЦИЯ КОНТЕЙНЕРОВ И СЕКЦИЙ
   ========================================================================== */

/* Мобильные отступы для всех секций */
@media screen and (max-width: 980px) {
    .t-container,
    .t-col,
    .t-section,
    [class*="__container"] {
        padding-left: 20px !important;
        padding-right: 20px !important;
    }
}

@media screen and (max-width: 640px) {
    .t-container,
    .t-col,
    .t-section,
    [class*="__container"] {
        padding-left: 20px !important;
        padding-right: 20px !important;
    }

}

/* ==========================================================================
   ТИПОГРАФИЯ ДЛЯ МОБИЛЬНЫХ
   ========================================================================== */

@media screen and (max-width: 980px) {
    /* Заголовки масштабируются */
    h1, .h1, [class*="hero-title"] {
        font-size: clamp(28px, 7vw, 40px) !important;
        line-height: 1.2 !important;
        margin-bottom: 16px !important;
    }

    h2, .h2 {
        font-size: clamp(24px, 6vw, 32px) !important;
        line-height: 1.3 !important;
        margin-bottom: 14px !important;
    }

    h3, .h3 {
        font-size: clamp(20px, 5vw, 24px) !important;
        line-height: 1.4 !important;
        margin-bottom: 12px !important;
    }

    h4, .h4 {
        font-size: clamp(20px, 5vw, 24px) !important;
        line-height: 1.4 !important;
    }

    /* Основной текст */
    p, .t-text {
        font-size: 15px !important;
        line-height: 1.6 !important;
        margin-bottom: 12px !important;
    }

    /* Маленький текст */
    small, .small-text {
        font-size: 13px !important;
    }
}

@media screen and (max-width: 640px) {
    h1, .h1, [class*="hero-title"] {
        font-size: clamp(24px, 8vw, 32px) !important;
    }

    h2, .h2 {
                font-size: 28px !important;
    }

    .bsl-heading-2, h2, .section-title {
    font-size: 28px !important;

}

    p, .t-text {
        font-size: 14px !important;
        color: #1a4870;
    }
}

/* ==========================================================================
   GRID И FLEXBOX АДАПТАЦИЯ
   ========================================================================== */

/* Все grid на мобильных становятся 1 колонкой */
@media screen and (max-width: 768px) {


    /* STATS GRID - ОБЯЗАТЕЛЬНО 2 КОЛОНКИ НА МОБИЛЬНЫХ */
    .stats-grid,
    #stats_section .stats-grid,
    section .stats-grid {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1.5rem !important;
    }

    /* Flex элементы переходят в колонку */
    [class*="flex"],
    [class*="__flex"] {
        flex-direction: column !important;
        gap: 16px !important;
    }
}

/* ==========================================================================
   STATS GRID - ДОПОЛНИТЕЛЬНАЯ АДАПТАЦИЯ ДЛЯ МАЛЕНЬКИХ ЭКРАНОВ
   ========================================================================== */

@media screen and (max-width: 640px) {
    /* STATS GRID остается 2 колонки даже на маленьких экранах */
    .stats-grid,
    #stats_section .stats-grid,
    section .stats-grid {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1rem !important;
        padding: 0 0.5rem !important;
    }

    /* Уменьшаем внутренние отступы карточек статистики */
    .stats-grid .stat-item,
    .stats-grid > div {
        padding: 1.5rem 1rem !important;
    }

    /* APPLICATIONS GRID - 2 колонки на мобильных */
    .applications-grid,
    .product-card__specs .applications-grid,
    div.applications-grid {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.75rem !important;
    }
}

@media screen and (max-width: 480px) {
    /* STATS GRID 2 колонки на очень маленьких экранах */
    .stats-grid,
    #stats_section .stats-grid,
    section .stats-grid {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.75rem !important;
        padding: 0 0.25rem !important;
    }

    /* Еще более компактные карточки */
    .stats-grid .stat-item,
    .stats-grid > div {
        padding: 1.25rem 0.75rem !important;
    }

    /* APPLICATIONS GRID - 2 колонки на очень маленьких экранах */
    .applications-grid,
    .product-card__specs .applications-grid,
    div.applications-grid {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.5rem !important;
    }
}

/* ==========================================================================
   КАРТОЧКИ И БЛОКИ
   ========================================================================== */

@media screen and (max-width: 980px) {
    /* Все карточки адаптируются */
    [class*="card"],
    [class*="__card"],
    .t-card {
        padding: 10px !important;
        border-radius: 12px !important;
    }

.services-section-commercial {
    margin-top:0px!important;
}

.services-section-commercial {
    padding-bottom:0px!important;
}
    
    /* Изображения в карточках */
    [class*="card"] img,
    [class*="__card"] img {
        width: 100% !important;
        height: auto !important;
        max-height: 250px !important;
        object-fit: cover !important;
    }
}

/* ==========================================================================
   МОДАЛЬНЫЕ ОКНА И ПОПАПЫ
   ========================================================================== */

@media screen and (max-width: 768px) {
    [class*="modal"],
    [class*="popup"],
    [class*="dialog"] {
        max-width: 95vw !important;
        margin: 10px !important;
        max-height: 90vh !important;
        overflow-y: auto !important;
    }
}

/* ==========================================================================
   ФОРМЫ И ИНПУТЫ
   ========================================================================== */

@media screen and (max-width: 980px) {
    /* Все инпуты удобные для касания */
    /* Исключаем формы с кастомными стилями */
    input:not(.custom-input):not(.bsl-input),
    textarea:not(.custom-textarea):not(.bsl-textarea),
    select:not(.custom-select):not(.bsl-select) {
        min-height: 48px !important;
        font-size: 16px !important; /* Предотвращает зум на iOS */
        padding: 12px 16px !important;
        border-radius: 8px !important;
        width: 100% !important;
    }

    textarea:not(.custom-textarea):not(.bsl-textarea) {
        min-height: 120px !important;
    }

    /* Лейблы */
    label:not(.custom-checkbox-label) {
                display: flex !important;
        margin-bottom: 8px !important;
        font-weight: 500 !important;
        font-size: 14px !important;
    }

    /* Кнопки submit */
    /* Исключаем кастомные кнопки форм */
    button[type="submit"]:not(.custom-submit-btn):not(.bsl-submit-btn),
    input[type="submit"]:not(.custom-submit-btn):not(.bsl-submit-btn) {
        width: 100% !important;
        min-height: 52px !important;
        font-size: 16px !important;
        font-weight: 600 !important;
        margin-top: 16px !important;
    }
}

/* ==========================================================================
   НАВИГАЦИЯ И ССЫЛКИ
   ========================================================================== */

@media screen and (max-width: 980px) {
    /* Все ссылки с удобной областью нажатия */
    a:not(.btn):not([class*="button"]) {
        min-height: 35px;
        display: inline-flex;
        align-items: center;
        padding: 8px 0;
    }

    /* Breadcrumbs */
    .breadcrumbs,
    [class*="breadcrumb"] {
        font-size: 13px !important;
        flex-wrap: wrap !important;
    }

    /* Пагинация */
    .pagination,
    [class*="pagination"] {
        justify-content: center !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
    }

    .pagination a,
    .pagination button {
        min-width: 44px !important;
        min-height: 44px !important;
    }
}

/* ==========================================================================
   ТАБЛИЦЫ
   ========================================================================== */

@media screen and (max-width: 768px) {
    /* Таблицы становятся скроллируемыми */
    table {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Или превращаем в карточки */
    table.responsive-cards {
        display: block;
    }

    table.responsive-cards thead {
        display: none;
    }

    table.responsive-cards tbody,
    table.responsive-cards tr,
    table.responsive-cards td {
        display: block;
        width: 100%;
    }

    table.responsive-cards tr {
        margin-bottom: 20px;
        border: 1px solid #e0e0e0;
        border-radius: 8px;
        padding: 16px;
    }

    table.responsive-cards td:before {
        content: attr(data-label);
        font-weight: 600;
        display: block;
        margin-bottom: 4px;
        color: #1a4870;
    }
}

/* ==========================================================================
   ИЗОБРАЖЕНИЯ И МЕДИА
   ========================================================================== */

@media screen and (max-width: 980px) {
    /* Все изображения адаптивные */
    img {
        max-width: 100%;
        height: auto;
        display: block;
    }

    /* Видео responsive */
    video,
    iframe {
        max-width: 100%;
        height: auto;
    }

    /* Wrapper для видео 16:9 */
    .video-wrapper {
        position: relative;
        padding-bottom: 56.25%;
        height: 0;
        overflow: hidden;
    }

    .video-wrapper iframe,
    .video-wrapper video {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
    }
}

/* ==========================================================================
   УТИЛИТЫ ДЛЯ СКРЫТИЯ/ПОКАЗА
   ========================================================================== */

/* Скрыть на мобильных */
@media screen and (max-width: 768px) {
    .hide-mobile,
    .desktop-only {
        display: none !important;
    }
}

/* Скрыть на планшетах */
@media screen and (min-width: 769px) and (max-width: 980px) {
    .hide-tablet {
        display: none !important;
    }
}

/* Скрыть на десктопе */
@media screen and (min-width: 981px) {
    .hide-desktop,
    .mobile-only {
        display: none !important;
    }
}

/* Показывать только на определенных разрешениях */
.show-mobile {
    display: none !important;
}

@media screen and (max-width: 768px) {
    .show-mobile {
        display: block !important;
    }

    .show-mobile-flex {
        display: flex !important;
    }

    .show-mobile-grid {
        display: grid !important;
    }
}

/* ==========================================================================
   SPACING UTILITIES
   ========================================================================== */

@media screen and (max-width: 768px) {
    /* Уменьшенные отступы для мобильных */
    .mt-mobile-0 { margin-top: 0 !important; }
    .mt-mobile-1 { margin-top: 8px !important; }
    .mt-mobile-2 { margin-top: 16px !important; }
    .mt-mobile-3 { margin-top: 24px !important; }
    .mt-mobile-4 { margin-top: 32px !important; }

    .mb-mobile-0 { margin-bottom: 0 !important; }
    .mb-mobile-1 { margin-bottom: 8px !important; }
    .mb-mobile-2 { margin-bottom: 16px !important; }
    .mb-mobile-3 { margin-bottom: 24px !important; }
    .mb-mobile-4 { margin-bottom: 32px !important; }

    .p-mobile-0 { padding: 0 !important; }
    .p-mobile-1 { padding: 8px !important; }
    .p-mobile-2 { padding: 16px !important; }
    .p-mobile-3 { padding: 24px !important; }
    .p-mobile-4 { padding: 32px !important; }
}

/* ==========================================================================
   PERFORMANCE ОПТИМИЗАЦИИ
   ========================================================================== */

@media screen and (max-width: 980px) {
    /* Отключаем сложные анимации на мобильных */
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.2s !important;
    }

    /* Но оставляем для кнопок и интерактивных элементов */
    button,
    a,
    .btn,
    [role="button"] {
        animation-duration: 0.3s !important;
        transition-duration: 0.3s !important;
    }
}

/* ==========================================================================
   ACCESSIBILITY - Доступность
   ========================================================================== */

/* Увеличенные области нажатия */
@media screen and (max-width: 980px) {
    a,
    button,
    [role="button"],
    [onclick] {
        min-width: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    /* Убираем hover эффекты на тач-устройствах */
    @media (hover: none) {
        *:hover {
            /* Hover эффекты отключены на тач */
        }
    }
}

/* Focus states для клавиатурной навигации */
*:focus-visible {
    outline: 1px solid #34465a !important;
    outline-offset: 2px !important;
}

/* ==========================================================================
   SAFE AREA для устройств с вырезами (iPhone X+)
   ========================================================================== */

@supports (padding: env(safe-area-inset-top)) {
    body {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }
}

/* ==========================================================================
   PRINT STYLES - Стили для печати
   ========================================================================== */

@media print {
    /* Скрываем ненужные элементы при печати */
    header,
    footer,
    .header,
    .footer,
    nav,
    .nav,
    button,
    .btn,
    [class*="cta"] {
        display: none !important;
    }

    /* Оптимизируем для печати */
    * {
        background: white !important;
        color: black !important;
    }

    a {
        text-decoration: underline !important;
    }

    /* Показываем URL ссылок */
    a[href]:after {
        content: " (" attr(href) ")";
        font-size: 12px;
        color: #666;
    }
}

/* ==========================================================================
   УНИФИЦИРОВАННЫЕ ЗАГОЛОВКИ СЕКЦИЙ
   ========================================================================== */

/* Заголовки всех секций */
.t-section__title,
.t-title,
h1.t-title,
h2.t-title {
    font-weight: 700 !important;
    line-height: 1.2 !important;
    margin-bottom: 20px !important;
}

/* Основной заголовок секции - Desktop */
.t-section__title.t-title_xs,
.t-section__title {
    font-size: 42px !important;
    letter-spacing: -0.5px !important;

}

.reviews-section .section-header{
    text-align: center;
    margin-bottom:40px;
    font-size: 42px !important;
}


/* Подзаголовки секций - Desktop */
.t-section__descr,
.t-descr {
    font-size: 18px !important;
    line-height: 1.6 !important;
    margin-bottom: 30px !important;
}

/* Tablet - заголовки */
@media screen and (max-width: 980px) {
    .t-section__title.t-title_xs,
    .t-section__title {
        font-size: 36px !important;
    }

    .t-section__descr,
    .t-descr {
        font-size: 17px !important;
        margin-bottom: 30px !important;
    }
}

/* Mobile - заголовки */
@media screen and (max-width: 640px) {
    .t-section__title.t-title_xs,
    .t-section__title {
        font-size: 28px !important;
        margin-bottom: 16px !important;
    }

    .t-section__descr,
    .t-descr {
        font-size: 15px !important;
    }

.footer-legal {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    flex-direction: row;
    margin-bottom: 10px;
}

}

/* Very small screens */
@media screen and (max-width: 380px) {
    .t-section__title.t-title_xs,
    .t-section__title {
        font-size: 24px !important;
        margin-bottom: 14px !important;
    }

    .t-section__descr,
    .t-descr {
        font-size: 14px !important;
        margin-bottom: 28px !important;
    }


}
