/* ==========================================================================
   Mi Primera Web Widgets Pro — estilos del frontend
   Prefijo de clases: mpw-
   ========================================================================== */

/* ==========================================================================
   HEADING HIGHLIGHT
   ========================================================================== */
.mpw-heading-hl { margin: 0; }
.mpw-heading-hl a { color: inherit; text-decoration: none; }

/* Palabra destacada: contenedor base */
.mpw-heading-hl .mpw-hl {
	display: inline-block;          /* necesario para transformaciones */
	position: relative;
	color: var(--mpw-hl-color, currentColor);
	--mpw-hl-dur: 2s;
	--mpw-hl-delay: 0s;
	--mpw-hl-ease: ease-in-out;
	--mpw-hl-iter: infinite;
	--mpw-hl-g1: #4f3de8;
	--mpw-hl-g2: #ff2d8e;
}

/* Degradado opcional en el texto destacado */
.mpw-heading-hl .mpw-hl.mpw-hl-gradient {
	background-image: linear-gradient(var(--mpw-hl-g-angle, 90deg), var(--mpw-hl-g1), var(--mpw-hl-g2));
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
	color: transparent;
}

/* Subrayado decorativo opcional */
.mpw-heading-hl .mpw-hl.mpw-hl-underline::after {
	content: "";
	position: absolute;
	left: 0; right: 0; bottom: -0.08em;
	height: 2px;
	background: currentColor;
	opacity: .9;
}

/* ----- Animaciones (sólo con .is-anim en el contenedor) -----
   "Al cargar" añade .is-anim en PHP; "al entrar en pantalla" lo añade el JS. */

/* Entrada: aparecer subiendo */
.mpw-heading-hl .mpw-hl.mpw-hl--fade-up { opacity: 0; }
.mpw-heading-hl.is-anim .mpw-hl.mpw-hl--fade-up {
	animation: mpwHlFadeUp var(--mpw-hl-dur) var(--mpw-hl-ease) var(--mpw-hl-delay) 1 both;
}
@keyframes mpwHlFadeUp {
	from { opacity: 0; transform: translateY(0.6em); }
	to   { opacity: 1; transform: translateY(0); }
}

/* Entrada: enfoque (blur) */
.mpw-heading-hl .mpw-hl.mpw-hl--blur-in { opacity: 0; }
.mpw-heading-hl.is-anim .mpw-hl.mpw-hl--blur-in {
	animation: mpwHlBlurIn var(--mpw-hl-dur) var(--mpw-hl-ease) var(--mpw-hl-delay) 1 both;
}
@keyframes mpwHlBlurIn {
	from { opacity: 0; filter: blur(12px); }
	to   { opacity: 1; filter: blur(0); }
}

/* Bucle: brillo (glow) */
.mpw-heading-hl.is-anim .mpw-hl.mpw-hl--glow {
	animation: mpwHlGlow var(--mpw-hl-dur) var(--mpw-hl-ease) var(--mpw-hl-delay) var(--mpw-hl-iter);
}
@keyframes mpwHlGlow {
	0%,100% { text-shadow: 0 0 0 rgba(255,45,142,0); }
	50%     { text-shadow: 0 0 18px rgba(255,45,142,.85); }
}

/* Bucle: barrido — fuerza degradado animado */
.mpw-heading-hl .mpw-hl.mpw-hl--shimmer {
	background-image: linear-gradient(90deg, var(--mpw-hl-g2) 0%, var(--mpw-hl-g1) 25%, #ffffff 50%, var(--mpw-hl-g1) 75%, var(--mpw-hl-g2) 100%);
	background-size: 200% auto;
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
	color: transparent;
}
.mpw-heading-hl.is-anim .mpw-hl.mpw-hl--shimmer {
	animation: mpwHlShimmer var(--mpw-hl-dur) linear var(--mpw-hl-delay) var(--mpw-hl-iter);
}
@keyframes mpwHlShimmer {
	0%   { background-position: 200% center; }
	100% { background-position: -200% center; }
}

/* Bucle: flotar */
.mpw-heading-hl.is-anim .mpw-hl.mpw-hl--float {
	animation: mpwHlFloat var(--mpw-hl-dur) var(--mpw-hl-ease) var(--mpw-hl-delay) var(--mpw-hl-iter);
}
@keyframes mpwHlFloat {
	0%,100% { transform: translateY(0); }
	50%     { transform: translateY(-0.18em); }
}

/* Entrada: subrayado que crece */
.mpw-heading-hl .mpw-hl.mpw-hl--underline-grow::after {
	content: "";
	position: absolute;
	left: 0; bottom: -0.08em;
	height: 2px; width: 0;
	background: currentColor;
}
.mpw-heading-hl.is-anim .mpw-hl.mpw-hl--underline-grow::after {
	animation: mpwHlUnderline var(--mpw-hl-dur) var(--mpw-hl-ease) var(--mpw-hl-delay) 1 forwards;
}
@keyframes mpwHlUnderline {
	from { width: 0; }
	to   { width: 100%; }
}

/* ==========================================================================
   BUTTON PRO (grupo de botones)
   ========================================================================== */
.mpw-btn-group {
	display: flex;
	flex-direction: row;
	flex-wrap: wrap;
	align-items: stretch;
	justify-content: center;
	gap: 16px;
}

/* Cada botón vive dentro de un "wrap" que ancla el tooltip */
.mpw-btn-group > .mpw-btn-wrap {
	position: relative;
	display: inline-flex;
}

.mpw-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	text-decoration: none;
	cursor: pointer;
	line-height: 1.2;
	box-sizing: border-box;
	-webkit-appearance: none;
	appearance: none;
	transition: all 0.3s ease;
}

