/* WooCommerce catalog and product-category pages */

.bep-catalog-intro {
    display: grid;
    align-items: center;
    gap: 28px;
    width: 100%;
    margin: 0 0 28px;
    padding: clamp(22px, 4vw, 38px);
    overflow: hidden;
    border: 1px solid var(--bep-border);
    border-radius: 18px;
    background:
        radial-gradient(circle at right top, rgba(244, 155, 36, .12), transparent 38%),
        linear-gradient(135deg, #f8fbff, #ffffff);
}

/* Only create the second column when an actual category image exists. */
.bep-catalog-intro--has-image {
    grid-template-columns: minmax(0, 1fr) minmax(260px, 38%);
}

.bep-catalog-intro--text-only {
    display: block;
}

.bep-catalog-intro--text-only .bep-catalog-intro__content {
    width: 100%;
    max-width: 920px;
}

.bep-catalog-intro__eyebrow {
    display: inline-flex;
    margin-bottom: 10px;
    padding: 6px 10px;
    border-radius: 999px;
    color: var(--bep-primary);
    background: rgba(11, 79, 156, .08);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.bep-catalog-intro h2 {
    margin: 0 0 8px;
    color: var(--bep-primary-dark);
    font-size: clamp(26px, 4vw, 40px);
    line-height: 1.2;
}

.bep-catalog-intro__count {
    display: block;
    margin-bottom: 12px;
    color: var(--bep-accent);
    font-size: 14px;
    font-weight: 700;
}

.bep-catalog-intro__description,
.bep-catalog-intro__description p {
    margin-bottom: 0;
    color: var(--bep-muted);
    line-height: 1.7;
}

.bep-catalog-intro__image {
    display: flex;
    min-height: 220px;
    align-items: center;
    justify-content: center;
}

.bep-catalog-intro__image img {
    width: 100%;
    max-height: 280px;
    object-fit: contain;
    filter: drop-shadow(0 18px 22px rgba(15, 50, 90, .14));
}

/* Toolbar */
.woocommerce .woocommerce-result-count {
    color: var(--bep-muted);
    font-size: 14px;
}

.woocommerce .woocommerce-ordering select {
    min-height: 42px;
    margin: 0;
    border: 1px solid var(--bep-border);
    border-radius: 8px;
    background-color: #fff;
    box-shadow: none;
}

/* Product grid card */
.products .product-small,
.products .product {
    height: 100%;
}

.products .product-small .col-inner,
.products .product .col-inner,
.products li.product {
    height: 100%;
}

.products .product-small.box,
.products .product .box {
    display: flex;
    height: 100%;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--bep-border);
    border-radius: var(--bep-radius);
    background: #fff;
    box-shadow: 0 8px 25px rgba(15, 50, 90, .06);
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}

.products .product-small.box:hover,
.products .product .box:hover {
    transform: translateY(-4px);
    border-color: rgba(11, 79, 156, .35);
    box-shadow: var(--bep-shadow);
}

.products .box-image {
    background: linear-gradient(145deg, #fbfdff, #f1f6fa);
}

.products .box-image img {
    object-fit: contain;
    padding: 10px;
}

.products .box-text {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 15px 16px 16px;
}

.products .product-title {
    min-height: 46px;
    margin-bottom: 7px;
    color: var(--bep-primary-dark);
    font-size: 16px;
    font-weight: 700;
    line-height: 1.4;
}

.products .product-title a {
    color: inherit;
}

.bep-loop-meta {
    margin: 3px 0 9px;
}

.bep-loop-code {
    display: block;
    margin-bottom: 7px;
    color: var(--bep-muted);
    font-size: 12px;
}

.bep-loop-code strong {
    color: var(--bep-text);
}

.bep-loop-specs {
    display: grid;
    gap: 5px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.bep-loop-specs li {
    display: grid;
    grid-template-columns: minmax(78px, auto) 1fr;
    gap: 7px;
    color: var(--bep-muted);
    font-size: 12px;
    line-height: 1.4;
}

.bep-loop-specs li span {
    white-space: nowrap;
}

.bep-loop-specs li strong {
    overflow: hidden;
    color: var(--bep-text);
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.products .price-wrapper {
    margin-top: auto;
    padding-top: 5px;
}

.products .price {
    color: #dc2626;
    font-size: 16px;
    font-weight: 800;
}

.bep-contact-price {
    color: var(--bep-accent);
    font-size: 15px;
    font-weight: 800;
}

.bep-loop-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 13px;
}

.bep-loop-button {
    display: inline-flex;
    min-height: 39px;
    align-items: center;
    justify-content: center;
    padding: 8px 10px;
    border: 1px solid transparent;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    transition: background .2s ease, border-color .2s ease, color .2s ease;
}

.bep-loop-button--detail {
    border-color: var(--bep-primary);
    color: var(--bep-primary);
    background: #fff;
}

.bep-loop-button--detail:hover {
    color: #fff;
    background: var(--bep-primary);
}

.bep-loop-button--quote {
    color: #fff;
    background: var(--bep-accent);
}

.bep-loop-button--quote:hover {
    color: #fff;
    background: #df8610;
}

/* Sidebar */
.shop-sidebar .widget,
.woocommerce-widget-layered-nav,
.widget_product_categories {
    margin-bottom: 18px;
    padding: 17px;
    border: 1px solid var(--bep-border);
    border-radius: 10px;
    background: #fff;
}

.shop-sidebar .widget-title {
    display: block;
    margin-bottom: 12px;
    color: var(--bep-primary-dark);
    font-size: 15px;
    font-weight: 800;
}

.shop-sidebar ul {
    margin: 0;
}

.shop-sidebar li {
    padding: 7px 0;
    border-bottom: 1px dashed #edf0f3;
}

.shop-sidebar li:last-child {
    border-bottom: 0;
}

@media (max-width: 849px) {
    .bep-catalog-intro--has-image {
        grid-template-columns: 1fr;
    }

    .bep-catalog-intro__image {
        min-height: 150px;
    }
}

@media (max-width: 549px) {
    .bep-catalog-intro {
        gap: 18px;
        padding: 20px;
        border-radius: 12px;
    }

    .bep-catalog-intro__image {
        display: none;
    }

    .bep-loop-actions {
        grid-template-columns: 1fr;
    }

    .products .product-title {
        min-height: auto;
    }

    .bep-loop-specs li {
        grid-template-columns: 72px 1fr;
    }
}
/* =========================================================
   ĐỒNG ĐỀU CARD SẢN PHẨM TRANG SHOP / DANH MỤC
   ========================================================= */

.woocommerce.archive .products {
    align-items: stretch !important;
}

.woocommerce.archive .products > .product-small,
.woocommerce.archive .products > .product {
    display: flex !important;
}

.woocommerce.archive .products .product-small > .col-inner,
.woocommerce.archive .products .product > .col-inner {
    display: flex !important;
    width: 100%;
    height: 100%;
}

.woocommerce.archive .products .product-small .box,
.woocommerce.archive .products .product .box {
    display: flex !important;
    width: 100%;
    height: 100%;
    flex-direction: column;
}

/* Cố định tất cả ảnh cùng một tỷ lệ */
.woocommerce.archive .products .box-image {
    width: 100% !important;
    aspect-ratio: 1 / 1;
    overflow: hidden;
}

.woocommerce.archive .products .box-image > div,
.woocommerce.archive .products .box-image .image-cover,
.woocommerce.archive .products .box-image .image-fade_in_back,
.woocommerce.archive .products .box-image a {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    padding-top: 0 !important;
}

.woocommerce.archive .products .box-image img {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    padding: 12px;
    object-fit: contain !important;
}

/* Phần nội dung kéo đều chiều cao */
.woocommerce.archive .products .box-text {
    display: flex !important;
    flex: 1;
    flex-direction: column;
}

.woocommerce.archive .products .product-title {
    min-height: 44px;
}

/* Giá và nút luôn nằm phía dưới */
.woocommerce.archive .products .price-wrapper {
    margin-top: auto !important;
}

.woocommerce.archive .products .bep-loop-actions {
    margin-top: 12px !important;
}