/**
 * Hero Slider Pro — estilos del frontend.
 * Todo el color y el ritmo salen de variables CSS para que cada slider
 * pueda ajustarse desde el panel sin tocar el archivo.
 */

.hsp {
	--hsp-h: 88svh;
	--hsp-h-mobile: 72svh;
	--hsp-ratio: 16 / 9;
	--hsp-speed: 700ms;
	--hsp-content-width: 1180px;
	--hsp-text: #fff;
	--hsp-accent: #1e6bff;
	--hsp-overlay: rgba(11, 18, 32, 0.45);
	--hsp-pad-x: clamp(20px, 5vw, 72px);
	--hsp-pad-y: clamp(32px, 6vh, 88px);
	--hsp-arrow-size: 52px;
	--hsp-arrow-gap: 12px;
	--hsp-arrow-edge: clamp(12px, 2vw, 28px);

	position: relative;
	width: 100%;
	color: var(--hsp-text);
}

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

.hsp__viewport {
	position: relative;
	overflow: hidden;
	height: var(--hsp-h);
	isolation: isolate;
	background-color: #0b1220;
	/* El gesto horizontal es del slider; el vertical y el zoom, del navegador. */
	touch-action: pan-y pinch-zoom;
}

.hsp--h-ratio .hsp__viewport {
	height: auto;
	aspect-ratio: var(--hsp-ratio);
}

/* ---------- Pista y slides ---------- */

.hsp__track {
	position: absolute;
	inset: 0;
}

.hsp__slide {
	position: absolute;
	inset: 0;
	opacity: 0;
	visibility: hidden;
	transition: opacity var(--hsp-speed) ease, visibility 0s linear var(--hsp-speed);
}

.hsp__slide.is-active {
	opacity: 1;
	visibility: visible;
	z-index: 2;
	transition: opacity var(--hsp-speed) ease, visibility 0s;
}

/* Deslizamiento horizontal */
.hsp--slide .hsp__track {
	display: flex;
	height: 100%;
	will-change: transform;
	transition: transform var(--hsp-speed) cubic-bezier(0.4, 0.01, 0.2, 1);
}

.hsp--slide .hsp__slide {
	position: relative;
	inset: auto;
	flex: 0 0 100%;
	width: 100%;
	opacity: 1;
	visibility: visible;
	transition: none;
}

/* ---------- Imagen ---------- */

.hsp__media {
	position: absolute;
	inset: 0;
	display: block;
	z-index: 0;
}

.hsp__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
	display: block;
}

/* Ken Burns: solo se anima la slide visible. */
.hsp--zoom .hsp__media img {
	transform: scale(1);
}

.hsp--zoom .hsp__slide.is-active .hsp__media img {
	animation: hsp-kenburns 14s ease-out both;
}

@keyframes hsp-kenburns {
	from {
		transform: scale(1);
	}
	to {
		transform: scale(1.09);
	}
}

.hsp__veil {
	position: absolute;
	inset: 0;
	z-index: 1;
	background: var(--hsp-overlay);
	pointer-events: none;
}

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

.hsp__content {
	position: absolute;
	inset: 0;
	z-index: 2;
	display: flex;
	padding: var(--hsp-pad-y) var(--hsp-pad-x);
	pointer-events: none;
}

.hsp__content[data-valign="top"] {
	align-items: flex-start;
}
.hsp__content[data-valign="middle"] {
	align-items: center;
}
.hsp__content[data-valign="bottom"] {
	align-items: flex-end;
	padding-bottom: calc(var(--hsp-pad-y) + 40px);
}

.hsp__content[data-align="left"] {
	justify-content: flex-start;
	text-align: left;
}
.hsp__content[data-align="center"] {
	justify-content: center;
	text-align: center;
}
.hsp__content[data-align="right"] {
	justify-content: flex-end;
	text-align: right;
}

.hsp__inner {
	width: 100%;
	max-width: var(--hsp-content-width);
	pointer-events: auto;
}

