/**
 * SosWoo Buy Now Button — frontend styles.
 *
 * Anything that is not the button skeleton itself goes here:
 * loading spinner, small notice banners, etc.
 *
 * @package SosWoo\BNB
 */

/* Inline loading spinner shown while the AJAX add-to-cart is running. */
.soswoo-bnb-button--loading::after {
	content: "";
	display: inline-block;
	width: 0.9em;
	height: 0.9em;
	margin-left: 0.5em;
	border: 2px solid currentColor;
	border-top-color: transparent;
	border-radius: 50%;
	vertical-align: -0.1em;
	animation: soswoo-bnb-spin 0.7s linear infinite;
}

@keyframes soswoo-bnb-spin {
	to {
		transform: rotate(360deg);
	}
}

/* Accessibility: respect reduced motion. */
@media (prefers-reduced-motion: reduce) {
	.soswoo-bnb-button,
	.soswoo-bnb-button--loading::after {
		animation: none;
		transition: none;
	}
}

/* Small toast that appears after a successful add-to-cart via Buy Now. */
.soswoo-bnb-toast {
	position: fixed;
	left: 50%;
	bottom: 24px;
	transform: translateX(-50%);
	background: #32373c;
	color: #fff;
	padding: 10px 16px;
	border-radius: 4px;
	font-size: 14px;
	z-index: 999999;
	opacity: 0;
	transition: opacity 0.2s ease;
	pointer-events: none;
	max-width: 90vw;
}

.soswoo-bnb-toast.is-visible {
	opacity: 1;
}

.soswoo-bnb-toast.is-error {
	background: #b32d2e;
}