/* =========================================================
   МОБИЛЬНАЯ ВЕРСИЯ (Адаптив) - Финальный релиз
   ========================================================= */

/* 1. Скрываем кнопку бургера на десктопе */
.mobile-menu-btn {
    display: none;
}

/* 2. Защита от горизонтального скролла */
html, body {
    overflow-x: hidden;
}

/* ---------------------------------------------------------
   Базовые настройки для экранов до 1024px
   --------------------------------------------------------- */
@media screen and (max-width: 1024px) {
    
    /* Контейнеры становятся резиновыми */
    .stak, .outer, .carusel, .mainphoto, .hrline {
        width: 100% !important;
        max-width: 1000px;
        padding: 0 15px;
    }
    
    /* Шапка выстраивается в колонку */
    .logo, .logotext, .flr {
        float: none !important;
        text-align: center;
        margin: 0 auto 15px auto;
        display: block;
        width: 100%;
    }
    .logotext { width: 100% !important; }
    
    /* Фикс заголовка в шапке (убираем пустоту после тире) */
    .logotext h1, .logotext strong { 
        font-size: 16px !important; 
        margin-bottom: 5px; 
        display: block; 
    }
    .logotext p { 
        display: none; /* Скрываем длинное описание, чтобы не занимало пол-экрана */
    }
    .flr .phone, .flr .email { text-align: center !important; }
    
    /* Поиск */
    .search {
        display: block !important;
        text-align: center;
        width: 100%;
        margin-bottom: 15px;
    }
    .search input[type="text"] {
        width: 80% !important;
        max-width: 300px;
    }

    /* Формы (защита от зума iOS) */
    input[type="text"], input[type="email"], input[type="tel"], textarea, select, .inpt, .form-control {
        font-size: 16px !important; 
        width: 100% !important;
        max-width: 100%;
    }
    
    /* ====================================================
       Кнопка мобильного меню (Бургер) - ЗАКРЕПЛЕННАЯ
       ==================================================== */
    .mobile-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        background: #409F5E;
        color: white;
        padding: 12px 0;
        cursor: pointer;
        font-size: 16px;
        font-weight: bold;
        font-family: "zgm", Arial, sans-serif;
        text-transform: uppercase;
        letter-spacing: 1px;
        border-bottom: 2px solid #2c9e55;
        
        /* Закрепляем при скролле */
        position: sticky;
        top: 0;
        z-index: 9999;
    }
    .burger-icon {
        display: flex;
        flex-direction: column;
        gap: 4px;
        margin-right: 10px;
    }
    .burger-icon span {
        display: block; width: 20px; height: 2px;
        background: #fff; transition: 0.3s;
    }
    
    /* ====================================================
       Главное меню - ИСПРАВЛЕНИЕ БЕЛОГО НА БЕЛОМ
       ==================================================== */
    .menu {
        display: none; 
        background: #409F5E !important; /* Даем сплошной фон, чтобы текст не сливался */
    }
    .ulmenu { 
        padding: 0; 
        width: 100% !important; 
    }
    .ulmenu > li {
        float: none; width: 100%;
        border-bottom: 1px solid rgba(255,255,255,0.2);
    }
    .ulmenu a {
        text-align: left; padding-left: 20px;
        height: auto; line-height: 20px;
        padding-top: 15px; padding-bottom: 15px;
        color: #fff !important; /* Принудительно белый текст */
    }
    
    /* Подменю на мобильных */
    .ulmenu ul {
        position: static !important; 
        width: 100% !important;
        max-width: 100% !important;
        background: rgba(0,0,0,0.15) !important; /* Чуть темнее для контраста */
        box-shadow: none !important;
        display: none; 
        padding: 0;
    }
    .ulmenu ul li a { padding-left: 40px; }

    /* Колонки контента друг под другом */
    .news, .rightindex, .content, .leftmenu, .onenews-content, .contacts-content, .contacts-rightcolumn, .lp, .rp {
        width: 100% !important;
        float: none !important;
        margin-right: 0 !important;
        margin-bottom: 30px !important;
    }
    .content { display: block !important; }

    /* ====================================================
       ИКОНКИ РАЗДЕЛОВ (КАТАЛОГ, ПРЕДСТАВИТЕЛИ и т.д.) - ФИКС РАЗМЕРА
       ==================================================== */
    .icons {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
    }
    .ico, .ico:visited {
        width: 48% !important;
        margin: 0 0 15px 0 !important;
        float: none !important;
        min-height: auto !important;
        text-align: center;
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    .ico img {
        max-width: 120px !important; /* Ограничиваем иконку, чтобы не была огромной */
        width: 100%;
        height: auto !important;
        margin: 0 auto 10px auto !important;
        display: block;
    }
    .ico h3 {
        font-size: 14px !important;
        margin-bottom: 0;
    }
    
    /* ====================================================
       ОБЛАСТИ ПРИМЕНЕНИЯ (Карасель) - НАТИВНЫЙ СВАЙП
       ==================================================== */
    .carusel {
        overflow: hidden;
        margin-bottom: 20px;
    }
    .caruop {
        width: 100% !important;
        height: auto !important;
        overflow: visible !important;
        border-bottom: none !important;
        background: transparent !important;
    }
    #carou_outer { padding: 0 !important; }
    
    /* Превращаем список в горизонтальную ленту */
    .carou {
        display: flex !important;
        overflow-x: auto !important;
        scroll-snap-type: x mandatory; /* Прилипание карточек при скролле */
        -webkit-overflow-scrolling: touch; /* Плавный скролл на iOS */
        gap: 15px;
        padding-bottom: 15px;
        width: 100% !important;
        height: auto !important;
        position: static !important;
        transform: none !important;
        float: none !important;
    }
    
    /* Настройки одной карточки */
    .carou li {
        flex: 0 0 85% !important; /* Карточка занимает 85% ширины экрана */
        scroll-snap-align: start;
        float: none !important;
        margin: 0 !important;
        height: auto !important;
        background: #f9f9f9;
        border-radius: 8px;
        padding: 10px !important;
        border-right: none !important;
        border: 1px solid #eee;
        display: flex;
        flex-direction: column;
    }
    
    .carou li img {
        width: 100% !important;
        height: auto !important;
        border-radius: 5px;
        margin-bottom: 10px;
    }
    
    .carou li h3 { font-size: 16px !important; margin-bottom: 5px; }
    .carou li .txt { height: auto !important; margin-bottom: 15px; font-size: 14px; }
    .carou li .str { margin-top: auto; align-self: flex-start; } /* Кнопка "Подробнее" внизу карточки */
    
    /* Прячем стрелки и тени от старого плагина */
    .prev, .next, .shadow { display: none !important; }

    /* ====================================================
       ОСТАЛЬНОЕ
       ==================================================== */
    .mb10 img, .mb20 img, .mb40 img {
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
    }

    #slides, .slidesjs-container, .slidesjs-control { width: 100% !important; height: auto !important; }
    #slides div img { width: 100% !important; }
    .mainphototext, a.mainphototext {
        position: relative !important; top: 0 !important;
        display: block; font-size: 18px !important;
        line-height: 1.2 !important; padding: 10px !important;
    }

    .page-content img, .onenews-content-material img, .newsitem img {
        max-width: 100% !important; height: auto !important;
    }
    .page-content img.fll, .page-content img.flr,
    .page-content img[style*="float"],
    .onenews-content-material img.fll,
    .onenews-content-material img.flr,
    .onenews-content-material img[style*="float"] {
        float: none !important; 
        display: block !important;
        margin: 10px auto !important; 
    }

    table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }

    #lightcase-case { max-width: 95% !important; }
    #form_window { 
        width: 95% !important; max-width: 400px; 
        left: 50% !important; transform: translateX(-50%) !important; 
    }

    footer .fll, footer .flr, .footcomp, .footpod {
        float: none !important; width: 100% !important;
        text-align: center !important; margin: 0 0 20px 0 !important;
        padding: 0 !important; border: none !important;
    }
    .sticky-header { display: none !important; }
    .mb20 > a[style*="background: #f95c3b"] {
        height: auto !important; padding: 10px !important; font-size: 14px !important; display: block;
    }
}

@media screen and (max-width: 600px) {
    .ico, .ico:visited { width: 100% !important; margin-bottom: 20px !important; }
    h1 { font-size: 24px; } h2 { font-size: 20px; }
}