/**
 * MiMusE Production Parity Layer
 * Version: 0.25.2
 *
 * Purpose:
 * - Make the tested Home / Shop / Single Product presentation less dependent
 *   on old theme/plugin state left in a production database.
 * - Suppress YITH loop UI that duplicates MiMusE's own product-card actions.
 * - Stabilize the bottom product-slider arrows.
 * - Use a grid-based single-product shell instead of legacy WooCommerce floats.
 */

/* --------------------------------------------------
   HOME — stable full-width Elementor canvas
-------------------------------------------------- */
body.home .mimuse-elementor-front-page,
body.front-page .mimuse-elementor-front-page,
.mimuse-elementor-front-page {
	width: 100% !important;
	max-width: none !important;
	margin: 0 !important;
	padding: 0 !important;
	overflow-x: clip;
}

.mimuse-elementor-front-page > .elementor,
.mimuse-elementor-front-page > .elementor-location-single,
.mimuse-elementor-front-page .elementor-element.e-con {
	max-width: none;
}

/* The glyph used by the browser can sit high/low depending on font metrics.
 * Draw the chevron ourselves so DEV/Production render identically. */
.mimuse-elementor-front-page .mimuse-strip-control {
	font-size: 0 !important;
	line-height: 0 !important;
}

.mimuse-elementor-front-page .mimuse-strip-control::before {
	content: "";
	display: block;
	width: 8px;
	height: 8px;
	border-top: 2px solid currentColor;
	border-right: 2px solid currentColor;
	box-sizing: border-box;
}

.mimuse-elementor-front-page .mimuse-strip-control--prev::before {
	transform: rotate(-135deg);
	margin-left: 3px;
}

.mimuse-elementor-front-page .mimuse-strip-control--next::before {
	transform: rotate(45deg);
	margin-right: 3px;
}

/* --------------------------------------------------
   SHOP / PRODUCT LOOPS — MiMusE owns the action cluster
-------------------------------------------------- */
body.woocommerce-shop .mimuse-woocommerce-main,
body.tax-product_cat .mimuse-woocommerce-main,
body.tax-product_tag .mimuse-woocommerce-main {
	width: min(calc(100% - 40px), var(--mimuse-container)) !important;
	max-width: var(--mimuse-container) !important;
	margin-inline: auto !important;
	padding: 34px 0 64px !important;
}

/* Hide only third-party buttons injected directly into the Woo product card.
 * MiMusE's own buttons live inside .mimuse-product-card__actions and remain. */
body.woocommerce-shop ul.products li.product > .yith-wcwl-add-to-wishlist,
body.woocommerce-shop ul.products li.product > .yith-add-to-wishlist-button-block,
body.woocommerce-shop ul.products li.product > .compare-button,
body.woocommerce-shop ul.products li.product > a.compare,
body.tax-product_cat ul.products li.product > .yith-wcwl-add-to-wishlist,
body.tax-product_cat ul.products li.product > .yith-add-to-wishlist-button-block,
body.tax-product_cat ul.products li.product > .compare-button,
body.tax-product_cat ul.products li.product > a.compare,
body.tax-product_tag ul.products li.product > .yith-wcwl-add-to-wishlist,
body.tax-product_tag ul.products li.product > .yith-add-to-wishlist-button-block,
body.tax-product_tag ul.products li.product > .compare-button,
body.tax-product_tag ul.products li.product > a.compare {
	display: none !important;
}

/* Product card action row should never inherit old theme spacing. */
body.woocommerce-shop .mimuse-product-card__actions,
body.tax-product_cat .mimuse-product-card__actions,
body.tax-product_tag .mimuse-product-card__actions {
	margin: 0 !important;
	padding: 0 !important;
	list-style: none !important;
}

/* --------------------------------------------------
   SINGLE PRODUCT — remove dependency on legacy Woo floats
-------------------------------------------------- */
@media (min-width: 901px) {
	body.single-product .mimuse-single-product-page div.product {
		display: grid !important;
		grid-template-columns: minmax(0, 48%) minmax(0, 1fr) !important;
		column-gap: 52px !important;
		row-gap: 0 !important;
		align-items: start !important;
		width: 100% !important;
	}

	body.single-product .mimuse-single-product-page div.product::before,
	body.single-product .mimuse-single-product-page div.product::after {
		content: none !important;
		display: none !important;
	}

	body.single-product .mimuse-single-product-page div.product > .woocommerce-product-gallery {
		grid-column: 1 !important;
		grid-row: 1 !important;
		float: none !important;
		width: 100% !important;
		max-width: 650px !important;
		margin: 0 !important;
	}

	body.single-product .mimuse-single-product-page div.product > .summary {
		grid-column: 2 !important;
		grid-row: 1 !important;
		float: none !important;
		width: 100% !important;
		min-width: 0 !important;
		max-width: none !important;
		margin: 0 !important;
		padding-top: 2px !important;
	}

	body.single-product .mimuse-single-product-page div.product > .woocommerce-tabs,
	body.single-product .mimuse-single-product-page div.product > .related.products,
	body.single-product .mimuse-single-product-page div.product > .upsells.products {
		grid-column: 1 / -1 !important;
		width: 100% !important;
	}
}

