/* ========================================
   АДАПТИВНАЯ ВЕРСТКА - ПОЛНАЯ ВЕРСИЯ
   ======================================== */

/* Глобальные исправления - запрещаем горизонтальный скролл */
* {
    max-width: 100%;
    box-sizing: border-box;
}

html, body {
    overflow-x: hidden !important;
    width: 100%;
    margin: 0;
    padding: 0;
}

body {
    overflow-x: hidden;
    position: relative;
}

.container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
    overflow: hidden;
}

img, video, iframe {
    max-width: 100%;
    height: auto;
}

.content,
.wrapper,
main {
    overflow-x: hidden;
    width: 100%;
}

/* Принудительные переносы текста */
h1, h2, h3, p, span, a, button, .text-block, .service-description {
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    white-space: normal;
}

.amenities-text__h1,
.banner-text h1,
.cases-hero__title,
.contacts-hero__title,
.text-block__h2,
.service-name {
    word-break: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    max-width: 100%;
}

/* Кнопки */
.button-order,
.consultation-btn,
.banner-buttons a,
.catalog-card__button,
.contacts-form__submit,
.catalog-modal__btn-primary,
.catalog-modal__btn-secondary {
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
}

/* ========================================
   ПЛАНШЕТЫ (768px - 1024px)
   ======================================== */
@media (max-width: 1024px) {
    .container {
        max-width: 95%;
        padding: 0 20px;
    }
    
    .catalog-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    h1, .amenities-text__h1 {
        font-size: 36px !important;
    }
    
    h2 {
        font-size: 28px !important;
    }
}

/* ========================================
   МОБИЛЬНЫЕ УСТРОЙСТВА (ДО 768px)
   ======================================== */
@media (max-width: 768px) {
    .container {
        max-width: 100%;
        padding: 0 15px;
    }
    
    /* Заголовки */
    h1, .amenities-text__h1, .banner-text h1, .cases-hero__title, .contacts-hero__title {
        font-size: 28px !important;
        line-height: 1.3 !important;
        word-wrap: break-word;
        white-space: normal;
    }
    
    h2, .text-block__h2, .catalog-title__h1, .about-text__h1 {
        font-size: 30px !important;
        line-height: 1.3 !important;
    }
    
    /* Кнопки на мобильных */
    .button-order,
    .consultation-btn,
    .banner-buttons a,
    .catalog-card__button,
    .contacts-form__submit {
        white-space: normal;
        word-break: break-word;
        padding: 10px 16px;
        font-size: 14px;
        min-width: auto;
        width: auto;
        max-width: 100%;
    }
    
    .banner-buttons,
    .button-group {
        flex-direction: column;
        width: 100%;
    }
    
    .banner-buttons a,
    .button-group .btn {
        width: 100%;
        text-align: center;
        margin: 5px 0;
    }
    
    /* ШАПКА */
    .header {
        flex-wrap: wrap;
        padding: 15px 0;
        position: relative;
    }
    
    .logo {
        order: 1;
    }
    
    .nav {
        display: none;
        width: 100%;
        order: 3;
        margin-top: 15px;
    }
    
    .nav ul {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
    
    .taskbar {
        order: 2;
        gap: 15px;
    }
    
    .consultation-btn {
        display: none;
    }
    
    .contact p {
        display: none;
    }
    
    .burger-btn {
        display: flex !important;
    }
    
    /* МОБИЛЬНОЕ МЕНЮ */
    .mobile-menu-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.9);
        z-index: 2000;
        visibility: hidden;
        opacity: 0;
        transition: all 0.3s;
    }
    
    .mobile-menu-overlay--visible {
        visibility: visible;
        opacity: 1;
    }
    
    .mobile-menu {
        position: absolute;
        top: 0;
        right: 0;
        width: 80%;
        max-width: 300px;
        height: 100%;
        background: white;
        padding: 30px;
        transform: translateX(100%);
        transition: transform 0.3s;
    }
    
    .mobile-menu-overlay--visible .mobile-menu {
        transform: translateX(0);
    }
    
    .mobile-menu__header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 30px;
    }
    
    .mobile-menu__title {
        font-size: 24px;
        font-weight: 700;
        color: #0a2463;
    }
    
    .mobile-menu__close {
        font-size: 32px;
        background: none;
        border: none;
        cursor: pointer;
    }
    
    .mobile-menu__nav {
        display: flex;
        flex-direction: column;
        gap: 20px;
    }
    
    .mobile-menu__link {
        font-size: 18px;
        color: #333;
        text-decoration: none;
        padding: 10px 0;
        border-bottom: 1px solid #eee;
    }
    
    /* БАННЕР (ГЛАВНАЯ) */
    .main-banner, .banner-section {
        text-align: center;
        padding: 40px 0;
    }
    
    .banner-text {
        width: 100%;
        text-align: center;
    }
    
    .banner-image {
        width: 100%;
        margin-top: 30px;
    }
    
    /* СТРАНИЦА УСЛУГ (ame-blocks) */
    .ame-blocks,
    .ame-blocks--right {
        flex-direction: column !important;
        text-align: center;
        gap: 30px;
    }
    
    .text-block {
        padding: 0 5px;
    }
    
    .text-block--right {
        text-align: center !important;
    }
    
    .picture-block {
        margin-top: 20px;
        text-align: center;
    }
    
    .picture-block img {
        max-width: 100%;
        height: auto;
    }
    
    .picture-block--right,
    .picture-block--left {
        margin: 0 auto;
    }
    
    /* Преимущества */
    .plus_box {
        grid-template-columns: 1fr !important;
        gap: 15px;
    }
    
    /* КАТАЛОГ */
    .catalog-grid {
        grid-template-columns: 1fr !important;
        gap: 20px;
    }
    
    .catalog-card {
        margin: 0 auto;
        width: 100%;
        max-width: 100%;
    }
    
    .catalog-card__content {
        padding: 15px;
    }
    
    .catalog-card__footer {
        flex-direction: column;
        gap: 10px;
        align-items: center;
    }
    
    .catalog-card__button {
        width: 100%;
        justify-content: center;
    }
    
    .catalog-tabs {
        flex-direction: column;
        gap: 10px;
    }
    
    .catalog-tab {
        width: 100%;
        min-width: 0;
        text-align: center;
        padding: 12px 16px;
        height: auto;
        min-height: 48px;
    }
    
    /* О КОМПАНИИ */
    .about-content__wrapper {
        flex-direction: column !important;
        text-align: center;
    }
    
    .about-content__image {
        margin-top: 30px;
    }
    
    .about-content__image img {
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
        display: block;
    }
    
    /* КЕЙСЫ */
    .cases-list > div > div {
        grid-template-columns: 1fr !important;
    }
    
    .case-card__meta {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
    
    /* КОНТАКТЫ */
    .contacts-cards__grid {
        grid-template-columns: 1fr !important;
        gap: 20px;
    }
    
    .contacts-main__layout {
        flex-direction: column;
        gap: 40px;
    }
    
    .form-control {
        width: 100%;
    }
    
    .contacts-faq {
        width: 100%;
    }
    
    .contacts-form__row {
        flex-direction: column;
        gap: 15px;
    }
    
    .contacts-form__field--half {
        width: 100%;
    }
    
    /* ПОДВАЛ */
    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: 30px;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 15px;
    }
    
    .footer-social {
        justify-content: center;
    }
    
    /* МОДАЛЬНЫЕ ОКНА */
    .catalog-modal__body {
        flex-direction: column;
    }
    
    .catalog-modal__left,
    .catalog-modal__right {
        width: 100%;
    }
    
    .catalog-modal__price-main {
        font-size: 28px;
    }
    
    /* ЦЕНА В КРУГЕ */
    .price-circle {
        width: 100px;
        height: 100px;
        margin: 0 auto;
    }
    
    .price-circle__value {
        font-size: 28px;
    }
    
    /* ОБЩИЕ КНОПКИ */
    .button-order,
    .contacts-form__submit,
    .catalog-modal__btn-primary,
    .catalog-modal__btn-secondary {
        width: 100%;
        justify-content: center;
        text-align: center;
        padding: 12px 20px;
    }
    
    /* БЛОК С ХЕДЕРОМ — стили в global.css */
    
    /* ОТСТУПЫ */
    section {
        padding: 40px 0;
    }
    
    /* Хлебные крошки */
    .breadcrumbs {
        white-space: normal;
        word-break: break-word;
        line-height: 1.4;
    }
}