.mpw-btn:hover,
.mpw-btn:focus { text-decoration: none; }

.mpw-btn-icon { display: inline-flex; align-items: center; }
.mpw-btn-icon svg { width: 1em; height: 1em; }

/* Estado "agregado" del AJAX de WooCommerce */
.mpw-btn.added::after {
	font-family: "WooCommerce";
	content: "\e017";
	margin-left: 0.4em;
}

.mpw-notice {
	display: inline-block;
	padding: 8px 12px;
	border: 1px dashed #c0392b;
	border-radius: 6px;
	color: #c0392b;
	font-size: 13px;
	background: rgba(192, 57, 43, 0.06);
}

/* ----- TOOLTIPS ----- */
.mpw-tooltip {
	--mpw-tt-offset: 12px;
	position: absolute;
	z-index: 9;
	max-width: 240px;
	white-space: normal;
	text-align: center;
	background: #160B28;
	color: #F4EEFF;
	padding: 7px 12px;
	border-radius: 8px;
	font-size: 13px;
	line-height: 1.4;
	box-shadow: 0 6px 22px rgba(0, 0, 0, 0.35);
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity 0.22s ease, transform 0.22s ease;
}

.mpw-tooltip.mpw-tt--arrow::after {
	content: "";
	position: absolute;
	width: 10px; height: 10px;
	background: inherit;
	transform: rotate(45deg);
}

/* Posición: arriba */
.mpw-tt--top { left: 50%; bottom: calc(100% + var(--mpw-tt-offset)); transform: translateX(-50%) translateY(6px); }
.mpw-tt--top.mpw-tt--arrow::after { bottom: -5px; left: 50%; margin-left: -5px; }

/* Posición: abajo */
.mpw-tt--bottom { left: 50%; top: calc(100% + var(--mpw-tt-offset)); transform: translateX(-50%) translateY(-6px); }
.mpw-tt--bottom.mpw-tt--arrow::after { top: -5px; left: 50%; margin-left: -5px; }

/* Posición: izquierda */
.mpw-tt--left { right: calc(100% + var(--mpw-tt-offset)); top: 50%; transform: translateY(-50%) translateX(6px); }
.mpw-tt--left.mpw-tt--arrow::after { right: -5px; top: 50%; margin-top: -5px; }

/* Posición: derecha */
.mpw-tt--right { left: calc(100% + var(--mpw-tt-offset)); top: 50%; transform: translateY(-50%) translateX(-6px); }
.mpw-tt--right.mpw-tt--arrow::after { left: -5px; top: 50%; margin-top: -5px; }

/* Mostrar al pasar el cursor / foco / siempre */
.mpw-btn-wrap:hover .mpw-tooltip,
.mpw-btn-wrap:focus-within .mpw-tooltip,
.mpw-tooltip.mpw-tt--always {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
}
.mpw-btn-wrap:hover .mpw-tt--top,
.mpw-btn-wrap:focus-within .mpw-tt--top,
.mpw-tt--top.mpw-tt--always,
.mpw-btn-wrap:hover .mpw-tt--bottom,
.mpw-btn-wrap:focus-within .mpw-tt--bottom,
.mpw-tt--bottom.mpw-tt--always {
	transform: translateX(-50%) translateY(0);
}
.mpw-btn-wrap:hover .mpw-tt--left,
.mpw-btn-wrap:focus-within .mpw-tt--left,
.mpw-tt--left.mpw-tt--always,
.mpw-btn-wrap:hover .mpw-tt--right,
.mpw-btn-wrap:focus-within .mpw-tt--right,
.mpw-tt--right.mpw-tt--always {
	transform: translateY(-50%) translateX(0);
}

/* ----- ANIMACIONES DE ENTRADA (auto-contenidas) ----- */
.mpw-btn.elementor-invisible { visibility: hidden; }

.mpw-btn.animated {
	animation-duration: 0.8s;
	animation-fill-mode: both;
	visibility: visible;
}
.mpw-btn.animated.mpw-dur-slow { animation-duration: 1.4s; }
.mpw-btn.animated.mpw-dur-fast { animation-duration: 0.5s; }

