/* ==========================================================
   Hitos Timeline para Elementor
   ========================================================== */

.ht-timeline {
	--ht-color: #0a3ea8;
	--ht-pin-bg: #ffffff;
	--ht-line: 2px;
	--ht-connector: 45px;
	--ht-visible: 4;
	--ht-arrow: var(--ht-color);
	--ht-node: 38px;

	position: relative;
	width: 100%;
}

/* ---------- Slider ---------- */
.ht-track {
	display: flex;
	align-items: stretch;
	overflow-x: auto;
	overflow-y: hidden;
	scroll-snap-type: x mandatory;
	overscroll-behavior-x: contain;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
}

.ht-track::-webkit-scrollbar {
	display: none;
}

.ht-has-overflow .ht-track {
	cursor: grab;
}

.ht-dragging .ht-track {
	cursor: grabbing;
	scroll-snap-type: none;
	user-select: none;
}

.ht-nav {
	display: none;
	justify-content: center;
	gap: 12px;
	margin-top: 16px;
}

.ht-has-overflow .ht-nav {
	display: flex;
}

.ht-arrow {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	padding: 0;
	border: 2px solid var(--ht-arrow);
	border-radius: 50%;
	background: transparent;
	color: var(--ht-arrow);
	cursor: pointer;
	transition: background-color .2s, color .2s, opacity .2s;
}

