/* ============================================
   CGIC — Proyectos Grid Vertical
   ============================================ */

/* ---------- Section ---------- */
.sliders-section {
  background: var(--color-bg);
  padding: var(--space-xl) 0 var(--space-2xl);
}

/* ---------- Eje Block ---------- */
.eje-block {
  padding: var(--space-xl) 0;
  /* Espacio generoso de separación */
}

/* ---------- Eje Header ---------- */
.eje-block__header {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: var(--space-lg);
}

.eje-block__info {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.eje-block__icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--color-orange);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(234, 88, 48, 0.25);
}

.eje-block__icon svg {
  width: 22px;
  height: 22px;
}

.eje-block__title {
  font-family: var(--font-heading);
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  color: var(--color-title);
  letter-spacing: 0.04em;
  line-height: 1.1;
}

.eje-block__desc {
  font-size: 1.05rem;
  color: var(--color-text);
  opacity: 0.8;
  max-width: 600px;
  margin-top: 0.2rem;
  margin-left: calc(48px + var(--space-sm)); /* Align with text */
}

/* ---------- Eje Divider ---------- */
.eje-divider {
  border: none;
  height: 1px;
  background: var(--color-bg-sub);
  max-width: 1200px;
  margin: 0 auto;
}

/* ---------- Timeline de Proyectos ---------- */
.timeline-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: var(--space-xl);
  position: relative;
  padding: var(--space-2xl) var(--space-md) var(--space-lg);
  
  /* Truco para extender el contenedor hasta el borde derecho de la pantalla */
  margin-right: calc(-50vw + 50%);
  padding-right: calc(50vw - 50% + var(--space-xl));
  
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none; /* Hide scrollbar for cleaner look */
  -ms-overflow-style: none;
}
.timeline-row::-webkit-scrollbar {
  display: none;
}

