/* TecnoAzar Timeline */
.ta-history-timeline{
  --ta-gold:#C9A227;
  --ta-gold-dark:#A17D10;
  --ta-title-color:#111318;
  --ta-text-color:#676767;
  --ta-line-color:#DDD7CA;
  --ta-white:#fff;
  position:relative;
  display:grid;
  grid-template-columns:repeat(var(--ta-count),minmax(0,1fr));
  width:100%;
  min-height:440px;
  margin:50px auto 20px;
}

/* La línea cruza EXACTAMENTE por el centro vertical */
.ta-history-line{
  position:absolute;
  z-index:1;
  top:50%;
  left:calc(50% / var(--ta-count));
  right:calc(50% / var(--ta-count));
  height:2px;
  background:var(--ta-line-color);
  transform:translateY(-50%);
  overflow:hidden;
}
.ta-history-line-progress{
  display:block;width:100%;height:100%;
  background:var(--ta-gold);
  transform:scaleX(0);
  transform-origin:left center;
  transition:transform 1.5s cubic-bezier(.22,.61,.36,1);
}

/* Cada columna ocupa toda la altura. Así el punto siempre cae en la línea. */
.ta-history-item{
  position:relative;
  z-index:2;
  min-width:0;
  height:100%;
  opacity:0;
  transition:opacity .65s ease,transform .65s cubic-bezier(.22,.61,.36,1);
}
.ta-history-top{transform:translateY(-24px)}
.ta-history-bottom{transform:translateY(24px)}

/* Punto: SIEMPRE centrado sobre la línea horizontal */
.ta-history-dot{
  position:absolute;
  z-index:4;
  left:50%;
  top:50%;
  width:16px;
  height:16px;
  box-sizing:border-box;
  background:var(--ta-white);
  border:3px solid var(--ta-gold);
  border-radius:50%;
  box-shadow:0 0 0 3px var(--ta-white);
  transform:translate(-50%,-50%) scale(.5);
  transition:transform .45s ease;
}

/* Texto centrado en la MISMA columna que su punto */
.ta-history-card{
  position:absolute;
  left:50%;
  width:min(210px,calc(100% - 20px));
  transform:translateX(-50%);
}
.ta-history-top .ta-history-card{bottom:calc(50% + 48px)}
.ta-history-bottom .ta-history-card{top:calc(50% + 48px)}

/* Conector: del punto hacia SU tarjeta (no invertido) */
.ta-history-connector{
  position:absolute;
  z-index:2;
  left:50%;
  width:1px;
  height:32px;
  background:var(--ta-line-color);
  transform:translateX(-50%);
}
.ta-history-top .ta-history-connector{bottom:50%;margin-bottom:8px}
.ta-history-bottom .ta-history-connector{top:50%;margin-top:8px}

.ta-history-kicker{
  display:block;margin-bottom:8px;
  color:var(--ta-gold-dark);
  font-size:12px;font-weight:700;line-height:1.3;letter-spacing:.9px;
}
.ta-history-card h3{
  margin:0 0 9px;color:var(--ta-title-color);
  font-size:19px;font-weight:700;line-height:1.25;
}
.ta-history-card p{
  margin:0;color:var(--ta-text-color);
  font-size:15px;line-height:1.55;
}

.ta-history-timeline.is-visible .ta-history-line-progress{transform:scaleX(1)}
.ta-history-timeline.is-visible .ta-history-item{
  opacity:1;transform:translateY(0);
  transition-delay:var(--ta-delay);
}
.ta-history-timeline.is-visible .ta-history-dot{
  transform:translate(-50%,-50%) scale(1);
}

/* Tablet: si hay muchos hitos, permitimos scroll horizontal sin romper alineación */
@media(max-width:1024px) and (min-width:768px){
  .ta-history-timeline{
    min-width:max(900px,calc(var(--ta-count) * 175px));
  }
  .elementor-widget-ta_timeline{overflow-x:auto}
  .ta-history-card{width:min(170px,calc(100% - 16px))}
  .ta-history-card h3{font-size:17px}
  .ta-history-card p{font-size:14px}
}

/* Móvil: timeline vertical; punto, línea y tarjeta quedan alineados por hito */
@media(max-width:767px){
  .ta-history-timeline{
    display:flex;
    flex-direction:column;
    gap:34px;
    min-height:0;
    margin-top:35px;
    padding-left:40px;
  }
  .ta-history-line{
    top:5px;bottom:5px;left:8px;right:auto;
    width:2px;height:auto;transform:none;
  }
  .ta-history-line-progress{
    width:100%;height:100%;
    transform:scaleY(0);transform-origin:center top;
  }
  .ta-history-timeline.is-visible .ta-history-line-progress{transform:scaleY(1)}
  .ta-history-item,.ta-history-top,.ta-history-bottom{
    width:100%;height:auto;transform:translateX(22px);
  }
  .ta-history-card,.ta-history-top .ta-history-card,.ta-history-bottom .ta-history-card{
    position:relative;top:auto;bottom:auto;left:auto;
    width:100%;max-width:none;transform:none;
  }
  .ta-history-connector{display:none}
  .ta-history-dot,
  .ta-history-top .ta-history-dot,
  .ta-history-bottom .ta-history-dot{
    top:7px;left:-32px;
    transform:translate(-50%,-50%) scale(.5);
  }
  .ta-history-timeline.is-visible .ta-history-dot{
    transform:translate(-50%,-50%) scale(1);
  }
  .ta-history-card h3{font-size:19px}
  .ta-history-card p{font-size:15px}
}

@media(prefers-reduced-motion:reduce){
  .ta-history-line-progress,.ta-history-item,.ta-history-dot{transition:none!important}
  .ta-history-line-progress{transform:none!important}
  .ta-history-item{opacity:1!important;transform:none!important}
  .ta-history-dot{transform:translate(-50%,-50%) scale(1)!important}
}
