/**
 * Estados de carga — checkout, carrito y Mi cuenta (TP 2026-09-15).
 */

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

/* Spinner reutilizable */
.exitbcn-spinner {
	display: inline-block;
	width: 28px;
	height: 28px;
	border: 2px solid var(--color-primary-200, #d1d1d1);
	border-top-color: var(--color-primary, #222);
	border-radius: 50%;
	animation: exitbcn-spin 700ms linear infinite;
}

/* 1. Botón enviando: texto oculto, spinner blanco centrado, sin hover */
button.exitbcn-is-loading,
input.exitbcn-is-loading,
.button.exitbcn-is-loading {
	position: relative !important;
	color: transparent !important;
	pointer-events: none !important;
	cursor: progress !important;
	background: var(--color-primary, #222) !important;
	border-color: var(--color-primary, #222) !important;
	transform: none !important;
	box-shadow: none !important;
	opacity: 1 !important;
}

button.exitbcn-is-loading::after,
.button.exitbcn-is-loading::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 18px;
	height: 18px;
	margin: -9px 0 0 -9px;
	border: 2px solid rgba(255, 255, 255, 0.35);
	border-top-color: #fff;
	border-radius: 50%;
	animation: exitbcn-spin 700ms linear infinite;
}

/* 2. Capa «Procesando tu pedido» */
.exitbcn-processing {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1.5rem;
	background: rgba(255, 255, 255, 0.92);
	animation: exitbcn-fade 200ms ease-out;
}

.exitbcn-processing[hidden] {
	display: none !important;
}

@keyframes exitbcn-fade {
	from { opacity: 0; }
	to { opacity: 1; }
}

.exitbcn-processing__box {
	max-width: 22rem;
	text-align: center;
}

.exitbcn-processing__box .exitbcn-spinner {
	width: 40px;
	height: 40px;
	margin-bottom: 1.25rem;
}

.exitbcn-processing__title {
	margin: 0 0 0.5rem;
	font-size: 1.25rem;
	font-weight: 900;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--color-primary, #222);
}

.exitbcn-processing__text {
	margin: 0;
	font-size: 0.9375rem;
	line-height: 1.5;
	color: var(--color-primary-600, #5d5d5d);
}

html.exitbcn-processing-open,
html.exitbcn-processing-open body {
	overflow: hidden;
}

/* 3. Barra fina de navegación */
.exitbcn-topbar {
	position: fixed;
	top: 0;
	left: 0;
	z-index: 100001;
	height: 3px;
	width: 0;
	background: var(--color-primary, #222);
	opacity: 0;
	pointer-events: none;
}

.exitbcn-topbar.is-active {
	opacity: 1;
	animation: exitbcn-topbar 8s cubic-bezier(0.1, 0.7, 0.2, 1) forwards;
}

@keyframes exitbcn-topbar {
	0% { width: 0; }
	10% { width: 35%; }
	100% { width: 90%; }
}

@media (prefers-reduced-motion: reduce) {
	.exitbcn-spinner,
	button.exitbcn-is-loading::after,
	.button.exitbcn-is-loading::after {
		animation-duration: 1.6s;
	}
	.exitbcn-topbar.is-active {
		animation: none;
		width: 60%;
	}
}

/* El tema fija el color de los botones con reglas más específicas: el texto se
   seguía viendo debajo del spinner. Se oculta con más especificidad y también
   el contenido interno (spans del botón del checkout). */
html body button.exitbcn-is-loading,
html body .woocommerce button.exitbcn-is-loading,
html body .woocommerce-account .woocommerce button.button.exitbcn-is-loading,
html body .woocommerce-account .woocommerce-MyAccount-content button.exitbcn-is-loading,
html body .woocommerce-account:not(.logged-in) #customer_login button.exitbcn-is-loading {
	color: transparent !important;
	-webkit-text-fill-color: transparent !important;
	text-shadow: none !important;
	background: var(--color-primary, #222) !important;
}

html body .exitbcn-is-loading > * {
	visibility: hidden !important;
}
