/* Правки вёрстки каталога. Подключается после styles.min.css */

/* ── Плитки разделов ──────────────────────────────────────────────────────
   Ряды разъезжались: обёртки растягивались, а карточка внутри оставалась
   высотой по тексту, и заголовки разной длины ломали ряд. */
.catalog_items,
.category-wrap {
    display: -webkit-box; display: -ms-flexbox; display: flex;
    -ms-flex-wrap: wrap; flex-wrap: wrap;
    -webkit-box-align: stretch; -ms-flex-align: stretch; align-items: stretch;
}
.catalog__item-wrap {
    display: -webkit-box; display: -ms-flexbox; display: flex;
    float: none;
}
.catalog__item-wrap > .catalog__item {
    width: 100%;
    -webkit-box-flex: 1; -ms-flex: 1 1 auto; flex: 1 1 auto;
    padding-bottom: 18px;
}
.catalog__item-title {
    min-height: 2.8em;
    display: -webkit-box; display: -ms-flexbox; display: flex;
    -webkit-box-align: center; -ms-flex-align: center; align-items: center;
    -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center;
    line-height: 1.3;
    padding: 0 6px;
}
.catalog__img-wrap {
    -webkit-box-flex: 1; -ms-flex: 1 1 auto; flex: 1 1 auto;
    -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center;
    -webkit-box-align: center; -ms-flex-align: center; align-items: center;
    min-height: 130px;
}
.catalog__img-wrap img { max-width: 100%; height: auto; }
.catalog__link { margin-top: auto; }

/* Заглушка для раздела без фотографии: раньше на её месте
   одиннадцать раз подряд печаталось название компании. */
.catalog__img-placeholder {
    width: 88px; height: 88px;
    opacity: .22;
    color: #2067bf;
}

/* ── Таблица товаров ────────────────────────────────────────────────────── */
.subcategory__thead .cell,
.product__item .cell {
    -webkit-box-pack: start; -ms-flex-pack: start; justify-content: flex-start;
    text-align: left;
    word-break: break-word;
    padding: 6px 8px;
    min-width: 0;
}
.subcategory__thead .cell { font-weight: 600; }
.product__item-title { display: inline-block; line-height: 1.35; word-break: break-word; }
/* «По договорённости» рвалось посреди слова */
.product__item .cell_price { white-space: nowrap; }
@media (max-width: 1199px) {
    .product__item .cell_price { white-space: normal; word-break: normal; }
}

