/* Full-width Shop layout added in ESP32 Store Child v1.5.0. */

/* Remove the Shop / Home / Shop heading area, including saved template copies. */
body.woocommerce-shop .esp-hidden-woocommerce-page-heading,
body.woocommerce-shop .esp-v150-shop-heading {
	display: none !important;
}

/* Remove the parent theme's reserved filter column. */
body.woocommerce-shop .esp-v150-shop-sidebar-column {
	display: none !important;
}

/* Remove the parent full-width wrapper padding before applying the shared shell. */
body.woocommerce-shop .esp-v150-shop-catalog-shell {
	box-sizing: border-box;
	width: 100% !important;
	max-width: none !important;
	padding-right: 0 !important;
	padding-left: 0 !important;
}

/* Match the Shop catalog edges to the 1180px header shell. */
body.woocommerce-shop .esp-v150-shop-catalog-columns {
	box-sizing: border-box;
	display: block !important;
	width: min(calc(100% - 44px), var(--esp-shell, 1180px)) !important;
	max-width: var(--esp-shell, 1180px) !important;
	margin-right: auto !important;
	margin-bottom: 0 !important;
	margin-left: auto !important;
}

body.woocommerce-shop .esp-v150-shop-products-column {
	box-sizing: border-box;
	width: 100% !important;
	max-width: none !important;
	margin: 0 !important;
	flex-basis: 100% !important;
}

body.woocommerce-shop .esp-v150-shop-products-column > *,
body.woocommerce-shop .esp-v150-shop-products-column .wp-block-woocommerce-product-collection {
	box-sizing: border-box;
	width: 100% !important;
	max-width: none !important;
	margin-right: 0 !important;
	margin-left: 0 !important;
}

/* Structural fallback for Product Catalog templates saved before v1.5.0. */
@supports selector(.wp-block-columns:has(.wp-block-woocommerce-product-collection)) {
	body.woocommerce-shop .wp-block-group.alignfull:has(> .wp-block-columns .wp-block-woocommerce-product-collection) {
		padding-right: 0 !important;
		padding-left: 0 !important;
	}

	body.woocommerce-shop .wp-block-columns:has(.wp-block-woocommerce-product-collection) {
		box-sizing: border-box;
		display: block !important;
		width: min(calc(100% - 44px), var(--esp-shell, 1180px)) !important;
		max-width: var(--esp-shell, 1180px) !important;
		margin-right: auto !important;
		margin-left: auto !important;
	}

	body.woocommerce-shop .wp-block-columns:has(.wp-block-woocommerce-product-collection) > .wp-block-column:not(:has(.wp-block-woocommerce-product-collection)) {
		display: none !important;
	}

	body.woocommerce-shop .wp-block-columns:has(.wp-block-woocommerce-product-collection) > .wp-block-column:has(.wp-block-woocommerce-product-collection) {
		width: 100% !important;
		max-width: none !important;
		flex-basis: 100% !important;
	}
}

@media (max-width: 700px) {
	body.woocommerce-shop .esp-v150-shop-catalog-columns {
		width: min(calc(100% - 28px), var(--esp-shell, 1180px)) !important;
	}

	@supports selector(.wp-block-columns:has(.wp-block-woocommerce-product-collection)) {
		body.woocommerce-shop .wp-block-columns:has(.wp-block-woocommerce-product-collection) {
			width: min(calc(100% - 28px), var(--esp-shell, 1180px)) !important;
		}
	}
}
