/* =========================================
   СТИЛИ КУКИ-БАРА (ЧИСТАЯ ВЕРСИЯ: БЕЗ СИСТЕМНОЙ ТЕМЫ)
   ========================================= */

/* 1. БАЗОВЫЕ НАСТРОЙКИ ПОЛОСКИ */
.dyn_mp_jqm_frame.TEXT {
    position: fixed !important;
    left: 0 !important; right: 0 !important; bottom: 0 !important; top: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    border-radius: 0 !important;
    transform: none !important;
    
    /* Ставим 2000 (выше контента, но ниже меню, которое мы поднимем до 4000) */
    z-index: 2000 !important; 
    
    background: #ffffff !important; /* Фон светлый по умолчанию */
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1) !important;
}

/* 2. НАСТРОЙКА КОНТЕЙНЕРА */
.dyn_mp_jqm_frame.TEXT .marketing-popup,
.dyn_mp_jqm_frame.TEXT--wide .marketing-popup {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    
    padding: 8px 15px !important; 
    min-height: auto !important;
    gap: 20px !important;
    position: relative !important;
}

/* Запрет растягивания обертки */
.dyn_mp_jqm_frame.TEXT .marketing-popup__wrapper,
.dyn_mp_jqm_frame.TEXT--wide .marketing-popup__wrapper {
    flex: 0 1 auto !important;
    width: auto !important;
    min-width: 0 !important;
}

/* 3. СКРЫВАЕМ ЗАГОЛОВОК */
.dyn_mp_jqm_frame.TEXT .marketing-popup__title,
.dyn_mp_jqm_frame.TEXT .switcher-title {
    display: none !important;
}

/* 4. ТЕКСТ */
.dyn_mp_jqm_frame.TEXT .marketing-popup__main-block {
    margin: 0 !important;
    width: auto !important;
    flex: 0 1 auto !important;
}
.dyn_mp_jqm_frame.TEXT .marketing-popup__main-block div {
    text-align: center !important;
}

/* 5. КНОПКА (Десктоп) */
.dyn_mp_jqm_frame.TEXT .marketing-popup__btn {
    margin: 0 !important;
    flex: 0 0 auto !important;
    min-width: 0 !important;
}
.dyn_mp_jqm_frame.TEXT .marketing-popup__btn .btn {
    background-color: #ffffff !important;
    color: #222222 !important;
    border: 1px solid #dcdcdc !important;
    border-radius: 4px;
    padding: 3px 20px; 
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: none !important;
    white-space: nowrap;
}
.dyn_mp_jqm_frame.TEXT .marketing-popup__btn .btn:hover {
    background-color: #f2f2f2 !important;
}


/* =========================================
   ТЕМНАЯ ТЕМА (ТОЛЬКО САЙТ)
   ========================================= */
/* Убрал @media (prefers-color-scheme: dark). 
   Теперь работает только от класса на body */

body.theme-dark .dyn_mp_jqm_frame.TEXT,
body.dark_theme .dyn_mp_jqm_frame.TEXT {
    background: #222222 !important;
    border-top: 1px solid #333333;
}
body.theme-dark .dyn_mp_jqm_frame.TEXT .marketing-popup,
body.theme-dark .dyn_mp_jqm_frame.TEXT span,
body.theme-dark .dyn_mp_jqm_frame.TEXT div {
    color: #ffffff !important;
}
body.theme-dark .dyn_mp_jqm_frame.TEXT a {
    color: #ffffff !important;
    text-decoration: underline;
}
body.theme-dark .dyn_mp_jqm_frame.TEXT .marketing-popup__btn .btn {
    background-color: #000000 !important;
    color: #ffffff !important;
    border: 1px solid #444444 !important;
}
body.theme-dark .dyn_mp_jqm_frame.TEXT .marketing-popup__btn .btn:hover {
    background-color: #333333 !important;
}


/* =========================================
   МОБИЛЬНАЯ ВЕРСИЯ (ПОЛНАЯ ШИРИНА)
   ========================================= */