@media (max-width: 900px) {
	body.single-product .mimuse-single-product-page div.product {
		display: block !important;
	}

	body.single-product .mimuse-single-product-page div.product > .woocommerce-product-gallery,
	body.single-product .mimuse-single-product-page div.product > .summary {
		float: none !important;
		width: 100% !important;
		max-width: none !important;
		margin: 0 !important;
	}
}

/* Related/upsell loops: suppress any YITH auto-loop injection while keeping
 * the MiMusE action cluster used by the tested product cards. */
body.single-product .related.products ul.products li.product > .yith-wcwl-add-to-wishlist,
body.single-product .related.products ul.products li.product > .yith-add-to-wishlist-button-block,
body.single-product .related.products ul.products li.product > .compare-button,
body.single-product .related.products ul.products li.product > a.compare,
body.single-product .upsells.products ul.products li.product > .yith-wcwl-add-to-wishlist,
body.single-product .upsells.products ul.products li.product > .yith-add-to-wishlist-button-block,
body.single-product .upsells.products ul.products li.product > .compare-button,
body.single-product .upsells.products ul.products li.product > a.compare {
	display: none !important;
}

/* --------------------------------------------------
   YITH COMPARE — visual fallback for duplicate legacy rows
   PHP normalizers remove the duplicate fields at source. This is only a
   fallback for cached/older markup.
-------------------------------------------------- */
.yith_woocompare_table tr.add_to_cart_2,
.yith-woocompare-table tr.add_to_cart_2,
.compare-list tr.add_to_cart_2,
.yith_woocompare_table tr.price_2,
.yith-woocompare-table tr.price_2,
.compare-list tr.price_2 {
	display: none !important;
}

@media (max-width: 768px) {
	body.woocommerce-shop .mimuse-woocommerce-main,
	body.tax-product_cat .mimuse-woocommerce-main,
	body.tax-product_tag .mimuse-woocommerce-main {
		width: min(calc(100% - 24px), var(--mimuse-container)) !important;
		padding: 24px 0 44px !important;
	}
}

/* --------------------------------------------------
   MiMusE 0.25.3 — Production page finish
   Scope is intentionally narrow:
   - Home bottom-strip arrow optical centering.
   - Single Product related/upsell card actions + CTA parity.
   Shop and Compare are already passing and are not reworked here.
-------------------------------------------------- */

/* HOME — center the drawn chevrons without font/margin-dependent offsets. */
.mimuse-elementor-front-page .mimuse-strip-control {
	position: absolute;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
}

.mimuse-elementor-front-page .mimuse-strip-control::before {
	position: absolute;
	top: 50%;
	left: 50%;
	margin: 0 !important;
	transform-origin: 50% 50%;
}

.mimuse-elementor-front-page .mimuse-strip-control--prev::before {
	transform: translate(-50%, -50%) rotate(-135deg);
}

.mimuse-elementor-front-page .mimuse-strip-control--next::before {
	transform: translate(-50%, -50%) rotate(45deg);
}

/* SINGLE PRODUCT — keep the related-card action stack compact and predictable
   even when YITH brings its own wrapper/label styles from an older install. */
body.single-product .related.products .mimuse-product-card__actions,
body.single-product .upsells.products .mimuse-product-card__actions {
	top: 14px !important;
	right: 14px !important;
	width: 38px !important;
	margin: 0 !important;
	padding: 0 !important;
	gap: 8px !important;
	align-items: center !important;
}

body.single-product .related.products .mimuse-yith-compare,
body.single-product .upsells.products .mimuse-yith-compare,
body.single-product .related.products .mimuse-yith-compare .compare-button,
body.single-product .upsells.products .mimuse-yith-compare .compare-button {
	display: block !important;
	width: 38px !important;
	height: 38px !important;
	min-width: 38px !important;
	min-height: 38px !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	font-size: 0 !important;
	line-height: 0 !important;
}

body.single-product .related.products .mimuse-yith-compare a.compare,
body.single-product .upsells.products .mimuse-yith-compare a.compare {
	display: grid !important;
	place-items: center !important;
	position: static !important;
	inset: auto !important;
	width: 38px !important;
	height: 38px !important;
	min-width: 38px !important;
	min-height: 38px !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 1px solid var(--mimuse-border) !important;
	border-radius: 999px !important;
	background: rgba(255,255,255,.96) !important;
	color: var(--mimuse-text) !important;
	font-size: 0 !important;
	line-height: 0 !important;
	text-indent: 0 !important;
	box-shadow: 0 4px 14px rgba(0,0,0,.05) !important;
}

body.single-product .related.products .mimuse-yith-compare a.compare::before,
body.single-product .upsells.products .mimuse-yith-compare a.compare::before {
	content: "↔" !important;
	display: block !important;
	font-size: 17px !important;
	font-weight: 500 !important;
	line-height: 1 !important;
}

