/* Основные стили для левого меню */
.side_panel .menu .category_nav {
    flex-direction: column;
    display: flex !important;
    white-space: normal !important;
}

.side_panel .menu .category_nav li.wrap {
    width: 100%;
    position: relative;
}

/* Скрываем подменю по умолчанию */
.side_panel .menu .category_nav .sub_menu {
    display: none;
    position: static;
    background: none;
    box-shadow: none;
    border: none;
    width: 100%;
    margin-left: 15px;
    margin-top: 5px;
    padding: 0;
}

/* Стили для ссылок в основном меню */
.side_panel .menu .category_nav > li.wrap > a {
    display: block;
    padding: 10px 15px;
    text-decoration: none;
    color: #333;
    border-bottom: 1px solid #eee;
    position: relative;
    transition: background-color 0.3s;
}

.side_panel .menu .category_nav > li.wrap > a:hover {
    background-color: #f5f5f5;
}



/* Стили для подкатегорий */
.side_panel .menu .category_nav .sub_menu li a {
    display: block;
    padding: 8px 15px 8px 25px;
    text-decoration: none;
    color: #666;
    font-size: 0.9em;
    border-bottom: 1px solid #f0f0f0;
}

.side_panel .menu .category_nav .sub_menu li:last-child a {
    border-bottom: none;
}

.side_panel .menu .category_nav .sub_menu li a:hover {
    background-color: #f9f9f9;
    color: #333;
}

/* Показываем подменю при активном состоянии */
.side_panel .menu .category_nav > li.wrap.active .sub_menu {
    display: block;
}

/* Скрываем дополнительное меню "ЕЩЁ" если оно есть */
.side_panel .menu .category_nav li.dropdown,
.side_panel .menu .category_nav li.more {
    display: none !important;
}

/* Адаптивность */
@media (max-width: 992px) {
    .side_panel .menu .category_nav {
        flex-direction: column;
    }
}

/* Для мобильных устройств */
@media (max-width: 768px) {
    .side_panel .menu {
        display: none; /* Скрываем на мобильных, если нужно */
    }
    
    .side_panel .menu.visible-xs {
        display: block;
    }
}


/* СЕТКА ТОВАРОВ И КАТЕГОРИЙ 4 КОЛОНКИ */
/* СЕТКА ТОВАРОВ И КАТАЛОГОВ - ИСПРАВЛЕННАЯ ВЕРСИЯ */

