/* Custom site-wide CSS overrides for b2b.orentechno.ru.
   Loaded last from header.php after all aspro-lite css files. */

/* Hide the top header strip (data-ajax-load-block="HEADER_TOP_PART"):
   contains city selector / contacts / extra links. For closed B2B it is
   not needed — operators want a compact header. Cheaper than removing
   the PHP include (no DOM, no JS init for the city popup). */
.header__top-part {
    display: none !important;
}

/* Hide .header__bottom-part if its menu is empty (no <li>/<a> rendered).
   Bitrix:menu still leaves <nav class="mega-menu"> wrapper even when the
   menu type has no items; :has() lets us detect actual content. Supported
   in Chrome 105+, Safari 15.4+, Firefox 121+ — fine for any modern target. */
.header__bottom-part:not(:has(:is(li, a))) {
    display: none !important;
}

/* When .header__top-part is hidden, Aspro adds .header__inner--no-pt to drop top
   padding — but bottom padding stays. With .header__bottom-part also hidden we
   want the header tight on both sides. */
.header__inner--no-pt {
    padding-bottom: 0 !important;
}

/* Hide the homepage "Кондиционирование" CTA block (drag-block CUSTOM_TEXT
   containing the AC catalog link). Customer asked to remove it. */
.drag-block.CUSTOM_TEXT:has(a[href="/catalog/konditsionirovanie-vozdukha/"]) {
    display: none !important;
}

/* Homepage popular categories — responsive column count.
   The catalog.section.list/main template emits CSS Grid classes
   (.grid-list uses `display: grid; grid-template-columns: repeat(N, 1fr)`)
   with breakpoints [768, 1200] for ELEMENTS_IN_ROW=4: default 1 col,
   ≥768 = 2 cols, ≥1200 = 4 cols. Override grid-template-columns directly
   since flex/width rules don't constrain grid items. MOBILE_SCROLLED=N
   keeps it a normal grid (no carousel). */
@media (max-width: 767px) {
    .sections-block .grid-list {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    /* Tighter inner padding on mobile so cards don't look hollow */
    .sections-block .sections-block__item-inner {
        padding: 10px !important;
    }
}
@media (min-width: 768px) and (max-width: 1199px) {
    .sections-block .grid-list {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

/* Mobile big-banner (BIGBANNER_MOBILE=3): make the TABLET_IMAGE fit the
   full viewport width instead of being cropped by background-size:cover. */
@media (max-width: 767px) {
    .banners-big__adaptive-img {
        background-size: 100% !important;
    }
}


/* Long category names: break inside a word when the line is too narrow.
   Applies to category tiles on the homepage AND inside section pages —
   both render via .sections-block__item-text. */
.sections-block__item-text {
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
}

/* Mobile: tighten vertical padding inside the 5-per-row category cards
   (.items-5). The card link uses CSS custom props --item-pt/--item-pb for
   its top/bottom padding; shrink them so cards are more compact on phones. */
@media (max-width: 767px) {
    .items-5 .sections-block__item-link {
        --item-pt: 5px;
        --item-pb: 5px;
    }
}

/* Brand badge top-left of catalog cards (catalog.section/catalog_block).
   Logo (from iblock 6 "Бренды" PREVIEW_PICTURE) or plain brand-name text. */
.catalog-block__inner { position: relative; }
.catalog-block__brand {
    position: absolute;
    top: -23px;
    left: 0px;
    z-index: 3;
    pointer-events: none;
    background: white;
    padding: 1px 7px;
    border-radius: 9px;
    /* border: 1px solid whitesmoke; */
    line-height: 13px;
}
.catalog-block__brand-logo {
    display: block;
    max-height: 16px;
    max-width: 100%;
    width: auto;
}
.catalog-block__brand-name {
    font-size: 10px;
    font-weight: 600;
    line-height: 1.2;
    color: #999;
}
.grid-list--fill-bg > .grid-list__item > div {
    padding-top: 30px !important;
}
/* ── Опт/РИЦ price labels (2026-07-02) ──────────────────────────── */
/* card wrapper holds Опт + РИЦ; row on desktop, stacked on mobile   */
.ot-price-block { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; width: 100%; }
.ot-price-line { display: flex; align-items: baseline; gap: 4px; }
.ot-price-line .price { margin: 0; }
/* the "Опт:" / "РИЦ:" caption — grey, smaller than the price value  */
.ot-price-label { color: #a7a7a7; font-weight: 600; font-size: 12px; line-height: 1; white-space: nowrap; }
.catalog-detail__price .ot-price-label { font-size: 14px; }
@media (max-width: 767px) {
    /* РИЦ drops onto its own line under Опт on phones */
    .ot-price-block { flex-direction: column; gap: 2px; }
    .ot-price-label { font-size: 11px; }
}
