/* Reset y variables CSS para la línea de tiempo - PALETA DORADO Y AMARILLO */
.timeline-section {
    padding: 60px 20px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.timeline-section * {
    box-sizing: border-box;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    color: #C4A55F;
    margin-bottom: 3rem;
    font-weight: 700;
}

.timeline-container {
    --primary-color: #C4A55F;        /* Dorado principal del sitio */
    --secondary-color: #B8A054;      /* Dorado más oscuro */
    --success-color: #F1C40F;        /* Amarillo para completado */
    --accent-color: #D4B86A;         /* Dorado claro para acentos */
    --yellow-color: #FFD700;         /* Amarillo dorado */
    --background-color: #FFFFFF;     /* Fondo neutro */
    --text-color: #333;              /* Texto principal */
    --border-color: #e8e8e8;         /* Bordes suaves */
    
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
    background: var(--background-color);
    border-radius: 15px;
    position: relative;
}

.timeline-header {
    text-align: center;
    padding: 30px 20px;
    
}

.timeline-title {
    color: var(--primary-color);
    margin: 0 0 15px 0;
    font-size: 2.2rem;
    font-weight: 700;
    line-height: 1.2;
    text-shadow: 0 1px 3px rgba(196, 165, 95, 0.1);
}

.timeline-subtitle {
    color: var(--text-color);
    font-size: 1.1rem;
    font-weight: 400;
    opacity: 0.7;
    margin: 0;
}

/* Controles actualizados */
.timeline-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 0 0 0 0;
    padding: 20px;
}

.timeline-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 140px;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(196, 165, 95, 0.2);
}

.timeline-btn:hover {
    background: linear-gradient(135deg, var(--secondary-color), var(--yellow-color));
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(196, 165, 95, 0.3);
    color: #333;
}

.timeline-btn:disabled {
    background: linear-gradient(135deg, #bbb, #999);
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Indicador de progreso actualizado */
.progress-indicator {
    margin: 0 0 40px 0;
    text-align: center;
}

.progress-bar {
    width: 70%;
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    margin: 0 auto 10px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color), var(--yellow-color));
    transition: width 1s ease;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(196, 165, 95, 0.3);
}

.progress-text {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 1rem;
    margin: 0;
}

/* Timeline principal actualizado */
.process-timeline {
    position: relative;
    margin: 0;
    z-index: 0; /* Z-INDEX AGREGADO */
}

.process-timeline::before {
    content: '';
    position: absolute;
    top: 100px;
    bottom: 100px;
    left: 50%;
    width: 4px;
    background: linear-gradient(to bottom, var(--primary-color), var(--accent-color), var(--yellow-color));
    transform: translateX(-50%);
    z-index: 0;
    border-radius: 2px;
    box-shadow: 0 0 10px rgba(196, 165, 95, 0.2);
}

/* Elementos de proceso actualizados */
.process-step {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 0 0px 0;
    position: relative;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease;
    scroll-margin-top: 120px;
}

.process-step.animate-step {
    opacity: 1;
    transform: translateY(0);
}

.process-step.active {
    transform: translateY(0) scale(1.02);
}

/* Contenido de los pasos actualizado */
.step-content {
    width: 380px;
    max-width: 380px;
    padding: 25px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(196, 165, 95, 0.1);
    position: relative;
    transition: all 0.4s ease;
    border: 2px solid transparent;
    margin: 0;
}

.step-left .step-content {
    margin-right: 450px;
    margin-left: 0;
}

.step-right .step-content {
    margin-left: 450px;
    margin-right: 0;
}

/* Flechas conectoras actualizadas */
.step-left .step-content::after {
    content: '';
    position: absolute;
    top: 50%;
    right: -12px;
    width: 0;
    height: 0;
    border: 12px solid transparent;
    border-left-color: white;
    transform: translateY(-50%);
    filter: drop-shadow(2px 0 4px rgba(196, 165, 95, 0.1));
}

.step-right .step-content::after {
    content: '';
    position: absolute;
    top: 50%;
    left: -12px;
    width: 0;
    height: 0;
    border: 12px solid transparent;
    border-right-color: white;
    transform: translateY(-50%);
    filter: drop-shadow(-2px 0 4px rgba(196, 165, 95, 0.1));
}