.timeline-track {
  position: absolute;
  top: calc(50% + 10px); /* Ajustado por el padding desigual */
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(to right, var(--color-orange), #0a0e1a);
  transform: translateY(-50%);
  z-index: 0;
  border-radius: 2px;
  opacity: 0.4;
}

.timeline-card {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
  min-width: 340px;
  max-width: 400px;
  height: 280px;
  box-shadow: var(--shadow-md);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.4s ease;
  flex-shrink: 0;
  cursor: pointer;
  overflow: hidden; /* Ensure hover text doesn't overflow */
}

.timeline-card.bg-orange {
  background: var(--color-orange);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.timeline-card.bg-blue {
  background: #0a0e1a;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.timeline-card__info {
  display: none;
}

.timeline-card__title {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  line-height: 1.1;
  margin-bottom: 0.4rem;
  letter-spacing: 0.03em;
}

.timeline-card.bg-blue:hover .timeline-card__title {
  color: var(--color-orange);
}

.timeline-card__desc {
  font-family: var(--font-body);
  font-size: 0.95rem;
  line-height: 1.5;
  opacity: 0.9;
}



.timeline-card__status {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--color-white);
  padding: 0.3rem 1.2rem;
  border-radius: var(--radius-full);
  box-shadow: 0 4px 12px rgba(4, 9, 24, 0.15);
  white-space: nowrap;
}

.timeline-card.bg-orange .timeline-card__status {
  color: var(--color-orange);
}

.timeline-card.bg-blue .timeline-card__status {
  color: #0a0e1a;
}

.timeline-card__status .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.timeline-card.bg-orange .timeline-card__status .dot {
  background: var(--color-orange);
}
.timeline-card.bg-blue .timeline-card__status .dot {
  background: #0a0e1a;
}

.timeline-card__status .vivo-dot {
  animation: badgeDotPulse 1.5s ease-in-out infinite;
}

.timeline-card__img {
  max-height: 210px;
  max-width: 100%;
  object-fit: contain;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  z-index: 3;
}

.timeline-card__img--accion-sur {
  max-height: 235px;
}

.timeline-card:hover {
  transform: translateY(-8px) scale(1.03);
  box-shadow: 0 16px 40px rgba(4, 9, 24, 0.2);
  z-index: 12;
}

.timeline-card:hover .timeline-card__img {
  transform: scale(1.1);
}

/* ============================================
   PROJECT MODAL
   ============================================ */
.project-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(4, 9, 24, 0.85);
  backdrop-filter: blur(5px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.project-modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}
.project-modal {
  background: var(--color-bg);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 800px;
  max-height: 90vh;
  overflow-y: auto;
  padding: var(--space-xl);
  position: relative;
  transform: translateY(30px);
  transition: transform 0.3s ease;
  box-shadow: 0 20px 40px rgba(0,0,0,0.5);
}
.project-modal-overlay.active .project-modal {
  transform: translateY(0);
}
.project-modal__close {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(19, 33, 67, 0.2);
  color: var(--color-title);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 14px rgba(4, 9, 24, 0.18);
  z-index: 2;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
.project-modal__close:hover {
  background: var(--color-orange);
  color: var(--color-white);
  transform: scale(1.06);
}
.project-modal__close:focus-visible {
  outline: 2px solid var(--color-orange);
  outline-offset: 2px;
}
.project-modal__content {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}
.project-modal__title {
  font-family: var(--font-heading);
  font-size: 2rem;
  color: var(--color-orange);
  margin-bottom: var(--space-sm);
}
.project-modal__desc {
  font-size: 1.1rem;
  color: var(--color-text);
  line-height: 1.6;
}
.project-modal__images {
  display: flex;
  gap: var(--space-md);
  position: relative;
  min-height: 250px;
}
.project-modal__images img {
  width: calc(50% - (var(--space-md) / 2));
  height: 250px;
  object-fit: cover;
  border-radius: var(--radius-md);
  cursor: zoom-in;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.project-modal__images img:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(0,0,0,0.25);
}

.project-modal__images.is-loading::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 34px;
  height: 34px;
  margin-top: -17px;
  margin-left: -17px;
  border-radius: 50%;
  border: 3px solid rgba(234, 88, 48, 0.2);
  border-top-color: var(--color-orange);
  animation: modalSpin 0.8s linear infinite;
}

@keyframes modalSpin {
  to { transform: rotate(360deg); }
}

@media (max-width: 768px) {
  .project-modal__images {
    flex-direction: column;
    min-height: 0;
  }
  .project-modal__images img {
    width: 100%;
    height: auto;
  }
}

/* ---------- Scroll Animations ---------- */
.eje-anim {
  opacity: 0;
  transform: translateY(24px);
  will-change: opacity, transform;
}

/* Clases agregadas por JS */
.eje-anim-visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 500ms ease-out, transform 500ms ease-out;
}

/* ============================================
   RESPONSIVE
   ============================================ */



@media (max-width: 992px) {
  .eje-block__desc {
    margin-left: 0;
  }
}

@media (max-width: 768px) {
  .timeline-row {
    gap: var(--space-lg);
    padding: var(--space-xl) var(--space-md) var(--space-md);
    margin-right: 0;
    padding-right: var(--space-md);
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }
  
  .timeline-card {
    min-width: 300px;
    height: 240px;
    padding: var(--space-md);
    scroll-snap-align: start;
  }
  
  .timeline-card__img {
    max-height: 180px;
  }
  
  .eje-block {
    padding: var(--space-lg) 0;
  }
}

@media (max-width: 480px) {
  .timeline-row {
    gap: var(--space-sm);
    padding: var(--space-lg) var(--space-sm) var(--space-sm);
  }

  .timeline-card {
    min-width: calc(100vw - 2.4rem);
    max-width: calc(100vw - 2.4rem);
    height: 220px;
    padding: var(--space-sm);
  }

  .timeline-card__status {
    font-size: 0.72rem;
    padding: 0.25rem 0.85rem;
  }

  .timeline-card__img {
    max-height: 160px;
  }

  .eje-block__title {
    font-size: clamp(1.45rem, 7vw, 1.9rem);
  }

  .eje-block__desc {
    font-size: 0.95rem;
  }
}

@media (max-width: 360px) {
  .timeline-card {
    min-width: calc(100vw - 1.8rem);
    max-width: calc(100vw - 1.8rem);
    height: 210px;
  }

  .timeline-card__img {
    max-height: 148px;
  }
}