/* 0. Сначала получаем контроль над контейнером */
.card_product_container {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 20px !important;
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* 1. Скрываем пустые шаблонные карточки */
.card_product_container > .blank_item {
    display: none !important;
}

/* 2. СБРОС ВСЕХ СТИЛЕЙ Bootstrap ДЛЯ КАРТОЧЕК */
.card_product_container > [class*="col-"],
.card_product_container > .card_product {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    float: none !important;
    position: static !important;
    left: auto !important;
    right: auto !important;
}

/* 3. ЯВНО ЗАДАЕМ РАЗМЕРЫ КАРТОЧЕК ДЛЯ Grid */
.card_product_container > *:not(.blank_item) {
    width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
}

/* 4. АДАПТИВНОСТЬ С ЯВНЫМИ ОТСТУПАМИ */
/* Для десктопа - 4 колонки */
@media (min-width: 992px) {
    .card_product_container {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 20px !important;
        /* Компенсируем отступы Bootstrap контейнера */
        width: calc(100% + 30px) !important;
        margin-left: -15px !important;
        margin-right: -15px !important;
        padding: 0 15px !important;
    }
}

/* Планшет - 2 колонки */
@media (max-width: 991px) and (min-width: 768px) {
    .card_product_container {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 15px !important;
        width: calc(100% + 30px) !important;
        margin-left: -15px !important;
        margin-right: -15px !important;
        padding: 0 15px !important;
    }
}

/* Мобильные - 1 колонка */
@media (max-width: 767px) {
     .card_product_container {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 15px !important;
        width: calc(100% + 30px) !important;
        margin-left: -15px !important;
        margin-right: -15px !important;
        padding: 0 15px !important;
    }
}



/* 6. СКРЫВАЕМ КНОПКУ СРАВНЕНИЯ */
.card_product_container .add_compare,
.card_product_container .goto_compare {
    display: none !important;
}

/* 7. ДОПОЛНИТЕЛЬНЫЕ ИСПРАВЛЕНИЯ ДЛЯ КОНТЕНТА КАРТОЧЕК */
.card_product_container > * > * {
    max-width: 100% !important;
}

/* 8. ОБРЕЗКА ДЛИННЫХ ТЕКСТОВ */
.card_product_title a,
.card_product_title h3,
.card_product_title h4 {
    word-break: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
}



/* УДАЛЕНИЕ БЕЛЫХ ПОЛЕЙ В СЛАЙДЕРЕ (ТАМ ПИСАЛИСЬ ЗАГОЛОВКИ ДЛЯ СЛАЙДЕРА) */

.carousel-caption {
    display: none !important;
}

.caption-wrapper, .caption-text {
    display: none !important;
}

/* ЗЕЛЕНЫЙ ЦВЕТ ДЛЯ ВЕРХНЕГО МЕНЮ */
/* Фон верхнего меню */
.header_top_nav.background_light_gray {
    background-color: #0bac02 !important;
    background: #0bac02 !important;
}

/* Ссылки в левом меню */
.header_top_nav .left_nav.list_inline li a,
.header_top_nav .left_nav.list_inline li a:link,
.header_top_nav .left_nav.list_inline li a:visited {
    color: #ffffff !important;
    text-decoration: none !important;
}

/* Ссылки в правом меню (заказы, настройки, выход) */
.header_top_nav .right_nav.list_inline li a,
.header_top_nav .right_nav.list_inline li a:link,
.header_top_nav .right_nav.list_inline li a:visited,
.header_top_nav .right_nav.list_inline li span a,
.header_top_nav .right_nav.list_inline li span a:link,
.header_top_nav .right_nav.list_inline li span a:visited {
    color: #ffffff !important;
    text-decoration: none !important;
}

/* Цвет текста в правом меню (текст без ссылок, если есть) */
.header_top_nav .right_nav.list_inline li span,
.header_top_nav .right_nav.list_inline .media-left span,
.header_top_nav .right_nav.list_inline .media-body span,
.header_top_nav .right_nav.list_inline .media-right span {
    color: #ffffff !important;
}

/* Эффекты при наведении для всех ссылок в верхнем меню */
.header_top_nav .left_nav.list_inline li a:hover,
.header_top_nav .right_nav.list_inline li a:hover,
.header_top_nav .right_nav.list_inline li span a:hover {
    color: #f0f0f0 !important;
    opacity: 0.9 !important;
}

/* Для активного пункта меню (если есть) */
.header_top_nav .left_nav.list_inline li.active a {
    color: #ffffff !important;
    font-weight: bold !important;
}

/* Убираем возможные границы и тени */
.header_top_nav.background_light_gray,
.header_top_nav .container.mobile_all_width {
    border: none !important;
    box-shadow: none !important;
}


/* ЗЕЛЕНЫЙ ЦВЕТ ДЛЯ МЕНЮ СЛЕВА (КАТЕГОРИЙНОГО) */

.side_panel .table-menu ul > li:hover > a, 
.side_panel .table-menu > ul > li.active > a {
    background: #0aac01 !important;
    background-color: #0aac01 !important;
    color: #fff !important;
}

/* Активные пункты подменю */
.side_panel .table-menu ul ul > li.active > a {
    background: #0aac01 !important;
    background-color: #0aac01 !important;
    color: #fff !important;
}

/* Ховер пунктов подменю */
.side_panel .table-menu ul ul > li:hover > a {
    background: #0aac01 !important; /* или #f06800 если оранжевый */
    background-color: #0aac01 !important;
    color: #fff !important;
}

/* ЗЕЛЕНЫЙ ЦВЕТ ДЛЯ КНОПКИ КОРЗИН */
/* Зеленая кнопка "Купить" */
.button_buy.button_buy_order {
    background-color: #0aac01 !important;
    background: #0aac01 !important;
    color: #ffffff !important;
    border-radius: 0 !important; /* Квадратные углы */
    border: none !important;
    text-decoration: none !important;
}

/* Ховер состояние */
.button_buy.button_buy_order:hover {
    background-color: #089c00 !important; /* Немного темнее зеленый */
    background: #089c00 !important;
    color: #ffffff !important;
    opacity: 0.9;
}

/* Фокус состояние */
.button_buy.button_buy_order:focus {
    outline: 2px solid #0aac01 !important;
    outline-offset: 2px !important;
}

/* Активное состояние (при нажатии) */
.button_buy.button_buy_order:active {
    background-color: #078b00 !important; /* Еще темнее */
    background: #078b00 !important;
}

/* ЗЕЛЕНЫЙ ЦВЕТ ДЛЯ КНОПКИ КОРЗИН (В КАРТОЧКЕ ТОВАРА) */
/* Общий стиль для всех зеленых кнопок покупки */
.green-btn {
    background-color: #0aac01 !important;
    color: #ffffff !important;
    border-radius: 0 !important;
    border: none !important;
    text-decoration: none !important;
    padding: 10px 20px !important;
    display: inline-block !important;
    text-align: center !important;
    cursor: pointer !important;
    transition: background-color 0.3s ease !important;
}

.green-btn:hover {
    background-color: #089c00 !important;
    color: #ffffff !important;
}

/* Применяем к конкретным кнопкам */
.button_buy,
.cart_btn.button_buy,
.one_click_btn,
.gotobasket {
    background-color: #0aac01 !important;
    color: #ffffff !important;
    border-radius: 0 !important;
    border: none !important;
}

/* ЗЕЛЕНЫЙ ЦВЕТ ДЛЯ КНОПКИ КОРЗИН (ВНУТРИ КОРЗИНЫ) */
.cart-goback-button {
    background-color: #0aac01 !important;
    color: #fff !important;
    border-radius: 0 !important;
    border: none !important;
    text-decoration: none !important;
}

.cart-goback-button:hover {
    background-color: #089c00 !important;
    color: #fff !important;
}

#basket_to_form {
    background-color: #0aac01 !important;
    color: #fff !important;
    border-radius: 0 !important;
    border: none !important;
    padding: 10px 20px !important;
    font-weight: bold !important;
}

