/* Product-only phone buying bar. Hidden also removes it from keyboard navigation. */
.humpf-sticky-atc {
	display: none;
}

@media (max-width: 781px) {
	html:has(body.humpf-sticky-atc-visible) {
		scroll-padding-bottom: calc(var(--humpf-sticky-atc-height, 0px) + 1rem);
	}

	body.humpf-sticky-atc-visible {
		padding-bottom: calc(var(--humpf-sticky-original-padding, 0px) + var(--humpf-sticky-atc-height, 0px));
	}

	.humpf-sticky-atc:not([hidden]) {
		box-sizing: border-box;
		position: fixed;
		inset: auto 0 0;
		z-index: 90;
		display: flex;
		align-items: center;
		gap: var(--wp--preset--spacing--30);
		padding: 0.625rem max(1rem, env(safe-area-inset-right)) calc(0.625rem + env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
		border-top: 1px solid var(--wp--preset--color--accent-6);
		background: var(--wp--preset--color--accent-3);
		color: var(--wp--preset--color--contrast);
		/* No slide animation, including with prefers-reduced-motion. */
	}

	.humpf-sticky-atc__details {
		flex: 1;
		min-width: 0;
		font-size: var(--wp--preset--font-size--small);
		line-height: 1.4;
	}

	.humpf-sticky-atc__name {
		display: block;
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
		font-weight: 700;
	}

	.humpf-sticky-atc__price {
		display: block;
		color: var(--wp--preset--color--accent-2);
	}

	.humpf-sticky-atc__button {
		flex: 0 0 auto;
		min-height: 44px;
		min-width: 44px;
		padding: 0.75rem;
		font-size: var(--wp--preset--font-size--small);
		letter-spacing: 0;
		text-transform: none;
		cursor: pointer;
	}

	.humpf-sticky-atc__button:disabled {
		cursor: wait;
		opacity: 0.6;
	}
}

/* Micro-interactions: fade on entry, keeping the native hidden state immediate. */
@media (max-width: 781px) and (prefers-reduced-motion: no-preference) {
	body:not(.humpf-no-motion) .humpf-sticky-atc:not([hidden]) {
		animation: humpf-sticky-fade-in 180ms cubic-bezier(0.16, 1, 0.3, 1);
	}
}

@keyframes humpf-sticky-fade-in {
	from { opacity: 0; }
	to { opacity: 1; }
}
