/* Mobile floating actions — sitewide, ≤767px only */
@media (max-width: 767px) {
	/* Keep page content scrollable above floating controls */
	#content.site-content,
	.site-content,
	.jsm-cooler-builder,
	.jsm-gaq {
		padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)) !important;
	}

	.ht-ctc.ht-ctc-chat,
	.ht-ctc-chat,
	#ht-ctc-chat {
		left: max(16px, env(safe-area-inset-left, 0px)) !important;
		right: auto !important;
		bottom: calc(16px + env(safe-area-inset-bottom, 0px)) !important;
		width: 50px !important;
		height: 50px !important;
		min-width: 50px !important;
		min-height: 50px !important;
		z-index: 99990 !important;
		box-shadow: 0 6px 18px rgba(10, 47, 92, 0.22) !important;
	}

	.ht-ctc.ht-ctc-chat .ht-ctc-style,
	.ht-ctc-chat .ht-ctc-style,
	.ht-ctc-chat img,
	.ht-ctc-chat svg {
		width: 50px !important;
		height: 50px !important;
	}

	/* Lift above sticky purchase bars when present */
	body.jsm-cro-active .ht-ctc.ht-ctc-chat,
	body.jsm-cro-active .ht-ctc-chat,
	body:has(.jsm-cro-mobile-cart-fixed:not(.jsm-mobile-float-cart)) .ht-ctc.ht-ctc-chat,
	body:has(.jsm-cb-summary.is-sticky) .ht-ctc.ht-ctc-chat,
	body:has(.jsm-gaq-sticky-continue) .ht-ctc.ht-ctc-chat {
		bottom: calc(72px + env(safe-area-inset-bottom, 0px)) !important;
	}

	/* Lift float cart above sticky purchase bars when present */
	body.jsm-cro-active a.jsm-mobile-float-cart,
	body:has(.jsm-cb-summary.is-sticky) a.jsm-mobile-float-cart,
	body:has(.jsm-gaq-sticky-continue) a.jsm-mobile-float-cart {
		bottom: calc(72px + env(safe-area-inset-bottom, 0px)) !important;
	}

	/* Collection / GAQ pages: keep float cart clear of primary content */
	body.jsm-category-landing a.jsm-mobile-float-cart,
	body:has(.jsm-gaq) a.jsm-mobile-float-cart {
		z-index: 99980 !important;
	}

	body:has(.jsm-gaq) .jsm-gaq-progress {
		position: relative;
		z-index: 1;
	}

	/* Hide redundant Chat Now panels when floating WhatsApp is present */
	body:has(.ht-ctc-chat) .jsm-ap-help,
	body:has(.ht-ctc-chat) .jsm-ap-sidebar .jsm-ap-help,
	body:has(.ht-ctc-chat) .jsm-ap-help__btn {
		display: none !important;
	}

	/* Keep reCAPTCHA from covering CTAs */
	.grecaptcha-badge {
		z-index: 9990 !important;
		bottom: 8px !important;
		transform: scale(0.78);
		transform-origin: bottom right;
		opacity: 0.72;
	}

	a.jsm-cro-mobile-cart-fixed,
	a.jsm-mobile-float-cart {
		display: inline-flex !important;
		align-items: center;
		justify-content: center;
		gap: 4px;
		position: fixed !important;
		top: auto !important;
		bottom: calc(16px + env(safe-area-inset-bottom, 0px)) !important;
		left: calc(max(16px, env(safe-area-inset-left, 0px)) + 66px) !important;
		right: auto !important;
		z-index: 99991 !important;
		min-width: 50px;
		min-height: 50px;
		height: 50px;
		padding: 0 12px;
		border: 1px solid rgba(255, 255, 255, 0.35);
		border-radius: 999px;
		background: #162b4a !important;
		color: #fff !important;
		text-decoration: none !important;
		box-shadow: 0 6px 18px rgba(10, 47, 92, 0.22) !important;
	}

	a.jsm-cro-mobile-cart-fixed .jsm-cro-mobile-cart-fixed__icon,
	a.jsm-mobile-float-cart .jsm-cro-mobile-cart-fixed__icon {
		display: block;
		flex-shrink: 0;
		color: #fff;
	}

	a.jsm-cro-mobile-cart-fixed .jsm-cro-mobile-cart-fixed__amount,
	a.jsm-mobile-float-cart .jsm-cro-mobile-cart-fixed__amount {
		max-width: 72px;
		padding: 0 6px;
		border-radius: 999px;
		background: #fff;
		color: #162b4a;
		font-size: 10px;
		font-weight: 700;
		line-height: 18px;
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
	}

	a.jsm-cro-mobile-cart-fixed ~ a.jsm-cro-mobile-cart-fixed {
		display: none !important;
	}

	/* Hide homepage float when CRO owns the fixed cart (higher specificity than show rules) */
	body.jsm-cro-active a.jsm-mobile-float-cart,
	body.jsm-cro-is-mobile.jsm-cro-active a.jsm-mobile-float-cart {
		display: none !important;
	}

	body.jsm-cro-is-mobile.jsm-cro-active a.jsm-cro-mobile-cart-fixed ~ a.jsm-cro-mobile-cart-fixed {
		display: none !important;
	}

	/* Hide floating View Basket when WooCommerce cart is empty */
	a.jsm-mobile-float-cart.is-empty,
	a.jsm-cro-mobile-cart-fixed.is-empty {
		display: none !important;
	}
}

@media (min-width: 768px) {
	body:not(.jsm-cro-active) a.jsm-mobile-float-cart,
	body:not(.jsm-cro-is-mobile) a.jsm-mobile-float-cart {
		display: none !important;
	}
	a.jsm-mobile-float-cart {
		display: none !important;
	}
}