#basket_to_form:hover {
    background-color: #089c00 !important;
    color: #fff !important;
}

/* ЗЕЛЕНЫЙ ЦВЕТ ДЛЯ КНОПКИ КОРЗИН (ВНУТРИ КОРЗИНЫ) */
/* Все кнопки подтверждения в формах */
input[type="submit"].alt_btn,
input[type="submit"][value*="заказ"],
input[type="submit"][value*="Заказ"],
input[type="submit"][value*="order"],
input[type="submit"][value*="Order"] {
    background-color: #0aac01 !important;
    color: #fff !important;
    border-radius: 0 !important;
    border: none !important;
}

/* ЗЕЛЕНЫЙ ЦВЕТ ДЛЯ КНОПКИ ОТЗЫВЫ */
#create_review {
    background-color: #0aac01 !important;
    color: #fff !important;
    border-radius: 0 !important;
    border: none !important;
    padding: 8px 16px !important;
    cursor: pointer !important;
}

#create_review:hover {
    background-color: #089c00 !important;
    color: #fff !important;
}

/* ЗЕЛЕНЫЙ ЦВЕТ ДЛЯ КНОПКИ ОБРАТНОЙ СВЯЗИ */
#order_submit {
    background-color: #0aac01 !important;
    color: #fff !important;
    border-radius: 0 !important;
    border: none !important;
    padding: 10px 20px !important;
    cursor: pointer !important;
    font-weight: bold !important;
}

#order_submit:hover {
    background-color: #089c00 !important;
    color: #fff !important;
}

/* СКРЫВАЕМ ЗАГОЛОВОК САЙТА, ЧТОБЫ ВЫТЯНУТЬ ЛОГОТИП */
/* Вместо текущего img, добавьте фоном оригинальное изображение */
.col-md-3.header_brand > .media-left img {
    opacity: 0 !important; /* Скрываем текущее */
    width: 300px !important;
    height: 150px !important;
}

.col-md-3.header_brand > .media-left {
    background-image: url("/images/cms/data/content/logo_21_max.png") !important;
    background-size: contain !important;
    background-repeat: no-repeat !important;
    background-position: left center !important;
    width: 300px !important;
    height: 150px !important;
}

/* ЗЕЛЕНЫЙ КАТАЛОГ СВЕРХУ ЛЕВОГО МЕНЮ */
/* Вариант с символом каталога и зеленым оформлением */
.side_panel .menu .row .table-menu {
    position: relative;
}

