/* ---------- Botón ---------- */
.epc-ca-wrap { display: flex; }

.epc-ca-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	cursor: pointer;
	border: 0 solid transparent;
	font-weight: 700;
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
	transition: background-color .2s, color .2s, border-color .2s, box-shadow .2s, transform .1s;
}
.epc-ca-btn:active { transform: translateY(1px); }
.epc-ca-btn.is-loading { opacity: .7; cursor: progress; }
.epc-ca-icon { display: inline-flex; line-height: 1; }
.epc-ca-icon svg { width: 1em; height: 1em; fill: currentColor; }

/* Tamaños predefinidos (los controles de Elementor los sobrescriben) */
.epc-ca-size-sm .epc-ca-btn { padding: 8px 16px;  font-size: 14px; border-radius: 4px; }
.epc-ca-size-md .epc-ca-btn { padding: 12px 24px; font-size: 16px; border-radius: 6px; }
.epc-ca-size-lg .epc-ca-btn { padding: 16px 32px; font-size: 18px; border-radius: 8px; }
.epc-ca-size-xl .epc-ca-btn { padding: 20px 44px; font-size: 22px; border-radius: 10px; }

/* ---------- Popup ---------- */
html.epc-ca-lock, html.epc-ca-lock body { overflow: hidden !important; }

.epc-ca-overlay {
	position: fixed;
	inset: 0;
	z-index: 2147483000;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, .6);
}
.epc-ca-overlay[hidden] { display: none; }

.epc-ca-modal {
	position: relative;
	width: var(--epc-ca-w, 85%);
	height: var(--epc-ca-h, 85%);
	max-width: 100%;
	max-height: 100%;
	background: #fff;
	border-radius: 12px;
	overflow: hidden;
	box-shadow: 0 20px 60px rgba(0, 0, 0, .4);
}
.epc-ca-iframe { display: block; width: 100%; height: 100%; border: 0; background: #fff; }

/* Botón cerrar: caja roja 50x50 en la esquina superior derecha, X blanca dibujada con CSS (centrada exacta).
   !important en lo esencial para que los estilos de botón del tema no lo alteren. */
.epc-ca-close {
	position: absolute !important;
	top: 0 !important;
	right: 0 !important;
	z-index: 3;
	display: block !important;
	width: 50px !important;
	height: 50px !important;
	min-width: 0 !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 0 !important;
	background: #e53935 !important;
	box-shadow: none !important;
	color: #fff !important;
	font-size: 0 !important;
	line-height: 0 !important;
	cursor: pointer;
	transition: background-color .15s;
}
.epc-ca-close:hover,
.epc-ca-close:focus-visible { background: #b71c1c !important; }
.epc-ca-close::before,
.epc-ca-close::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 24px;
	height: 3px;
	background: #fff;
	border-radius: 2px;
}
.epc-ca-close::before { transform: translate(-50%, -50%) rotate(45deg); }
.epc-ca-close::after  { transform: translate(-50%, -50%) rotate(-45deg); }

.epc-ca-loader {
	position: absolute;
	inset: 0;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #fff;
}
.epc-ca-loader.is-hidden { display: none; }
.epc-ca-spinner {
	width: 44px;
	height: 44px;
	border: 4px solid #ddd;
	border-top-color: #ff6a00;
	border-radius: 50%;
	animation: epc-ca-spin .8s linear infinite;
}
@keyframes epc-ca-spin { to { transform: rotate(360deg); } }

/* ---------- Aviso de error (p. ej. producto agotado) ----------
   Caja roja grande al centro de la pantalla. Estática: solo se cierra con la X. */
.epc-ca-alert-overlay {
	position: fixed;
	inset: 0;
	z-index: 2147483001;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	background: rgba(0, 0, 0, .55);
}
.epc-ca-alert {
	position: relative;
	box-sizing: border-box;
	width: min(92vw, 680px);
	padding: 76px 40px 56px;
	border-radius: 14px;
	overflow: hidden;
	background: #d32f2f;
	box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
	text-align: center;
}
.epc-ca-alert-text {
	margin: 0;
	color: #fff;
	font-size: clamp(24px, 4vw, 38px);
	font-weight: 800;
	line-height: 1.25;
}
/* La X va sobre fondo rojo: se oscurece para que se distinga */
.epc-ca-alert .epc-ca-close { background: #7f0000 !important; }
.epc-ca-alert .epc-ca-close:hover,
.epc-ca-alert .epc-ca-close:focus-visible { background: #4a0000 !important; }
