/* Storefront layout refinements added in ESP32 Store Child v1.4.0. */

/* Shop: remove the result-count row for both block and classic templates. */
body.woocommerce-shop .wc-block-product-results-count,
body.woocommerce-shop .woocommerce-result-count,
body.post-type-archive-product .wc-block-product-results-count,
body.post-type-archive-product .woocommerce-result-count {
	display: none !important;
}

/* Shop: keep compact, evenly spaced product cards. */
body.woocommerce-shop .wc-block-product-template > .wc-block-product,
body.post-type-archive-product .wc-block-product-template > .wc-block-product,
body.woocommerce-shop ul.products > li.product,
body.post-type-archive-product ul.products > li.product {
	box-sizing: border-box;
	min-width: 0;
	padding: 12px;
	background: #fff;
	border: 1px solid var(--esp-line);
	border-radius: 6px;
}

body.woocommerce-shop .wc-block-components-product-image,
body.post-type-archive-product .wc-block-components-product-image,
body.woocommerce-shop ul.products > li.product .woocommerce-loop-product__link,
body.post-type-archive-product ul.products > li.product .woocommerce-loop-product__link {
	display: block;
	margin-bottom: 10px !important;
}

body.woocommerce-shop .wc-block-components-product-image img,
body.post-type-archive-product .wc-block-components-product-image img,
body.woocommerce-shop ul.products > li.product img,
body.post-type-archive-product ul.products > li.product img {
	display: block;
	width: 100%;
	height: auto !important;
	margin: 0 !important;
	aspect-ratio: 1 / 1 !important;
	object-fit: contain !important;
	object-position: center center !important;
}

body.woocommerce-shop .wc-block-components-product-image.image-zoom-hover:hover img,
body.post-type-archive-product .wc-block-components-product-image.image-zoom-hover:hover img {
	transform: none;
}

/* Product search: keep the search band compact when its title row is empty. */
body.search.post-type-archive-product .wp-block-cover.alignfull {
	min-height: 0 !important;
	padding: 18px 22px !important;
}

body.search.post-type-archive-product .wp-block-cover.alignfull .wp-block-cover__inner-container > .wp-block-group.alignwide:first-child {
	display: none;
}

body.search.post-type-archive-product .wp-block-cover.alignfull .wp-block-search {
	margin: 0 auto;
}

/* Product search uses featured-image Cover blocks instead of Product Image blocks. */
body.search.post-type-archive-product .wp-block-product-template > .wc-block-product > .wp-block-cover.image-zoom-hover {
	box-sizing: border-box;
	min-height: 0 !important;
	margin: 0 0 10px !important;
	aspect-ratio: 1 / 1 !important;
	background: #fff;
}

body.search.post-type-archive-product .wp-block-product-template > .wc-block-product > .wp-block-cover.image-zoom-hover > .wp-block-cover__image-background {
	width: 100%;
	height: 100%;
	object-fit: contain !important;
	object-position: center center !important;
	transform: none !important;
}

body.woocommerce-shop .wc-block-components-product-title,
body.post-type-archive-product .wc-block-components-product-title,
body.woocommerce-shop ul.products > li.product .woocommerce-loop-product__title,
body.post-type-archive-product ul.products > li.product .woocommerce-loop-product__title {
	font-size: 13px;
	line-height: 1.4;
}

@media (min-width: 901px) {
	body.woocommerce-shop .wc-block-product-template,
	body.post-type-archive-product .wc-block-product-template,
	body.woocommerce-shop ul.products,
	body.post-type-archive-product ul.products {
		display: grid !important;
		grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
		gap: 18px 14px !important;
	}

	body.woocommerce-shop .wc-block-product-template > .wc-block-product,
	body.post-type-archive-product .wc-block-product-template > .wc-block-product,
	body.woocommerce-shop ul.products > li.product,
	body.post-type-archive-product ul.products > li.product {
		float: none !important;
		width: auto !important;
		margin: 0 !important;
	}
}

@media (max-width: 700px) {
	body.search.post-type-archive-product .wp-block-cover.alignfull {
		padding: 14px !important;
	}
}

/* Homepage: every New Arrivals/Most Popularity card gets a complete border. */
.esp-store-front .esp-product-grid {
	column-gap: 14px;
	row-gap: 18px;
	border: 0;
}

.esp-store-front .esp-product-card {
	box-sizing: border-box;
	overflow: hidden;
	border: 1px solid #d9dee5;
	border-radius: 6px;
}

/* Contact Us: the remaining R&D office occupies a clean single column. */
.esp-contact-page .esp-contact-locations {
	grid-template-columns: minmax(0, 1fr);
	max-width: 760px;
}
