/**
 * WoodMart / WooCommerce: square gallery cells with white padding (letterboxing).
 *
 * Copy into Theme Options → Custom CSS (or child theme) if you disable the plugin stylesheet via:
 *   add_filter( 'wave_woo_enqueue_product_gallery_square_css', '__return_false' );
 * (Disables main slide + thumbnail rules below.)
 *
 * Uses object-fit: contain — no stretch/crop. Theme zoom/lightbox receive the same img element.
 */

.woocommerce-product-gallery figure.woocommerce-product-gallery__image:not(.woocommerce-product-gallery__image--placeholder) {
	aspect-ratio: 1 / 1;
	background-color: #fff;
	margin: 0;
}

/* After base rule: WoodMart video slides must not be forced square (higher specificity). */
.woocommerce-product-gallery .wd-carousel-item.wd-with-video figure.woocommerce-product-gallery__image {
	aspect-ratio: auto;
	background-color: transparent;
}

.woocommerce-product-gallery figure.woocommerce-product-gallery__image:not(.woocommerce-product-gallery__image--placeholder) > a {
	display: block;
	width: 100%;
	height: 100%;
	line-height: 0;
}

.woocommerce-product-gallery figure.woocommerce-product-gallery__image img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	object-position: center;
	max-height: none;
	border-radius: inherit;
}

/* Thumbnails: same white square letterboxing (WoodMart .wd-gallery-thumb, Woo .flex-control-thumbs, legacy .product-images). */
.woocommerce-product-gallery .wd-gallery-thumb .wd-carousel-item {
	position: relative;
	overflow: hidden;
	aspect-ratio: 1 / 1;
	background-color: #fff;
	height: auto;
	align-self: center;
	border-radius: var(--wd-brd-radius);
}

.woocommerce-product-gallery.thumbs-position-left .wd-gallery-thumb .wd-carousel-item {
	height: auto;
}

.woocommerce-product-gallery .wd-gallery-thumb .wd-carousel-item img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
	object-position: center;
	margin: 0;
	max-height: none;
	border-radius: inherit;
	vertical-align: top;
}

.woocommerce-product-gallery :is(ol, ul).flex-control-thumbs li {
	position: relative;
	overflow: hidden;
	aspect-ratio: 1 / 1;
	background-color: #fff;
	border-radius: var(--wd-brd-radius, 0);
}

.woocommerce-product-gallery :is(ol, ul).flex-control-thumbs li img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	object-position: center;
	max-height: none;
	border-radius: inherit;
	vertical-align: top;
}

.woocommerce-product-gallery .product-images .thumbnails li {
	position: relative;
	overflow: hidden;
	aspect-ratio: 1 / 1;
	background-color: #fff;
	border-radius: var(--wd-brd-radius, 0);
}

.woocommerce-product-gallery .product-images .thumbnails li > a {
	display: block;
	height: 100%;
	line-height: 0;
}

.woocommerce-product-gallery .product-images .thumbnails img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	object-position: center;
	max-height: none;
	border-radius: inherit;
	vertical-align: top;
}
