/* ============================================================
   TES · Componentes modernos (hero + carrusel de unidades)
   JavaScript puro, sin dependencias externas.
   Se carga después de estilos.css, por lo que puede sobrescribir.
   ============================================================ */

:root {
	--tes-orange: #c9932b;
	--tes-orange-dark: #b8801f;
	--tes-orange-2: #E35929;
	--tes-ink: #1c1a17;
	--tes-muted: #6f6a63;
	--tes-line: rgba(0, 0, 0, .08);
	--tes-radius: 18px;
	--tes-shadow: 0 24px 50px -24px rgba(0, 0, 0, .45);
	--tes-shadow-sm: 0 10px 28px -14px rgba(0, 0, 0, .38);
	--tes-ease: cubic-bezier(.22, .61, .36, 1);
	--tes-ancho: 1100px;
}

/* ============================================================
   Botones y flechas reutilizables
   ============================================================ */
.tes-btn {
	display: inline-flex;
	align-items: center;
	gap: .55em;
	padding: .9em 1.6em;
	border-radius: 999px;
	background: var(--tes-orange);
	color: #fff;
	font-weight: 700;
	font-size: 16px;
	line-height: 1;
	text-decoration: none;
	transition: background .25s var(--tes-ease), transform .25s var(--tes-ease), box-shadow .25s var(--tes-ease);
}

.tes-btn:hover {
	background: var(--tes-orange-dark);
	transform: translateY(-2px);
	box-shadow: 0 16px 30px -12px rgba(201, 147, 43, .85);
	color: #fff;
}

.tes-arrow {
	width: 46px;
	height: 46px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	border: 1px solid var(--tes-line);
	background: #fff;
	color: var(--tes-ink);
	cursor: pointer;
	transition: transform .2s var(--tes-ease), background .2s var(--tes-ease), color .2s var(--tes-ease), opacity .2s;
}

.tes-arrow svg { width: 20px; height: 20px; }