.mpw-btn.animated.fadeIn      { animation-name: mpw-fadeIn; }
.mpw-btn.animated.fadeInUp    { animation-name: mpw-fadeInUp; }
.mpw-btn.animated.fadeInDown  { animation-name: mpw-fadeInDown; }
.mpw-btn.animated.fadeInLeft  { animation-name: mpw-fadeInLeft; }
.mpw-btn.animated.fadeInRight { animation-name: mpw-fadeInRight; }
.mpw-btn.animated.zoomIn      { animation-name: mpw-zoomIn; }
.mpw-btn.animated.zoomInUp    { animation-name: mpw-zoomInUp; }
.mpw-btn.animated.slideInUp   { animation-name: mpw-slideInUp; }
.mpw-btn.animated.slideInDown { animation-name: mpw-slideInDown; }
.mpw-btn.animated.slideInLeft { animation-name: mpw-slideInLeft; }
.mpw-btn.animated.slideInRight{ animation-name: mpw-slideInRight; }
.mpw-btn.animated.bounceIn    { animation-name: mpw-bounceIn; }
.mpw-btn.animated.pulse       { animation-name: mpw-pulse; }
.mpw-btn.animated.flipInX     { animation-name: mpw-flipInX; backface-visibility: visible; }

@keyframes mpw-fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes mpw-fadeInUp { from { opacity: 0; transform: translateY(40px); } to { opacity: 1; transform: none; } }
@keyframes mpw-fadeInDown { from { opacity: 0; transform: translateY(-40px); } to { opacity: 1; transform: none; } }
@keyframes mpw-fadeInLeft { from { opacity: 0; transform: translateX(-40px); } to { opacity: 1; transform: none; } }
@keyframes mpw-fadeInRight { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: none; } }
@keyframes mpw-zoomIn { from { opacity: 0; transform: scale(0.5); } to { opacity: 1; transform: none; } }
@keyframes mpw-zoomInUp { from { opacity: 0; transform: scale(0.5) translateY(60px); } to { opacity: 1; transform: none; } }
@keyframes mpw-slideInUp { from { transform: translateY(100%); } to { transform: none; } }
@keyframes mpw-slideInDown { from { transform: translateY(-100%); } to { transform: none; } }
@keyframes mpw-slideInLeft { from { transform: translateX(-100%); } to { transform: none; } }
@keyframes mpw-slideInRight { from { transform: translateX(100%); } to { transform: none; } }
@keyframes mpw-pulse { 0% { transform: scale(1); } 50% { transform: scale(1.06); } 100% { transform: scale(1); } }
@keyframes mpw-bounceIn {
	0% { opacity: 0; transform: scale(0.3); }
	50% { opacity: 1; transform: scale(1.05); }
	70% { transform: scale(0.95); }
	100% { transform: scale(1); }
}
@keyframes mpw-flipInX {
	0% { opacity: 0; transform: perspective(400px) rotateX(80deg); }
	100% { opacity: 1; transform: perspective(400px) rotateX(0); }
}

/* ==========================================================================
   MARQUEE PRO (loop infinito continuo)
   ========================================================================== */
.mpw-marquee-pro {
	width: 100%;
	overflow: hidden;
	white-space: nowrap;
}

.mpw-marquee-track {
	display: flex;
	width: max-content;
	will-change: transform;
	/* Anima la pista completa el ancho de UNA copia (-50%) para un bucle
	   infinito perfectamente continuo, sin saltos ni reinicios visibles. */
	animation: mpw-marquee-scroll var(--mpw-marquee-speed, 20s) linear infinite;
}

.mpw-marquee-group {
	display: flex;
	align-items: center;
	flex-shrink: 0;
}

.mpw-marquee-dir-right .mpw-marquee-track { animation-direction: reverse; }
.mpw-marquee-pause:hover .mpw-marquee-track { animation-play-state: paused; }

.mpw-marquee-item { display: inline-flex; align-items: center; white-space: nowrap; }
.mpw-marquee-item a { text-decoration: none; }
.mpw-marquee-sep { display: inline-flex; align-items: center; padding: 0 0.4em; user-select: none; }

@keyframes mpw-marquee-scroll {
	from { transform: translateX(0); }
	to   { transform: translateX(-50%); }
}

/* ==========================================================================
   Accesibilidad: respeta la preferencia de movimiento reducido.
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
	.mpw-marquee-track,
	.mpw-btn.animated {
		animation: none !important;
	}
	.mpw-heading-hl .mpw-hl {
		animation: none !important;
		opacity: 1 !important;
		filter: none !important;
	}
	.mpw-heading-hl .mpw-hl.mpw-hl--underline-grow::after { width: 100%; }
	.mpw-btn.elementor-invisible { visibility: visible !important; }
}
