/* Keep product media in its own layout row across classic and block cards. */
.product-card {
	display: flex;
	flex-direction: column;
	min-width: 0;
	height: 100%;
	overflow: hidden;
}

.product-card .product-image {
	position: relative;
	inset: auto;
	z-index: 0;
	display: grid;
	place-items: center;
	flex: 0 0 245px;
	width: 100%;
	height: 245px;
	min-height: 0;
	overflow: hidden;
	transform: none;
}

.product-card .product-image img {
	position: static;
	inset: auto;
	display: block;
	width: 100%;
	height: 100%;
	max-height: 100%;
	object-fit: contain;
	transform: none;
}

.product-card .product-info {
	position: relative;
	z-index: 1;
	flex: 1 1 auto;
	width: 100%;
	min-height: 0;
	background: #fff;
}

.woocommerce ul.products li.product {
	display: flex;
	flex-direction: column;
	min-width: 0;
	height: 100%;
	overflow: hidden;
}

.woocommerce ul.products li.product .woocommerce-loop-product__link {
	position: relative;
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.woocommerce ul.products li.product .woocommerce-loop-product__link > img {
	position: static;
	inset: auto;
	flex: 0 0 auto;
	width: 100%;
	height: auto;
	aspect-ratio: 1 / 1;
	margin: 0 0 14px;
	object-fit: contain;
	transform: none;
}

.wc-block-product,
.wc-block-grid__product {
	position: relative;
	display: flex !important;
	flex-direction: column;
	min-width: 0;
	height: 100%;
	overflow: hidden;
}

.wc-block-components-product-image,
.wc-block-grid__product-image,
.wp-block-woocommerce-product-image {
	position: relative !important;
	inset: auto !important;
	z-index: 0;
	display: grid !important;
	place-items: center;
	flex: 0 0 auto;
	width: 100% !important;
	height: auto !important;
	min-height: 0;
	aspect-ratio: 1 / 1;
	overflow: hidden;
	transform: none !important;
}

.wc-block-components-product-image img,
.wc-block-grid__product-image img,
.wp-block-woocommerce-product-image img {
	position: static !important;
	inset: auto !important;
	display: block;
	width: 100% !important;
	height: 100% !important;
	max-height: 100% !important;
	object-fit: contain !important;
	transform: none !important;
}

.wc-block-components-product-name,
.wc-block-grid__product-title,
.wc-block-product .wp-block-post-title,
.wc-block-product .wp-block-woocommerce-product-price,
.wc-block-product .wc-block-components-product-button {
	position: relative;
	inset: auto;
	z-index: 1;
	width: 100%;
	background: #fff;
}

@media (max-width: 768px) {
	.product-card .product-image {
		flex-basis: auto;
		height: auto;
		aspect-ratio: 1 / 1;
		padding: 14px;
	}

	.woocommerce ul.products li.product .woocommerce-loop-product__link > img,
	.wc-block-components-product-image,
	.wc-block-grid__product-image,
	.wp-block-woocommerce-product-image {
		max-height: 300px;
	}
}

@media (max-width: 390px) {
	.product-card .product-image,
	.woocommerce ul.products li.product .woocommerce-loop-product__link > img,
	.wc-block-components-product-image,
	.wc-block-grid__product-image,
	.wp-block-woocommerce-product-image {
		max-height: 260px;
	}
}

/* Home featured products: show the complete package without cropping. */
.products-section .product-card .product-image,
.lubricruz-related-products .product-card .product-image {
	flex: 0 0 auto;
	width: 100%;
	height: auto;
	max-height: none;
	aspect-ratio: 1 / 1;
	padding: 16px;
	overflow: hidden;
}

.products-section .product-card .product-image img,
.lubricruz-related-products .product-card .product-image img {
	position: static;
	width: auto;
	height: auto;
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
	object-position: center;
}

@media (max-width: 560px) {
	.products-section .product-card .product-image,
	.lubricruz-related-products .product-card .product-image {
		padding: 20px;
	}
}
