:root {
  --primary-color: #6E12C0;
  --line-color: #cbd5e1;
  --card-bg: #ffffff;
  --gap-size: 40px;
  /* Espacio horizontal entre items */
  --card-width: 240px;
  /* Ancho de la tarjeta */
  --card-height: 473px;
  /* Altura fija de la imagen */
  --track-height: 1100px;
  /* Altura total del área de timeline */
}

/* --- Estructura Principal --- */
.timeline-wrapper {
  position: relative;
  width: 100%;
  max-width: 1200px;
}

/* Botones de Navegación */
.nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background-color: white;
  border: 1px solid var(--line-color);
  border-radius: 50%;
  width: 48px;
  height: 48px;
  cursor: pointer;
  z-index: 20;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-color);
  font-size: 1.2rem;
  transition: transform 0.2s, background-color 0.2s;
}

.nav-btn:hover {
  background-color: var(--primary-color);
  color: white;
  transform: translateY(-50%) scale(1.1);
}

.nav-btn.prev {
  left: -25px;
}

.nav-btn.next {
  right: -25px;
}

/* Contenedor con Scroll */
.timeline-container {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  height: var(--track-height);
  display: flex;
  align-items: center;
  /* Ocultar barra de scroll */
  scrollbar-width: none;
  -ms-overflow-style: none;
  /* padding: 0 0 80px 0; */
}

.timeline-container::-webkit-scrollbar {
  display: none;
}

.timeline-track {
  display: flex;
  gap: var(--gap-size);
  position: relative;
  height: 100%;
  padding: 0 60px;
  /* Padding lateral para que el primero no se pegue */
  width: max-content;
}

/* --- LÍNEA CENTRAL (EJE) --- */
/* .timeline-track::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 4px;
  background-color: var(--line-color);
  transform: translateY(-50%);
  z-index: 0;
  border-radius: 2px;
} */

.timeline-track::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;

  /* Mantienes la altura */
  height: 4px;

  /* Usas un degradado en lugar de color plano */
  background-image: linear-gradient(to right,
      var(--line-color) 50%,
      transparent 50%);

  /* Esto define el patrón: 20px de ancho total (10px línea, 10px espacio) */
  background-size: 20px 100%;
  background-repeat: repeat-x;

  transform: translateY(-50%);
  z-index: 0;
}

/* --- ITEM INDIVIDUAL --- */
.timeline-item {
  flex: 0 0 auto;
  width: var(--card-width);
  height: 100%;
  /* Ocupa los 450px completos */
  position: relative;
  display: flex;
  flex-direction: column;
  transition: opacity 0.3s ease;
  margin: 0 -40px;
}

/* --- LÓGICA ZIG-ZAG (Desktop) --- */

/* 1. IMPARES (Arriba) */
.timeline-item.odd {
  justify-content: flex-start;
  /* Pega la tarjeta al techo */
}

/* Línea vertical conectora IMPAR */
/* .timeline-item:nth-child(odd)::after {
  content: "";
  position: absolute;
  width: 2px;
  background-color: var(--line-color);
  left: 50%;
  transform: translateX(-50%);
  z-index: 0;
  top: var(--card-height);
  bottom: 50%;
} */

.timeline-item.odd::after {
  content: "";
  position: absolute;
  /* 1. Cambiamos width a 0 para que el borde sea la línea */
  width: 0;

  /* 2. Reemplazamos background por border-left */
  border-left: 4px dashed var(--line-color);

  left: 50%;
  transform: translateX(-50%);
  z-index: 0;
  top: var(--card-height);
  bottom: 50%;
}

/* 2. PARES (Abajo) */
.timeline-item.even {
  justify-content: flex-end;
  /* Pega la tarjeta al suelo */
}

/* Línea vertical conectora PAR */
.timeline-item.even::after {
  content: "";
  position: absolute;
  width: 2px;
  /* background-color: var(--line-color);
   */
  /* 2. Reemplazamos background por border-left */
  border-left: 4px dashed var(--line-color);
  left: 50%;
  transform: translateX(-50%);
  z-index: 0;
  /* Geometría exacta */
  top: 50%;
  /* Empieza en la línea central */
  bottom: var(--card-height);
  /* Termina justo encima de la imagen */
}

/* --- TARJETA (IMAGEN) --- */
.timeline-card p {
  background: #fff;
  border-radius: 12px;
  margin-bottom: 12px;
  margin-top: 0px;
  text-align: center;
  /* padding: 0 12px; */
  height: 68px;
  display: flex;
  flex-direction: column;
  align-content: center;
  justify-content: center;
}

.timeline-item.even .timeline-card p {
  margin-top: 12px;
  margin-bottom: 0px;
}

.timeline-card .video-card {
  background: #fff;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  border: 3px solid #fff;
  border-radius: 12px;
  height: 100%;
  padding: 12px;
}

.timeline-card {
  width: 100%;
  height: var(--card-height);
  overflow: hidden;
  position: relative;
  z-index: 2;
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
}

.timeline-item.even .timeline-card {
  justify-content: flex-end;
  flex-direction: column-reverse;
}