.tes-arrow:hover { background: var(--tes-orange); color: #fff; border-color: transparent; transform: translateY(-2px); }

.tes-arrow:disabled {
	opacity: .3;
	cursor: default;
	transform: none;
	background: #fff;
	color: var(--tes-ink);
	border-color: var(--tes-line);
}

/* ============================================================
   Hero / slideshow
   ============================================================ */
.tes-hero {
	position: relative;
	overflow: hidden;
	background: #14120f;
	color: #fff;
	outline: none;
}

.tes-hero:focus-visible { box-shadow: inset 0 0 0 3px rgba(201, 147, 43, .8); }

.tes-hero__viewport {
	position: relative;
	height: clamp(360px, 72vh, 640px);
}

.tes-hero__track { position: absolute; inset: 0; touch-action: pan-y; }

.tes-hero__slide {
	position: absolute;
	inset: 0;
	opacity: 0;
	visibility: hidden;
	transform: scale(1.06);
	transition: opacity .9s var(--tes-ease), transform 1.2s var(--tes-ease), visibility .9s;
	will-change: opacity, transform;
}

.tes-hero__slide.is-active { opacity: 1; visibility: visible; transform: scale(1); z-index: 1; }

.tes-hero__img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.tes-hero__slide::after {
	content: "";
	position: absolute;
	inset: 0;
	background:
		linear-gradient(90deg, rgba(0, 0, 0, .55) 0%, rgba(0, 0, 0, .30) 45%, rgba(0, 0, 0, .06) 100%),
		linear-gradient(0deg, rgba(0, 0, 0, .30) 0%, rgba(0, 0, 0, 0) 45%);
}

.tes-hero__content {
	position: absolute;
	z-index: 2;
	left: 6%;
	right: 6%;
	bottom: 0;
	padding-bottom: 96px;
	max-width: 760px;
}

.tes-hero__content h2 {
	font-size: clamp(28px, 4.4vw, 54px);
	font-weight: 800;
	line-height: 1.04;
	letter-spacing: -.5px;
	color: #fff;
	text-shadow: 0 10px 34px rgba(0, 0, 0, .55);
}

.tes-hero__content p {
	margin: 14px 0 26px;
	font-size: clamp(15px, 1.6vw, 21px);
	line-height: 1.5;
	max-width: 600px;
	color: #f0ece7;
	text-shadow: 0 6px 24px rgba(0, 0, 0, .55);
}

/* entrada escalonada del texto */
.tes-hero__slide .tes-hero__content > * {
	opacity: 0;
	transform: translateY(24px);
	transition: opacity .7s var(--tes-ease), transform .7s var(--tes-ease);
}

.tes-hero__slide.is-active .tes-hero__content > * { opacity: 1; transform: none; }
.tes-hero__slide.is-active .tes-hero__content > *:nth-child(2) { transition-delay: .12s; }
.tes-hero__slide.is-active .tes-hero__content > *:nth-child(3) { transition-delay: .24s; }

/* flechas laterales */
.tes-hero__nav {
	position: absolute;
	z-index: 5;
	top: 50%;
	transform: translateY(-50%);
	width: 52px;
	height: 52px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	border: 1px solid rgba(255, 255, 255, .38);
	background: rgba(0, 0, 0, .28);
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
	color: #fff;
	cursor: pointer;
	transition: background .25s var(--tes-ease), border-color .25s var(--tes-ease), transform .25s var(--tes-ease);
}

.tes-hero__nav svg { width: 22px; height: 22px; }
.tes-hero__nav:hover { background: var(--tes-orange); border-color: transparent; }
.tes-hero__nav--prev { left: max(14px, 2%); }
.tes-hero__nav--next { right: max(14px, 2%); }

/* puntos */
.tes-hero__dots {
	position: absolute;
	z-index: 5;
	left: 6%;
	bottom: 42px;
	display: flex;
	gap: 10px;
}

.tes-hero__dot {
	width: 34px;
	height: 4px;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: rgba(255, 255, 255, .42);
	cursor: pointer;
	transition: background .3s var(--tes-ease), width .3s var(--tes-ease);
}

.tes-hero__dot:hover { background: rgba(255, 255, 255, .72); }
.tes-hero__dot.is-active { background: #fff; width: 54px; }

/* barra de progreso */
.tes-hero__progress {
	position: absolute;
	z-index: 5;
	left: 0;
	right: 0;
	bottom: 0;
	height: 3px;
	background: rgba(255, 255, 255, .16);
}

.tes-hero__progress span {
	display: block;
	height: 100%;
	width: 0;
	background: linear-gradient(90deg, var(--tes-orange), var(--tes-orange-2));
}

/* ============================================================
   Carrusel de unidades
   ============================================================ */
main.tes-cars-wrap { margin: 0; }

.tes-cars {
	position: relative;
	margin: 90px 0;
}

.tes-cars__head {
	max-width: 780px;
	margin: 0 auto 34px;
	padding: 0 20px;
	text-align: center;
}

.tes-cars__eyebrow {
	display: inline-block;
	margin-bottom: 12px;
	font-size: 12px;
	font-weight: 800;
	letter-spacing: .18em;
	text-transform: uppercase;
	color: var(--tes-orange-2);
}

.tes-cars__head h2 {
	font-size: clamp(26px, 3.4vw, 42px);
	font-weight: 800;
	letter-spacing: -.4px;
	color: var(--tes-ink);
	line-height: 1.1;
}

.tes-cars__head p {
	margin-top: 12px;
	font-size: 17px;
	line-height: 1.5;
	color: var(--tes-ink);
}

.tes-cars__viewport {
	width: min(100% - 32px, var(--tes-ancho));
	margin: 0 auto;
}

.tes-cars__track {
	display: flex;
	gap: 24px;
	padding: 8px 6px 40px;
	overflow-x: auto;
	overflow-y: hidden;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	scrollbar-width: none;
	-ms-overflow-style: none;
	-webkit-overflow-scrolling: touch;
	outline: none;
}

.tes-cars__track::-webkit-scrollbar { display: none; }
.tes-cars__track:focus-visible { box-shadow: 0 0 0 3px rgba(201, 147, 43, .45); border-radius: var(--tes-radius); }
.tes-cars__track.is-dragging { scroll-snap-type: none; cursor: grabbing; }

.tes-cars__track > * {
	flex: 0 0 calc(50% - 12px);
	min-width: 0;
	scroll-snap-align: start;
}

/* Tarjeta */
.tes-car { display: flex; }

.tes-car__link {
	display: block;
	width: 100%;
	border-radius: var(--tes-radius);
	overflow: hidden;
	background: #fff;
	text-decoration: none;
	color: inherit;
	box-shadow: var(--tes-shadow-sm);
	transition: transform .35s var(--tes-ease), box-shadow .35s var(--tes-ease);
}

.tes-car__link:hover,
.tes-car__link:focus-visible { transform: translateY(-6px); box-shadow: var(--tes-shadow); outline: none; }

.tes-car__media {
	position: relative;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	background: #e9e5df;
}

.tes-car__media img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform .9s var(--tes-ease);
}

.tes-car__link:hover .tes-car__media img,
.tes-car__link:focus-visible .tes-car__media img { transform: scale(1.07); }

.tes-car__media::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgba(0, 0, 0, 0) 38%, rgba(0, 0, 0, .72) 100%);
}

