/**
 * Green Code – Global Fixes
 *
 * Fixes inconsistent product image heights in "Deals of the Day" carousel.
 *
 * ROOT CAUSE (confirmed by live HTML inspection):
 *  The Deals carousel uses class structure:
 *    .deals-item .thumb-wrapper > .deals-thumb > img
 *  Images are uploaded at varying sizes:
 *    600×600, 324×270, 241×270, 340×270, etc.
 *  product-deals.css sets NO fixed height on .thumb-wrapper or .deals-thumb,
 *  so each card's image zone expands to its image's native height.
 *
 * NOTE: The widget does NOT use .electron-loop-product.type-3 —
 * that selector was incorrect. The correct selectors are below.
 */

/* ══════════════════════════════════════════════════════
   DEALS CAROUSEL – Consistent image container height
   ══════════════════════════════════════════════════════ */

/* Fix the thumb container to a consistent height */
.deals-item .thumb-wrapper {
    height: 200px !important;
    min-height: 200px !important;
    max-height: 200px !important;
    overflow: hidden;
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 12px !important;
    box-sizing: border-box !important;
}

/* The inner deals-thumb link wrapper */
.deals-item .deals-thumb {
    width: 100%;
    height: 100%;
    display: flex !important;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Force image to scale naturally within limits */
.deals-item .thumb-wrapper img,
.deals-item .deals-thumb img {
    width: 100% !important;
    height: auto !important;
    max-width: 90% !important;
    max-height: 140px !important;
    object-fit: contain !important;
    object-position: center center !important;
    display: block !important;
    margin: 0 auto !important;
}

/* ── Responsive ── */
@media (max-width: 1024px) {
    .deals-item .thumb-wrapper {
        height: 170px !important;
        min-height: 170px !important;
        max-height: 170px !important;
    }
    .deals-item .thumb-wrapper img,
    .deals-item .deals-thumb img {
        max-height: 120px !important;
    }
}

@media (max-width: 600px) {
    .deals-item .thumb-wrapper {
        height: 140px !important;
        min-height: 140px !important;
        max-height: 140px !important;
    }
    .deals-item .thumb-wrapper img,
    .deals-item .deals-thumb img {
        max-height: 100px !important;
    }
}

/* ══════════════════════════════════════════════════════
   PRODUCT BOX TYPE-3 – Consistent image container height
   (for shop/category pages using product box type 3)
   ══════════════════════════════════════════════════════ */

.electron-loop-product.type-3 .thumb-wrapper {
    height: 200px !important;
    min-height: 200px !important;
    max-height: 200px !important;
    overflow: hidden;
    padding: 12px !important;
    box-sizing: border-box !important;
}

.electron-loop-product.type-3 .thumb-wrapper img {
    width: 100% !important;
    height: auto !important;
    max-width: 90% !important;
    max-height: 140px !important;
    object-fit: contain !important;
    object-position: center center !important;
    display: block !important;
    margin: 0 auto !important;
}

.electron-loop-product.type-3 .thumb-wrapper .product-link {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 16px;
    box-sizing: border-box;
}

@media (max-width: 1024px) {
    .electron-loop-product.type-3 .thumb-wrapper {
        height: 170px !important;
        min-height: 170px !important;
        max-height: 170px !important;
    }
}

@media (max-width: 600px) {
    .electron-loop-product.type-3 .thumb-wrapper {
        height: 140px !important;
        min-height: 140px !important;
        max-height: 140px !important;
    }
}
