/* Fatih Sürbisa 0.4 — consistent WoodMart/WooCommerce product-card images. */
/* WoodMart (source theme): keep product image area square and prevent huge portrait products covering product prices. */
.wd-products .wd-product:not(.product-list-item) .wd-product-thumb.product-element-top,
.woocommerce .wd-product:not(.product-list-item) .wd-product-thumb.product-element-top {
    width: 100% !important;
    aspect-ratio: 1 / 1;
    height: auto !important;
    max-height: none !important;
    min-height: 0 !important;
    overflow: hidden !important;
    position: relative;
    background: #fff;
}
.wd-products .wd-product:not(.product-list-item) .wd-product-img-link,
.woocommerce .wd-product:not(.product-list-item) .wd-product-img-link {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    overflow: hidden;
}
.wd-products .wd-product:not(.product-list-item) .wd-product-thumb img,
.woocommerce .wd-product:not(.product-list-item) .wd-product-thumb img {
    max-width: 100% !important;
    max-height: 100% !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    object-position: center center !important;
}
.wd-products .wd-product:not(.product-list-item) .product-element-bottom,
.woocommerce .wd-product:not(.product-list-item) .product-element-bottom {
    position: relative;
    z-index: 1;
}
/* Core WooCommerce (no WoodMart wrapper) / Elementor Products grid */
.woocommerce ul.products li.product:not(.wd-product) img.attachment-woocommerce_thumbnail,
.woocommerce ul.products li.product:not(.wd-product) a.woocommerce-loop-product__link > img,
.elementor-widget-woocommerce-products ul.products li.product:not(.wd-product) img.attachment-woocommerce_thumbnail {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 1 / 1;
    object-fit: contain !important;
    object-position: center !important;
    background: white;
}
/* Cards with native thumbnails should retain the name and price after the image. */
.woocommerce ul.products li.product:not(.wd-product) .woocommerce-loop-product__title,
.woocommerce ul.products li.product:not(.wd-product) .price {
    position: relative;
}
