/**
 * Single product — bouton « Ajouter au panier » : couleur de marque fixe, pas de violet Woo,
 * chargement + feedback coche puis disparition en douceur.
 */

:root {
	--sailiz-atc-brand: #c5580d;
	--sailiz-atc-brand-hover: #a84a0b;
}

@keyframes sailiz-atc-spin {
	to {
		transform: translateY(-50%) rotate(360deg);
	}
}

@keyframes sailiz-atc-shimmer {
	0% {
		transform: translateX(-130%) skewX(-12deg);
	}
	100% {
		transform: translateX(130%) skewX(-12deg);
	}
}

@keyframes sailiz-atc-check-in {
	0% {
		opacity: 0;
		transform: translateY(-50%) scale(0.35);
	}
	70% {
		opacity: 1;
		transform: translateY(-50%) scale(1.08);
	}
	100% {
		opacity: 1;
		transform: translateY(-50%) scale(1);
	}
}

/* Couleur de base + survol (remplace --woocommerce / thème) */
body.single-product .woocommerce .single_add_to_cart_button,
body.single-product.woocommerce .single_add_to_cart_button,
body.single-product .elementor-widget-woocommerce-add-to-cart .single_add_to_cart_button {
	background-color: var(--sailiz-atc-brand) !important;
	color: #fff !important;
	border-color: var(--sailiz-atc-brand) !important;
}

body.single-product .woocommerce .single_add_to_cart_button:hover:not(:disabled):not(.loading),
body.single-product.woocommerce .single_add_to_cart_button:hover:not(:disabled):not(.loading),
body.single-product .elementor-widget-woocommerce-add-to-cart .single_add_to_cart_button:hover:not(:disabled):not(.loading) {
	background-color: var(--sailiz-atc-brand-hover) !important;
	border-color: var(--sailiz-atc-brand-hover) !important;
}

body.single-product .woocommerce .single_add_to_cart_button.loading,
body.single-product.woocommerce .single_add_to_cart_button.loading,
body.single-product .elementor-widget-woocommerce-add-to-cart .single_add_to_cart_button.loading {
	background-color: var(--sailiz-atc-brand) !important;
	border-color: var(--sailiz-atc-brand) !important;
	opacity: 1 !important;
	color: #fff !important;
	position: relative;
	overflow: hidden;
	cursor: wait;
	filter: none;
}

body.single-product .woocommerce .single_add_to_cart_button.loading::before,
body.single-product.woocommerce .single_add_to_cart_button.loading::before,
body.single-product .elementor-widget-woocommerce-add-to-cart .single_add_to_cart_button.loading::before {
	content: "";
	position: absolute;
	inset: 0;
	width: 45%;
	background: linear-gradient(
		95deg,
		transparent,
		rgba(255, 255, 255, 0.22),
		transparent
	);
	animation: sailiz-atc-shimmer 1.45s ease-in-out infinite;
	pointer-events: none;
	z-index: 1;
}

body.single-product .woocommerce .single_add_to_cart_button.loading::after,
body.single-product.woocommerce .single_add_to_cart_button.loading::after,
body.single-product .elementor-widget-woocommerce-add-to-cart .single_add_to_cart_button.loading::after {
	content: "" !important;
display: none !important;
}

/* Succès : coche SVG blanche à droite */
body.single-product .woocommerce .single_add_to_cart_button.added,
body.single-product.woocommerce .single_add_to_cart_button.added,
body.single-product .elementor-widget-woocommerce-add-to-cart .single_add_to_cart_button.added {
	background-color: var(--sailiz-atc-brand) !important;
	border-color: var(--sailiz-atc-brand) !important;
	color: #fff !important;
	opacity: 1 !important;
	position: relative;
	overflow: hidden;
}

body.single-product .woocommerce .single_add_to_cart_button.added::after,
body.single-product.woocommerce .single_add_to_cart_button.added::after,
body.single-product .elementor-widget-woocommerce-add-to-cart .single_add_to_cart_button.added::after {
	content: "" !important;
	font-family: inherit !important;
	font-size: 0 !important;
	line-height: 0 !important;
	vertical-align: unset !important;
	margin: 0 !important;

	display: block !important;
	width: 0;
	height: 0;
	border-radius: 50%;
	background-color: rgba(255, 255, 255, 0.22);
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6L9 17l-5-5'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: center;
	background-size: 68%;

	position: absolute !important;
	top: 50% !important;
	inset-inline-end: 0.85em !important;
	inset-inline-start: auto !important;

	transform: translateY(-50%) scale(1);
	transform-origin: 50% 50%;
	animation: sailiz-atc-check-in 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
	z-index: 2;

	transition: opacity 0.4s ease, transform 0.4s ease;
}

body.single-product .woocommerce .single_add_to_cart_button.added.sailiz-atc-check-leave::after,
body.single-product.woocommerce .single_add_to_cart_button.added.sailiz-atc-check-leave::after,
body.single-product .elementor-widget-woocommerce-add-to-cart .single_add_to_cart_button.added.sailiz-atc-check-leave::after {
	opacity: 0 !important;
	transform: translateY(-50%) scale(0.65) !important;
	animation: none;
}
