/**
 * 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-action) !important;
	border-radius: 8px !important;
	background: var(--mimuse-action) !important;
	color: #fff !important;
	font-size: 0 !important;
	line-height: 0 !important;
	text-indent: 0 !important;
	box-shadow: none !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-action) !important;
	border-radius: 8px !important;
	background: var(--mimuse-action) !important;
	color: #fff !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 should match the approved Shop treatment. */
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-action) !important;
	border-radius: 0 0 6px 6px !important;
	background: var(--mimuse-action) !important;
	color: var(--mimuse-action-text, #fff) !important;
	font-weight: 700 !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-action-hover) !important;
	border-color: var(--mimuse-action-hover) !important;
	color: var(--mimuse-action-text, #fff) !important;
	opacity: 1 !important;
}