.ht-arrow svg {
	width: var(--ht-arrow-size, 18px);
	height: var(--ht-arrow-size, 18px);
	fill: none;
	stroke: currentColor;
	stroke-width: 2.5;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.ht-arrow:hover:not(:disabled),
.ht-arrow:focus-visible {
	background: var(--ht-arrow);
	color: var(--ht-pin-bg);
}

.ht-arrow:disabled {
	opacity: .35;
	cursor: default;
}

/* ---------- Hito (escritorio: horizontal) ---------- */
.ht-item {
	position: relative;
	flex: 1 0 calc(100% / var(--ht-visible));
	box-sizing: border-box;
	scroll-snap-align: start;
	display: grid;
	grid-template-rows: 1fr auto 1fr;
	justify-items: center;
	text-align: center;
	padding: 0 8px;
}

/* Línea horizontal principal */
.ht-item::before {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	top: 50%;
	height: var(--ht-line);
	background: var(--ht-color);
	transform: translateY(-50%);
	z-index: 0;
}

/* La línea comienza en el primer hito */
.ht-item:first-child::before {
	left: 50%;
}

.ht-half {
	display: flex;
	align-items: center;
	width: 100%;
}

/* El DOM va desde el nodo hacia afuera */
.ht-half--top {
	flex-direction: column-reverse;
	justify-content: flex-start;
}

.ht-half--bottom {
	flex-direction: column;
	justify-content: flex-start;
}

/* Línea punteada vertical */
.ht-connector {
	flex: 0 0 auto;
	width: 0;
	height: var(--ht-connector);
	border-left: 3px dashed var(--ht-color);
}

/* Año */
.ht-year {
	color: var(--ht-color);
	font-size: 22px;
	font-weight: 700;
	line-height: 1.2;
	padding: 6px 0;
}

/* Círculo pequeño (pin) */
.ht-pin {
	flex: 0 0 auto;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	border: 4px solid var(--ht-color);
	background: var(--ht-pin-bg);
	box-sizing: border-box;
}

/* Texto */
.ht-content {
	color: #555;
	font-size: 13px;
	line-height: 1.35;
	padding: 8px 0;
	max-width: 180px;
}

/* Nodo sobre la línea */
.ht-node {
	position: relative;
	z-index: 1;
	width: var(--ht-node);
	height: var(--ht-node);
	border-radius: 50%;
	border: 1px dashed var(--ht-color);
	background: var(--ht-pin-bg);
	display: flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
}

.ht-node span {
	width: 24px;
	height: 24px;
	border-radius: 50%;
	border: 1.5px solid var(--ht-color);
	display: flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
}

.ht-node span::after {
	content: "";
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background: var(--ht-color);
}

/* ---------- Móvil: vertical ---------- */
@media (max-width: 767px) {
	.ht-mobile-vertical .ht-track {
		flex-direction: column;
		overflow: visible;
		scroll-snap-type: none;
	}

	.ht-mobile-vertical .ht-nav {
		display: none;
	}

	.ht-mobile-vertical .ht-item {
		flex: none;
		grid-template-columns: var(--ht-node) 1fr;
		grid-template-rows: auto auto;
		column-gap: 16px;
		justify-items: start;
		align-items: start;
		text-align: left;
		padding: 0 0 24px;
	}

	.ht-mobile-vertical .ht-item::before {
		left: calc(var(--ht-node) / 2);
		right: auto;
		top: 0;
		bottom: 0;
		width: var(--ht-line);
		height: auto;
		transform: translateX(-50%);
	}

	.ht-mobile-vertical .ht-item:first-child::before {
		left: calc(var(--ht-node) / 2);
		top: calc(var(--ht-node) / 2);
	}

	.ht-mobile-vertical .ht-node {
		grid-column: 1;
		grid-row: 1 / span 2;
	}

	.ht-mobile-vertical .ht-half {
		grid-column: 2;
		display: block;
	}

	.ht-mobile-vertical .ht-item--year-top .ht-half--top,
	.ht-mobile-vertical .ht-item--year-bottom .ht-half--bottom {
		grid-row: 1;
	}

	.ht-mobile-vertical .ht-item--year-top .ht-half--bottom,
	.ht-mobile-vertical .ht-item--year-bottom .ht-half--top {
		grid-row: 2;
	}

	.ht-mobile-vertical .ht-connector,
	.ht-mobile-vertical .ht-pin {
		display: none;
	}

	.ht-mobile-vertical .ht-year {
		padding: 4px 0 0;
	}

	.ht-mobile-vertical .ht-content {
		max-width: none;
		padding: 4px 0 0;
	}
}

/* ==========================================================
   Plantilla: Tarjetas
   ========================================================== */

.ht-template-cards {
	--ht-arrow: #ffffff;
	--ht-gap: 30px;
	--ht-fade: 120px;
	--ht-visible: 2.4;
}

.ht-template-cards .ht-slider {
	display: flex;
	align-items: center;
	gap: 16px;
}

.ht-template-cards .ht-track {
	flex: 1 1 auto;
	min-width: 0;
	gap: var(--ht-gap);
}

/* Modo centrado: espaciadores para que la primera y la última tarjeta queden al centro */
.ht-template-cards.ht-center .ht-track::before,
.ht-template-cards.ht-center .ht-track::after {
	content: "";
	flex: 0 0 max(0px, calc((100% - (100% - var(--ht-gap) * (var(--ht-visible) - 1)) / var(--ht-visible)) / 2 - var(--ht-gap)));
}

.ht-template-cards.ht-center .ht-card {
	scroll-snap-align: center;
}

/* Desvanecido en ambos bordes */
.ht-template-cards.ht-fade.ht-has-overflow .ht-track {
	-webkit-mask-image: linear-gradient(to right, transparent 0, #000 var(--ht-fade), #000 calc(100% - var(--ht-fade)), transparent 100%);
	mask-image: linear-gradient(to right, transparent 0, #000 var(--ht-fade), #000 calc(100% - var(--ht-fade)), transparent 100%);
}

.ht-card {
	flex: 0 0 calc((100% - var(--ht-gap) * (var(--ht-visible) - 1)) / var(--ht-visible));
	box-sizing: border-box;
	scroll-snap-align: start;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	padding: 32px 28px;
	border: 1px solid rgba(255, 255, 255, .75);
	border-radius: 26px;
	background: transparent;
}

.ht-template-cards .ht-year {
	color: #ffffff;
	font-size: 22px;
	font-weight: 700;
	padding: 0;
}

.ht-divider {
	display: block;
	width: 26px;
	height: 3px;
	margin: 10px auto 22px;
	border-radius: 2px;
	background: #f4b400;
}

.ht-template-cards .ht-content {
	color: #ffffff;
	font-size: 13px;
	max-width: none;
	padding: 0;
}

/* Flechas laterales sin círculo */
.ht-template-cards .ht-arrow {
	flex: 0 0 auto;
	width: auto;
	height: auto;
	padding: 8px;
	border: 0;
	border-radius: 0;
	visibility: hidden;
}

.ht-template-cards .ht-arrow svg {
	width: var(--ht-arrow-size, 22px);
	height: var(--ht-arrow-size, 22px);
}

.ht-template-cards.ht-has-overflow .ht-arrow {
	visibility: visible;
}

.ht-template-cards .ht-arrow:hover:not(:disabled),
.ht-template-cards .ht-arrow:focus-visible {
	background: transparent;
	color: var(--ht-arrow);
	opacity: .7;
}

.ht-template-cards .ht-arrow:disabled {
	opacity: .3;
}

@media (max-width: 767px) {
	.ht-template-cards .ht-slider {
		gap: 4px;
	}

	.ht-template-cards .ht-arrow {
		padding: 4px;
	}
}