body.single-product .related.products .mimuse-product-action--cart,
body.single-product .upsells.products .mimuse-product-action--cart {
	width: 38px !important;
	height: 38px !important;
	min-width: 38px !important;
	min-height: 38px !important;
	margin: 0 !important;
	padding: 0 !important;
	border-color: var(--mimuse-border) !important;
	border-radius: 999px !important;
	background: rgba(255,255,255,.96) !important;
	color: var(--mimuse-text) !important;
	box-shadow: 0 4px 14px rgba(0,0,0,.05) !important;
}

body.single-product .related.products .mimuse-yith-wishlist,
body.single-product .upsells.products .mimuse-yith-wishlist,
body.single-product .related.products .mimuse-yith-wishlist .yith-wcwl-add-to-wishlist,
body.single-product .upsells.products .mimuse-yith-wishlist .yith-wcwl-add-to-wishlist,
body.single-product .related.products .mimuse-yith-wishlist .yith-add-to-wishlist-button-block,
body.single-product .upsells.products .mimuse-yith-wishlist .yith-add-to-wishlist-button-block {
	width: 38px !important;
	height: 38px !important;
	min-width: 38px !important;
	min-height: 38px !important;
	margin: 0 !important;
	padding: 0 !important;
}

body.single-product .related.products .mimuse-yith-wishlist a,
body.single-product .upsells.products .mimuse-yith-wishlist a {
	width: 38px !important;
	height: 38px !important;
	min-width: 38px !important;
	min-height: 38px !important;
	margin: 0 !important;
	padding: 0 !important;
}

/* Related/upsell primary CTA follows the approved DEV card treatment:
   dark neutral CTA, not the red Shop override. */
body.single-product .related.products ul.products li.product > a.button,
body.single-product .upsells.products ul.products li.product > a.button,
body.single-product .related.products ul.products li.product .button.add_to_cart_button,
body.single-product .upsells.products ul.products li.product .button.add_to_cart_button {
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	width: 100% !important;
	min-height: 42px !important;
	margin: auto 0 0 !important;
	padding: 0 16px !important;
	border: 1px solid var(--mimuse-text) !important;
	border-radius: var(--mimuse-radius-md) !important;
	background: var(--mimuse-text) !important;
	color: #fff !important;
	font-weight: 600 !important;
	text-decoration: none !important;
}

body.single-product .related.products ul.products li.product > a.button:hover,
body.single-product .upsells.products ul.products li.product > a.button:hover {
	background: var(--mimuse-text) !important;
	border-color: var(--mimuse-text) !important;
	color: #fff !important;
	opacity: .88 !important;
}


/* --------------------------------------------------
   MiMusE 0.25.5 — DEV visual parity
   Related/upsell floating actions are neutral white circles and the
   primary CTA is dark, matching the approved DEV card language.
-------------------------------------------------- */
/* --------------------------------------------------
   MiMusE 0.25.4 — Related products final cleanup
-------------------------------------------------- */
/* Keep only the Compare control inside MiMusE's floating action cluster.
   Dirty/older YITH installs can inject another Compare wrapper after the
   WooCommerce Add to cart button. These selectors intentionally target only
   siblings outside .mimuse-product-card__actions. */
body.single-product .mimuse-single-product-page .related.products ul.products li.product > .compare-button,
body.single-product .mimuse-single-product-page .upsells.products ul.products li.product > .compare-button,
body.single-product .mimuse-single-product-page .related.products ul.products li.product > a.compare,
body.single-product .mimuse-single-product-page .upsells.products ul.products li.product > a.compare,
body.single-product .mimuse-single-product-page .related.products ul.products li.product > .yith-woocompare-button,
body.single-product .mimuse-single-product-page .upsells.products ul.products li.product > .yith-woocompare-button,
body.single-product .mimuse-single-product-page .related.products ul.products li.product > .yith-compare-button,
body.single-product .mimuse-single-product-page .upsells.products ul.products li.product > .yith-compare-button {
	display: none !important;
}

/* Some YITH builds wrap the injected Compare link in a generic container.
   Hide the duplicate link and collapse a wrapper that contains only it. */
body.single-product .mimuse-single-product-page .related.products ul.products li.product > *:not(.mimuse-product-card__actions) > a.compare,
body.single-product .mimuse-single-product-page .upsells.products ul.products li.product > *:not(.mimuse-product-card__actions) > a.compare {
	display: none !important;
}

@supports selector(:has(*)) {
	body.single-product .mimuse-single-product-page .related.products ul.products li.product > *:not(.mimuse-product-card__actions):has(> a.compare),
	body.single-product .mimuse-single-product-page .upsells.products ul.products li.product > *:not(.mimuse-product-card__actions):has(> a.compare) {
		display: none !important;
	}
}

/* Sale badge must not collide with the top-right action stack. */
body.single-product .mimuse-single-product-page .related.products ul.products li.product > .onsale,
body.single-product .mimuse-single-product-page .upsells.products ul.products li.product > .onsale {
	top: 14px !important;
	left: 14px !important;
	right: auto !important;
	margin: 0 !important;
	z-index: 4 !important;
}
