/* ==========================================================================
   Toscano – Hero Home (carrusel)
   Figma: "Hero" (nodo 593:692) — Home, rediseñado como carrusel.
   Prefijo .thh — selectores con dos clases para ganar al Kit de Elementor.
   ========================================================================== */

.thh {
	--thh-teal: var(--toscano-brand-teal, #009a9d);
	--thh-deep: var(--toscano-brand-deep, #032d35);
	--thh-white: var(--toscano-neutral-white, #ffffff);

	--thh-overlay: #004451;
	--thh-overlay-a: .84;
	--thh-eyebrow: var(--thh-teal);
	--thh-title: var(--thh-white);
	--thh-highlight: var(--thh-teal);
	--thh-text: rgba(255, 255, 255, .88);
	--thh-stat: var(--thh-white);
	--thh-btn-bg: var(--thh-teal);
	--thh-btn-bg-hover: var(--toscano-text-accent, #007b7e);
	--thh-btn-color: var(--thh-white);
	--thh-btn2: var(--thh-white);
	--thh-accent: #2fc4c7;

	/* Altura automática: el alto de pantalla que queda por debajo de lo que hay
	   encima del hero (cabecera, barra de admin…). El JS mide --thh-offset y, si la
	   cabecera va fija por encima del hero, --thh-top-auto (hueco para el texto).
	   Con "Altura fija" / "Espacio para la cabecera" se usan --thh-h / --thh-top. */
	position: relative;
	box-sizing: border-box;
	display: flex;
	width: 100%;
	min-height: max(560px, calc(100vh - var(--thh-offset, 0px)));
	min-height: max(560px, var(--thh-h, calc(100svh - var(--thh-offset, 0px))));
	padding-top: var(--thh-top, var(--thh-top-auto, 0px));
	overflow: hidden;
	isolation: isolate;
	background: var(--thh-deep);
	color: var(--thh-white);
	font-family: "Inter", sans-serif;
	-webkit-font-smoothing: antialiased;
	word-break: break-word;
	touch-action: pan-y;
}

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

/* ---------- Fotos ---------- */

.thh .thh__media {
	position: absolute;
	inset: 0;
	z-index: -1;
	overflow: hidden;
}

.thh .thh__bg {
	position: absolute;
	inset: 0;
	overflow: hidden;
	opacity: 0;
	visibility: hidden;
}

.thh .thh__bg.is-active {
	opacity: 1;
	visibility: visible;
}

.thh .thh__bg.is-entering {
	z-index: 1;
	opacity: 1;
	visibility: visible;
}

.thh .thh__bg-move {
	position: absolute;
	inset: 0;
	will-change: transform;
}

.thh .thh__img {
	position: absolute;
	inset: -3%;
	width: 106%;
	height: 106%;
	max-width: none;
	object-fit: cover;
	object-position: var(--thh-pos, 50% 50%);
	will-change: transform;
}

/* Velo del diseño (degradado 74°) + sombra inferior para que la barra se lea */
.thh .thh__veil {
	position: absolute;
	inset: 0;
	z-index: 2;
	pointer-events: none;
	background:
		linear-gradient(0deg, rgba(0, 20, 26, .55) 0%, rgba(0, 20, 26, 0) 32%),
		linear-gradient(74deg, color-mix(in srgb, var(--thh-overlay) calc(var(--thh-overlay-a) * 100%), transparent) 15%, rgba(0, 0, 0, .46) 54%, rgba(0, 0, 0, 0) 93%);
}

/* Filo de la cortina: línea de luz con un rayo quebrado (lo mueve el JS) */
.thh .thh__edge {
	position: absolute;
	top: -5%;
	bottom: -5%;
	left: 0;
	z-index: 3;
	width: 40px;
	margin-left: -20px;
	opacity: 0;
	pointer-events: none;
	transform: skewX(-12deg);
}

.thh .thh__edge::before {
	content: "";
	position: absolute;
	top: 0;
	bottom: 0;
	left: 50%;
	width: 2px;
	margin-left: -1px;
	background: var(--thh-accent);
	box-shadow: 0 0 18px 4px color-mix(in srgb, var(--thh-accent) 70%, transparent), 0 0 4px 1px #ffffff;
}

.thh .thh__bolt {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	overflow: visible;
}

.thh .thh__bolt path {
	fill: none;
	stroke-linecap: round;
	stroke-linejoin: round;
	vector-effect: non-scaling-stroke;
}

.thh .thh__bolt-glow {
	stroke: var(--thh-accent);
	stroke-width: 4;
	opacity: .55;
	filter: drop-shadow(0 0 6px var(--thh-accent));
}

.thh .thh__bolt-core {
	stroke: #ffffff;
	stroke-width: 1.4;
}

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

.thh .thh__inner {
	position: relative;
	display: flex;
	flex-direction: column;
	width: 100%;
	max-width: 1248px;
	margin: 0 auto;
	padding: clamp(24px, 4vh, 48px) 24px 40px;
}

.thh .thh__slides {
	display: grid;
	flex: 1 1 auto;
	align-items: center;
	min-height: 0;
}

.thh .thh__slide {
	grid-area: 1 / 1;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 24px;
	max-width: 640px;
	visibility: hidden;
	opacity: 0;
}

.thh .thh__slide.is-active {
	visibility: visible;
	opacity: 1;
}

.thh .thh__eyebrow {
	margin: 0 0 -14px;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: var(--thh-eyebrow);
}

.thh .thh__title {
	margin: 0;
	padding: 0;
	font-family: "Inter", sans-serif;
	font-size: 56px;
	font-weight: 600;
	line-height: 1.06;
	letter-spacing: -.01em;
	text-transform: none;
	color: var(--thh-title);
}

.thh .thh__hl {
	color: var(--thh-highlight);
}

/* Palabras (el JS las envuelve para que suban desde una máscara) */
.thh .thh__word {
	display: inline-block;
	overflow: hidden;
	vertical-align: top;
	padding-bottom: .1em;
	margin-bottom: -.1em;
}

.thh .thh__word-inner {
	display: inline-block;
	will-change: transform;
}

/* Parte destacada: degradado para el destello de luz (lo mueve GSAP) */
.thh .thh__word-inner.thh__hl {
	background-image: linear-gradient(100deg, var(--thh-highlight) 0%, var(--thh-highlight) 40%, #b9f2f3 50%, var(--thh-highlight) 60%, var(--thh-highlight) 100%);
	background-size: 250% 100%;
	background-position: 0% 0;
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
	color: transparent;
}

.thh .thh__text {
	max-width: 500px;
	margin: 0;
	font-size: 17px;
	font-weight: 400;
	line-height: 1.59;
	color: var(--thh-text);
}

.thh .thh__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	margin-top: 8px;
}

.thh .thh__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	padding: 14px 28px;
	border: 1px solid var(--thh-btn-bg);
	border-radius: 4px;
	background: var(--thh-btn-bg);
	color: var(--thh-btn-color);
	font-family: "Inter", sans-serif;
	font-size: 14px;
	font-weight: 700;
	line-height: 20px;
	letter-spacing: normal;
	text-transform: none;
	text-decoration: none;
	white-space: nowrap;
	transition: background-color .25s ease, border-color .25s ease, color .25s ease;
}

.thh .thh__btn:hover,
.thh .thh__btn:focus-visible {
	background: var(--thh-btn-bg-hover);
	border-color: var(--thh-btn-bg-hover);
	color: var(--thh-btn-color);
	text-decoration: none;
}

.thh .thh__btn-arrow {
	transition: transform .25s ease;
}

.thh .thh__btn:hover .thh__btn-arrow {
	transform: translateX(4px);
}

.thh .thh__btn--outline {
	background: rgba(255, 255, 255, .04);
	border-color: color-mix(in srgb, var(--thh-btn2) 70%, transparent);
	color: var(--thh-btn2);
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
}

.thh .thh__btn--outline:hover,
.thh .thh__btn--outline:focus-visible {
	background: var(--thh-btn2);
	border-color: var(--thh-btn2);
	color: var(--thh-deep);
}

.thh a:focus-visible,
.thh button:focus-visible {
	outline: 2px solid var(--thh-accent);
	outline-offset: 3px;
}

/* ---------- Barra inferior: cifras + pestañas ---------- */

.thh .thh__bar {
	position: relative;
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 32px;
	padding-top: 28px;
}

.thh .thh__bar::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 1px;
	background: rgba(255, 255, 255, .18);
	transform-origin: 0 50%;
	transform: scaleX(var(--thh-line, 1));
}

/* Sin cifras: la navegación va a la derecha y no queda hueco */
.thh .thh__bar--no-stats {
	justify-content: flex-end;
}

.thh .thh__stats {
	display: flex;
	flex: 0 0 auto;
	gap: clamp(28px, 3vw, 48px);
	margin: 0;
	padding: 0;
	list-style: none;
}

.thh .thh__stat {
	display: flex;
	flex-direction: column;
	gap: 3px;
	margin: 0;
	padding: 0;
}

.thh .thh__stat-number {
	font-size: 39px;
	font-weight: 400;
	line-height: 1.2;
	color: var(--thh-stat);
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.thh .thh__stat-label {
	font-size: 13px;
	font-weight: 700;
	line-height: 1.2;
	color: color-mix(in srgb, var(--thh-stat) 80%, transparent);
}

/* La navegación ocupa el espacio que dejan las cifras; las pestañas se encogen */
.thh .thh__nav {
	display: flex;
	flex: 0 1 auto;
	align-items: flex-end;
	gap: 24px;
	min-width: 0;
}

.thh .thh__tabs {
	display: flex;
	flex: 0 1 auto;
	gap: 18px;
	min-width: 0;
}

.thh button.thh__tab {
	display: flex;
	flex: 0 1 140px;
	flex-direction: column;
	align-items: flex-start;
	gap: 6px;
	width: 140px;
	min-width: 72px;
	overflow: hidden;
	margin: 0;
	padding: 0 0 2px;
	border: 0;
	border-radius: 0;
	background: none;
	box-shadow: none;
	color: rgba(255, 255, 255, .6);
	font-family: "Inter", sans-serif;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.3;
	letter-spacing: normal;
	text-align: left;
	text-transform: none;
	cursor: pointer;
	transition: color .3s ease;
}

.thh button.thh__tab:hover,
.thh button.thh__tab.is-active {
	background: none;
	color: #ffffff;
}

.thh .thh__tab-label {
	max-width: 100%;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.thh .thh__ctrls {
	flex: 0 0 auto;
}

.thh .thh__tab-num {
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .08em;
	color: var(--thh-accent);
	font-variant-numeric: tabular-nums;
}

.thh .thh__tab-bar {
	position: relative;
	display: block;
	width: 100%;
	height: 2px;
	margin-top: 4px;
	overflow: hidden;
	border-radius: 2px;
	background: rgba(255, 255, 255, .22);
}

.thh .thh__tab-fill {
	position: absolute;
	inset: 0;
	background: var(--thh-accent);
	box-shadow: 0 0 8px var(--thh-accent);
	transform-origin: 0 50%;
	transform: scaleX(var(--p, 0));
}

.thh .thh__ctrls {
	display: flex;
	gap: 8px;
}

.thh button.thh__ctrl {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	margin: 0;
	padding: 0;
	border: 1px solid rgba(255, 255, 255, .35);
	border-radius: 50%;
	background: rgba(255, 255, 255, .04);
	box-shadow: none;
	color: #ffffff;
	cursor: pointer;
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
	transition: background-color .25s ease, border-color .25s ease, transform .25s ease;
}

.thh button.thh__ctrl:hover {
	background: rgba(255, 255, 255, .14);
	border-color: #ffffff;
	color: #ffffff;
}

.thh .thh__ctrl svg {
	display: block;
}

.thh .thh__i-play {
	display: none;
}

.thh.is-paused .thh__i-pause {
	display: none;
}

.thh.is-paused .thh__i-play {
	display: block;
}

/* ==========================================================================
   Diseños (control "Diseño"): classic (base) · center · glass · split
   ========================================================================== */

/* ---------- Centrado ---------- */
.thh.thh--center .thh__slides {
	justify-items: center;
}

.thh.thh--center .thh__slide {
	align-items: center;
	max-width: 880px;
	text-align: center;
}

.thh.thh--center .thh__title {
	font-size: 64px;
}

.thh.thh--center .thh__text {
	max-width: 600px;
}

.thh.thh--center .thh__actions {
	justify-content: center;
}

.thh.thh--center .thh__veil {
	background:
		linear-gradient(0deg, rgba(0, 20, 26, .6) 0%, rgba(0, 20, 26, 0) 34%),
		radial-gradient(ellipse 72% 62% at 50% 46%,
			color-mix(in srgb, var(--thh-overlay) calc(var(--thh-overlay-a) * 96%), transparent) 0%,
			color-mix(in srgb, var(--thh-overlay) calc(var(--thh-overlay-a) * 64%), transparent) 62%,
			color-mix(in srgb, var(--thh-overlay) calc(var(--thh-overlay-a) * 42%), transparent) 100%);
}

/* ---------- Tarjeta de vidrio ---------- */
.thh.thh--glass .thh__slides {
	position: relative;
	flex: 0 0 auto;
	align-self: flex-start;
	width: 100%;
	max-width: 660px;
	margin: auto 0;
	padding: clamp(28px, 4.5vh, 44px) 44px clamp(26px, 4vh, 40px);
	overflow: hidden;
	border: 1px solid rgba(255, 255, 255, .18);
	border-radius: 16px;
	background: linear-gradient(135deg, rgba(3, 45, 53, .58) 0%, rgba(3, 45, 53, .3) 100%);
	box-shadow: 0 24px 60px rgba(0, 0, 0, .25);
	-webkit-backdrop-filter: blur(16px) saturate(1.2);
	backdrop-filter: blur(16px) saturate(1.2);
}

/* Filo de luz en el borde superior de la tarjeta */
.thh.thh--glass .thh__slides::before {
	content: "";
	position: absolute;
	top: 0;
	left: 44px;
	right: 44px;
	height: 1px;
	background: linear-gradient(90deg, transparent, var(--thh-accent), transparent);
	box-shadow: 0 0 10px var(--thh-accent);
}

.thh.thh--glass .thh__title {
	font-size: clamp(38px, 5.4vh, 48px);
}

.thh.thh--glass .thh__slide {
	gap: 20px;
}

.thh.thh--glass .thh__veil {
	background:
		linear-gradient(0deg, rgba(0, 20, 26, .55) 0%, rgba(0, 20, 26, 0) 32%),
		linear-gradient(74deg, color-mix(in srgb, var(--thh-overlay) calc(var(--thh-overlay-a) * 50%), transparent) 10%, rgba(0, 0, 0, .12) 60%, rgba(0, 0, 0, 0) 95%);
}

/* ---------- Dividido (sólo escritorio; en tablet/móvil = Clásico) ---------- */
.thh {
	--thh-panel: var(--thh-deep);
	--thh-split: 46vw;
}

@media (min-width: 1025px) {
	.thh.thh--split::before {
		content: "";
		position: absolute;
		top: 0;
		bottom: 0;
		left: 0;
		z-index: -2;
		width: var(--thh-split);
		background:
			repeating-linear-gradient(115deg, rgba(255, 255, 255, .03) 0 1px, transparent 1px 22px),
			radial-gradient(120% 80% at 0% 100%, color-mix(in srgb, var(--thh-teal) 32%, transparent) 0%, transparent 60%),
			var(--thh-panel);
	}

	.thh.thh--split .thh__media {
		left: var(--thh-split);
	}

	.thh.thh--split .thh__veil {
		background:
			linear-gradient(0deg, rgba(0, 20, 26, .55) 0%, rgba(0, 20, 26, 0) 34%),
			linear-gradient(90deg, color-mix(in srgb, var(--thh-panel) 55%, transparent) 0%, transparent 30%);
	}

	/* El texto cabe en el panel: su ancho menos el margen lateral del contenido */
	.thh.thh--split .thh__slide {
		max-width: calc(var(--thh-split) - max(24px, (100vw - 1200px) / 2) - 56px);
	}

	.thh.thh--split .thh__title {
		font-size: 48px;
	}
}

/* ---------- Pre-animación (el script en línea añade .thh--pre) ---------- */
.thh.thh--pre .thh__slide.is-active,
.thh.thh--pre .thh__bar {
	visibility: hidden;
}

/* ---------- Responsive ---------- */

@media (max-width: 1199px) {
	.thh .thh__title {
		font-size: 48px;
	}

	.thh button.thh__tab {
		width: 110px;
	}

	.thh.thh--center .thh__title {
		font-size: 54px;
	}

	.thh.thh--glass .thh__title,
	.thh.thh--split .thh__title {
		font-size: 44px;
	}
}

@media (max-width: 1024px) {
	/* Legibilidad: en pantallas estrechas el texto ocupa casi todo el ancho, así que
	   el velo oscurece toda la zona del texto (no sólo la izquierda) */
	.thh.thh--classic .thh__veil,
	.thh.thh--split .thh__veil {
		background:
			linear-gradient(0deg, rgba(0, 26, 33, .9) 0%, rgba(0, 26, 33, .55) 42%, rgba(0, 26, 33, .3) 72%, rgba(0, 26, 33, .4) 100%),
			linear-gradient(90deg, color-mix(in srgb, var(--thh-overlay) calc(var(--thh-overlay-a) * 100%), transparent) 0%, color-mix(in srgb, var(--thh-overlay) calc(var(--thh-overlay-a) * 60%), transparent) 100%);
	}

	.thh .thh__text {
		max-width: 560px;
		color: #ffffff;
		text-shadow: 0 1px 14px rgba(0, 20, 26, .6);
	}

	.thh .thh__stat {
		text-shadow: 0 1px 12px rgba(0, 20, 26, .5);
	}

	.thh .thh__bar {
		flex-direction: column;
		align-items: stretch;
		gap: 24px;
	}

	.thh .thh__nav {
		justify-content: space-between;
	}

	.thh .thh__tabs {
		flex: 1 1 auto;
	}

	.thh button.thh__tab {
		flex: 1 1 0;
		width: auto;
	}
}

@media (max-width: 767px) {
	.thh {
		min-height: max(520px, var(--thh-h, calc(100svh - var(--thh-offset, 0px))));
	}

	/* Pestañas: zona táctil de al menos 40 px de alto (medían 30) */
	.thh button.thh__tab {
		padding-top: 10px;
	}

	.thh .thh__inner {
		padding: 24px 16px 28px;
	}

	.thh .thh__slides {
		align-items: end;
		padding-bottom: 32px;
	}

	.thh .thh__slide {
		gap: 18px;
	}

	.thh .thh__eyebrow {
		margin-bottom: -8px;
		font-size: 13px;
	}

	.thh .thh__title {
		font-size: 34px;
		line-height: 1.1;
	}

	.thh .thh__text {
		font-size: 15px;
	}

	.thh .thh__actions {
		width: 100%;
		gap: 12px;
	}

	.thh .thh__btn {
		flex: 1 1 100%;
	}

	.thh .thh__bar {
		padding-top: 20px;
	}

	.thh .thh__stats {
		justify-content: space-between;
		gap: 12px;
	}

	.thh .thh__stat-number {
		font-size: 26px;
	}

	.thh .thh__stat-label {
		font-size: 11px;
	}

	.thh .thh__tabs {
		gap: 10px;
	}

	/* En móvil sólo el número y la barra; el nombre, sólo en la activa */
	.thh button.thh__tab .thh__tab-label {
		display: none;
	}

	.thh button.thh__prev,
	.thh button.thh__next {
		display: none;
	}

	.thh button.thh__ctrl {
		width: 38px;
		height: 38px;
	}

	/* Móvil: el texto va abajo, así que el velo es más denso de abajo a arriba */
	.thh.thh--classic .thh__veil,
	.thh.thh--split .thh__veil,
	.thh.thh--center .thh__veil {
		background:
			linear-gradient(0deg, rgba(0, 26, 33, .96) 0%, rgba(0, 26, 33, .84) 45%, rgba(0, 26, 33, .5) 75%, rgba(0, 26, 33, .32) 100%);
	}

	.thh .thh__text {
		font-size: 15px;
		line-height: 1.55;
	}

	.thh.thh--center .thh__title {
		font-size: 36px;
	}

	.thh.thh--glass .thh__slides {
		margin: auto 0 24px;
		padding: 26px 22px 24px;
		border-radius: 14px;
	}

	.thh.thh--glass .thh__slides::before {
		left: 22px;
		right: 22px;
	}

	.thh.thh--glass .thh__title {
		font-size: 30px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.thh .thh__bg-move,
	.thh .thh__img {
		transform: none !important;
	}
}
