/* Macrigi 2027 — WooCommerce presentation shell.
   WooCommerce/plugins remain owners of products, prices and checkout logic. */

/* WooCommerce archive/product pages are rendered by WooCommerce templates,
   and the exact inner wrapper can vary by version/plugin. Constrain the Core
   main shell itself instead of depending on a fragile direct-child selector.
   This creates visible desktop margins and keeps the commerce grid compact. */
body.post-type-archive-product .mc-main,
body.tax-product_cat .mc-main,
body.tax-product_tag .mc-main{
	width:min(calc(100% - (var(--mc-gutter) * 2)),var(--mc-commerce,1440px));
	max-width:var(--mc-commerce,1440px);
	margin-inline:auto;
	padding-block:var(--mc-section-space-compact);
	overflow:visible;
}

/* Product Detail 2027: wider only on the single-product view.
   Archives/categories keep their already-approved commerce width. */
body.single-product.mc-product-2027-page .mc-main{
	width:100%;
	max-width:none;
	margin-inline:0;
	padding:var(--mc-section-space-compact) 12px;
	overflow:visible;
}

/* Some WooCommerce/plugin templates add an extra generic .container around
   the single product. Widen only the single-product branch so the Product
   Detail 2027 can use the available desktop space without affecting archives. */
body.single-product.mc-product-2027-page .mc-main > :is(.container,.container-fluid,.woocommerce,.site-main,#primary,.content-area),
body.single-product.mc-product-2027-page .mc-main > :is(.woocommerce,.site-main,#primary,.content-area) > :is(.container,.container-fluid){
	width:min(100%,1840px)!important;
	max-width:1840px!important;
	margin-inline:auto!important;
	padding-inline:0!important;
}

/* Do not add a second width constraint inside the commerce shell. */
body.post-type-archive-product .mc-main :where(.site-main,#primary,.content-area),
body.tax-product_cat .mc-main :where(.site-main,#primary,.content-area),
body.tax-product_tag .mc-main :where(.site-main,#primary,.content-area),
body.single-product .mc-main :where(.site-main,#primary,.content-area){
	width:100%!important;
	max-width:none!important;
	margin-inline:0!important;
}

/* Once the WooCommerce wrapper owns the width, product single content can
   fill it without adding a second independent max-width. */
body.single-product .mc-main .product{
	width:min(100%,1840px)!important;
	max-width:1840px!important;
	margin-inline:auto!important;
}

/* More compact hierarchy for shop/category headers. */
body.woocommerce-page .mc-main .woocommerce-breadcrumb{
	margin:0 0 14px;
}
body.woocommerce-page .mc-main .woocommerce-products-header{
	margin-bottom:22px;
}
body.woocommerce-page .mc-main .woocommerce-products-header__title,
body.woocommerce-page .mc-main .page-title{
	margin-top:0;
}
.woocommerce .woocommerce-breadcrumb{margin-bottom:20px}
.woocommerce ul.products{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:22px}
.woocommerce ul.products::before,.woocommerce ul.products::after{display:none}
.woocommerce ul.products li.product{width:auto!important;margin:0!important;float:none!important}
.woocommerce div.product{width:100%;max-width:none;margin-inline:0;padding-block:0}
.woocommerce-cart .woocommerce,
.woocommerce-checkout .woocommerce,
.woocommerce-account .woocommerce{width:min(calc(100% - (var(--mc-gutter) * 2)),var(--mc-wide));margin-inline:auto;padding-block:var(--mc-section-space-compact)}
@media(max-width:900px){.woocommerce ul.products{grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}}
@media(max-width:560px){.woocommerce ul.products{grid-template-columns:1fr;gap:16px}}

@media(max-width:1024px){
	body.post-type-archive-product .mc-main,body.tax-product_cat .mc-main,body.tax-product_tag .mc-main{
		width:calc(100% - (var(--mc-gutter) * 2));
	}
	body.single-product.mc-product-2027-page .mc-main{
		width:100%;
		padding-inline:16px;
	}
}
