/**
 * Coti Motion - estilos de soporte.
 *
 * Solo lo imprescindible para que los efectos funcionen. El diseno sigue
 * saliendo de Elementor.
 */

:root {
	--coti-page-bg: #fcfbf7;
	--coti-cursor-color: #e26150;
	--coti-footer-h: 0px;
}

/* --------------------------------------------------------------------- */
/* Zonas de color                                                         */
/* --------------------------------------------------------------------- */

/**
 * El fondo lo pinta GSAP directo en el estilo del contenedor (queda confinado
 * a esa caja). Esta transicion es solo un respaldo por si algo dispara el
 * cambio sin pasar por la animacion.
 */
[data-coti-zone] {
	transition: background-color 0.15s linear;
}

/**
 * Clase de ayuda: ponela en Avanzado > Clases CSS de cualquier titulo o texto
 * que tenga que seguir el color de SU zona. El color lo aplica GSAP solo a
 * los elementos con esta clase que esten dentro de la zona activa.
 */
.coti-text a {
	color: inherit;
}

/* --------------------------------------------------------------------- */
/* Reveal de texto                                                        */
/* --------------------------------------------------------------------- */

/**
 * Evita el parpadeo: el texto arranca invisible solo si el JS llego a marcar
 * el documento. Si el script falla, un temporizador saca la clase y el texto
 * se ve igual.
 */
.coti-js [data-coti-text] {
	opacity: 0;
}

.coti-line {
	overflow: hidden;
	/* Aire extra para que no se corten las colas de las letras. */
	padding-bottom: 0.12em;
	margin-bottom: -0.12em;
}

.coti-word {
	display: inline-block;
	will-change: transform, opacity;
}

/* --------------------------------------------------------------------- */
/* Imagen que crece a pantalla completa                                   */
/* --------------------------------------------------------------------- */

.coti-scale-el {
	position: relative;
	z-index: 2;
}

.coti-scale-el img,
.coti-scale-el video,
.coti-scale-el iframe {
	will-change: transform;
	backface-visibility: hidden;
}

/* --------------------------------------------------------------------- */
/* Scroll horizontal                                                      */
/* --------------------------------------------------------------------- */

.coti-hscroll {
	overflow: hidden;
}

.coti-hscroll > .e-con-inner,
.coti-hscroll > *:first-child {
	will-change: transform;
}

/* En movil se usa el scroll nativo del navegador. */
.coti-hscroll-native {
	overflow-x: auto;
	overflow-y: hidden;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
}

.coti-hscroll-native::-webkit-scrollbar {
	display: none;
}

.coti-hscroll-native > .e-con-inner,
.coti-hscroll-native > *:first-child {
	flex-wrap: nowrap !important;
	width: max-content;
}

/* --------------------------------------------------------------------- */
/* Footer revelado                                                        */
/* --------------------------------------------------------------------- */

.coti-has-footer .coti-footer-fixed {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	width: 100%;
	z-index: 0;
}

/**
 * Todo lo que va arriba del footer tiene que ser opaco, si no el footer fijo
 * se transparenta a traves del contenido.
 */
.coti-has-footer .coti-above-footer {
	position: relative;
	z-index: 1;
	background-color: var( --coti-page-bg );
}

.coti-has-footer .coti-footer-spacer {
	height: var( --coti-footer-h );
	pointer-events: none;
}

/* --------------------------------------------------------------------- */
/* Cursor personalizado                                                   */
/* --------------------------------------------------------------------- */

@media ( min-width: 1025px ) {

	.coti-has-cursor,
	.coti-has-cursor a,
	.coti-has-cursor button,
	.coti-has-cursor .elementor-button {
		cursor: none;
	}

	#coti-cursor {
		position: fixed;
		top: 0;
		left: 0;
		width: 15px;
		height: 15px;
		margin: -7.5px 0 0 -7.5px;
		border-radius: 50%;
		background-color: var( --coti-cursor-color );
		pointer-events: none;
		z-index: 999999;
		opacity: 0;
		transition: width 0.2s ease, height 0.2s ease, opacity 0.2s ease, filter 0.2s ease;
		will-change: transform;
	}

	#coti-cursor.is-visible {
		opacity: 1;
	}

	#coti-cursor.is-hover {
		width: 35px;
		height: 35px;
		margin: -17.5px 0 0 -17.5px;
		filter: blur( 6px );
	}
}

/* --------------------------------------------------------------------- */
/* Editor de Elementor                                                    */
/* --------------------------------------------------------------------- */

/* Dentro del editor nada se oculta, para poder trabajar comodo. */
.coti-editor [data-coti-text],
.elementor-editor-active [data-coti-text] {
	opacity: 1 !important;
}

.coti-editor #coti-cursor,
.elementor-editor-active #coti-cursor {
	display: none !important;
}

/* --------------------------------------------------------------------- */
/* Accesibilidad                                                          */
/* --------------------------------------------------------------------- */

@media ( prefers-reduced-motion: reduce ) {

	.coti-js [data-coti-text] {
		opacity: 1;
	}

	#coti-cursor {
		display: none !important;
	}
}
