/*
 * One loading spinner everywhere (Lena 2026-11-26): the ring of «In den Warenkorb» on the product page (Blocksy's
 * add-to-cart spinner, the same drawing as --ll-icon-spinner), in the colour of what it stands in for, one turn per
 * --ll-t-spin. No button changes its size, nothing moves:
 * - round button: the ring instead of the icon;
 * - add-to-cart text buttons (buy box, sticky bar), stepper number, undo link: the ring in place of the label,
 *   centred in the same box (the label turns transparent, so --ll-spinner-ink names its colour; Lena 2026-11-26:
 *   the buy box like the card button);
 * - other text buttons: the ring at the inner end of the button, out of the flow, the label stays where it is.
 * Reduced motion: it keeps turning, like Blocksy's (it is the only sign that something is on its way).
 * Also kept on the One Page Checkout pages (inc/commerce/checkout-skin.php).
 */
@keyframes ll-spin {
	to {
		transform: rotate(1turn);
	}
}

/* Round cart button of the product cards: the ring instead of the cart. Blocksy's .loading::after turned the cart
   itself, because that pseudo-element carries the cart icon (product-card.css). */
html [data-products] .product .ct-woo-card-actions .add_to_cart_button.loading::after {
	-webkit-mask-image: var(--ll-icon-spinner);
	mask-image: var(--ll-icon-spinner);
	animation: ll-spin var(--ll-t-spin) linear infinite;
}

/* Other text buttons: «Benachrichtige mich», the thank-you newsletter and «Jetzt kaufen» (One Page Checkout: placing
   the order, or the totals on their way). */
:root form[aria-busy="true"] .ll-notify__submit,
:root .ll-ty-nl__form[aria-busy="true"] .ll-ty-nl__btn,
:root .opcw form.checkout.processing #place_order,
:root .opcw #opcw-payment:is(.is-updating, [aria-busy="true"]) #place_order {
	position: relative;
}
:root form[aria-busy="true"] .ll-notify__submit::after,
:root .ll-ty-nl__form[aria-busy="true"] .ll-ty-nl__btn::after,
:root .opcw form.checkout.processing #place_order::after,
:root .opcw #opcw-payment:is(.is-updating, [aria-busy="true"]) #place_order::after {
	content: "";
	position: absolute;
	inset-block-start: 50%;
	inset-inline-end: var(--ll-space-24);
	inline-size: var(--ll-icon-s);
	block-size: var(--ll-icon-s);
	margin: calc(var(--ll-icon-s) / -2) 0 0;
	background: currentColor;
	-webkit-mask: var(--ll-icon-spinner) center / contain no-repeat;
	mask: var(--ll-icon-spinner) center / contain no-repeat;
	animation: ll-spin var(--ll-t-spin) linear infinite;
}

/* In place of the label: the buy box and the sticky bar of the product page, the drawer's stepper and undo link, the
   quantity in the checkout summary (One Page Checkout, aria-busy on the line). The buy box overrides Blocksy's ring
   after the label (a flex item that grew the button by 1 px and moved the label). */
:root [data-ll-buybox] .ll-buybox__form button[type="submit"].loading,
:root .ll-sticky-cta__btn.loading {
	--ll-spinner-ink: var(--theme-button-text-initial-color);
}
:root #woo-cart-panel .ll-cart__item[aria-busy="true"] output,
:root .opcw [data-opcw-cart-item][aria-busy="true"] .opcw-qty {
	--ll-spinner-ink: var(--ll-ink);
}
:root #woo-cart-panel .ll-cart__undo-btn:disabled {
	--ll-spinner-ink: var(--ll-petrol);
}
:root [data-ll-buybox] .ll-buybox__form button[type="submit"].loading,
:root .ll-sticky-cta__btn.loading,
:root #woo-cart-panel .ll-cart__item[aria-busy="true"] output,
:root #woo-cart-panel .ll-cart__undo-btn:disabled,
:root .opcw [data-opcw-cart-item][aria-busy="true"] .opcw-qty {
	position: relative;
}
:root [data-ll-buybox] .ll-buybox__form button[type="submit"].loading,
:root .ll-sticky-cta__btn.loading,
:root #woo-cart-panel .ll-cart__item[aria-busy="true"] output,
:root #woo-cart-panel .ll-cart__undo-btn:disabled,
:root .opcw [data-opcw-cart-item][aria-busy="true"] .opcw-qty .opcw-qty__n {
	color: transparent;
	-webkit-text-fill-color: transparent;
}
:root [data-ll-buybox] .ll-buybox__form button[type="submit"].loading::after,
:root .ll-sticky-cta__btn.loading::after,
:root #woo-cart-panel .ll-cart__item[aria-busy="true"] output::after,
:root #woo-cart-panel .ll-cart__undo-btn:disabled::after,
:root .opcw [data-opcw-cart-item][aria-busy="true"] .opcw-qty::after {
	content: "";
	position: absolute;
	inset-block-start: 50%;
	inset-inline-start: 50%;
	inline-size: var(--ll-icon-s);
	block-size: var(--ll-icon-s);
	margin: calc(var(--ll-icon-s) / -2) 0 0 calc(var(--ll-icon-s) / -2);
	background: var(--ll-spinner-ink);
	-webkit-mask: var(--ll-icon-spinner) center / contain no-repeat;
	mask: var(--ll-icon-spinner) center / contain no-repeat;
	animation: ll-spin var(--ll-t-spin) linear infinite;
}
