/* ========================================================================== 
   PRODUCT IMAGES — GLOBAL 1:1 RULE
   Product photography stays square and is never cropped.
   Environment / project / editorial photography is intentionally excluded.
   ========================================================================== */

/* Product cards / product-based carousels. */
.malabar-category-carousel:not(.malabar-alg-bottom-gallery) .malabar-category-carousel__image-wrap,
.malabar-featured-pieces__image,
.malabar-products-catalog__media,
.malabar-editorial-product-card__media,
.malabar-product-related__media {
    aspect-ratio: 1 / 1 !important;
    overflow: hidden;
}

/* Never crop product photography. */
.malabar-category-carousel:not(.malabar-alg-bottom-gallery) .malabar-category-carousel__image,
.malabar-featured-pieces__img,
.malabar-products-catalog__image,
.malabar-editorial-product-card__image,
.malabar-product-related__image,
.malabar-product-single__gallery--product .malabar-product-single__gallery-image {
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: contain !important;
    object-position: center;
}

/* Product gallery on the single product page only. Environment photos keep
   their own original/editorial ratio. */
.malabar-product-single__gallery--product .malabar-product-single__gallery-item {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--malabar-cream, #FFFDE0);
}

/* WordPress / WooCommerce fallbacks, useful for search results or any
   WooCommerce-generated product card that bypasses the custom catalogue. */
.woocommerce ul.products li.product a img,
.wc-block-grid__product-image img,
.wp-block-woocommerce-product-image img,
img.attachment-woocommerce_thumbnail,
img.woocommerce-placeholder {
    aspect-ratio: 1 / 1;
    object-fit: contain !important;
    object-position: center;
}

.product-thumbnail {
    aspect-ratio: 1 / 1;
    background-size: contain !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
}
