/* --- CONTENEDOR PRINCIPAL --- */
.timeline {
  position: relative;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 100px 0;
}

/* --- LÍNEA CENTRAL --- */
.timeline-line {
  position: absolute;
  top: 0;
  left: 50%;
  width: 2px;
  height: 100%;
  background: rgba(255, 165, 0, 0.2);
  transform: translateX(-50%);
  z-index: 1;
}

.timeline-progress {
  position: absolute;
  top: 0;
  left: 50%;
  width: 3px;
  background: orange;
  transform: translateX(-50%);
  height: 0;
  border-radius: 2px;
  transition: height 0.2s ease-out;
  z-index: 2;
}

/* --- ITEMS --- */
.timeline-item {
  position: relative;
  width: 50%;
  padding: 40px;
  box-sizing: border-box;
  opacity: 0;
  transform: translateY(60px);
  transition: all 0.8s ease-out;
}

/* --- ALTERNANCIA --- */
.timeline-item.left {
  left: 0;
  text-align: right;
}

.timeline-item.right {
  left: 50%;
  text-align: left;
}

/* --- CAJAS DE TEXTO --- */
.timeline-box {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 15px;
  padding: 25px 30px;
  backdrop-filter: blur(6px);
  max-width: 420px;
  display: inline-block;
}

.timeline-title {
  font-size: 1.7rem;
  font-weight: 700;
  color: #fff;
  margin: 10px 0;
}

.timeline-subtitle {
  color: orange;
  font-weight: bold;
  font-size: 1rem;
}

.timeline-box p {
  color: #ddd;
  font-size: 1rem;
  line-height: 1.6;
}

.timeline-img img {
  width: 100%;
  max-width: 350px;
  border-radius: 15px;
  margin-top: 15px;
}

/* --- ANIMACIÓN DE APARICIÓN --- */
.timeline-item.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- MOSTRAR SOLO UNO A LA VEZ EN WEB --- */
@media (min-width: 769px) {
  .timeline-item {
    opacity: 0;
    pointer-events: none;
  }

  .timeline-item.visible {
    opacity: 1;
    pointer-events: auto;
  }

  .timeline-item.left {
    left: 0;
    text-align: right;
    padding-right: 8%;
  }

  .timeline-item.right {
    left: 50%;
    text-align: left;
    padding-left: 8%;
  }

  .timeline-box {
    display: inline-block;
    text-align: inherit;
    max-width: 400px;
  }

}

/* --- VERSIÓN MÓVIL --- */
@media (max-width: 768px) {
  .timeline-line,
  .timeline-progress {
    left: 10%;
  }

  .timeline-item {
    width: 100%;
    text-align: left;
    padding: 30px 20px;
    transform: translateY(40px);
  }

  .timeline-item.left,
  .timeline-item.right {
    left: 0;
    text-align: left;
    padding-left: 20%;
  }

  .timeline-box {
    max-width: 90%;
    margin: 0 auto;
  }

  .timeline-img img {
    display: block;
    margin: 15px auto 0;
    max-width: 90%;
  }
}
