/**
 * SC Hero con video (v2).
 *
 * Secuencia (desde que se carga la página):
 * 1. 0,15 s: el video sube desde abajo, recortado al 40 % central (1,12 s). Medido del "Hero Video Reveal" de Framer.
 * 2. 1,37 s: el recorte se abre a todo el hero, el video baja a 0,8 de opacidad y entra el sombreado (0,93 s).
 * 3. 2,0 s: "Esencias y colorantes" se escribe a pincel, de izquierda a derecha (1,6 s).
 * 4. 3,1 s: "de alta calidad" sube y aparece; 3,35 s: se dibuja el trazo naranja debajo.
 * 5. 3,45 s: el texto; 3,7 s y 3,8 s: los botones.
 *
 * Al terminar la entrada, el video queda fijo (clase is-fixed) y la sección siguiente, blanca y con las esquinas de
 * arriba redondeadas, sube por encima del hero como una hoja.
 */

.sc-hvr {
	--sc-hvr-bg: #fff;
	--sc-hvr-accent: #ff6600;
	--sc-hvr-accent-hover: #e65c00;
	--sc-hvr-ink: 26, 16, 8;
	--sc-hvr-top: 111px;
	--sc-hvr-overlap: var(--sc-header-radius, 40px);
	--sc-hvr-radius: var(--sc-header-radius, 40px);
	--sc-hvr-script: clamp(84px, 9.4vw, 168px);
	--sc-hvr-kicker: clamp(13px, 1.25vw, 19px);
	--sc-hvr-text: clamp(15px, 1.1vw, 18px);
	--sc-hvr-ease-rise: cubic-bezier(0.2, 0.8, 0.26, 1);
	--sc-hvr-ease-open: cubic-bezier(0.26, 0.2, 0.2, 0.9);
	--sc-hvr-ease-out: cubic-bezier(0.22, 1, 0.36, 1);
	--sc-hvr-ease-brush: cubic-bezier(0.45, 0.05, 0.3, 1);

	position: relative;
	z-index: 0;
	box-sizing: border-box;
	width: 100%;
	/* Ocupa el resto de la pantalla debajo del encabezado y sube por detrás de sus esquinas redondeadas. */
	height: max(560px, calc(100vh - var(--sc-hvr-top) + var(--sc-hvr-overlap)));
	height: max(560px, calc(100svh - var(--sc-hvr-top) + var(--sc-hvr-overlap)));
	margin: calc(-1 * var(--sc-hvr-overlap)) 0 0;
	overflow: hidden;
	background: var(--sc-hvr-bg);
	font-family: Inter, "Inter Placeholder", sans-serif;
	isolation: isolate;
}

.sc-hvr *,
.sc-hvr *::before,
.sc-hvr *::after {
	box-sizing: border-box;
}

/* ---------------------------------------------------------------------------
 * Video
 * ------------------------------------------------------------------------- */

.sc-hvr__media {
	position: absolute;
	inset: 0;
	background: #000;
	/* El recorte también limita al video cuando queda fijo a la pantalla (position: fixed). */
	clip-path: inset(0);
}

/* Del tamaño de la pantalla y alineado con ella, así al pasar a "fijo" no salta el encuadre. */
.sc-hvr__video {
	position: absolute;
	top: calc(var(--sc-hvr-overlap) - var(--sc-hvr-top));
	left: 0;
	display: block;
	width: 100%;
	height: max(100vh, calc(100% + var(--sc-hvr-top) - var(--sc-hvr-overlap)));
	max-width: none;
	margin: 0;
	object-fit: cover;
	opacity: 0.8;
	pointer-events: none;
}

/* Sombreado cálido para que el texto blanco se lea sobre un video muy claro. */
.sc-hvr__shade {
	position: absolute;
	inset: 0;
	background:
		radial-gradient(120% 85% at 50% 52%, rgba(var(--sc-hvr-ink), 0.18) 0%, rgba(var(--sc-hvr-ink), 0.5) 75%),
		linear-gradient(180deg, rgba(var(--sc-hvr-ink), 0.2) 0%, rgba(var(--sc-hvr-ink), 0.35) 45%, rgba(var(--sc-hvr-ink), 0.55) 100%);
	pointer-events: none;
}

