/*
Theme Name: Metal Machinery
Theme URI: https://github.com/eclipse-digital-es/moonbase
Description: A custom WordPress theme for Metal Machinery with ACF integration.
Version: 1.1.2
Author: Eclipse Digital
Author URI: https://eclipse-digital.com/
Text Domain: metal-machinery
*/

/*
 * PDP main image fit.
 *
 * The WebP plugin rewrites the template's <img id="main-product-image"> into a
 * <picture id="main-product-image">…<img></picture>, moving the utility classes
 * onto the <picture> (inert — object-fit only applies to replaced elements) and
 * leaving the rendered inner <img> classless at object-fit:fill. A 1:1
 * placeholder inside the 4:3, overflow-hidden wrapper then gets cropped top and
 * bottom. Target the inner <img> directly so the fit survives the rewrite.
 */
#main-product-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/*
 * Manufacturer logo cards (Manufacturers page template). Target the inner <img>
 * so sizing survives the WebP plugin's <picture> rewrite (which strips classes
 * off the rendered <img>). Logos fit within the card without distortion.
 */
.mfr-logo img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

/*
 * Product card thumbnails (archive + search listings). The WebP plugin's
 * <picture> rewrite drops the w-full/h-full classes off the rendered <img>,
 * so it lands at its natural size (e.g. 1082px) and overflows the card on
 * mobile. Force the picture/img to fill the square box.
 */
.mm-card-thumb picture,
.mm-card-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