.hsp__content[data-align="left"] .hsp__inner,
.hsp__content[data-align="right"] .hsp__inner {
	max-width: min(var(--hsp-content-width), 62ch);
}

.hsp__eyebrow {
	margin: 0 0 clamp(8px, 1.4vh, 16px);
	font-size: clamp(0.72rem, 0.68rem + 0.2vw, 0.85rem);
	font-weight: 600;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	opacity: 0.85;
}

.hsp__title {
	margin: 0;
	font-size: clamp(2rem, 1.35rem + 3.1vw, 4.25rem);
	line-height: 1.05;
	letter-spacing: -0.02em;
	font-weight: 700;
	text-wrap: balance;
	color: inherit;
}

.hsp__subtitle {
	margin: clamp(12px, 2vh, 22px) 0 0;
	font-size: clamp(1rem, 0.94rem + 0.42vw, 1.35rem);
	line-height: 1.55;
	opacity: 0.92;
	text-wrap: pretty;
}

.hsp__content[data-align="center"] .hsp__subtitle {
	margin-left: auto;
	margin-right: auto;
	max-width: 62ch;
}

.hsp__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin-top: clamp(20px, 3.2vh, 36px);
}

.hsp__content[data-align="center"] .hsp__actions {
	justify-content: center;
}
.hsp__content[data-align="right"] .hsp__actions {
	justify-content: flex-end;
}

.hsp__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 48px;
	padding: 0 26px;
	border-radius: 6px;
	border: 2px solid transparent;
	font-size: 1rem;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
	transition: transform 180ms ease, background-color 180ms ease, border-color 180ms ease, opacity 180ms ease;
}

.hsp__btn--solid {
	background: var(--hsp-accent);
	border-color: var(--hsp-accent);
	color: #fff;
}

.hsp__btn--outline {
	background: transparent;
	border-color: currentColor;
	color: var(--hsp-text);
}

.hsp__btn--text {
	min-height: auto;
	padding: 6px 2px;
	color: var(--hsp-text);
	border-bottom: 2px solid currentColor;
	border-radius: 0;
}

.hsp__btn:hover {
	transform: translateY(-2px);
}

.hsp__btn--solid:hover {
	filter: brightness(1.08);
}

.hsp__btn--outline:hover {
	background: rgba(255, 255, 255, 0.12);
}

.hsp__blocklink {
	position: absolute;
	inset: 0;
	z-index: 1;
}

/* Entrada escalonada del texto de la slide activa. */
.hsp__inner > * {
	opacity: 0;
	transform: translateY(14px);
}

.hsp__slide.is-active .hsp__inner > * {
	opacity: 1;
	transform: none;
	transition: opacity 620ms ease, transform 620ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

.hsp__slide.is-active .hsp__inner > *:nth-child(1) {
	transition-delay: 120ms;
}
.hsp__slide.is-active .hsp__inner > *:nth-child(2) {
	transition-delay: 220ms;
}
.hsp__slide.is-active .hsp__inner > *:nth-child(3) {
	transition-delay: 320ms;
}
.hsp__slide.is-active .hsp__inner > *:nth-child(4) {
	transition-delay: 420ms;
}

/* ---------- Controles ---------- */

.hsp__arrow {
	position: absolute;
	top: 50%;
	z-index: 5;
	display: flex;
	align-items: center;
	justify-content: center;
	width: var(--hsp-arrow-size);
	height: var(--hsp-arrow-size);
	margin: 0;
	padding: 0;
	transform: translateY(-50%);
	border: 1px solid rgba(255, 255, 255, 0.32);
	border-radius: 50%;
	background: rgba(12, 18, 30, 0.4);
	color: #fff;
	cursor: pointer;
	backdrop-filter: blur(6px);
	transition: background-color 200ms ease, border-color 200ms ease;
}

.hsp__arrow:hover {
	background: rgba(12, 18, 30, 0.72);
	border-color: rgba(255, 255, 255, 0.6);
}

.hsp__arrow[disabled] {
	opacity: 0.35;
	cursor: default;
}

.hsp__arrow svg {
	width: 22px;
	height: 22px;
}

/* Una flecha a cada lado, a media altura. */
.hsp__arrow--prev {
	left: var(--hsp-arrow-edge);
}

.hsp__arrow--next {
	right: var(--hsp-arrow-edge);
}

.hsp__controls {
	position: absolute;
	left: 50%;
	bottom: clamp(18px, 3vh, 34px);
	z-index: 5;
	display: flex;
	align-items: center;
	gap: 14px;
	transform: translateX(-50%);
}

.hsp__dots {
	display: flex;
	align-items: center;
	gap: 10px;
}

.hsp__dot {
	width: 10px;
	height: 10px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.45);
	cursor: pointer;
	transition: width 260ms ease, background-color 260ms ease;
}

