/* === catalog final cards/layout override START === */

html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

.bb-catalog-top,
.bb-catalog-top__inner,
.bb-catalog-hero,
.content,
.products-grid,
.product-card {
    max-width: 100%;
}

.bb-catalog-hero {
    overflow: hidden;
}

.bb-catalog-hero__actions {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: flex-end !important;
    align-items: center !important;
    gap: 12px !important;
    max-width: 100% !important;
    min-width: 0 !important;
}

.bb-catalog-hero__btn {
    min-width: 160px !important;
    max-width: 100% !important;
    white-space: normal !important;
    text-align: center !important;
    line-height: 1.2 !important;
}

.products-grid {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 18px !important;
    align-items: stretch !important;
}

.product-card {
    position: relative;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    border-radius: 24px !important;
    border: 1px solid #e5e7eb !important;
    background: #ffffff !important;
    box-shadow: 0 12px 30px rgba(15, 23, 42, .07) !important;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 40px rgba(15, 23, 42, .12) !important;
    border-color: #cbd5e1 !important;
}

.product-card.sale-row {
    border-color: #fecaca !important;
    background: linear-gradient(180deg, #ffffff 0%, #fff7ed 100%) !important;
}

.product-card .img-box {
    height: 210px !important;
    padding: 18px !important;
    background: #ffffff !important;
    border-bottom: 1px solid #eef2f7 !important;
}

.product-card .img-box img {
    max-width: 100% !important;
    max-height: 176px !important;
    object-fit: contain !important;
    display: block !important;
}

.product-card .product-body {
    padding: 16px !important;
    gap: 10px !important;
    flex: 1 1 auto !important;
}

.product-card .brand {
    color: #64748b !important;
    font-size: 13px !important;
    font-weight: 900 !important;
    min-height: 18px;
}

.product-card .name {
    color: #0f172a !important;
    font-size: 16px !important;
    line-height: 1.28 !important;
    font-weight: 950 !important;
    text-decoration: none !important;
    min-height: 62px !important;
    overflow-wrap: anywhere !important;
}

.bb-product-specs {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
    margin-top: 4px !important;
}

.bb-product-spec {
    min-width: 0 !important;
    padding: 10px 12px !important;
    border-radius: 14px !important;
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
}

.bb-product-spec span {
    display: block !important;
    color: #64748b !important;
    font-size: 11px !important;
    line-height: 1.1 !important;
    font-weight: 900 !important;
    margin-bottom: 5px !important;
}

.bb-product-spec strong {
    display: block !important;
    color: #0f172a !important;
    font-size: 14px !important;
    line-height: 1.2 !important;
    font-weight: 950 !important;
    overflow-wrap: anywhere !important;
}

/* Мин. заказ делаем органичным, без оранжевой заливки */
.bb-product-spec--min-order {
    background: #f8fafc !important;
    border-color: #e2e8f0 !important;
}

.bb-product-spec--min-order span,
.bb-product-spec--min-order strong {
    color: #0f172a !important;
}

.bb-min-order-note {
    width: max-content !important;
    max-width: 100% !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 7px 10px !important;
    border-radius: 999px !important;
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    color: #64748b !important;
    font-size: 12px !important;
    font-weight: 900 !important;
    line-height: 1.2 !important;
    overflow-wrap: anywhere !important;
}

.sale-badge {
    width: max-content !important;
    max-width: 100% !important;
    padding: 7px 10px !important;
    border-radius: 999px !important;
    background: #dc2626 !important;
    color: #ffffff !important;
    font-size: 12px !important;
    font-weight: 950 !important;
    box-shadow: 0 10px 18px rgba(220, 38, 38, .20) !important;
}

.product-card .price {
    margin-top: auto !important;
    padding-top: 4px !important;
}

.old-price {
    color: #64748b !important;
    text-decoration: line-through !important;
    font-size: 13px !important;
    font-weight: 700 !important;
}

.new-price,
.regular-price {
    color: #0f172a !important;
    font-size: 22px !important;
    line-height: 1.1 !important;
    font-weight: 950 !important;
}

.product-card .actions {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 9px !important;
    margin-top: 12px !important;
}

.product-card .action {
    min-height: 46px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 14px !important;
    padding: 0 12px !important;
    text-align: center !important;
    text-decoration: none !important;
    font-size: 14px !important;
    font-weight: 950 !important;
    line-height: 1.15 !important;
}

.product-card .open {
    background: #0f172a !important;
    color: #ffffff !important;
}

.product-card .quick {
    background: #dc2626 !important;
    color: #ffffff !important;
}

.result-line {
    margin: 18px 0 16px !important;
    color: #475569 !important;
    font-size: 17px !important;
    font-weight: 950 !important;
}

.bb-pagination {
    margin: 26px 0 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.bb-pagination a,
.bb-pagination span {
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 16px;
    border-radius: 14px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    color: #0f172a;
    text-decoration: none;
    font-weight: 900;
    box-shadow: 0 8px 20px rgba(15, 23, 42, .06);
}

.bb-pagination a {
    background: #0f172a;
    color: #ffffff;
}

@media (max-width: 1180px) {
    .products-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 860px) {
    .products-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .bb-catalog-hero__actions {
        width: 100% !important;
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
    }

    .bb-catalog-hero__btn {
        width: 100% !important;
        min-width: 0 !important;
    }
}

@media (max-width: 560px) {
    .products-grid {
        grid-template-columns: 1fr !important;
        gap: 14px !important;
    }

    .product-card .img-box {
        height: 185px !important;
    }

    .product-card .img-box img {
        max-height: 155px !important;
    }

    .product-card .name {
        min-height: auto !important;
        font-size: 15px !important;
    }

    .bb-catalog-hero__actions {
        grid-template-columns: 1fr !important;
    }

    .bb-product-specs {
        grid-template-columns: 1fr 1fr !important;
    }

    .new-price,
    .regular-price {
        font-size: 21px !important;
    }
}

/* === catalog final cards/layout override END === */


/* === catalog final polish START === */

.result-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 14px 0 18px !important;
    padding: 12px 16px;
    border-radius: 16px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    color: #334155 !important;
    font-weight: 900 !important;
    box-shadow: 0 8px 22px rgba(15,23,42,.05);
}

.products-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 18px !important;
}

