/* ============================================================
   dveri101 — стили доработок сайта.
   Файл подключается темой автоматически, если существует:
   template/template/2/Template.html → <link href="/b/dveri101/second.css?v=filectime">
   Грузится последним в <head>, поэтому перебивает стили темы.
   Раньше эти правила выводились инлайном из PHP-оверрайдов
   (b/dveri101/class/class2001.php, class2041.php) — перенесены сюда.
   ============================================================ */

/* ---------- Задача 1: бейдж «Распродажа» в карточке листинга ---------- */
.blk_status .blk_st { padding-left: 0 !important; }
.blk_status .blk_st.blk_st_sale > span {
    display: inline-block;
    background: #df0000 !important;
    color: #fff !important;
    padding: 3px 10px;
    border-radius: 3px;
    font-weight: 600;
    font-size: 12px;
    line-height: 1.35;
    white-space: nowrap;
}
/* старый лейбл «Акция» темы не показываем */
.catalog-item .blk_st_1 { display: none !important; }

/* ---------- Задача 5: 2-е фото при наведении на карточку ---------- */
.catalog-item .has-hover { position: relative; }
.catalog-item .has-hover .img-hover {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    object-fit: contain;
    background: #fff;
    transition: opacity .3s;
    pointer-events: none;
}
.catalog-item .has-hover:hover .img-hover { opacity: 1; }

/* ---------- Задача 1: строка сортировки + теги-статусы ---------- */
.filter-items.cb {
    display: flex !important;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 0;
}
.filter-items.cb .filter-item { margin: 0 !important; float: none !important; }
.filter-items.cb .filter-item-1 { margin: 0 16px 0 0 !important; }
.filter-items.cb .filter-item-type { margin-left: auto; }