@media (max-width: 767px) {
    
    /* 1. ГЛАВНЫЙ КОНТЕЙНЕР */
    .dyn_mp_jqm_frame.TEXT {
        bottom: 60px !important; 
        border-top: 1px solid rgba(0,0,0,0.05);
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        
        /* Разносим контент и крестик по краям */
        justify-content: space-between !important; 
        
        /* Небольшие отступы */
        padding: 4px 8px !important; 
        
        box-sizing: border-box !important;
        width: 100% !important;
        max-width: 100vw !important;
        right: 0 !important;
        left: 0 !important;
    }

    /* 2. БЛОК С ТЕКСТОМ И КНОПКОЙ */
    .dyn_mp_jqm_frame.TEXT .marketing-popup,
    .dyn_mp_jqm_frame.TEXT--wide .marketing-popup {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        
        /* Растягиваем до крестика */
        flex: 1 1 auto !important; 
        width: 100% !important;
        
        /* Распределяем текст и кнопку */
        justify-content: space-around !important; 
        
        gap: 5px !important; 
        padding: 0 !important;
        margin: 0 !important;
    }

    /* 3. КРЕСТИК (В ряду, прижат вправо) */
    .dyn_mp_jqm_frame.TEXT .top-close,
    .dyn_mp_jqm_frame.TEXT .jqmClose {
        position: static !important;
        display: flex !important;
        align-items: center;
        justify-content: center;
        
        flex: 0 0 auto !important;
        width: 24px !important;
        height: 24px !important;
        
        margin-left: 5px !important;
        
        top: auto !important; right: auto !important;
        background: transparent !important;
    }

    /* Иконка крестика */
    .dyn_mp_jqm_frame.TEXT .jqmClose svg {
        width: 10px !important;
        height: 10px !important;
    }

    /* 4. ТЕКСТ */
    .mobile-text {
        display: inline-block !important;
        font-size: 10px !important;
        line-height: 1.1;
        white-space: nowrap;
        text-align: left;
    }
    .desktop-text { display: none !important; }

    /* 5. КНОПКА */
    .dyn_mp_jqm_frame.TEXT .marketing-popup__btn .btn {
        padding: 3px 8px !important; 
        font-size: 10px !important;
        white-space: nowrap;
        height: auto !important;
        min-height: 0 !important;
        margin: 0 !important;
    }

    /* Цвет крестика для темной темы сайта */
    body.theme-dark .dyn_mp_jqm_frame.TEXT .jqmClose svg path,
    body.theme-dark .dyn_mp_jqm_frame.TEXT .jqmClose svg use {
        fill: #ffffff !important;
    }
}

/* ПК версия */
@media (min-width: 768px) {
    .mobile-text { display: none !important; }
    .desktop-text { display: inline-block !important; }
}

/* =========================================
   FIX: ПОДНИМАЕМ МОБИЛЬНОЕ МЕНЮ НАД КУКИ
   ========================================= */

/* Поднимаем верхнюю мобильную шапку выше 2000 */
#mobileheader, 
.mobile_header, 
.header-mobile,
#headerfixed {
    z-index: 4000 !important; 
    position: relative; 
}
/* Бургер и линии */
.burger, 
.lines-wrapper,
.burger-wrapper {
    z-index: 4001 !important;
}

@media (min-width: 768px) and (max-width: 1199px) {
    
    /* 1. ГЛАВНЫЙ КОНТЕЙНЕР */
    .dyn_mp_jqm_frame.TEXT {
        
        border-top: 1px solid rgba(0,0,0,0.05);

        /* Flexbox для выстраивания в ряд */
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: center !important;
        flex-wrap: nowrap !important;
    }

    /* 2. Показываем КОРОТКИЙ текст */
    .desktop-text { display: none !important; }
    .mobile-text { 
        display: inline-block !important; 
        font-size: 13px !important; 
        white-space: nowrap; 
    }

    /* 3. Блок контента (Текст + Кнопка) */
    .dyn_mp_jqm_frame.TEXT .marketing-popup {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: center !important;
        
        flex: 0 1 auto !important;
        width: auto !important;
        margin: 0 !important;
        padding: 0 !important;
        gap: 15px !important;
    }

    /* 4. КРЕСТИК (Статичный) */
    .dyn_mp_jqm_frame.TEXT .top-close,
    .dyn_mp_jqm_frame.TEXT .jqmClose {
        position: static !important;
        display: flex !important;
        align-items: center;
        justify-content: center;
        
        flex: 0 0 auto !important;
        width: 30px !important;
        height: 30px !important;
        
        background: transparent !important;
        margin-left: 10px !important;
        
        top: auto !important; 
        right: auto !important;
    }

    .dyn_mp_jqm_frame.TEXT .marketing-popup__btn .btn {
         
        font-size: 12px !important;   /* Чуть меньше шрифт */
        height: auto !important;      /* Сброс фиксированной высоты */
        min-height: 0 !important;     /* Сброс минимальной высоты */
        line-height: 1.2 !important;  /* Компактный межстрочный интервал */
    }
        
}

@media (min-width: 768px) and (max-width: 1000px) {
.dyn_mp_jqm_frame.TEXT {
        /* 🔴 ПОДНИМАЕМ ВЫШЕ (было 0, стало 90px) */
        bottom: 50px !important;}

}