.subcategory__tbody .product__item-wrap:nth-child(odd) { background: #fafcfe; }
.subcategory__tbody .product__item-wrap:hover { background: #f1f7fd; }
.product__item-wrap { border-bottom: 1px solid #eef1f4; }
.product__item { -webkit-box-align: center; -ms-flex-align: center; align-items: center; }
.product__count-wrap { -ms-flex-negative: 0; flex-shrink: 0; }

/* ── Описание раздела: перенесено под товар ─────────────────────────────── */
.section-text {
    margin: 40px 0 10px;
    padding-top: 26px;
    border-top: 1px solid #e6ecf2;
    color: #4a4a4a;
    line-height: 1.65;
}
.section-text .block__header { margin-bottom: 14px; }

/* ── Карточка товара ────────────────────────────────────────────────────── */
.product-page__about img { max-width: 100%; height: auto; }
.product-page__table .row { margin-bottom: 2px; }
.product-page__table .first-col { font-weight: 600; }

/* ── Плавающие элементы не должны налезать друг на друга ────────────────── */
.pay-widget { bottom: 96px !important; }
@media (max-width: 767px) {
    .pay-widget { bottom: 150px !important; }
}

/* ── Планшет и телефон ──────────────────────────────────────────────────── */
@media (max-width: 991px) {
    .product__item { padding: 10px 0; }
    .product__item .cell { padding: 4px 8px; }
    .product__item-description { font-weight: 600; margin-right: 6px; color: #7d8794; }
}
@media (max-width: 767px) {
    /* Строка товара на телефоне читается как карточка.
       Ячейки обязаны сжиматься, иначе строка вылезает за экран. */
    .product__item-wrap { padding: 14px 12px; }
    .product__item { -ms-flex-wrap: wrap; flex-wrap: wrap; }
    .product__item > .cell { min-width: 0; max-width: 100%; }
    .product__item > .cell:first-child {
        -ms-flex: 0 0 100%; flex: 0 0 100%;
        max-width: 100%;
        margin-bottom: 8px;
    }
    /* подпись «Наименование:» на телефоне лишняя — рядом сама позиция */
    .product__item > .cell:first-child .product__item-description { display: none; }
    .product__item-title { font-size: 15px; font-weight: 600; }
    .product__item-thumb { float: left; }
    .catalog__item-title { min-height: 0; }
    .block__header { word-break: break-word; font-size: 20px; }
    .subcategory__table { margin-bottom: 50px; }
    .category-wrap { margin-bottom: 40px; }
    .subcategory__thead { display: none; }
}

/* Ничто не должно выталкивать страницу вбок на телефоне */
html, body { overflow-x: hidden; }
.container, .row { max-width: 100%; }
img, svg, table { max-width: 100%; }

/* ── Страница «не найдено» не должна быть пустым экраном ────────────────── */
.page-404 { padding: 30px 0 90px; }
.page-404__title { font-size: 24px; font-weight: 700; margin-bottom: 10px; }
.page-404__links { margin-top: 18px; }
.page-404__links a { display: inline-block; margin: 0 14px 8px 0; color: #2067bf; }

.pagination { clear: both; }
.product-all { margin: 10px 0 0; }
img { max-width: 100%; }

/* ── Миниатюра в списке товаров ──────────────────────────────────────────
   Раньше фотографии были видны только внутри карточки. */
.product__item-thumb {
    display: inline-block;
    width: 56px; height: 56px;
    margin-right: 12px;
    vertical-align: middle;
    -ms-flex-negative: 0; flex-shrink: 0;
    border: 1px solid #e8edf2;
    border-radius: 4px;
    background: #fff;
    overflow: hidden;
    color: #c3d3e6;
}
.product__item-thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.product__item-thumb svg { width: 34px; height: 34px; margin: 10px auto; display: block; }
.product__item .cell:first-child {
    -webkit-box-align: center; -ms-flex-align: center; align-items: center;
}
@media (max-width: 767px) {
    .product__item-thumb { width: 46px; height: 46px; margin-right: 10px; }
    .product__item-thumb svg { width: 26px; height: 26px; margin: 9px auto; }
}

/* ── Телефон: ничто не должно выходить за край экрана ──────────────────── */
@media (max-width: 767px) {
    .cell, [class*="col-xs-"], [class*="col-sm-"], [class*="col-md-"] {
        -webkit-box-sizing: border-box; box-sizing: border-box;
    }
    .product__item .cell { padding: 3px 6px; }
    /* подпись Bootstrap помечает !important, поэтому перебиваем так же */
    .product__item > .cell:first-child .product__item-description { display: none !important; }
    .product__item-description { display: block; font-size: 12px; margin: 0 0 2px; }
    /* плашка cookie шире экрана выталкивала страницу вбок */
    #cookie-notice { left: 10px !important; right: 10px !important; max-width: none !important; }
    .pay-widget { left: auto !important; right: 10px !important; max-width: 70vw; }
}

/* ── «Другие позиции этого раздела» на карточке товара ─────────────────── */
.same-section {
    margin: 34px 0 10px;
    padding-top: 26px;
    border-top: 1px solid #e6ecf2;
}
.same-section__title { font-size: 17px; font-weight: 700; margin-bottom: 14px; color: #2c3137; }
.same-section__list {
    list-style: none; margin: 0; padding: 0;
    display: -ms-flexbox; display: flex; -ms-flex-wrap: wrap; flex-wrap: wrap;
}
.same-section__item {
    -ms-flex: 0 0 50%; flex: 0 0 50%;
    max-width: 50%;
    padding: 7px 16px 7px 0;
    box-sizing: border-box;
    line-height: 1.4;
}
.same-section__item a { color: #2067bf; text-decoration: none; }
.same-section__item a:hover { text-decoration: underline; }
.same-section__stock { color: #8b95a1; font-size: 13px; margin-left: 8px; white-space: nowrap; }
.same-section__all { display: inline-block; margin-top: 12px; font-weight: 600; color: #2067bf; }
@media (max-width: 767px) {
    .same-section__item { -ms-flex: 0 0 100%; flex: 0 0 100%; max-width: 100%; }
    /* фото в списке на телефоне было слишком мелким */
    .product__item-thumb { width: 72px; height: 72px; }
    .product__item-thumb svg { width: 40px; height: 40px; margin: 15px auto; }
    /* хлебные крошки не должны обрезаться */
    .breadcrumbs, .breadcrumb { -ms-flex-wrap: wrap; flex-wrap: wrap; word-break: break-word; }
    .product__item .cell_price { font-size: 13px; }
}

/* плашка cookie перекрывала низ футера */
.block_footer { padding-bottom: 110px; }
@media (max-width: 767px) { .block_footer { padding-bottom: 190px; } }

/* ── Иконки блока «оплата / доставка / качество» ─────────────────────────
   Файлы картинок отсутствовали на диске — рисуем встроенными. */
.property__ico {
    display: block;
    width: 54px; height: 54px;
    margin: 0 auto 12px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    opacity: .85;
}
.property__ico_delivery {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64' fill='none' stroke='%232067bf' stroke-width='3'%3E%3Crect x='3' y='16' width='34' height='26' rx='2'/%3E%3Cpath d='M37 24h11l8 9v9H37z'/%3E%3Ccircle cx='17' cy='47' r='5'/%3E%3Ccircle cx='46' cy='47' r='5'/%3E%3C/svg%3E");
}
.property__ico_payment {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64' fill='none' stroke='%232067bf' stroke-width='3'%3E%3Crect x='5' y='14' width='54' height='36' rx='4'/%3E%3Cpath d='M5 26h54' stroke-width='6'/%3E%3Crect x='12' y='36' width='16' height='4' rx='2' fill='%232067bf' stroke='none'/%3E%3C/svg%3E");
}
.property__ico_quality {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64' fill='none' stroke='%232067bf' stroke-width='3'%3E%3Cpath d='M32 5l24 10v16c0 13-10 24-24 28C18 55 8 44 8 31V15z'/%3E%3Cpath d='M21 31l8 8 15-15'/%3E%3C/svg%3E");
}
.product-page__property { text-align: center; padding: 0 12px 18px; }
.properties__title { font-size: 15px; font-weight: 700; margin: 0 0 6px; }
.properties__text { font-size: 14px; color: #5c6570; line-height: 1.5; }