.status-tags { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.status-tags .status-tag {
    display: inline-block;
    padding: 6px 14px;
    background: #fff;
    border: 1px solid #df0000;
    border-radius: 20px;
    font-size: 13px;
    color: #333;
    text-decoration: none;
    line-height: 1.2;
    transition: .15s;
    cursor: pointer;
}
.status-tags .status-tag:hover { background: #df0000; color: #fff; }
.status-tags .status-tag.active { background: #df0000; border-color: #df0000; color: #fff; }

@media screen and (max-width: 610px) {
    .filter-items.cb .filter-item.filter-item-2 {
        display: flex !important;
        flex: 1 1 100%;
        order: 3;
        margin: 8px 0 0 !important;
    }
    .filter-items.cb .filter-item-1 { order: 1; }
    .filter-items.cb .filter-item-type { order: 2; }
}

/* ---------- Задача 6: кнопки тегов под сортировкой ---------- */
.cat-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.cat-tags .cat-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: #f3f3f3;
    border: 1px solid #e2e2e2;
    border-radius: 20px;
    font-size: 13px;
    line-height: 1.2;
    color: #333;
    text-decoration: none;
    transition: .15s;
}
.cat-tags .cat-tag:hover { border-color: #df0000; color: #df0000; }
.cat-tags .cat-tag.active { background: #333; border-color: #333; color: #fff; }
.cat-tags .cat-tag.active:hover { background: #df0000; border-color: #df0000; color: #fff; }
.cat-tags .cat-tag-x { font-size: 16px; line-height: 1; opacity: .8; }

@media screen and (max-width: 780px) {
    .cat-tags { margin: 0; padding-bottom: 14px; }
}

/* ---------- Задача 4: плашки цвета в фильтре ---------- */
.flt-color-sw {
    display: inline-block;
    width: 16px;
    height: 16px;
    border-radius: 3px;
    border: 1px solid rgba(0, 0, 0, .28);
    vertical-align: middle;
    margin-right: 7px;
    flex: 0 0 auto;
}
.flt-color .podbor_dch label,
.flt-color .podbor_dch { display: flex; align-items: center; }
.podbor_checkb.flt-scroll { max-height: 230px; overflow-y: auto; padding-right: 4px; }

/* ---------- Задача 3: блоки «Входные/Межкомнатные двери» на главной ---------- */
#main-doors-wrap { width: 100% !important; float: left; position: relative; z-index: 2; }
.main-doors { margin: 0; display: flow-root; width: 100% !important; }
.main-doors-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin: 80px 0 18px;
    width: 100% !important;
}
.main-doors .main-doors-title { margin: 0; font-size: 24px; font-weight: 700; color: #121212 !important; }
.main-doors-all { color: #df0000; text-decoration: none; white-space: nowrap; font-size: 14px; }
.main-doors-all:hover { text-decoration: underline; }
.main-doors-list {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    width: 100% !important;
}
.main-doors-list .catalog-item { margin: 0 !important; width: 100% !important; max-width: none !important; }

@media (max-width: 1000px) { .main-doors-list { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 768px)  { .main-doors-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) {
    .main-doors-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .main-doors-head { padding-left: 10px; padding-right: 10px; }
}

/* ---------- Мессенджер Max в блоке соцсетей (шапка, подвал, мобильное меню) ----------
   Остальные иконки — символы шрифта krz-font в ::before, значка Max там нет.
   Рисуем SVG маской: цвет берётся из currentColor, как у соседних иконок
   (в шапке белый, в мобильном меню — свой). Размер/позиция ::before — от темы.
   Форма — фирменный знак Max (толстое кольцо с отверстием и хвостом слева внизу,
   толщина кольца ≈ 0.26 диаметра), только монохромно, без цветного градиента. */
.soc_link.max::before {
    content: '' !important;
    /* тема ставит иконкам height:auto — соседям высоту даёт символ шрифта (18px),
       а пустой ::before схлопывается в 0 и маске не на чем рисоваться */
    height: 18px !important;
    background-color: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill-rule='evenodd' d='M8.75 19.93A9.5 9.5 0 1 0 3.77 15.75L3.8 21.2ZM12.2 6.4A4.6 4.6 0 1 0 12.2 15.6A4.6 4.6 0 1 0 12.2 6.4Z'/%3E%3C/svg%3E") center / 18px 18px no-repeat;
            mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill-rule='evenodd' d='M8.75 19.93A9.5 9.5 0 1 0 3.77 15.75L3.8 21.2ZM12.2 6.4A4.6 4.6 0 1 0 12.2 15.6A4.6 4.6 0 1 0 12.2 6.4Z'/%3E%3C/svg%3E") center / 18px 18px no-repeat;
}

/* ---------- «Запросить цену» у товаров без цены (вместо количества и корзины) ----------
   Разметку рисует class2001_btn() в b/dveri101/class/class2001.php.
   Тема обнуляет font-size у контейнеров кнопок — размер шрифта задаём явно. */
.cart-btn.price-request { display: block; width: 100%; background: transparent; }
.cart-btn.price-request .price-request-link {
    display: flex; align-items: center; justify-content: center;
    width: 100%; box-sizing: border-box;
    padding: 0 10px; border-radius: 0;
    background: #df0000; color: #fff !important; text-decoration: none !important;
    transition: background-color .2s;
}
.cart-btn.price-request .price-request-link:hover { background: #b80000; }
.cart-btn.price-request .price-request-link span { color: #fff !important; line-height: 1.2; }
/* листинг — на месте блока «− 1 + | корзина» (46px) */
.price-request-list .price-request-link { min-height: 46px; }
.price-request-list .price-request-link span { font-size: 14px; font-weight: 600; }
/* карточка товара — как основная кнопка «В корзину» (45px, прописные).
   Отступ 14px до «Получить консультацию» — как у штатных кнопок карточки
   (тема даёт его своим классам .incart-typefull2/.fast_buy_first, у нашей кнопки свой класс) */
.cart-btn.price-request-full { margin-bottom: 14px; }
.price-request-full .price-request-link { min-height: 45px; }
.price-request-full .price-request-link span { font-size: 16px; font-weight: 700; text-transform: uppercase; }

/* ---------- «Купить в 1 клик» в листинге (над «− 1 + | корзина») ----------
   Разметку выводит class2001_getCard() в b/dveri101/class/class2001.php.
   Вид — как в карточке товара: красная рамка, красный текст; при наведении заливка. */
.blk_oneclick { margin-bottom: 8px; }
.blk_oneclick a {
    display: flex; align-items: center; justify-content: center;
    width: 100%; min-height: 38px; box-sizing: border-box; padding: 0 10px;
    border: 1px solid #df0000; background: transparent; color: #df0000 !important;
    text-decoration: none !important; cursor: pointer; transition: background-color .2s, color .2s;
}
.blk_oneclick a .a_fast { font-size: 14px; font-weight: 600; line-height: 1.2; color: inherit !important; }
.blk_oneclick a:hover { background: #df0000; color: #fff !important; }