.hsp__dot.is-active {
	width: 30px;
	border-radius: 5px;
	background: #fff;
}

.hsp__playpause {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	padding: 0;
	border: 1px solid rgba(255, 255, 255, 0.32);
	border-radius: 50%;
	background: rgba(12, 18, 30, 0.4);
	color: #fff;
	cursor: pointer;
}

.hsp__playpause svg {
	width: 16px;
	height: 16px;
	fill: currentColor;
}

.hsp__playpause .hsp__icon-play {
	display: none;
}

.hsp.is-paused .hsp__playpause .hsp__icon-play {
	display: block;
}

.hsp.is-paused .hsp__playpause .hsp__icon-pause {
	display: none;
}

.hsp__progress {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 5;
	height: 3px;
	background: rgba(255, 255, 255, 0.2);
}

.hsp__progress-bar {
	display: block;
	width: 0;
	height: 100%;
	background: var(--hsp-accent);
}

/* ---------- Utilidades ---------- */

.hsp__sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

.hsp :focus-visible {
	outline: 3px solid #fff;
	outline-offset: 3px;
	border-radius: 4px;
}

/* ---------- Móvil ---------- */

@media (max-width: 781px) {
	.hsp__viewport {
		height: var(--hsp-h-mobile);
	}

	.hsp--h-ratio .hsp__viewport {
		height: auto;
	}

	/* Sin flechas: en pantalla táctil se pasa deslizando el dedo,
	   y así el contenido recupera el espacio de los laterales. */
	.hsp__arrow {
		display: none;
	}

	/* Los puntos se ven de 10 px pero se tocan en un área de 44. */
	.hsp__dot {
		position: relative;
	}

	.hsp__dot::after {
		content: "";
		position: absolute;
		top: 50%;
		left: 50%;
		width: 44px;
		height: 44px;
		transform: translate(-50%, -50%);
	}

	.hsp__content[data-align="right"] {
		justify-content: flex-start;
		text-align: left;
	}

	.hsp__content[data-align="right"] .hsp__actions {
		justify-content: flex-start;
	}

	/* Cada botón ocupa lo que mide su texto. Si los dos caben en la
	   línea, van juntos; si no, el segundo baja sin estirarse. */
	.hsp__actions {
		gap: 10px;
	}

	.hsp__btn {
		flex: 0 1 auto;
		max-width: 100%;
		padding: 0 20px;
		text-align: center;
	}
}

/* ---------- Movimiento reducido ---------- */

@media (prefers-reduced-motion: reduce) {
	.hsp__slide,
	.hsp--slide .hsp__track,
	.hsp__btn,
	.hsp__dot {
		transition-duration: 1ms !important;
	}

	.hsp--zoom .hsp__slide.is-active .hsp__media img {
		animation: none;
	}

	.hsp__inner > * {
		opacity: 1;
		transform: none;
	}

	.hsp__progress {
		display: none;
	}
}

/* Sin JS: se ve la primera slide, nunca un hueco vacío. */
.hsp:not(.is-ready) .hsp__slide:first-child {
	opacity: 1;
	visibility: visible;
}