/* ========================================
   МАЛЕНЬКИЕ ТЕЛЕФОНЫ (ДО 480px)
   ======================================== */
@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }
    
    h1, .amenities-text__h1, .banner-text h1 {
        font-size: 22px !important;
    }
    
    h2, .text-block__h2 {
        font-size: 25px !important;
    }
    
    p, .service-description {
        font-size: 14px;
        line-height: 1.5;
    }
    
    .button-order,
    .consultation-btn,
    .banner-buttons a {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    /* Логотип */
    .logo__text-1 {
        font-size: 16px;
    }
    
    .logo__text-2 {
        font-size: 10px;
    }
    
    .logo__pin img {
        width: 35px;
    }
    
    /* Корзина и иконки */
    .taskbar {
        gap: 10px;
    }
    
    .basket-btn img,
    .contact-ico {
        width: 20px;
    }
    
    /* Цена */
    .price-box {
        font-size: 20px;
        padding: 6px 12px;
    }
    
    .price {
        font-size: 16px;
    }
    
    .button-order img {
        width: 14px;
    }
    
    /* Карточки каталога */
    .catalog-card__title {
        font-size: 18px;
    }
    
    .catalog-card__description {
        font-size: 13px;
    }
    
    .catalog-card__price-value {
        font-size: 20px;
    }
    
    .catalog-card__price-period {
        font-size: 12px;
    }
    
    /* Мобильное меню */
    .mobile-menu {
        width: 85%;
        padding: 20px;
    }
    
    .mobile-menu__title {
        font-size: 20px;
    }
    
    .mobile-menu__link {
        font-size: 16px;
    }
    
    /* Хлебные крошки */
    .breadcrumbs {
        font-size: 11px;
    }
}

/* ========================================
   БОЛЬШИЕ ЭКРАНЫ (ОГРАНИЧЕНИЕ ШИРИНЫ)
   ======================================== */
@media (min-width: 1400px) {
    .container {
        max-width: 1300px;
    }
}