.side_panel .menu .row .table-menu::before {
    content: "📚 Каталог товаров";
    display: block;
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
    background-color: #0aac01;
    padding: 12px 15px;
    margin-bottom: 15px;
    border-radius: 4px;
    white-space: normal !important;
    width: 100%;
    box-sizing: border-box;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}



.side_panel .menu .row .table-menu.hover-effect::before:hover {
    background-color: #089a00;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

/* Для мобильных устройств */
@media (max-width: 767px) {
    .side_panel .menu .row .table-menu::before {
        font-size: 16px;
        padding: 10px 12px;
        margin-bottom: 10px;
    }
}

/* Убираем nowrap для контейнера */
.table-menu[style*="white-space: nowrap;"] {
    white-space: normal !important;
}

/* Если нужно сохранить nowrap для элементов меню, но не для заголовка */
.table-menu > ul.level-0.category_nav.up {
    white-space: nowrap;
    display: inline-flex;
}

/* МЕНЮ ДЛЯ МОБИЛЬНЫХ */
/* Минимальный вариант без логотипа */
@media (max-width: 991px) {
    .header_middle_nav {
        display: block !important;
        height: 60px !important;
        background: white !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        z-index: 1000 !important;
        border-bottom: 1px solid #eee !important;
    }
    
    .header_middle_nav .container {
        display: block !important;
        height: 60px !important;
        padding: 0 15px !important;
    }
    
    .header_middle_nav .row {
        display: flex !important;
        align-items: center !important;
        justify-content: flex-end !important;
        height: 60px !important;
        margin: 0 !important;
    }
    
    /* Скрываем ВСЁ */
    .header_middle_nav .header_brand,
    .header_middle_nav .header_work_time,
    .header_middle_nav .header_cart {
        display: none !important;
    }
    
    /* Только нужные элементы */
    .header_middle_nav .header_contact {
        display: block !important;
    }
    
    .header_middle_nav .header_contact .row {
        display: flex !important;
        align-items: center !important;
        gap: 30px !important;
    }
    
    .header_middle_nav .header_contact .row > div:first-child a {
        font-size: 14px !important;
        color: #333 !important;
    }
    
    .header_middle_nav .phone_number {
        font-size: 16px !important;
        font-weight: bold !important;
        color: #007bff !important;
    }
    
    .header_mobile {
        margin-top: 60px;
    }
}

/* ИСПРАВЛЕНИЕ КАТАЛОГА НА ГЛАВНОЙ*/
/* ======================= */
/* 1. ТОЛЬКО ДЛЯ ГЛАВНОЙ СТРАНИЦЫ */
/* ======================= */



/* Делаем карточки квадратными на главной */
.special_items .card_product {
    position: relative !important;
    padding-top: 100% !important; /* Создаем квадрат */
    height: 0 !important;
}

/* Прячем всё кроме контейнера изображения на главной */
.special_items .card_product > *:not(.card_product_img):not(.item_img) {
    display: none !important;
}

/* Растягиваем контейнер изображения на всю карточку на главной */
.special_items .card_product_img {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
}

/* Растягиваем само изображение на главной */
.special_items .card_product_img img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center !important;
}

/* Убираем скрытие на мобильных на главной */
.special_items .card_product_img.hidden-xs,
.special_items .card_product_img.hidden-sm {
    display: block !important;
}

/* ======================= */
/* 2. ТОЛЬКО ДЛЯ СТРАНИЦ КАТЕГОРИЙ (где НЕТ .object) */
/* ======================= */

/* ВАЖНО: Эти стили применяются ТОЛЬКО когда в контейнере НЕТ .object */
/* .object есть только на страницах товаров */

/* Определяем страницу категорий по отсутствию .object в контейнере */
.catalog_page .card_product_container:not(:has(.object)) > .card_product {
    position: relative !important;
    padding-top: 100% !important; /* Создаем квадрат */
    height: 0 !important;
    overflow: hidden !important;
}

/* Прячем всё кроме контейнера изображения на страницах категорий */
.catalog_page .card_product_container:not(:has(.object)) > .card_product > *:not(.card_product_img):not(.item_img) {
    display: none !important;
}