/* ---------------------------------------------------------------------------
 * Contenido
 * ------------------------------------------------------------------------- */

.sc-hvr__content {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	/* Centrado en la parte visible: debajo del encabezado y arriba del borde de la sección siguiente. */
	padding: var(--sc-hvr-overlap) 20px var(--sc-hvr-radius);
	will-change: transform, opacity;
	color: #fff;
	text-align: center;
}

.sc-hvr .sc-hvr__title {
	display: flex;
	flex-direction: column;
	align-items: center;
	margin: 0;
	padding: 0;
	color: #fff;
	font: inherit;
	text-transform: none;
}

/* Título a pincel: la máscara deja ver el trazo de izquierda a derecha con un borde suave. */
.sc-hvr__script {
	display: inline-block;
	/* Aire para los trazos de Allison que se salen de la caja (la máscara recorta lo que queda afuera). */
	margin: -0.18em -0.25em -0.28em;
	padding: 0.18em 0.25em 0.28em;
	font-family: "Allison", cursive;
	font-size: var(--sc-hvr-script);
	font-weight: 400;
	line-height: 0.95;
	letter-spacing: 0;
	text-shadow: 0 6px 34px rgba(var(--sc-hvr-ink), 0.35);
	text-wrap: balance;
}

.sc-hvr__kicker {
	position: relative;
	display: inline-block;
	margin: 0.9em -0.34em 0 0; /* compensa el espaciado de la última letra para que quede centrado */
	padding-bottom: 0.85em;
	font-size: var(--sc-hvr-kicker);
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: 0.34em;
	text-transform: uppercase;
}

.sc-hvr__swash {
	position: absolute;
	left: -4%;
	bottom: 0;
	width: calc(104% - 0.34em);
	height: 0.75em;
	overflow: visible;
	fill: none;
	stroke: var(--sc-hvr-accent);
	stroke-width: 3;
	stroke-linecap: round;
	stroke-dasharray: 1;
	stroke-dashoffset: 0;
}

.sc-hvr__swash path {
	vector-effect: non-scaling-stroke;
}

.sc-hvr .sc-hvr__text {
	max-width: 38em;
	margin: 28px 0 0;
	padding: 0;
	color: rgba(255, 255, 255, 0.88);
	font-size: var(--sc-hvr-text);
	font-weight: 500;
	line-height: 1.6;
	letter-spacing: -0.005em;
	text-wrap: balance;
}

/* ---------------------------------------------------------------------------
 * Botones (píldoras como el resto de los componentes)
 * ------------------------------------------------------------------------- */

.sc-hvr__actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 14px;
	margin-top: 36px;
}

