/* Timeline Carousel - Diseño Stepper Horizontal v1.17 */

/* ========================================
   CONTENEDOR PRINCIPAL
   ======================================== */
.timeline-carousel-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 60px 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: transparent;
    position: relative;
}

/* ========================================
   PESTAÑAS DE CATEGORÍAS
   ======================================== */
.timeline-tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 40px;
    gap: 12px;
    flex-wrap: wrap;
}

.tab-button {
    padding: 10px 20px;
    border: 2px solid #ddd;
    background: white;
    cursor: pointer;
    border-radius: 20px;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tab-button.active,
.tab-button:hover {
    background: #444;
    color: white;
    border-color: #444;
}

/* ========================================
   STEPPER PRINCIPAL
   ======================================== */
.timeline-stepper {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 500px;
}

/* Línea horizontal principal */
.timeline-line {
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 2px;
    background: #444444;
    transform: translateY(-50%);
    z-index: 1;
}

/* ========================================
   CONTENEDOR DE STEPS
   ======================================== */
.timeline-steps {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    position: relative;
    z-index: 2;
}

/* ========================================
   STEP INDIVIDUAL
   ======================================== */
.timeline-step {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    transition: all 0.3s ease;
}

.timeline-step.filtered-out {
    display: none;
}

/* ========================================
   NODOS CIRCULARES
   ======================================== */
.timeline-node {
    position: relative;
    z-index: 3;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.timeline-node-outer {
    width: 30px;
    height: 30px;
    border: 2px solid #444444;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

/* Semicírculo inferior (cuna) - steps impares */
.timeline-step:nth-child(odd) .timeline-node-outer {
    clip-path: polygon(0% 50%, 0% 100%, 100% 100%, 100% 50%, 97% 45%, 93% 40%, 88% 35%, 82% 30%, 75% 26%, 68% 23%, 60% 20%, 52% 18%, 48% 18%, 40% 20%, 32% 23%, 25% 26%, 18% 30%, 12% 35%, 7% 40%, 3% 45%);
}

/* Semicírculo superior (puente) - steps pares */
.timeline-step:nth-child(even) .timeline-node-outer {
    clip-path: polygon(0% 50%, 0% 0%, 100% 0%, 100% 50%, 97% 55%, 93% 60%, 88% 65%, 82% 70%, 75% 74%, 68% 77%, 60% 80%, 52% 82%, 48% 82%, 40% 80%, 32% 77%, 25% 74%, 18% 70%, 12% 65%, 7% 60%, 3% 55%);
}

.timeline-node-inner {
    width: 18px;
    height: 18px;
    background: #444444;
    border-radius: 50%;
    transition: all 0.3s ease;
    /* No aplicar clip-path al inner - siempre círculo completo */
}

/* ========================================
   CONECTORES VERTICALES
   ======================================== */
.timeline-connector {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    background: #444444;
    z-index: 2;
}

/* Alternancia: abajo (impares) */
.timeline-step:nth-child(odd) .timeline-connector {
    top: 15px;
    /* height: 28px; */
    height: 56px;
}

/* Alternancia: arriba (pares) */
.timeline-step:nth-child(even) .timeline-connector {
    bottom: 15px;
    /* height: 28px; */
    height: 56px;
}

/* ========================================
   ICONOS
   ======================================== */
.timeline-icon {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 24px;
    color: #444444;
    stroke: #444444;
    stroke-width: 1.5;
    fill: none;
    z-index: 2;
}

/* Alternancia: abajo (impares) */
.timeline-step:nth-child(odd) .timeline-icon {
    top: 43px;
}

/* Alternancia: arriba (pares) */
.timeline-step:nth-child(even) .timeline-icon {
    bottom: 43px;
}

/* ========================================
   CONTENIDO DE TEXTO
   ======================================== */
.step-content {
    text-align: center;
    max-width: 200px;
}

/* Alternancia: abajo (impares) */
.timeline-step:nth-child(odd) .step-content {
    position: absolute;
    top: 75px;
}

/* Alternancia: arriba (pares) */
.timeline-step:nth-child(even) .step-content {
    position: absolute;
    bottom: 75px;
}

.step-number {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
    color: #444444;
}

.step-title {
    font-size: 15px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin: 0 0 10px 0;
    color: #1e293b;
    line-height: 1.3;
}

.step-description {
    font-size: 12px;
    line-height: 1.5;
    color: #666666;
    margin: 0;
}

/* ========================================
   MENSAJE SIN CONTENIDO
   ======================================== */
.timeline-no-content {
    text-align: center;
    padding: 40px;
    background: #f8fafc;
    border-radius: 12px;
    border: 2px dashed #cbd5e1;
}

/* ========================================
   RESPONSIVE: TABLET (768px - 1024px)
   ======================================== */
@media (max-width: 1024px) {
    .timeline-carousel-container {
        padding: 50px 15px;
        min-height: 480px;
    }
    
    .step-content {
        max-width: 160px;
    }
    
    .step-title {
        font-size: 14px;
    }
    
    .step-description {
        font-size: 11px;
    }
    
    .timeline-node-outer {
        width: 26px;
        height: 26px;
    }
    
    .timeline-node-inner {
        width: 10px;
        height: 10px;
    }
}

/* ========================================
   RESPONSIVE: MÓVIL (< 768px)
   ======================================== */
@media (max-width: 768px) {
    .timeline-carousel-container {
        padding: 40px 20px;
    }
    
    .timeline-tabs {
        gap: 8px;
        margin-bottom: 30px;
    }
    
    .tab-button {
        padding: 8px 16px;
        font-size: 12px;
    }
    
    /* Ocultar línea horizontal en móvil */
    .timeline-line {
        display: none;
    }
    
    /* Contenedor vertical */
    .timeline-stepper {
        min-height: auto;
        flex-direction: column;
        align-items: stretch;
        padding: 0;
    }
    
    .timeline-steps {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
    }
    
    /* Step vertical */
    .timeline-step {
        flex: none;
        width: 100%;
        display: flex;
        flex-direction: row;
        align-items: flex-start;
        margin-bottom: 30px;
        position: relative;
    }
    
    .timeline-step:last-child {
        margin-bottom: 0;
    }
    
    /* Columna izquierda: nodo + línea vertical */
    .timeline-step::before {
        content: '';
        position: absolute;
        left: 15px;
        top: 30px;
        bottom: -30px;
        width: 2px;
        background: #444444;
        z-index: 1;
    }
    
    .timeline-step:last-child::before {
        display: none;
    }
    
    /* Nodo circular a la izquierda */
    .timeline-node {
        position: relative;
        flex-shrink: 0;
        z-index: 2;
        margin-right: 20px;
    }
    
    .timeline-node-outer {
        width: 30px;
        height: 30px;
        clip-path: none !important;
    }
    
    .timeline-node-inner {
        width: 12px;
        height: 12px;
    }
    
    /* Contenido a la derecha */
    .step-content {
        position: static !important;
        text-align: left;
        max-width: none;
        flex: 1;
        padding-top: 5px;
    }
    
    .step-number {
        font-size: 13px;
        margin-bottom: 6px;
    }
    
    .step-title {
        font-size: 16px;
        margin-bottom: 8px;
    }
    
    .step-description {
        font-size: 13px;
        line-height: 1.5;
    }
    
    /* Ocultar conectores e iconos originales */
    .timeline-connector,
    .timeline-icon {
        display: none !important;
    }
}

/* ========================================
   RESPONSIVE: MUY PEQUEÑO (< 400px)
   ======================================== */
@media (max-width: 400px) {
    .timeline-carousel-container {
        padding: 30px 15px;
    }
    
    .timeline-step {
        margin-bottom: 25px;
    }
    
    .timeline-node {
        margin-right: 15px;
    }
    
    .step-title {
        font-size: 15px;
    }
    
    .step-description {
        font-size: 12px;
    }
    
    .tab-button {
        padding: 6px 12px;
        font-size: 11px;
    }
}

/* ========================================
   ANIMACIONES Y TRANSICIONES
   ======================================== */
.timeline-step {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hover effects */

/* Active state */
.timeline-step.active .timeline-node-outer {
    border-color: #222;
}

.timeline-step.active .timeline-node-inner {
    background: #222;
}

.timeline-step.active .step-title {
    color: #000;
}