.timeline-card:hover {
  /* transform: scale(1.05); */
  border-color: var(--primary-color);
  /* box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2); */
}

.card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* --- PUNTO CENTRAL --- */
.timeline-marker {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 46px;
  height: 46px;
  /* background-color: var(--primary-color); */
  /* border: 3px solid #fff; */
  border-radius: 50%;
  /* box-shadow: 0 0 0 2px var(--primary-color); */
  z-index: 5;
  background-image: url("https://copernicowms.co/wp-content/uploads/2026/01/tiny-logo.webp");
  background-size: contain;
}

/* --- FASES SELECTOR --- */
.fases-selector {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  margin-bottom: 20px;
  padding: 16px;
  background: white;
  border-radius: 90px;
  margin-bottom: 80px;
  transition: all 0.3s ease;
}

.fases-selector p {
  font-size: 1.2rem;
  font-weight: bold;
  color: var(--primary-color);
}

.fases-selector .fase {
  display: none;
  margin: 0 20px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.fases-selector .fase.active {
  display: flex;
  flex-direction: row;
  gap: 10px;
  justify-content: center;
  align-items: center;
  opacity: 1;
  animation: fadeInPhase 0.3s ease;
}

@keyframes fadeInPhase {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fases-selector .fase.active .numero-fase {
  color: var(--primary-color);
  padding: 10px 20px;
  border-radius: 90px;
  border: 2px solid var(--primary-color);
  margin: 0;
  transition: all 0.3s ease;
}

.fases-selector .fase.active .nombre-fase {
  color: var(--primary-color);
  padding: 0 10px;
  margin: 0;
  transition: all 0.3s ease;
}

.fases-selector .arrow-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-left: auto;
}

.btn-previous,
.btn-next {
  width: 40px;
  height: 40px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: all 0.3s ease;
  margin: 0 10px;
}

.btn-previous:hover,
.btn-next:hover {
  transform: scale(1.1);
  opacity: 0.8;
}



/* --- RESPONSIVIDAD (MÓVIL) --- */
@media (max-width: 768px) {
  .nav-btn {
    display: none;
  }

  .timeline-container {
    height: auto;
    /* Altura automática */
    display: block;
    /* Bloque normal, no flex container global */
    overflow: visible;
  }

  .timeline-track {
    flex-direction: column;
    /* Vertical */
    height: auto;
    width: 100%;
    padding: 20px 0 20px 30px;
    /* Espacio izq para la línea */
    gap: 30px;
  }

  .timeline-item.even .timeline-card p {
    margin-top: 0;
    margin-bottom: 12px;
  }

  .timeline-item.even .timeline-card {
    /* justify-content: flex-end; */
    flex-direction: column;
  }

  /* La línea se vuelve vertical a la izquierda */
  /* .timeline-track::before {
    top: 0;
    bottom: 0;
    left: 6px;
    right: auto;
    width: 4px;
    height: 100%;
    transform: none;
  } */

  .timeline-track::before {
    top: 0;
    bottom: 0;
    left: 6px;
    right: auto;
    width: 4px;
    /* Aquí sí mantenemos el ancho */
    height: 100%;

    /* Creamos el patrón de arriba hacia abajo */
    background-image: linear-gradient(to bottom,
        var(--line-color) 50%,
        transparent 50%);

    /* Controlamos el tamaño: 100% de ancho y 20px de alto por cada segmento */
    background-size: 100% 20px;
    background-repeat: repeat-y;

    transform: none;
  }

  .timeline-item {
    width: 100%;
    height: auto;
    flex-direction: row;
    /* Lado a lado */
    justify-content: flex-start !important;
    /* Resetear justificación */
    align-items: center;
    padding-left: 20px;
    /* Espacio para separar de la línea vertical */
    margin: 0px;
  }

  /* Quitar conectores verticales de desktop */
  .timeline-item.odd::after,
  .timeline-item.even::after {
    display: none;
  }

  /* Nuevo conector horizontal pequeño para móvil */
  /* .timeline-item::before {
    content: "";
    position: absolute;
    left: -7px;
    top: 50%;
    width: 30px;
    height: 4px;
    background-color: var(--line-color);
    transform: translateY(-50%);
  } */

  .timeline-item::before {
    content: "";
    position: absolute;
    left: -7px;
    top: 50%;
    width: 30px;

    /* 1. Altura a 0 */
    height: 0;

    /* 2. Reemplazamos background por border-top */
    /* El grosor de 4px que tenías ahora va en el border */
    border-top: 4px dashed var(--line-color);

    transform: translateY(-50%);
  }

  .timeline-marker {
    left: -21px;
    /* Pegado a la línea vertical */
    top: 50%;
    transform: translate(-50%, -50%);
    width: 28px;
    height: 28px;
  }

  .timeline-card {
    /* height: 160px; */
    /* Un poco más alto en móvil */
    /* Reset margins que pudiera tener */
    margin: 0 !important;
  }

  .fases-selector .fase.active {
    flex-direction: column;
    align-items: flex-start;
  }
}