/* =====================================================================
   Explore Products (explore-3.php) – Responsive layout patch
   Moves the promo banners from under the filter sidebar into a proper
   right-hand column that fills the empty space next to the product
   grid on desktop, and collapses cleanly below the "lg" breakpoint.
   Load AFTER style.css and responsive.css.
   ===================================================================== */

img {
    max-width: 100%;
    height: auto;
}

/* ---------- Product card sizing on desktop ---------- */
/* The grid markup uses .col-lg-4 (3 cards/row) from 992px up, which
   made cards too small/cramped once the products column was
   narrowed to make room for the ads sidebar. Re-balance: 2 cards per
   row on typical laptop/desktop widths, and only go back to 3 per
   row on very wide monitors where there is enough room per card. */
@media (min-width: 992px) and (max-width: 1399.98px) {
    #explore-products-grid .col-lg-4.col-md-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }
}
@media (min-width: 1400px) {
    #explore-products-grid .col-lg-4.col-md-6 {
        flex: 0 0 33.3333%;
        max-width: 33.3333%;
    }
}

/* ---------- Ad banners ---------- */
/* Root fix: these were hard-coded to height:420px + object-fit:fill,
   which stretches/distorts the image on every screen size. */
.banner-ad-img {
    display: block;
    width: 100%;
    object-fit: cover;
    border-radius: 16px;
}

/* On desktop the ads column should always match the actual rendered
   height of the product grid next to it (not a guessed vh value):
   the row already stretches columns to equal height by default, so
   we just make the ads column fill that height and split it evenly
   between the two banners. */
@media (min-width: 992px) {
    .tf-section-2 > .container > .row {
        align-items: stretch;
    }
    .explore-ads-col {
        display: flex;
    }
    .explore-ads-sticky {
        display: flex;
        flex-direction: column;
        width: 100%;
        gap: 16px;
        position: sticky;
        top: 110px;
    }
    .explore-ads-sticky .mb-20 {
        flex: 1 1 0;
        margin-bottom: 0;
        min-height: 220px;
    }
    .explore-ads-sticky .mb-20 a {
        display: block;
        width: 100%;
        /* height: 100%; */
    }
    .explore-ads-sticky .explore-ad-img {
        height: 100%;
    }
}

/* ---------- Column stacking / order ---------- */
/* Below "lg" (991.98px): filters, then products, then ads — each
   full width, in a clean single column, matching the DOM order. */
@media (max-width: 991.98px) {
    .explore-filter-col,
    .explore-ads-col {
        width: 100%;
        max-width: 100%;
        flex: 0 0 100%;
    }
    .explore-ads-sticky {
        position: static;
        display: flex;
        gap: 16px;
        margin-top: 10px;
    }
    .explore-ads-sticky .mb-20 {
        flex: 1 1 0;
        margin-bottom: 0;
    }
}

/* On phones the two ad banners read better stacked than side by side */
@media (max-width: 575.98px) {
    .explore-ads-sticky {
        flex-direction: column;
    }
}

/* ---------- Filter sidebar spacing on tablet/mobile ---------- */
@media (max-width: 991.98px) {
    .explore-filter-col {
        margin-bottom: 24px;
    }
}