.sc-hvr .sc-hvr__btn {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	margin: 0;
	padding: 16px 26px 16px 30px;
	border: 1px solid transparent;
	border-radius: 999px;
	font-family: inherit;
	font-size: 15px;
	font-weight: 600;
	line-height: 1;
	letter-spacing: -0.01em;
	text-decoration: none;
	white-space: nowrap;
	transition: background-color 0.25s ease, border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.sc-hvr__btn-icon {
	display: block;
	width: 18px;
	height: 18px;
	transition: transform 0.25s ease;
}

.sc-hvr .sc-hvr__btn:hover {
	text-decoration: none;
	transform: translateY(-2px);
}

.sc-hvr .sc-hvr__btn:hover .sc-hvr__btn-icon {
	transform: translateX(3px);
}

.sc-hvr .sc-hvr__btn--primary,
.sc-hvr .sc-hvr__btn--primary:hover,
.sc-hvr .sc-hvr__btn--primary:focus {
	color: #fff;
}

.sc-hvr .sc-hvr__btn--primary {
	background: var(--sc-hvr-accent);
	box-shadow: 0 14px 30px -10px rgba(255, 102, 0, 0.7);
}

.sc-hvr .sc-hvr__btn--primary:hover {
	background: var(--sc-hvr-accent-hover);
	box-shadow: 0 18px 34px -10px rgba(255, 102, 0, 0.8);
}

.sc-hvr .sc-hvr__btn--glass,
.sc-hvr .sc-hvr__btn--glass:hover,
.sc-hvr .sc-hvr__btn--glass:focus {
	color: #fff;
}

.sc-hvr .sc-hvr__btn--glass {
	border-color: rgba(255, 255, 255, 0.4);
	background: rgba(255, 255, 255, 0.14);
	-webkit-backdrop-filter: blur(14px) saturate(1.4);
	backdrop-filter: blur(14px) saturate(1.4);
}

.sc-hvr .sc-hvr__btn--glass:hover {
	border-color: rgba(255, 255, 255, 0.7);
	background: rgba(255, 255, 255, 0.24);
}

.sc-hvr .sc-hvr__btn:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 3px;
}

/* ---------------------------------------------------------------------------
 * Animación de entrada (la clase la pone el script en línea antes del primer pintado)
 * ------------------------------------------------------------------------- */

@keyframes sc-hvr-rise {
	from { transform: translateY(100%); }
	to { transform: translateY(0); }
}

/* Ventana con las cuatro esquinas redondeadas (mismo radio que las tarjetas y el encabezado) que se abre a todo el hero. */
@keyframes sc-hvr-open {
	from { clip-path: inset(30% 30% 30% 30% round var(--sc-hvr-radius)); }
	to { clip-path: inset(0 0 0 0 round 0); }
}

@keyframes sc-hvr-dim {
	from { opacity: 0.9; }
	to { opacity: 0.8; }
}

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

@keyframes sc-hvr-brush {
	from { -webkit-mask-position: 100% 0; mask-position: 100% 0; }
	to { -webkit-mask-position: 0% 0; mask-position: 0% 0; }
}

@keyframes sc-hvr-up {
	from { opacity: 0; transform: translateY(var(--sc-hvr-from, 24px)); }
	to { opacity: 1; transform: translateY(0); }
}

@keyframes sc-hvr-draw {
	from { stroke-dashoffset: 1; }
	to { stroke-dashoffset: 0; }
}

.sc-hvr.is-intro .sc-hvr__media {
	animation:
		sc-hvr-rise 1.12s var(--sc-hvr-ease-rise) 0.15s backwards,
		sc-hvr-open 0.93s var(--sc-hvr-ease-open) 1.37s both;
	/* "backwards" en la subida: al terminar no queda ningún transform, que impediría fijar el video. */
}

.sc-hvr.is-intro .sc-hvr__video {
	animation: sc-hvr-dim 0.93s var(--sc-hvr-ease-open) 1.37s both;
}

.sc-hvr.is-intro .sc-hvr__shade {
	animation: sc-hvr-fade 0.93s var(--sc-hvr-ease-open) 1.37s both;
}

