/**
 * HiGuppy stability layer.
 *
 * This file intentionally loads last. Keep it focused on neutralizing XStore
 * duplicate controls and recurring mobile shell issues.
 */

:root {
	--hg-stability-page-bg: #f7fbff;
	--hg-stability-footer-bg: #061f3f;
}

html:has(body.higuppy-site-shell),
html:has(body.hg-homepage-active),
body.higuppy-site-shell,
body.hg-homepage-active {
	background: var(--hg-stability-footer-bg) !important;
	overscroll-behavior-y: none;
}

body.higuppy-site-shell .page-wrapper,
body.higuppy-site-shell .template-container,
body.higuppy-site-shell .template-content,
body.higuppy-site-shell .content-page,
body.higuppy-site-shell main,
body.higuppy-site-shell .main-content,
body.higuppy-site-shell .site-main,
body.higuppy-site-shell .woocommerce,
body.hg-homepage-active .page-wrapper,
body.hg-homepage-active .template-container,
body.hg-homepage-active .template-content,
body.hg-homepage-active .content-page,
body.hg-homepage-active main,
body.hg-homepage-active .main-content,
body.hg-homepage-active .site-main {
	background: var(--hg-stability-page-bg) !important;
}

.hg-footer-bridge {
	background: var(--hg-stability-page-bg) !important;
}

.hg-site-footer {
	margin-bottom: 0 !important;
	background-color: var(--hg-stability-footer-bg) !important;
}

.hg-site-footer::after {
	content: "";
	position: absolute;
	inset-inline: 0;
	top: 100%;
	height: 120vh;
	background: var(--hg-stability-footer-bg);
	pointer-events: none;
}

body.hg-homepage-active .hg-site-footer::after,
body.hg-custom-home-layout .hg-site-footer::after {
	display: none !important;
	height: 0 !important;
	content: none !important;
}

body.higuppy-site-shell .widget_shopping_cart_live_region,
body.hg-homepage-active .widget_shopping_cart_live_region {
	background: var(--hg-stability-footer-bg) !important;
}

/* Shop: one filter entry point only. Keep HiGuppy's toolbar button, remove
   XStore's floating mobile funnel that overlaps product cards. */
body.woocommerce-shop .filter-content .higuppy-shop-filter-btn,
body.post-type-archive-product .filter-content .higuppy-shop-filter-btn,
body.tax-product_cat .filter-content .higuppy-shop-filter-btn,
body.hg-shop-page-active .filter-content .higuppy-shop-filter-btn {
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	flex: 0 0 auto !important;
	min-width: 50px !important;
	min-height: 44px !important;
	margin: 0 !important;
	padding: 8px 10px !important;
	border: 1px solid var(--hg-shop-border, #e6ecf7) !important;
	border-radius: 12px !important;
	background: #fff !important;
	color: var(--hg-shop-blue, #1747b8) !important;
	box-shadow: none !important;
	font-size: 12px !important;
	font-weight: 700 !important;
	line-height: 1 !important;
}

body.woocommerce-shop .et-toggle-mob-sidebars-wrapper,
body.post-type-archive-product .et-toggle-mob-sidebars-wrapper,
body.tax-product_cat .et-toggle-mob-sidebars-wrapper,
body.hg-shop-page-active .et-toggle-mob-sidebars-wrapper,
body.woocommerce-shop .et-toggle-mob-sidebars-inner,
body.post-type-archive-product .et-toggle-mob-sidebars-inner,
body.tax-product_cat .et-toggle-mob-sidebars-inner,
body.hg-shop-page-active .et-toggle-mob-sidebars-inner,
body.woocommerce-shop .et-toggle-mob-sidebar,
body.post-type-archive-product .et-toggle-mob-sidebar,
body.tax-product_cat .et-toggle-mob-sidebar,
body.hg-shop-page-active .et-toggle-mob-sidebar {
	display: none !important;
	visibility: hidden !important;
	pointer-events: none !important;
}

body.woocommerce-shop .sidebar.sidebar-left.is-higuppy-filter-open,
body.post-type-archive-product .sidebar.sidebar-left.is-higuppy-filter-open,
body.tax-product_cat .sidebar.sidebar-left.is-higuppy-filter-open,
body.hg-shop-page-active .sidebar.sidebar-left.is-higuppy-filter-open {
	display: block !important;
	position: fixed !important;
	left: 0 !important;
	right: auto !important;
	margin-left: 0 !important;
	width: min(86vw, 340px) !important;
	transform: translate3d(0, 0, 0) !important;
	visibility: visible !important;
	opacity: 1 !important;
	pointer-events: auto !important;
}

@media (max-width: 767px) {
	body.woocommerce-shop .products-loop,
	body.post-type-archive-product .products-loop,
	body.tax-product_cat .products-loop,
	body.hg-shop-page-active .products-loop {
		align-items: start !important;
	}

	body.woocommerce-shop .products-loop > .product,
	body.post-type-archive-product .products-loop > .product,
	body.tax-product_cat .products-loop > .product,
	body.hg-shop-page-active .products-loop > .product {
		align-self: start !important;
		height: auto !important;
		min-height: 0 !important;
		margin-bottom: 0 !important;
		padding-bottom: 0 !important;
	}

	body.woocommerce-shop .products-loop .product .content-product,
	body.post-type-archive-product .products-loop .product .content-product,
	body.tax-product_cat .products-loop .product .content-product,
	body.hg-shop-page-active .products-loop .product .content-product {
		height: auto !important;
		min-height: 0 !important;
		margin-bottom: 0 !important;
		padding-bottom: 0 !important;
	}

	body.woocommerce-shop .products-loop .product .content-product .product-details,
	body.post-type-archive-product .products-loop .product .content-product .product-details,
	body.tax-product_cat .products-loop .product .content-product .product-details,
	body.hg-shop-page-active .products-loop .product .content-product .product-details {
		padding-bottom: 3px !important;
	}

	body.woocommerce-shop .products-loop .product .swiper-button-prev,
	body.woocommerce-shop .products-loop .product .swiper-button-next,
	body.woocommerce-shop .products-loop .product .slick-arrow,
	body.woocommerce-shop .products-loop .product .owl-prev,
	body.woocommerce-shop .products-loop .product .owl-next,
	body.woocommerce-shop .products-loop .product .et-swiper-elementor-nav,
	body.post-type-archive-product .products-loop .product .swiper-button-prev,
	body.post-type-archive-product .products-loop .product .swiper-button-next,
	body.post-type-archive-product .products-loop .product .slick-arrow,
	body.post-type-archive-product .products-loop .product .owl-prev,
	body.post-type-archive-product .products-loop .product .owl-next,
	body.post-type-archive-product .products-loop .product .et-swiper-elementor-nav,
	body.hg-shop-page-active .products-loop .product .swiper-button-prev,
	body.hg-shop-page-active .products-loop .product .swiper-button-next,
	body.hg-shop-page-active .products-loop .product .slick-arrow,
	body.hg-shop-page-active .products-loop .product .owl-prev,
	body.hg-shop-page-active .products-loop .product .owl-next,
	body.hg-shop-page-active .products-loop .product .et-swiper-elementor-nav {
		display: none !important;
	}
}
