/* =========================================================================
   КАТЕГОРИИ (ФОТО-БЛОКИ)
========================================================================= */
/*.bg-categ__row {*/
/*    height: 320px !important;*/
/*    min-height: 320px !important;*/
/*    background-size: cover !important;*/
/*    background-position: center !important;*/
/*    border-radius: 12px !important;*/
/*    margin-bottom: 20px !important;*/
/*    display: flex !important;*/
/*    align-items: flex-end !important;*/
/*    padding: 0 !important;*/
/*    overflow: hidden !important;*/
/*    position: relative !important;*/
/*}*/

/*.bg-categ__title {*/
/*    background: rgba(0, 0, 0, 0.4) !important;*/
/*    width: 100% !important;*/
/*    margin: 0 !important;*/
/*    padding: 20px !important;*/
/*    color: #ffffff !important;*/
/*    text-align: left !important;*/
/*}*/

/*.bg-categ__title a {*/
/*    color: #ffffff !important;*/
/*    text-decoration: none !important;*/
/*    font-size: 18px !important;*/
/*    font-weight: bold !important;*/
/*}*/

/*.bg-categ {*/
/*    padding: 0 !important;*/
/*}*/

/*.bg-categ__link {*/
/*    position: absolute !important;*/
/*    inset: 0 !important;*/
/*    z-index: 2 !important;*/
/*    display: block !important;*/
/*    text-decoration: none !important;*/
/*}*/

/* =========================================================================
   КАТЕГОРИИ: ПРИНУДИТЕЛЬНЫЙ КЛИК ЧЕРЕЗ ПСЕВДОЭЛЕМЕНТ
========================================================================= */

.bg-categ__row {
    height: 320px !important;
    min-height: 320px !important;
    max-height: 320px !important;
    position: relative !important;
    display: flex !important;
    align-items: flex-start !important; /* Название СВЕРХУ */
    justify-content: flex-start !important;
    overflow: hidden !important;
    border-radius: 12px !important;
    margin-bottom: 20px !important;
    padding: 0 !important;
}

/* СЕРАЯ ПОЛОСКА */
.bg-categ__title {
    background: rgba(0, 0, 0, 0.4) !important;
    width: 100% !important;
    height: 60px !important; 
    margin: 0 !important;
    padding: 0 20px !important;
    display: flex !important;
    align-items: center !important;
    position: relative !important;
    z-index: 1 !important;
}

.bg-categ__title a {
    color: #ffffff !important;
    text-decoration: none !important;
    font-size: 18px !important;
    font-weight: bold !important;
    display: inline-block !important;
}

/* МАГИЯ КЛИКАБЕЛЬНОСТИ: Создаем невидимый слой на всю картинку */
.bg-categ__title a::after {
    content: "" !important;
    position: absolute !important;
    /* Эти координаты заставляют ссылку занять всё пространство .bg-categ__row */
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 320px !important; 
    z-index: 9999 !important;
    cursor: pointer !important;
    display: block !important;
}

/* Эффект при наведении на всю область */
.bg-categ__row:hover {
    filter: brightness(1.1);
    transition: 0.2s;
}
/* =========================================================================
   КАТЕГОРИИ (ФОТО-БЛОКИ)
========================================================================= */
.bg-categ__row {
    height: 320px !important;
    min-height: 320px !important;
    background-size: cover !important;
    background-position: center !important;
    border-radius: 12px !important;
    margin-bottom: 20px !important;
    display: flex !important;
    align-items: flex-end !important;
    padding: 0 !important;
    overflow: hidden !important;
    position: relative !important;
}

.bg-categ__title {
    background: rgba(0, 0, 0, 0.4) !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 20px !important;
    color: #ffffff !important;
    text-align: left !important;
    /* Убеждаемся, что заголовок не перекрывает ссылку-пустышку */
    position: relative !important;
    z-index: 1 !important;
}

.bg-categ__title a {
    color: #ffffff !important;
    text-decoration: none !important;
    font-size: 18px !important;
    font-weight: bold !important;
}

.bg-categ {
    padding: 0 !important;
}

/* ДОБАВЛЕННЫЙ БЛОК ДЛЯ КЛИКАБЕЛЬНОСТИ */
.bg-categ__link {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 10 !important; /* Самый высокий слой */
    display: block !important;
    text-decoration: none !important;
    background-color: transparent !important;
}
/* =========================================================================
   ТАБЫ — ОБЩИЕ СТИЛИ (ВСЕ УСТРОЙСТВА)
========================================================================= */
.tab__names {
    margin-bottom: 0 !important;
}

.custom-scroller-tabs {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    display: flex !important;
}

.custom-scroller-tabs .h-menu__item {
    display: block !important;
    margin: 0 !important;
    border: 1px solid #eee !important;
    margin-right: -1px !important;
}

.custom-scroller-tabs .h-menu__link {
    display: block !important;
    padding: 12px 20px !important;
    text-decoration: none !important;
    color: #333 !important;
    font-size: 14px !important;
    font-weight: bold !important;
    white-space: nowrap !important;
    background: #fff !important;
}

.custom-scroller-tabs .h-menu__link_active-tab {
    color: #cc0000 !important;
}

.tab__blocks {
    border: 1px solid #eee !important;
    padding: 25px !important;
    margin-top: -1px !important;
    background-color: #fff !important;
}

