/* ============================================
   RESPONSIVE.CSS - Адаптивные стили для мобильных устройств
   ============================================ */

/* ============================================
   ПЕРЕКЛЮЧАТЕЛИ ВИДИМОСТИ ЭЛЕМЕНТОВ
   ============================================ */

@media (max-width: 800px) {
    .hide_800 { display: none; }
    .show_800 { display: block; }
}

@media (max-width: 900px) {
    .hide_900 { display: none; }
    .show_900 { display: block; }
}

/* ============================================
   ПЛАНШЕТЫ (768px - 1024px)
   ============================================ */

@media (min-width: 768px) and (max-width: 1023px) {
    /* --- ПЕРЕКЛЮЧАТЕЛИ --- */
    .hide_900 { display: none; }
    .show_900 { display: block; }
    
    /* --- ГАЛЕРЕЯ АРЕНДАТОРОВ (только для планшетов) --- */
    .renters-gallery {
        display: grid !important;
        grid-template-columns: repeat(5, 1fr) !important; /* 5 колонок как на десктопе */
        gap: 0.75rem !important; /* Еще более уменьшенные отступы */
        align-items: stretch !important; /* Все ячейки растягиваются на одинаковую высоту */
        justify-items: stretch !important; /* Все ячейки растягиваются на одинаковую ширину */
        padding: 1rem 0 !important;
        margin: 2rem 0 !important;
    }
    
    /* --- ХЕДЕР --- */
    header {
        padding: 0.5rem 1rem; /* Отступы для всего хедера */
    }
    
    .header_b-c {
        padding: 0.5rem 0; /* Вертикальные отступы, горизонтальные убраны (управляются через header) */
    }
    
    .header_b-c .show_900 {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
    }
    
    .header_b-c .show_900 > .d_flex.flex_100 {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 0.75rem;
        flex: 1;
        padding: 0;
    }
    
    .header_b-c .show_900 .header-logo-wrapper {
        flex: 0 0 auto;
        max-width: 60px;
        padding: 0;
    }
    
    .header_b-c .show_900 .header-logo {
        max-height: 50px;
        max-width: 100%;
        object-fit: contain;
    }
    
    .header_b-c .show_900 .p.t-a_center {
        text-align: left;
        padding: 0;
        flex: 1;
    }
    
    .header_b-c .show_900 .f-s_150.f-w_700 {
        font-size: 1.3rem;
        margin: 0 0 0.15rem 0;
        text-align: left;
        line-height: 1.2;
    }
    
    .header_b-c .show_900 .f-w_400 {
        font-size: 0.95rem;
        text-align: left;
        line-height: 1.3;
    }
    
    .header_b-c .show_900 .header-contacts {
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        gap: 0.35rem;
        flex-shrink: 0;
    }
    
    .header_b-c .show_900 .header-contact-item {
        padding: 0;
        font-size: 1rem;
        white-space: nowrap;
    }
    
    /* --- ВКЛАДКИ --- */
    .tabs__nav-item {
        font-size: 0.95rem;
        padding: 0.85rem 1rem;
        letter-spacing: 0.3px;
        white-space: normal;
        word-break: break-word;
        overflow-wrap: break-word;
    }
    
    /* --- СЕКЦИИ --- */
    .section-shadow .d_flex.f-w_nowrap .m-b > div {
        font-size: 1.1rem;
    }
    
    .section-shadow .d_flex.f-w_nowrap .m-b > div.f-s_150 {
        font-size: 1.2rem;
    }
    
    /* Стили для логотипов арендаторов на планшетах */
    .renter-logo {
        width: 100% !important; /* Занимает всю ширину ячейки grid */
        height: 100% !important; /* Занимает всю высоту ячейки grid */
        min-height: 70px !important; /* Уменьшенная минимальная высота */
        max-height: 90px !important; /* Ограничиваем максимальную высоту */
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        padding: 0.25rem !important; /* Минимальный padding */
        margin: 0 !important; /* Убираем все отступы */
        background-color: transparent !important; /* Убираем прозрачный фон */
        border-radius: 4px !important;
        box-sizing: border-box !important;
    }
    
    .renter-img {
        max-width: 80% !important; /* Уменьшенный отступ от краев */
        max-height: 80% !important; /* Уменьшенный отступ от краев */
        width: auto !important;
        height: auto !important;
        object-fit: contain !important; /* Сохраняем пропорции, вписываем в контейнер */
        object-position: center !important; /* Центрируем изображение */
        display: block !important;
        margin: 0 !important; /* Убираем все отступы */
    }
    
    .renter-logo-bottom-1,
    .renter-logo-bottom-2,
    .renter-logo-bottom-3,
    .renter-logo-bottom-4,
    .renter-logo-bottom-5 {
        margin: 0;
    }
    
    /* --- ФУТЕР --- */
    .footer_b-c .internal__container {
        max-width: 100% !important; /* Убираем ограничение 1200px для планшетов */
        padding: 0 0.5rem !important; /* Уменьшаем боковые отступы для планшетов */
        box-sizing: border-box !important;
        overflow-x: hidden !important; /* Предотвращаем горизонтальный скролл */
    }
    
    .footer_b-c .d_flex {
        flex-direction: row;
        align-items: center; /* Выравнивание по вертикали по центру */
        gap: 0.5rem !important; /* Еще более уменьшенный отступ между ячейками */
        justify-content: space-between !important; /* Равномерное распределение */
        width: 90% !important; /* Уменьшаем общую ширину контейнера */
        max-width: 90% !important;
        margin: 0 auto !important; /* Центрируем контейнер */
        box-sizing: border-box !important;
        overflow-x: hidden !important; /* Предотвращаем выход за границы */
    }
    
    .footer_b-c .flex_33 {
        flex: 0 0 auto !important; /* Отключаем автоматическое растягивание */
        display: flex !important;
        align-items: center !important; /* Выравнивание содержимого по вертикали по центру */
        box-sizing: border-box !important; /* Учитываем padding в ширине */
        overflow: hidden !important; /* Предотвращаем выход за границы */
        word-wrap: break-word !important; /* Перенос длинных слов */
        overflow-wrap: break-word !important; /* Перенос длинных слов */
        hyphens: auto !important; /* Автоматические переносы */
    }
    
    /* Первая колонка - название (20% ширины с учетом gap) */
    .footer_b-c .flex_33:first-child {
        flex: 0 0 20% !important; /* Уменьшаем до 20% ширины */
        max-width: 20% !important;
        min-width: 0 !important; /* Позволяем сжиматься */
        justify-content: flex-start !important;
        padding-right: 0.25rem !important; /* Небольшой отступ справа */
    }
    
    /* Средняя колонка - контакты (45% ширины) */
    .footer_b-c .flex_33:nth-child(2) {
        flex: 0 0 45% !important; /* Уменьшаем до 45% ширины */
        max-width: 45% !important;
        min-width: 0 !important; /* Позволяем сжиматься */
        justify-content: center !important;
        padding: 0 0.25rem !important; /* Небольшие отступы по бокам */
    }
    
    /* Последняя колонка - кнопка "наверх" (20% ширины с учетом gap) */
    .footer_b-c .flex_33:last-child {
        flex: 0 0 20% !important; /* Уменьшаем до 20% ширины */
        max-width: 20% !important;
        min-width: 0 !important; /* Позволяем сжиматься */
        justify-content: flex-end !important;
        margin-right: 0 !important; /* Убираем margin-right полностью */
        padding-right: 0 !important; /* Убираем padding справа */
        padding-left: 0.25rem !important; /* Небольшой отступ слева */
    }
    
    .footer_b-c .f-s_90 {
        font-size: 0.85rem;
        line-height: 1.4;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
    }
    
    .footer_b-c .f-s_120 {
        font-size: 1rem;
        line-height: 1.4;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
    }
    
    .footer_b-c a {
        display: inline-block;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
    }
    
    /* Предотвращаем выход текста за границы */
    .footer_b-c p,
    .footer_b-c div {
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        max-width: 100% !important;
    }
    
    /* --- HERO-СЕКЦИЯ --- */
    .hero-inner {
        flex-direction: row;
        align-items: center;
        text-align: left;
        padding: 60px 24px;
        gap: 2rem;
    }
    
    .hero-text {
        flex: 1 1 50%;
        align-items: flex-start;
        text-align: left;
    }
    
    .hero-form {
        flex: 0 0 320px;
        max-width: 320px;
    }
    
    /* --- СХЕМА СКЛАДА --- */
    .warehouse-map-section {
        margin-bottom: 1rem; /* Уменьшаем отступ снизу секции */
    }
    
    .warehouse-map-container {
        margin: 1rem 0; /* Уменьшаем вертикальные отступы контейнера */
    }
    
    #warehouse-map-embedded {
        min-height: 300px !important; /* Уменьшаем минимальную высоту для планшетов */
    }
    
    .warehouse-map-title {
        margin-bottom: 0.75rem !important; /* Уменьшаем отступ под заголовком */
    }
}

