/* ========================================
   MOBILE GRID FIX (STRICT FLUID)
   ======================================== */

@media (max-width: 991px) {

    /* 1. Ensure the container has enough width */
    .container-fluid.bg-light .row.g-4,
    .container-fluid.bg-white .row.g-4 {
        display: flex !important;
        flex-wrap: wrap !important;
        margin-left: -8px !important;
        /* Tighter than default but not 0 */
        margin-right: -8px !important;
        justify-content: flex-start !important;
        /* Start from left */
    }

    /* 2. Force 50% width on items */
    .container-fluid.bg-light .row.g-4>[class*="col-"],
    .container-fluid.bg-white .row.g-4>[class*="col-"],
    .container-fluid.bg-light .row.g-4>.col-6,
    .container-fluid.bg-white .row.g-4>.col-6 {
        flex: 0 0 50% !important;
        width: 50% !important;
        max-width: 50% !important;
        padding-left: 8px !important;
        padding-right: 8px !important;
        margin-top: 15px !important;
        /* Space between rows */
        display: block !important;
    }

    /* 3. Handle card sizing inside the col-50 */
    .explore-product-item {
        padding: 15px 10px !important;
        /* Adjust padding to fit */
        height: 100% !important;
    }

    .explore-product-img {
        margin-bottom: 15px !important;
    }

    .explore-product-img img {
        max-width: 100% !important;
        height: auto !important;
        max-height: 100px !important;
        /* Ensure images don't blow up */
        object-fit: contain !important;
    }
}

/* Small Mobile Screens (Below 576px) */
@media (max-width: 576px) {

    /* Maintain 2-column layout */
    .container-fluid.bg-light .row.g-4,
    .container-fluid.bg-white .row.g-4 {
        display: flex !important;
        flex-wrap: wrap !important;
        margin-left: -6px !important;
        margin-right: -6px !important;
        justify-content: flex-start !important;
    }

    /* Force 50% width */
    .container-fluid.bg-light .row.g-4>[class*="col-"],
    .container-fluid.bg-white .row.g-4>[class*="col-"],
    .container-fluid.bg-light .row.g-4>.col-6,
    .container-fluid.bg-white .row.g-4>.col-6 {
        flex: 0 0 50% !important;
        width: 50% !important;
        max-width: 50% !important;
        padding-left: 6px !important;
        padding-right: 6px !important;
        margin-top: 12px !important;
    }

    /* Adjust card sizing for smaller screens */
    .explore-product-item {
        padding: 12px 8px !important;
    }

    .explore-product-img {
        margin-bottom: 12px !important;
    }

    .explore-product-img img {
        max-height: 90px !important;
    }

    .explore-product-item h5 {
        font-size: 11px !important;
    }
}

/* Very Small Screens */
@media (max-width: 380px) {
    .explore-product-item {
        padding: 10px 5px !important;
    }

    .explore-product-img img {
        max-height: 80px !important;
    }

    h5 {
        font-size: 12px !important;
    }
}