/*
 * Featured products repair v1.0.2.
 * The action buttons now live inside box-text; do not flex the product column.
 */

.bep-featured-products {
    width: 100%;
    margin-top: 22px;
}

.bep-featured-products .products {
    align-items: stretch;
    margin-bottom: 0;
}

/* Critical reset: product column must not be a horizontal flex container. */
.bep-featured-products .product-small {
    display: block !important;
    margin-bottom: 24px;
}

.bep-featured-products .product-small > .col-inner {
    display: block !important;
    width: 100%;
    height: 100%;
}

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

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

.bep-featured-products .box-image {
    display: block !important;
    width: 100% !important;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: linear-gradient(145deg, #fbfdff, #f1f6fa);
}

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

.bep-featured-products .box-image a {
    display: block;
    width: 100%;
    height: 100%;
}

.bep-featured-products .box-image img {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    max-height: none !important;
    padding: 12px;
    object-fit: contain !important;

}

.bep-featured-products .box-text {
    display: flex !important;
    flex: 1;
    flex-direction: column;
    padding: 15px 16px 16px !important;
    text-align: left !important;
}

.bep-featured-products .category {
    margin-bottom: 4px;
    color: var(--bep-muted);
    font-size: 11px;
    line-height: 1.2;
    text-transform: uppercase;
}

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

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

.bep-featured-products .bep-loop-meta {
    display: block;
    margin: 4px 0 10px;
}

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

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

.bep-featured-products ul.bep-loop-specs {
    display: grid !important;
    gap: 6px;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}

.bep-featured-products ul.bep-loop-specs > li {
    display: grid !important;
    grid-template-columns: minmax(80px, auto) minmax(0, 1fr);
    gap: 7px;
    margin: 0 !important;
    padding: 0 !important;
    color: var(--bep-muted);
    font-size: 12px;
    line-height: 1.4;
    list-style: none !important;
}

.bep-featured-products ul.bep-loop-specs > li::before,
.bep-featured-products ul.bep-loop-specs > li::marker {
    display: none !important;
    content: "" !important;
}

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

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

.bep-featured-products .price,
.bep-featured-products .price-wrapper .amount {
    color: #dc2626;
    font-size: 16px;
    font-weight: 800;
}

/* Buttons are now inside box-text. */
.bep-featured-products .bep-loop-actions {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px !important;
    width: 100%;
    margin-top: 14px !important;
}

.bep-featured-products .bep-loop-actions > .bep-loop-button {
    display: flex !important;
    width: 100% !important;
    min-width: 0;
    min-height: 42px;
    margin: 0 !important;
    padding: 8px !important;
    align-items: center;
    justify-content: center;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
}

@media (max-width: 549px) {
    .bep-featured-products .box-text {
        padding: 12px !important;
    }

    .bep-featured-products .product-title {
        min-height: auto;
        font-size: 14px;
    }

    .bep-featured-products ul.bep-loop-specs > li {
        grid-template-columns: 72px minmax(0, 1fr);
        font-size: 11px;
    }

    .bep-featured-products .bep-loop-actions {
        grid-template-columns: 1fr;
    }
}
/* Thu gọn khoảng trắng trong card */
.bep-featured-products .bep-loop-meta {
    flex: 0 0 auto !important;
    margin-top: 8px !important;
}

.bep-featured-products .price-wrapper {
    margin-top: 12px !important;
    padding-top: 0 !important;
}

.bep-featured-products .bep-loop-actions {
    margin-top: auto !important;
    padding-top: 16px;
}

/* Làm rõ hai nút thao tác */
.bep-featured-products .bep-loop-button--detail {
    border: 1px solid #0b4f9c !important;
    color: #0b4f9c !important;
    background: #fff !important;
}

.bep-featured-products .bep-loop-button--detail:hover {
    color: #fff !important;
    background: #0b4f9c !important;
}

.bep-featured-products .bep-loop-button--quote {
    border: 1px solid #f49b24 !important;
    color: #fff !important;
    background: #f49b24 !important;
}

.bep-featured-products .bep-loop-button--quote:hover {
    background: #dc8212 !important;
}
/* Khôi phục khung ảnh chính của Flatsome */
.bep-featured-products .box-image .image-fade_in_back {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.bep-featured-products .box-image .image-fade_in_back > a {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
}

/* Luôn hiển thị ảnh đại diện sản phẩm */
.bep-featured-products .box-image .image-fade_in_back img:first-child {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    padding: 12px;
    object-fit: contain !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Chỉ ẩn ảnh album dùng làm hiệu ứng hover */
.bep-featured-products .box-image img.show-on-hover,
.bep-featured-products .box-image img.back-image {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
}