/* Shop loading state (assets/js/shop-loading.js): a veil over the product grid with a spinner while
   Bricks loads new results. Colours come from the Style Guide variables. */

.is-sng-loading {
	position: relative;
	pointer-events: none;
}

/* Absolutely positioned, so it is not a grid item and keeps the current products visible underneath. */
.sng-loading-veil {
	position: absolute;
	inset: 0;
	z-index: 20;
	padding-top: 120px;
	background: color-mix(in srgb, var(--color-surface-cream) 70%, transparent);
	border-radius: var(--radius-card);
	animation: sng-loading-fade 0.15s ease-out;
}

/* Sticky: follows the screen centre while the grid is scrolled, but stays inside the grid. */
.sng-loading-veil__spinner {
	position: sticky;
	top: calc(50vh - 22px);
	display: block;
	width: 44px;
	height: 44px;
	margin: 0 auto;
	border: 3px solid var(--color-border-subtle);
	border-top-color: var(--color-brand-deep);
	border-radius: 50%;
	animation: sng-loading-spin 0.8s linear infinite;
}

@keyframes sng-loading-spin {
	to {
		transform: rotate(360deg);
	}
}

@keyframes sng-loading-fade {
	from {
		opacity: 0;
	}
}

@media (prefers-reduced-motion: reduce) {
	.sng-loading-veil__spinner {
		animation-duration: 2s;
	}
}