.product-card {
    border-radius: 24px !important;
    overflow: hidden !important;
    min-width: 0 !important;
}

.product-card .img-box {
    height: 190px !important;
    padding: 16px !important;
    background: linear-gradient(180deg, #ffffff, #f8fafc) !important;
}

.product-card .img-box img {
    max-height: 162px !important;
}

.product-card .name {
    min-height: 62px !important;
    font-size: 15px !important;
    line-height: 1.25 !important;
    overflow-wrap: anywhere !important;
}

.bb-product-specs {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
}

.bb-product-spec {
    min-width: 0 !important;
    border-radius: 14px !important;
    background: #f8fafc !important;
    border: 1px solid #e5e7eb !important;
    padding: 9px 10px !important;
}

.bb-product-spec span {
    color: #64748b !important;
    font-size: 10px !important;
    font-weight: 900 !important;
    text-transform: uppercase;
    letter-spacing: .03em;
}

.bb-product-spec strong {
    display: block;
    color: #0f172a !important;
    font-size: 13px !important;
    line-height: 1.25 !important;
    overflow-wrap: anywhere !important;
}

.bb-product-spec--min-order {
    background: #f8fafc !important;
    border-color: #e5e7eb !important;
    box-shadow: inset 3px 0 0 #dc2626 !important;
}

.bb-product-spec--min-order span {
    color: #64748b !important;
}

.bb-product-spec--min-order strong {
    color: #0f172a !important;
}

.product-card .bb-min-order-note {
    margin-top: 2px !important;
    padding: 8px 10px !important;
    border-radius: 12px !important;
    background: #f1f5f9 !important;
    color: #475569 !important;
    font-size: 12px !important;
    font-weight: 800 !important;
    line-height: 1.25 !important;
}

.sale-badge {
    width: fit-content !important;
    max-width: 100% !important;
    white-space: normal !important;
    line-height: 1.2 !important;
}

.product-card .price {
    margin-top: auto !important;
    padding-top: 8px !important;
}

.product-card .old-price {
    font-size: 13px !important;
}

.product-card .new-price,
.product-card .regular-price {
    font-size: 22px !important;
    line-height: 1.1 !important;
}

.product-card .actions {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
    gap: 8px !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
}

.product-card .action {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    line-height: 1.15 !important;
    min-height: 44px !important;
    padding: 10px 9px !important;
}

.bb-pagination {
    margin: 24px 0 4px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.bb-page-link,
.bb-page-current {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 14px;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 900;
    text-decoration: none;
    box-sizing: border-box;
}

.bb-page-link {
    background: #111827;
    color: #fff;
}

.bb-page-current {
    background: #fff;
    color: #334155;
    border: 1px solid #e5e7eb;
}

@media (max-width: 1180px) {
    .products-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 820px) {
    .products-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 12px !important;
    }

    .product-card .actions {
        grid-template-columns: 1fr !important;
    }

    .product-card .img-box {
        height: 160px !important;
    }

    .product-card .img-box img {
        max-height: 136px !important;
    }
}

@media (max-width: 460px) {
    .products-grid {
        grid-template-columns: 1fr !important;
    }

    .result-line {
        display: block;
        font-size: 14px;
    }

    .bb-pagination {
        display: grid;
        grid-template-columns: 1fr;
    }

    .bb-page-link,
    .bb-page-current {
        width: 100%;
    }
}

/* === catalog final polish END === */