/* Растягиваем контейнер изображения на страницах категорий */
.catalog_page .card_product_container:not(:has(.object)) > .card_product .card_product_img {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 1 !important;
}

/* Растягиваем само изображение на страницах категорий */
.catalog_page .card_product_container:not(:has(.object)) > .card_product .card_product_img img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center !important;
}

/* Убираем скрытие на мобильных на страницах категорий */
.catalog_page .card_product_container:not(:has(.object)) > .card_product .card_product_img.hidden-xs,
.catalog_page .card_product_container:not(:has(.object)) > .card_product .card_product_img.hidden-sm {
    display: block !important;
}


/* ИСПРАВЛЕНИЕ КОНТАКТОВ*/


/* Скрываем все текстовые узлы внутри #map, кроме содержимого iframe */
#map {
    color: transparent;
    font-size: 0;
    line-height: 0;
}

/* Возвращаем видимость для iframe и его содержимого */
#map iframe,
#map iframe * {
    color: initial;
    font-size: initial;
    line-height: initial;
}

/* ФОНЫ В КОНТАКТКАХ*/
/* Блок с адресом (первый) - карта */
.container.mobile_all_width .row > .col-md-4:nth-child(1) {
    background-image: url("/images/cms/data/content/adres.png");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 8px;
    padding: 20px;
    min-height: 200px;
    position: relative;
}

/* Блок с телефоном (второй) */
.container.mobile_all_width .row > .col-md-4:nth-child(2) {
    background-image: url("/images/cms/data/content/phone.png");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 8px;
    padding: 20px;
    min-height: 200px;
    position: relative;
}

/* Блок с email (третий) */
.container.mobile_all_width .row > .col-md-4:nth-child(3) {
    background-image: url("/images/cms/data/content/mail.png");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 8px;
    padding: 20px;
    min-height: 200px;
    position: relative;
}

/* Контент поверх фона */
.container.mobile_all_width .info_item > * {
    position: relative;
    z-index: 2;
}

/* Стили для текста внутри блоков */
.container.mobile_all_width .info_text span {
    display: inline-block;
    padding: 10px 15px;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 6px;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
/* МОБИЛЬНЫЙ ХАРДКОД (минимальная версия) */
@media (max-width: 767.98px) {
    .container.mobile_all_width .row > .col-md-4 {
        width: 300px !important;
        height: 300px !important;
        min-height: 300px !important;
        max-width: 300px !important;
        margin: 15px auto !important;
        padding: 0 !important;
        border-radius: 15px !important;
        overflow: hidden !important;
        position: relative !important;
    }
    
    .container.mobile_all_width .info_item {
        width: 100% !important;
        height: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: flex-end !important; /* Оставляем внизу */
        align-items: center !important;
        background: none !important;
    }
    
    /* СКРЫВАЕМ ИКОНКИ НА МОБИЛЬНЫХ */
    .container.mobile_all_width .info_icon {
        display: none !important;
    }
    
    /* Переопределяем flex-grow-1 для мобильных */
    .container.mobile_all_width .info_text.flex-grow-1 {
        flex-grow: 0 !important;
        width: 100% !important;
        text-align: center !important;
        padding-bottom: 20px !important;
    }
    
    .container.mobile_all_width .info_text span {
        display: inline-block !important;
        padding: 15px 18px !important;
        background-color: rgba(255, 255, 255, 0.95) !important;
        border-radius: 10px !important;
        font-weight: 600 !important;
        box-shadow: 0 4px 15px rgba(0,0,0,0.25) !important;
        font-size: 15px !important; /* Увеличенный шрифт */
        line-height: 1.5 !important; /* Увеличенный межстрочный */
        text-align: center !important;
        margin: 0 auto !important;
        max-width: 90% !important;
    }
    
    /* Фоны для каждого блока */
    .container.mobile_all_width .row > .col-md-4:nth-child(1) {
        background: url("/images/cms/data/content/adres.png") center/cover no-repeat !important;
    }
    
    .container.mobile_all_width .row > .col-md-4:nth-child(2) {
        background: url("/images/cms/data/content/phone.png") center/cover no-repeat !important;
    }
    
    .container.mobile_all_width .row > .col-md-4:nth-child(3) {
        background: url("/images/cms/data/content/mail.png") center/cover no-repeat !important;
    }
}