/* =========================================================================
   ТАБЫ — ТОЛЬКО ДЕСКТОП
========================================================================= */
@media (min-width: 768px) {
    .custom-scroller-tabs {
        flex-wrap: wrap !important;
        justify-content: flex-start !important;
        -webkit-mask-image: none !important;
        mask-image: none !important;
    }
}

/* =========================================================================
   ТАБЫ — ТОЛЬКО МОБИЛЬНЫЕ
========================================================================= */
@media (max-width: 767px) {

    .promo_wrap, .promo {
        display: none !important;
    }


    /* Общая обёртка — единая рамка снаружи */
    .tab__names {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: hidden !important;
        border: 1px solid #d0d0d0 !important;   /* тонкая серая рамка */
        border-bottom: none !important;          /* низ закроет tab__blocks */
        background: #fff !important;
        box-sizing: border-box !important;
        position: relative !important;
        left: 0 !important;
        transform: none !important;
        will-change: auto !important;
    }

    /* Внутренняя лента — только она скроллится */
    .custom-scroller-tabs {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        -webkit-overflow-scrolling: auto !important;
        overscroll-behavior-x: contain !important;
        touch-action: pan-x !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        border-bottom: 1px solid #d0d0d0 !important; /* линия под табами */
    }

    .custom-scroller-tabs::-webkit-scrollbar {
        display: none !important;
    }

    /* Каждый таб */
    .custom-scroller-tabs .h-menu__item {
        flex: 0 0 auto !important;
        margin: 0 !important;
        padding: 0 !important;
        border: none !important;
        border-right: 1px solid #d0d0d0 !important; /* разделитель между табами */
        background: #fff !important;
    }

    .custom-scroller-tabs .h-menu__item:last-child {
        border-right: none !important;
    }

    .custom-scroller-tabs .h-menu__link {
        display: block !important;
        padding: 12px 16px !important;
        white-space: nowrap !important;
        color: #333 !important;
        font-size: 14px !important;
        font-weight: normal !important;  /* как на brasvet — не жирный */
        text-decoration: none !important;
    }

    /* Активный таб — убираем красный цвет, оставляем только жирный шрифт или обычный */
    .custom-scroller-tabs .h-menu__link_active-tab,
    .custom-scroller-tabs .h-menu__item.active .h-menu__link {
        color: #333 !important;      /* Цвет теперь такой же, как у остальных (темно-серый) */
        font-weight: bold !important; /* Оставляем жирным, чтобы было понятно, какой таб выбран */
        border-bottom: 2px solid #333 !important; /* Опционально: можно добавить линию снизу вместо цвета */
    }

    /* Убираем эффект при нажатии (tap highlight), если он появляется */
    .custom-scroller-tabs .h-menu__link {
        -webkit-tap-highlight-color: transparent !important;
    }
    /* Блок с контентом — продолжение той же рамки */
    .tab__blocks {
        width: 100% !important;
        box-sizing: border-box !important;
        margin: 0 0 20px 0 !important;
        padding: 15px !important;
        border: 1px solid #d0d0d0 !important;
        border-top: none !important;   /* стыкуется с низом табов */
        background: #fff !important;
    }
}

/* =========================================================================
   ИСПРАВЛЕНИЕ ОТСТУПОВ ДЛЯ ДЛИННЫХ НАЗВАНИЙ (ПК)
========================================================================= */
@media (min-width: 768px) {
    /* Контейнер списка */
    .tab__names .h-menu,
    .custom-scroller-tabs {
        display: flex !important;
        flex-wrap: nowrap !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    /* Ячейка таба: убираем жесткую ширину, ставим автоматическую */
    .tab__names .h-menu__item,
    .custom-scroller-tabs .h-menu__item {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        flex: 0 0 auto !important; /* Ширина подстраивается под текст */
        border: 1px solid #eee !important;
        margin-right: -1px !important;
        background: #fcfcfc !important;
        height: 55px !important;
        min-width: 140px !important; /* Минимальный порог для коротких слов */
    }

    /* Ссылка: задаем одинаковые отступы СЛЕВА и СПРАВА */
    .tab__names .h-menu__link,
    .custom-scroller-tabs .h-menu__link {
        display: block !important;
        width: auto !important;
        /* 30px — это отступы по бокам, которые создадут нужный зазор */
        padding: 0 30px !important; 
        margin: 0 !important;
        text-align: center !important;
        font-size: 14px !important;
        font-weight: bold !important;
        color: #333 !important;
        line-height: 55px !important;
        white-space: nowrap !important; /* Текст всегда в одну строку */
    }

    /* Активный таб */
    .tab__names .h-menu__item.active,
    .custom-scroller-tabs .h-menu__item.active {
        background: #fff !important;
        border-bottom-color: #fff !important;
    }

    .tab__names .h-menu__item.active .h-menu__link {
        color: #cc0000 !important;
    }
}

/* УДАЛЕНИЕ ЗАГОЛОВКА ВНУТРИ ТАБОВ ПО ТОЧНОМУ КЛАССУ */
.tab__blocks .in-blocks__title {
    display: none !important;
}

/* Уменьшаем отступ сверху у контента, чтобы не было большой дырки */
.tab__blocks .tab_block {
    padding-top: 10px !important;
}