/* Íconos de los pasos actualizados */
.step-icon {
    position: absolute;
    width: 75px;
    height: 75px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.8rem;
    box-shadow: 0 0 0 6px var(--background-color), 0 0 0 10px var(--primary-color);
    z-index: 10;
    top: 50%;
    transform: translateY(-50%);
    transition: all 0.5s ease;
}

.step-left .step-icon {
    right: -37px;
}

.step-right .step-icon {
    left: -37px;
}

.process-step.active .step-icon {
    background: linear-gradient(135deg, var(--success-color), var(--yellow-color));
    box-shadow: 0 0 0 6px var(--background-color), 0 0 0 10px var(--success-color);
    transform: translateY(-50%) scale(1.1);
    color: #333;
}

.step-icon.pulse {
    animation: iconPulse 2s ease-in-out infinite;
}

@keyframes iconPulse {
    0%, 100% {
        transform: translateY(-50%) scale(1.1);
        box-shadow: 0 0 0 6px var(--background-color), 0 0 0 10px var(--success-color);
    }
    50% {
        transform: translateY(-50%) scale(1.2);
        box-shadow: 0 0 0 6px var(--background-color), 0 0 0 18px var(--success-color), 0 0 30px rgba(241, 196, 15, 0.3);
    }
}

/* Títulos de pasos actualizados */
.step-title {
    font-size: 1.4rem;
    color: var(--primary-color);
    margin: 0 0 18px 0;
    display: flex;
    align-items: center;
    font-weight: 700;
    line-height: 1.3;
}

.step-title i {
    margin-right: 12px;
    color: var(--primary-color);
}

.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: 50%;
    margin-right: 12px;
    font-size: 0.9rem;
    font-weight: 700;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(196, 165, 95, 0.3);
}

/* Listas de pasos actualizadas */
.step-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.step-list li {
    padding: 10px 0;
    border-bottom: 1px solid rgba(196, 165, 95, 0.1);
    position: relative;
    padding-left: 30px;
    line-height: 1.5;
    color: var(--text-color);
    font-size: 0.95rem;
}

.step-list li:last-child {
    border-bottom: none;
}

.step-list li::before {
    content: '●';
    position: absolute;
    left: 0;
    color: var(--accent-color);
    font-weight: bold;
    font-size: 1.2rem;
    top: 10px;
}

/* Estados de los pasos actualizados */
.step-status {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 1.2rem;
}

.step-status .pending {
    color: var(--accent-color);
    display: inline-block;
    animation: pendingPulse 2s ease-in-out infinite;
}

.step-status .completed {
    color: var(--success-color);
    display: none;
    animation: completedBounce 0.6s ease-out;
}

