/**
 * Shop view — featured product grid (com_store / shop.php)
 *
 * .shop-featured-products-section replaces .masonry-loader-showing: Porto’s theme-shop.css sets
 * .masonry-loader-showing .products { opacity: 0 } until the masonry plugin removes that class.
 * Without data-plugin-masonry, the grid would stay invisible.
 *
 * Layout:
 * - < 768px (below Bootstrap md): 2 columns (use .col-6 on items)
 * - >= 768px: 3 columns (use .col-md-4 on items)
 *
 * All rules are scoped under .shop-featured-grid so other .products / masonry
 * layouts on the site are unaffected.
 */

.shop-featured-grid.row > [class*="col-"] {
    display: flex;
    flex-direction: column;
}

.shop-featured-grid .shop-product-card-flex {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
    width: 100%;
}

/* Pin primary CTA to bottom when titles/prices differ in height */
.shop-featured-grid .shop-product-card-flex > .addtocart-btn-wrapper {
    margin-top: auto;
    padding-top: 0.35rem;
}

/* Consistent image frame per row */
.shop-featured-grid .product-thumb-info-image {
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background-color: #f4f4f4;
}

.shop-featured-grid .product-thumb-info-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Subtle hover — desktop / tablet only */
@media (min-width: 768px) {
    .shop-featured-grid .shop-product-card-flex {
        transition: box-shadow 0.28s ease, transform 0.28s ease;
        border-radius: 0.35rem;
    }

    .shop-featured-grid .shop-product-card-flex:hover {
        box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
        transform: translateY(-3px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .shop-featured-grid .shop-product-card-flex {
        transition: none;
    }

    .shop-featured-grid .shop-product-card-flex:hover {
        transform: none;
    }
}

/*
 * Mobile only: one-line “ADD TO CART”.
 * Theme + Bootstrap use !important on .text-3 (font-size) and .px-5 (padding), so earlier rules here
 * were ignored. Markup uses px-2 / py-2 on xs and px-md-5 / py-md-3 from md up; this block still forces
 * nowrap and a slightly smaller type where .text-3 would otherwise win.
 */
@media (max-width: 767.98px) {
    .shop-featured-grid .shop-product-card-flex > .addtocart-btn-wrapper a.shop-primary-addtocart.btn.btn-primary {
        white-space: nowrap !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        font-size: 0.75rem !important;
        line-height: 1.25 !important;
        letter-spacing: 0.02em !important;
    }
}
