/*
 * ABCake loader: replaces WooCommerce's default blockUI spinner.
 * A spinning ring (::before) around a gently bobbing cake (::after).
 *
 * blockUI sets the overlay colour and opacity inline, hence the !important.
 */

.woocommerce .blockUI.blockOverlay {
	background: rgba(255, 255, 255, 0.8) !important;
	opacity: 1 !important;
	cursor: progress !important;
	animation: abc-loader-in 0.2s ease-out;
}

body .woocommerce .blockUI.blockOverlay::before,
body .woocommerce .blockUI.blockOverlay::after {
	content: "";
	position: absolute;
	top: 50%;
	right: auto;
	left: 50%;
	display: block;
	width: 84px;
	height: 84px;
	margin: -42px 0 0 -42px;
	border-radius: 50%;
	font-size: 16px;
}

body .woocommerce .blockUI.blockOverlay::before {
	z-index: 1;
	background: conic-gradient(from 0deg, rgba(81, 32, 30, 0) 0%, #f0cdb9 35%, #51201e 100%);
	-webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3px));
	mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3px));
	animation: abc-loader-spin 1s linear infinite;
}

body .woocommerce .blockUI.blockOverlay::after {
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Cpath d='M24 5c2.2 2.4 2.6 3.6 2.6 4.6a2.6 2.6 0 01-5.2 0C21.4 8.600 21.800 7.400 24 5z' fill='%23e8a07c'/%3E%3Cpath d='M24 13v6' stroke='%2351201e' stroke-width='2.400' stroke-linecap='round'/%3E%3Cpath d='M13 19h22a3 3 0 013 3v5H10v-5a3 3 0 013-3z' fill='%23f0cdb9'/%3E%3Cpath d='M10 26c2.300 0 2.300 3 4.700 3s2.300-3 4.600-3 2.400 3 4.700 3 2.400-3 4.700-3 2.300 3 4.600 3 2.400-3 4.700-3v12H10z' fill='%2351201e'/%3E%3Cpath d='M7 40h34' stroke='%2351201e' stroke-width='2.400' stroke-linecap='round'/%3E%3C/svg%3E") 50% 50% / 50px no-repeat #fff;
	box-shadow: 0 8px 28px rgba(81, 32, 30, 0.16);
	animation: abc-loader-bob 1.2s ease-in-out infinite;
}

/* The order table and the payment box are blocked together: one loader is enough. */
.woocommerce table.woocommerce-checkout-review-order-table .blockUI.blockOverlay::before,
.woocommerce table.woocommerce-checkout-review-order-table .blockUI.blockOverlay::after {
	display: none !important;
}

/* Placing the order blocks the whole form, which is taller than the screen: cover the screen. */
.woocommerce form.checkout > .blockUI.blockOverlay {
	position: fixed !important;
	inset: 0 !important;
	z-index: 9990 !important; /* below any payment pop-up */
	width: auto !important;
	height: auto !important;
	background: rgba(255, 247, 241, 0.86) !important;
}

body .woocommerce form.checkout > .blockUI.blockOverlay::before,
body .woocommerce form.checkout > .blockUI.blockOverlay::after {
	position: fixed;
}

@keyframes abc-loader-in {
	from {
		background-color: transparent;
	}
}

@keyframes abc-loader-spin {
	to {
		transform: rotate(360deg);
	}
}

@keyframes abc-loader-bob {
	0%,
	100% {
		background-position: 50% calc(50% + 1px);
	}

	50% {
		background-position: 50% calc(50% - 4px);
	}
}

@media (prefers-reduced-motion: reduce) {
	body .woocommerce .blockUI.blockOverlay::before {
		animation-duration: 3s;
	}

	body .woocommerce .blockUI.blockOverlay::after {
		animation: none;
	}
}