.sc-hvr.is-intro .sc-hvr__script {
	-webkit-mask-image: linear-gradient(90deg, #000 0%, #000 42%, transparent 58%, transparent 100%);
	mask-image: linear-gradient(90deg, #000 0%, #000 42%, transparent 58%, transparent 100%);
	-webkit-mask-size: 260% 100%;
	mask-size: 260% 100%;
	-webkit-mask-repeat: no-repeat;
	mask-repeat: no-repeat;
	animation: sc-hvr-brush 1.6s var(--sc-hvr-ease-brush) 2s both;
}

.sc-hvr.is-intro .sc-hvr__kicker {
	--sc-hvr-from: 18px;
	animation: sc-hvr-up 0.7s var(--sc-hvr-ease-out) 3.1s both;
}

.sc-hvr.is-intro .sc-hvr__swash {
	animation: sc-hvr-draw 0.9s var(--sc-hvr-ease-brush) 3.35s both;
}

.sc-hvr.is-intro .sc-hvr__text {
	animation: sc-hvr-up 0.8s var(--sc-hvr-ease-out) 3.45s both;
}

/* "backwards" y no "both": al terminar, el botón vuelve a su estilo normal y el hover puede moverlo. */
.sc-hvr.is-intro .sc-hvr__btn {
	--sc-hvr-from: 30px;
	animation: sc-hvr-up 0.8s var(--sc-hvr-ease-out) 3.7s backwards;
}

.sc-hvr.is-intro .sc-hvr__btn + .sc-hvr__btn {
	animation-delay: 3.8s;
}

/* Video fijo después de la entrada: la sección siguiente lo tapa al bajar. */
.sc-hvr.is-fixed .sc-hvr__video {
	position: fixed;
	top: 0;
	height: 100vh;
	height: 100lvh;
}

/* ---------------------------------------------------------------------------
 * Sección siguiente: hoja blanca con las esquinas de arriba redondeadas, apoyada sobre el hero
 * ------------------------------------------------------------------------- */

html body .elementor-section:has(.sc-hvr) + .elementor-section,
html body .e-con:has(.sc-hvr) + .e-con {
	position: relative;
	z-index: 2;
	margin-top: calc(-1 * var(--sc-header-radius, 40px));
	border-radius: var(--sc-header-radius, 40px) var(--sc-header-radius, 40px) 0 0;
	/* Sin esto, el fondo blanco del contenido (el carrusel) tapa las esquinas redondeadas. */
	overflow: hidden;
	background-color: #fff;
	box-shadow: 0 -22px 44px -18px rgba(26, 16, 8, 0.35);
	transition: box-shadow 0.6s ease;
}

/* Durante la entrada el hero todavía es blanco: la sombra recién aparece cuando el video ya se abrió. */
html body .elementor-section:has(.sc-hvr.is-intro:not(.is-fixed)) + .elementor-section,
html body .e-con:has(.sc-hvr.is-intro:not(.is-fixed)) + .e-con {
	box-shadow: 0 -22px 44px -18px rgba(26, 16, 8, 0);
}

/* Tablet */
@media (max-width: 1023px) {
	.sc-hvr {
		--sc-hvr-script: clamp(84px, 12vw, 120px);
	}
}

/* Celular: el título a pincel en un solo renglón (el tamaño sigue al ancho de la pantalla) */
@media (max-width: 809px) {
	.sc-hvr {
		/* "Esencias y colorantes" mide ~4,95em en Allison: entra justo en el ancho menos los 20 px de cada lado. */
		--sc-hvr-script: clamp(44px, calc((100vw - 40px) / 5.2), 96px);
		--sc-hvr-kicker: 13px;
		--sc-hvr-text: 15px;
	}

	.sc-hvr__script {
		white-space: nowrap;
	}

	.sc-hvr .sc-hvr__text {
		margin-top: 22px;
	}

	.sc-hvr__actions {
		margin-top: 28px;
		gap: 10px;
	}

	.sc-hvr .sc-hvr__btn {
		padding: 15px 20px 15px 24px;
		font-size: 14px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.sc-hvr.is-intro .sc-hvr__media,
	.sc-hvr.is-intro .sc-hvr__video,
	.sc-hvr.is-intro .sc-hvr__shade,
	.sc-hvr.is-intro .sc-hvr__script,
	.sc-hvr.is-intro .sc-hvr__kicker,
	.sc-hvr.is-intro .sc-hvr__swash,
	.sc-hvr.is-intro .sc-hvr__text,
	.sc-hvr.is-intro .sc-hvr__btn {
		animation: none;
	}

	.sc-hvr.is-intro .sc-hvr__script {
		-webkit-mask-image: none;
		mask-image: none;
	}

	.sc-hvr .sc-hvr__btn,
	.sc-hvr__btn-icon {
		transition: none;
	}
}