/* ============================================
   МОБИЛЬНЫЕ ТЕЛЕФОНЫ (до 767px)
   ============================================ */

@media (max-width: 767px) {
    /* --- ПЕРЕКЛЮЧАТЕЛИ --- */
    .hide_900 { display: none; }
    .show_900 { display: block; }
    .hide-t { display: none; }
    .show-t { display: inline; }
    
    /* --- ХЕДЕР --- */
    header {
        padding: 0.5rem 1rem; /* Отступы для всего хедера */
    }
    
    .header_b-c {
        padding: 0.5rem 0; /* Вертикальные отступы, горизонтальные убраны (управляются через header) */
    }
    
    .header_b-c .show_900 {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 1rem;
        padding: 0;
        width: 100%;
    }
    
    .header_b-c .show_900 > .d_flex.flex_100 {
        flex-direction: row;
        align-items: flex-start;
        text-align: left;
        gap: 1.5rem;
        width: 100%;
        padding: 0;
        margin: 0;
        justify-content: flex-start;
    }
    
    .header_b-c .show_900 .header-logo-wrapper {
        flex: 0 0 auto;
        max-width: 55px;
        padding: 0;
    }
    
    .header_b-c .show_900 .header-logo {
        max-height: 55px;
        max-width: 100%;
        object-fit: contain;
    }
    
    .header_b-c .show_900 .p.t-a_center {
        padding: 0;
        margin: 0;
        flex: 1;
        text-align: left;
    }
    
    .header_b-c .show_900 .f-s_150.f-w_700 {
        font-size: 1.2rem;
        line-height: 1.2;
        margin: 0 0 0.15rem 0;
        padding: 0;
        text-align: left;
        font-weight: 700;
    }
    
    .header_b-c .show_900 .f-w_400 {
        font-size: 1rem;
        line-height: 1;
        margin: 0;
        padding: 0;
        text-align: left;
        font-weight: 400;
    }
    
    .header_b-c .show_900 .header-contacts {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.6rem;
        margin: 0.75rem 0 0 0;
        width: 100%;
        padding: 0;
    }
    
    .header_b-c .show_900 .header-contact-item {
        font-size: 0.9rem;
        padding: 0.5rem 1rem;
        background-color: rgba(0, 0, 0, 0.4);
        border-radius: 8px;
        width: 100%;
        max-width: 280px;
        justify-content: center;
        text-align: center;
        transition: background-color 0.3s ease;
    }
    
    .header_b-c .show_900 .header-contact-item:hover {
        background-color: rgba(0, 0, 0, 0.6);
    }
    
    .header_b-c .show_900 .header-contact-item .sm-r {
        width: 22px;
        height: 22px;
        margin-right: 0.6rem;
        flex-shrink: 0;
    }
    
    .header_b-c .show_900 .p {
        padding: 0;
    }
    
    .header_b-c .show_900 .t-a_center {
        text-align: center;
    }
    
    .header_b-c .show_900 .t_flex_100 {
        width: 100%;
    }
    
    /* --- ВКЛАДКИ --- */
    .tabs__nav {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
        padding: 1rem 0;
        overflow-x: hidden; /* Убираем горизонтальный скролл на мобильных */
    }
    
    .tabs__nav-item {
        padding: 1rem 1rem;
        font-size: 0.9rem;
        white-space: normal;
        word-break: break-word;
        overflow-wrap: break-word;
        text-align: center;
        line-height: 1.3;
        min-width: 0;
        flex: 1 1 auto;
    }
    
    .tabs__content-item {
        margin-top: 0;
    }
    
    .tabs__content-inner {
        padding: 1rem;
    }
    
    .tabs__content-title {
        font-size: 1.2rem;
        margin-bottom: 0.75rem;
    }
    
    .tabs__content-text {
        font-size: 1rem;
    }
    
    /* --- СЕКЦИИ --- */
    .section-shadow .d_flex.p {
        max-width: 100%;
        padding: 3.5rem;
    }
    
    .section-shadow .feature-icon {
        width: 40px;
        height: 40px;
        min-width: 40px;
        max-width: 40px; /* Фиксированная ширина */
        margin-right: 0.75rem;
        flex-shrink: 0;
        align-self: flex-start; /* Выравнивание иконки по верхнему краю */
    }
    
    /* SVG внутри иконок - фиксированный размер, не растягиваются */
    .section-shadow .feature-icon svg {
        width: 24px !important;
        height: 24px !important;
        max-width: 24px !important;
        max-height: 24px !important;
        object-fit: contain; /* Сохраняем пропорции */
        flex-shrink: 0;
    }
    
    .section-shadow .d_flex.f-w_nowrap {
        flex-wrap: nowrap;
        align-items: flex-start; /* Выравнивание по верхнему краю для симметрии */
        justify-content: flex-start; /* Выравнивание по левому краю */
        gap: 0.75rem;
    }
    
    .section-shadow .d_flex.f-w_nowrap .m-b {
        flex: 1 1 auto;
        min-width: 0;
        overflow: hidden;
        text-align: left; /* Выравнивание текста по левому краю */
    }
    
    .section-shadow .d_flex.f-w_nowrap .m-b > div {
        word-wrap: break-word;
        overflow-wrap: break-word;
        font-size: 0.8rem;
        line-height: 1.4;
        text-align: left; /* Выравнивание текста по левому краю */
    }
    
    .section-shadow .d_flex.f-w_nowrap .m-b > div.f-s_150 {
        font-size: 0.9rem;
        text-align: left; /* Выравнивание текста по левому краю */
    }
    
    .section-shadow .d_flex.p {
        flex-direction: column;
        gap: 0.5rem;
        padding: 0.5rem;
    }
    
    .section-shadow .flex_50.t_flex_100 {
        width: 100%;
        flex: 0 0 100%;
        padding: 0.5rem;
        text-align: left;
    }
    
    .section-shadow .m-r.m-b {
        margin-right: 0.5rem;
        margin-bottom: 0;
    }
    
    .section-spacing-top-small {
        padding-top: 1.5rem;
    }
    
    .section-spacing-bottom {
        padding-top: 1.5rem;
        padding-bottom: 1.5rem;
    }
    
    .section-shadow {
        padding-top: 1.5rem;
        padding-bottom: 1.5rem;
    }
    
    /* --- СЕКЦИЯ "О СКЛАДЕ" --- */
    .fon_2 .d_flex {
        flex-direction: column;
        gap: 2rem;
    }
    
    .fon_2 .flex_50-p {
        width: 100%;
        flex: 0 0 100%;
        padding: 1rem;
    }
    
    /* --- ТАБЛИЦЫ --- */
    /* Стили таблицы для планшетов перенесены в css/table.css */
    
    /* --- ФУТЕР --- */
    .footer_b-c .d_flex {
        flex-direction: column;
        align-items: center;
        gap: 1.5rem;
    }
    
    .footer_b-c .flex_33 {
        width: 100%;
        flex: 0 0 100%;
        margin-bottom: 0;
    }
    
    .footer_b-c .f-s_90 {
        font-size: 0.9rem;
        line-height: 1.5;
    }
    
    .footer_b-c .f-s_120 {
        font-size: 1rem;
        line-height: 1.5;
    }
    
    .footer_b-c .t_t-a_center,
    .footer_b-c .t-a_right,
    .footer_b-c .t-a_center {
        text-align: center;
    }
    
    .footer_b-c .hide-t {
        display: inline;
    }
    
    .footer_b-c a {
        display: inline-block;
    }
    
    /* --- ГАЛЕРЕЯ АРЕНДАТОРОВ --- */
    .section-shadow .renters-gallery,
    .renters-gallery {
        display: flex !important;
        flex-direction: row !important; /* Горизонтальное направление */
        flex-wrap: wrap !important; /* Разрешаем перенос на новую строку */
        align-items: center !important;
        justify-content: center !important; /* Центрируем элементы */
        gap: 0.5rem !important; /* Расстояние между логотипами */
        padding: 0.5rem 0 !important;
        margin: 1rem 0 !important;
        grid-template-columns: none !important; /* Отключаем grid для мобильных */
    }
    
    .renter-logo {
        width: calc(50% - 0.25rem) !important; /* Два элемента в ряд с учетом gap */
        flex: 0 0 calc(50% - 0.25rem) !important; /* Фиксированная ширина для двух колонок */
        height: auto !important; /* Автоматическая высота */
        min-height: 80px !important; /* Минимальная высота для всех одинаково */
        max-width: none !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        margin: 0 !important;
        padding: 0.5rem !important; /* Одинаковый padding для всех */
        box-sizing: border-box !important;
    }
    
    .renter-img {
        max-width: clamp(84px, 28vw, 105px) !important; /* Уменьшено на 30% (было 120px-150px) */
        max-height: 49px !important; /* Уменьшено на 30% (было 70px) */
        width: auto !important;
        height: auto !important;
        object-fit: contain !important;
        display: block !important;
    }
    
    .renter-logo-bottom-1,
    .renter-logo-bottom-2,
    .renter-logo-bottom-3,
    .renter-logo-bottom-4,
    .renter-logo-bottom-5 {
        margin: 0 auto !important;
    }
    
    /* --- HERO-СЕКЦИЯ --- */
    .hero-inner {
        padding: 50px 16px;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .hero-text {
        gap: 1.5rem;
        align-items: center;
        text-align: center;
    }
    
    .hero-bottom-text {
        font-size: clamp(16px, 4vw, 20px);
        text-align: center;
    }
    
    .hero-form {
        max-width: 100%;
        width: 100%;
    }
    
    .hero-form input,
    .hero-form textarea {
        padding: 10px 12px;
        font-size: 1rem;
    }
    
    /* --- ГАЛЕРЕЯ ИЗОБРАЖЕНИЙ --- */
    .gallery-container {
        height: 300px;
    }
    
    /* --- ЗАГОЛОВКИ --- */
    .quarry.f-w_700.f-s_180 {
        font-size: 1.5rem;
    }
    
    /* --- АККОРДЕОН --- */
    .accordion-toggle {
        padding: 0.8rem 1rem;
        font-size: 1rem;
    }
    
    /* --- СХЕМА СКЛАДА --- */
    /* Схема имеет горизонтальную ориентацию, экран мобильного - вертикальную */
    /* Решение: схема масштабируется по ширине экрана, сохраняя пропорции */
    /* Если схема шире экрана, добавляется горизонтальная прокрутка */
    
    .warehouse-map-section {
        margin-bottom: 1rem; /* Уменьшаем отступ снизу секции */
    }
    
    .warehouse-map-container {
        width: 100%;
        overflow-x: auto; /* Горизонтальная прокрутка, если схема шире экрана */
        overflow-y: visible; /* Не обрезаем по вертикали */
        -webkit-overflow-scrolling: touch; /* Плавная прокрутка на iOS */
        margin: 0.75rem 0; /* Уменьшаем вертикальные отступы */
        padding: 0;
    }
    
    .warehouse-map-container::-webkit-scrollbar {
        height: 8px; /* Высота полосы прокрутки */
    }
    
    .warehouse-map-container::-webkit-scrollbar-track {
        background: rgba(255, 255, 255, 0.1);
        border-radius: 4px;
    }
    
    .warehouse-map-container::-webkit-scrollbar-thumb {
        background: rgba(245, 106, 3, 0.5);
        border-radius: 4px;
    }
    
    .warehouse-map-container::-webkit-scrollbar-thumb:hover {
        background: rgba(245, 106, 3, 0.7);
    }
    
    #warehouse-map-embedded {
        width: 100%;
        min-height: 0 !important; /* Убираем фиксированную высоту полностью */
        height: auto !important; /* Высота определяется содержимым */
        max-width: 100%;
    }
    
    #warehouse-map-embedded svg {
        width: 100%; /* Схема масштабируется по ширине контейнера */
        height: auto; /* Высота автоматически подстраивается, сохраняя пропорции */
        max-width: 100%;
        display: block;
    }
    
    .warehouse-map-title {
        font-size: 1.3rem !important;
        margin-bottom: 0.5rem !important; /* Уменьшаем отступ под заголовком */
    }
    
    /* --- ТАБЛИЦА ВАКАНТНЫХ ПЛОЩАДЕЙ --- */
    /* Стили таблицы для мобильных перенесены в css/table.css */
}