.tes-car__badge,
.tes-car__count {
	position: absolute;
	z-index: 2;
	top: 16px;
	font-size: 12.5px;
	font-weight: 800;
	line-height: 1;
	padding: 8px 13px;
	border-radius: 999px;
}

.tes-car__badge { left: 16px; background: rgba(255, 255, 255, .94); color: var(--tes-ink); }
.tes-car__count { right: 16px; background: rgba(0, 0, 0, .5); color: #fff; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }

.tes-car__body {
	position: absolute;
	z-index: 2;
	left: 0;
	right: 0;
	bottom: 0;
	padding: 24px 24px 22px;
	color: #fff;
}

.tes-car__body h3 {
	font-size: clamp(20px, 2vw, 26px);
	font-weight: 800;
	line-height: 1.15;
	letter-spacing: -.2px;
	color: #fff;
}

.tes-car__desc {
	margin-top: 6px;
	font-size: 15px;
	line-height: 1.45;
	color: rgba(255, 255, 255, .86);
}

.tes-car__cta {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin-top: 12px;
	font-size: 14px;
	font-weight: 700;
	color: #fff;
}

.tes-car__cta svg { width: 16px; height: 16px; transition: transform .3s var(--tes-ease); }
.tes-car__link:hover .tes-car__cta svg,
.tes-car__link:focus-visible .tes-car__cta svg { transform: translateX(4px); }

/* Controles del carrusel */
.tes-cars__controls {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 18px;
	margin-top: 4px;
}

.tes-cars__dots { display: flex; align-items: center; gap: 9px; }

.tes-cars__dot {
	width: 10px;
	height: 10px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: #d9d3c9;
	cursor: pointer;
	transition: background .25s var(--tes-ease), transform .25s var(--tes-ease);
}

.tes-cars__dot:hover { background: #bfb7aa; }
.tes-cars__dot.is-active { background: var(--tes-orange); transform: scale(1.3); }

/* Sin desplazamiento: se ocultan los controles */
.tes-cars.is-static .tes-cars__controls { display: none; }

/* ============================================================
   Revelado al hacer scroll
   ============================================================ */
[data-reveal] {
	opacity: 0;
	transform: translateY(28px);
	transition: opacity .75s var(--tes-ease), transform .75s var(--tes-ease);
}

[data-reveal].is-in { opacity: 1; transform: none; }

/* ============================================================
   Responsive
   ============================================================ */
@media screen and (max-width: 1150px) {
	.tes-hero__content { left: 5%; right: 5%; }
	.tes-hero__dots { left: 5%; }
}

@media screen and (max-width: 900px) {
	.tes-cars { margin: 70px 0; }
	.tes-cars__track > * { flex: 0 0 78%; }
}

@media screen and (max-width: 850px) {
	.tes-hero__viewport { height: clamp(340px, 66vh, 520px); }
	.tes-hero__content { padding-bottom: 86px; }
	.tes-hero__nav { width: 44px; height: 44px; }
	.tes-hero__nav svg { width: 19px; height: 19px; }
}

@media screen and (max-width: 600px) {
	.tes-hero__viewport { height: 74vh; min-height: 430px; }
	.tes-hero__content { padding-bottom: 78px; }
	.tes-hero__content p { margin: 12px 0 20px; }
	.tes-hero__dots { bottom: 34px; gap: 8px; }
	.tes-hero__dot { width: 26px; }
	.tes-hero__dot.is-active { width: 40px; }
	.tes-hero__nav { display: none; }

	.tes-cars { margin: 56px 0; }
	.tes-cars__track > * { flex: 0 0 88%; }
	.tes-car__body { padding: 20px 18px 18px; }
}

/* Accesibilidad: respeta la preferencia de menos movimiento */
@media (prefers-reduced-motion: reduce) {
	.tes-hero__slide,
	.tes-hero__slide .tes-hero__content > *,
	.tes-car__link,
	.tes-car__media img,
	[data-reveal] {
		transition: none !important;
	}

	.tes-cars__track { scroll-behavior: auto; }
	.tes-hero__slide { transform: none; }
	[data-reveal] { opacity: 1; transform: none; }
}
