/**
 * Ebike Hause - mobile sticky purchase bar (Phase 3A, 2026-09-09).
 *
 * Mobile only. Above 767px the bar is removed from the layout entirely, so the
 * desktop product page is byte-identical to before.
 *
 * z-index sits at 330: below WoodMart's side drawers (500) and their overlay
 * (400) so the cart drawer covers the bar when it opens, and below the
 * scroll-to-top control (350), which is nudged upward while the bar is shown.
 */

.engwe-sticky-cta {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 330;
	box-sizing: border-box;
	max-width: 100%;
	background: #fff;
	border-top: 1px solid #e6e6e6;
	box-shadow: 0 -2px 12px rgba(0, 0, 0, .10);
	padding: 8px 12px max(8px, env(safe-area-inset-bottom)) 12px;
	transform: translateY(110%);
	transition: transform .18s ease-out;
	will-change: transform;
}

/* Shown only once JS has removed [hidden] and the inline button is off screen. */
.engwe-sticky-cta.is-shown {
	transform: translateY(0);
}

.engwe-sticky-cta[hidden] {
	display: none !important;
}

.engwe-sticky-cta__inner {
	display: flex;
	align-items: center;
	gap: 12px;
	max-width: 100%;
}

.engwe-sticky-cta__price {
	flex: 0 0 auto;
	font-size: 19px;
	font-weight: 700;
	line-height: 1.2;
	color: #222;
	white-space: nowrap;
}

/* price_html can carry a struck-through original; the bar shows the payable
   amount only, so any <del> is dropped. */
.engwe-sticky-cta__price del {
	display: none;
}

.engwe-sticky-cta__price ins {
	text-decoration: none;
}

.engwe-sticky-cta__btn {
	flex: 1 1 auto;
	min-width: 0;
	min-height: 48px; /* comfortable tap target */
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 0 14px;
	border: 0;
	border-radius: 6px;
	background: #d9232d;
	color: #fff;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.2;
	text-align: center;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
}

.engwe-sticky-cta__btn:active {
	filter: brightness(.92);
}

.engwe-sticky-cta__label {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* Variation not chosen yet: still tappable, because tapping is what explains
   what to do. Only genuinely unpurchasable states use [disabled]. */
.engwe-sticky-cta__btn.is-needs-variation {
	background: #6b7280;
}

.engwe-sticky-cta__btn[disabled] {
	background: #b9bcc2;
	cursor: not-allowed;
}

/* Loading state: immediate feedback, no layout change. */
.engwe-sticky-cta__spinner {
	display: none;
	width: 16px;
	height: 16px;
	flex: 0 0 auto;
	border: 2px solid rgba(255, 255, 255, .45);
	border-top-color: #fff;
	border-radius: 50%;
	animation: engwe-sticky-spin .6s linear infinite;
}

.engwe-sticky-cta__btn.is-loading .engwe-sticky-cta__spinner {
	display: block;
}

.engwe-sticky-cta__btn.is-loading {
	filter: brightness(.92);
}

@keyframes engwe-sticky-spin {
	to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
	.engwe-sticky-cta { transition: none; }
	.engwe-sticky-cta__spinner { animation-duration: 1.6s; }
}

.engwe-sticky-cta__hint {
	margin: 6px 0 0;
	font-size: 13px;
	line-height: 1.35;
	color: #a4341a;
}

.engwe-sticky-cta__hint[hidden] {
	display: none !important;
}

/* Brief highlight on the swatches when the user taps without choosing. */
.engwe-attn {
	animation: engwe-attn-pulse 1.4s ease-out 1;
	border-radius: 6px;
}

@keyframes engwe-attn-pulse {
	0%, 100% { box-shadow: 0 0 0 0 rgba(217, 35, 45, 0); }
	25%      { box-shadow: 0 0 0 4px rgba(217, 35, 45, .28); }
	60%      { box-shadow: 0 0 0 4px rgba(217, 35, 45, .18); }
}

@media (max-width: 767px) {
	/* Keep the last footer row reachable above the bar. Applied from first
	   paint, so it costs no layout shift. */
	body.engwe-has-sticky-cta {
		padding-bottom: 72px;
	}

	/* Lift WoodMart's scroll-to-top clear of the bar while it is showing. */
	body.engwe-sticky-cta-on .scrollToTop {
		bottom: calc(78px + env(safe-area-inset-bottom)) !important;
	}
}

/* Desktop and tablet: the bar does not exist. */
@media (min-width: 768px) {
	.engwe-sticky-cta {
		display: none !important;
	}
}