@keyframes pendingPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes completedBounce {
    0% { transform: scale(0); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* Elementos inicio y final actualizados */
.start-end {
    text-align: center;
    margin: 30px 0;
    position: relative;
    z-index: 5;
}

.start-element {
    margin-bottom: 20px;
}

.end-element {
    margin-top: 20px;
}

.start-end .step-content {
    width: 240px;
    max-width: 240px;
    margin: 0 auto;
    background: linear-gradient(135deg, var(--primary-color), var(--yellow-color));
    color: #333;
    box-shadow: 0 15px 40px rgba(196, 165, 95, 0.3);
    border: none;
    position: relative;
    z-index: 10;
    padding: 20px 18px;
}

.start-end .step-title {
    color: #333;
    justify-content: center;
    margin: 0;
    font-size: 1.3rem;
    font-weight: 700;
}

.start-end .step-title i {
    color: #333;
    margin-right: 10px;
    text-shadow: 0 1px 3px rgba(255,255,255,0.3);
}

/* Conectores de flujo actualizados - OCULTOS */
.flow-connector {
    width: 4px;
    height: 60px;
    background: var(--border-color);
    margin: 0 auto;
    position: relative;
    transition: all 1s ease;
    border-radius: 2px;
    display: none; /* OCULTA LOS CONECTORES */
}

.flow-connector.active {
    background: linear-gradient(to bottom, var(--primary-color), var(--yellow-color));
    animation: flowAnimation 1s ease;
    box-shadow: 0 0 8px rgba(196, 165, 95, 0.4);
    display: none; /* MANTIENE OCULTO AUNQUE ESTÉ ACTIVO */
}

@keyframes flowAnimation {
    0% {
        height: 0;
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        height: 60px;
        opacity: 1;
    }
}

/* Estados activos actualizados */
.process-step.active .step-content {
    border-color: var(--success-color);
    background: linear-gradient(135deg, white, rgba(241, 196, 15, 0.05));
    box-shadow: 0 12px 35px rgba(241, 196, 15, 0.15), 0 0 0 1px rgba(196, 165, 95, 0.1);
    transform: translateY(-2px);
}

.process-step.active .step-status .pending {
    display: none;
}

.process-step.active .step-status .completed {
    display: inline-block;
}

/* Mensaje de completado actualizado */
.completion-message {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(196, 165, 95, 0.8), rgba(241, 196, 15, 0.8));
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.6s ease;
    backdrop-filter: blur(5px);
}

.completion-message.show {
    opacity: 1;
}

.completion-content {
    background: white;
    padding: 40px 30px;
    border-radius: 20px;
    text-align: center;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(196, 165, 95, 0.3);
    border: 2px solid var(--primary-color);
}

.completion-content i {
    font-size: 4rem;
    color: var(--success-color);
    margin-bottom: 20px;
    animation: completedBounce 0.8s ease-out;
}

.completion-content h3 {
    color: var(--primary-color);
    font-size: 1.8rem;
    margin-bottom: 15px;
    font-weight: 700;
}

.completion-content p {
    color: #666;
    font-size: 1.1rem;
    margin-bottom: 25px;
    line-height: 1.6;
}

.close-message {
    background: linear-gradient(135deg, var(--primary-color), var(--success-color));
    color: #333;
    border: none;
    padding: 12px 25px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(196, 165, 95, 0.2);
}

.close-message:hover {
    background: linear-gradient(135deg, var(--yellow-color), var(--success-color));
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(241, 196, 15, 0.4);
}

/* RESPONSIVE DESIGN MEJORADO - MOBILE FIRST */

/* Tablets (768px - 1024px) */
@media (max-width: 1024px) {
    .timeline-container {
        max-width: 700px;
        padding: 15px;
    }
    
    .step-content {
        width: 320px;
        max-width: 320px;
        padding: 20px;
    }
    
    .step-left .step-content {
        margin-right: 380px;
    }
    
    .step-right .step-content {
        margin-left: 380px;
    }
    
    .step-icon {
        width: 70px;
        height: 70px;
        font-size: 1.7rem;
    }
}

/* Tablets pequeñas y móviles grandes (768px y menos) */
@media (max-width: 768px) {
    .timeline-section {
        padding: 40px 15px;
    }
    
    .timeline-container {
        padding: 10px;
        margin: 0 5px;
        border-radius: 10px;
    }
    
    .timeline-header {
        padding: 20px 15px;
    }
    
    .timeline-title {
        font-size: 1.8rem;
        margin-bottom: 10px;
    }
    
    .timeline-subtitle {
        font-size: 1rem;
    }
    
    .timeline-controls {
        flex-direction: column;
        gap: 10px;
        padding: 15px;
    }
    
    .timeline-btn {
        width: 100%;
        max-width: 250px;
        margin: 0 auto;
        min-width: auto;
        font-size: 0.9rem;
        padding: 12px 20px;
    }
    
    /* Timeline vertical para móvil */
    .process-timeline::before {
        left: 37px;
        top: 80px;
        bottom: 80px;
        width: 3px;
    }
    
    .process-step {
        justify-content: flex-start;
        padding-left: 90px;
        margin-bottom: 30px;
        scroll-margin-top: 100px;
    }
    
    .step-content {
        width: calc(100% - 30px);
        max-width: none;
        padding: 18px;
        margin: 0 !important;
        border-radius: 12px;
    }
    
    .step-left .step-content::after,
    .step-right .step-content::after {
        display: none;
    }
    
    .step-icon {
        left: 0 !important;
        right: auto !important;
        width: 65px;
        height: 65px;
        font-size: 1.5rem;
        box-shadow: 0 0 0 4px var(--background-color), 0 0 0 7px var(--primary-color);
    }
    
    .process-step.active .step-icon {
        box-shadow: 0 0 0 4px var(--background-color), 0 0 0 7px var(--success-color);
    }
    
    .start-end .step-content {
        width: 200px;
        max-width: 200px;
        padding: 18px 15px;
        margin-left: 90px !important;
    }
    
    .flow-connector {
        width: 3px;
        height: 40px;
        margin-left: 37px;
        display: none; /* OCULTO EN MÓVIL */
    }
    
    .progress-bar {
        width: 90%;
        height: 6px;
    }
    
    .step-title {
        font-size: 1.2rem;
        margin-bottom: 15px;
    }
    
    .step-number {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
        margin-right: 10px;
    }
    
    .step-list li {
        padding: 8px 0;
        padding-left: 25px;
        font-size: 0.9rem;
    }
    
    .step-list li::before {
        font-size: 1rem;
        top: 8px;
    }
}

/* Móviles medianos (480px - 640px) */
@media (max-width: 640px) {
    .timeline-title {
        font-size: 1.6rem;
        line-height: 1.1;
    }
    
    .timeline-subtitle {
        font-size: 0.95rem;
        padding: 0 10px;
    }
    
    .step-content {
        padding: 16px;
        width: calc(100% - 25px);
    }
    
    .step-icon {
        width: 60px;
        height: 60px;
        font-size: 1.4rem;
    }
    
    .start-end .step-content {
        width: 180px;
        max-width: 180px;
        padding: 16px 12px;
    }
    
    .start-end .step-title {
        font-size: 1.1rem;
    }
    
    .completion-content {
        padding: 30px 20px;
        margin: 0 20px;
        border-radius: 15px;
    }
    
    .completion-content i {
        font-size: 3rem;
        margin-bottom: 15px;
    }
    
    .completion-content h3 {
        font-size: 1.5rem;
        margin-bottom: 12px;
    }
    
    .completion-content p {
        font-size: 1rem;
        margin-bottom: 20px;
    }
}

/* Móviles pequeños (480px y menos) */
@media (max-width: 480px) {
    .timeline-section {
        padding: 30px 10px;
    }
    
    .timeline-container {
        margin: 0;
        padding: 8px;
    }
    
    .timeline-header {
        padding: 15px 10px;
    }
    
    .timeline-title {
        font-size: 1.4rem;
        margin-bottom: 8px;
    }
    
    .timeline-subtitle {
        font-size: 0.9rem;
        padding: 0 5px;
    }
    
    .timeline-controls {
        padding: 10px;
        gap: 8px;
    }
    
    .timeline-btn {
        font-size: 0.85rem;
        padding: 10px 16px;
        border-radius: 8px;
    }
    
    .process-timeline::before {
        left: 32px;
        width: 2px;
    }
    
    .process-step {
        padding-left: 75px;
        margin-bottom: 25px;
    }
    
    .step-content {
        padding: 14px;
        width: calc(100% - 20px);
        border-radius: 10px;
    }
    
    .step-icon {
        width: 55px;
        height: 55px;
        font-size: 1.2rem;
        box-shadow: 0 0 0 3px var(--background-color), 0 0 0 6px var(--primary-color);
    }
    
    .process-step.active .step-icon {
        box-shadow: 0 0 0 3px var(--background-color), 0 0 0 6px var(--success-color);
        animation: iconPulseMobile 2s ease-in-out infinite;
    }
    
    @keyframes iconPulseMobile {
        0%, 100% {
            transform: translateY(-50%) scale(1);
            box-shadow: 0 0 0 3px var(--background-color), 0 0 0 6px var(--success-color);
        }
        50% {
            transform: translateY(-50%) scale(1.1);
            box-shadow: 0 0 0 3px var(--background-color), 0 0 0 12px var(--success-color), 0 0 20px rgba(241, 196, 15, 0.3);
        }
    }
    
    .flow-connector {
        margin-left: 32px;
        height: 30px;
        width: 2px;
        display: none; /* OCULTO EN MÓVIL PEQUEÑO */
    }
    
    .start-end .step-content {
        width: 160px;
        max-width: 160px;
        padding: 14px 10px;
        margin-left: 75px !important;
        font-size: 0.9rem;
    }
    
    .start-end .step-title {
        font-size: 1rem;
    }
    
    .start-end .step-title i {
        margin-right: 8px;
        font-size: 0.9rem;
    }
    
    .step-title {
        font-size: 1.1rem;
        margin-bottom: 12px;
    }
    
    .step-number {
        width: 24px;
        height: 24px;
        font-size: 0.75rem;
        margin-right: 8px;
    }
    
    .step-list li {
        padding: 6px 0;
        padding-left: 20px;
        font-size: 0.85rem;
        line-height: 1.4;
    }
    
    .step-list li::before {
        font-size: 0.9rem;
        top: 6px;
    }
    
    .step-status {
        top: 12px;
        right: 15px;
        font-size: 1rem;
    }
    
    .progress-bar {
        width: 95%;
        height: 5px;
        margin-bottom: 8px;
    }
    
    .progress-text {
        font-size: 0.9rem;
    }
    
    .completion-content {
        padding: 25px 15px;
        margin: 0 15px;
        border-radius: 12px;
    }
    
    .completion-content i {
        font-size: 2.5rem;
        margin-bottom: 12px;
    }
    
    .completion-content h3 {
        font-size: 1.3rem;
        margin-bottom: 10px;
    }
    
    .completion-content p {
        font-size: 0.9rem;
        margin-bottom: 18px;
        line-height: 1.5;
    }
}

/* Móviles muy pequeños (360px y menos) */
@media (max-width: 360px) {
    .timeline-title {
        font-size: 1.2rem;
    }
    
    .timeline-subtitle {
        font-size: 0.85rem;
    }
    
    .timeline-btn {
        font-size: 0.8rem;
        padding: 9px 14px;
    }
    
    .step-content {
        padding: 12px;
    }
    
    .step-icon {
        width: 50px;
        height: 50px;
        font-size: 1.1rem;
    }
    
    .process-step {
        padding-left: 65px;
    }
    
    .flow-connector {
        margin-left: 27px;
        display: none; /* OCULTO EN MÓVIL MUY PEQUEÑO */
    }
    
    .start-end .step-content {
        width: 140px;
        max-width: 140px;
        margin-left: 65px !important;
        padding: 12px 8px;
    }
    
    .start-end .step-title {
        font-size: 0.9rem;
    }
    
    .step-title {
        font-size: 1rem;
    }
    
    .step-list li {
        font-size: 0.8rem;
        padding-left: 18px;
    }
    
    .completion-content {
        margin: 0 10px;
        padding: 20px 12px;
    }
    
    .completion-content i {
        font-size: 2rem;
    }
    
    .completion-content h3 {
        font-size: 1.1rem;
    }
    
    .completion-content p {
        font-size: 0.85rem;
    }
}

/* Optimizaciones para pantallas táctiles */
@media (hover: none) and (pointer: coarse) {
    .timeline-btn {
        min-height: 44px; /* Tamaño mínimo para touch */
        touch-action: manipulation;
    }
    
    .timeline-btn:hover {
        transform: none; /* Remover hover effects en touch */
    }
    
    .timeline-btn:active {
        transform: scale(0.98);
        background: linear-gradient(135deg, var(--secondary-color), var(--yellow-color));
    }
    
    .close-message {
        min-height: 44px;
        touch-action: manipulation;
    }
    
    .close-message:hover {
        transform: none;
    }
    
    .close-message:active {
        transform: scale(0.98);
    }
}

/* Optimizaciones para rendimiento en móvil */
@media (max-width: 768px) {
    .process-step {
        will-change: transform, opacity;
    }
    
    .step-icon {
        will-change: transform;
    }
    
    .flow-connector {
        will-change: background, height;
    }
    
    /* Reducir animaciones en dispositivos de bajo rendimiento */
    @media (prefers-reduced-motion: reduce) {
        .process-step,
        .step-icon,
        .flow-connector,
        .timeline-btn,
        .completion-message {
            transition: none;
            animation: none;
        }
        
        .step-icon.pulse {
            animation: none;
        }
        
        .process-step.active .step-icon {
            animation: none;
        }
    }
}

/* Landscape móvil */
@media (max-width: 768px) and (orientation: landscape) {
    .timeline-section {
        padding: 20px 10px;
    }
    
    .timeline-header {
        padding: 15px 10px;
    }
    
    .completion-content {
        max-width: 350px;
        padding: 25px 20px;
    }
    
    .step-content {
        max-height: 60vh;
        overflow-y: auto;
    }
}