/* ============================================
   PROCESS SECTION
   ============================================ */

.process {
    padding: var(--space-lg) 0 var(--space-xl) 0;
    background-color: #0e1216; /* NOSSO PROCESSO - Dark Mode */
    color: var(--text-white);
}

[data-theme="light"] .process {
    background-color: #6c92bd; /* NOSSO PROCESSO - Light Mode */
}

.process__container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

.process__header {
    text-align: center;
    margin-bottom: calc(var(--space-lg) + 2rem);
}

.process__timeline {
    display: flex;
    justify-content: space-between;
    position: relative;
    gap: var(--space-md);
}

.process__timeline::before {
    content: '';
    position: absolute;
    top: 30px;
    left: 0;
    width: 0%; /* Initial state */
    height: 2px;
    background: var(--secondary); /* Progresso em dourado */
    z-index: 0;
    transition: width 1.5s ease-out; /* Smooth transition */
}

/* Base line (background track) */
.process__timeline::after {
    content: '';
    position: absolute;
    top: 30px;
    left: 0;
    width: 100%;
    height: 2px;
    background: rgba(255, 255, 255, 0.2);
    z-index: -1;
}

.process__timeline.animated::before {
    width: 100%; /* Fill on animation */
}

/* Call badges between steps */
.process__call-badge {
    position: absolute;
    top: -3.5rem;
    width: 0;
    flex: 0 0 0;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.5s ease-out;
    pointer-events: none;
}

.process__timeline.animated .process__call-badge {
    opacity: 1;
    transform: translateY(0);
}

/* Badges à esquerda */
.process__call-badge--left[data-call="1-2"] {
    left: calc(14.28% - 3% + 1.5rem);
    top: -2rem;
    transform: translateX(-50%);
    transition-delay: 0.8s;
}

.process__call-badge--left[data-call="3-4"] {
    left: calc(42.86% - 3% + 2rem);
    top: -2rem;
    transform: translateX(-50%);
    transition-delay: 1.4s;
}

/* Badges à direita - escondidos no desktop também */
.process__call-badge--right[data-call="1-2"] {
    display: none; /* Esconde o badge da direita 1-2 */
}

.process__call-badge--right[data-call="3-4"] {
    display: none; /* Esconde o badge da direita 3-4 */
}

.process__timeline.animated .process__call-badge--left[data-call="1-2"],
.process__timeline.animated .process__call-badge--right[data-call="1-2"] {
    transform: translateX(-50%) translateY(0);
}

.process__timeline.animated .process__call-badge--left[data-call="3-4"],
.process__timeline.animated .process__call-badge--right[data-call="3-4"] {
    transform: translateX(-50%) translateY(0);
}

.process__call-text {
    background: var(--secondary);
    color: #ffffff;
    padding: 0.375rem 0.625rem;
    border-radius: var(--radius-sm);
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.3;
    text-align: center;
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3);
    position: relative;
    display: inline-block;
    white-space: normal;
    word-break: keep-all;
    min-width: fit-content;
}

.process__call-text::before {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid var(--secondary);
}

.process__step {
    position: relative;
    z-index: 1;
    text-align: center;
    flex: 1;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease-out;
}

.process__step.animated {
    opacity: 1;
    transform: translateY(0);
}

.process__step[data-step="1"] { transition-delay: 0.1s; }
.process__step[data-step="2"] { transition-delay: 0.3s; }
.process__step[data-step="3"] { transition-delay: 0.5s; }
.process__step[data-step="4"] { transition-delay: 0.7s; }
.process__step[data-step="5"] { transition-delay: 0.9s; }
.process__step[data-step="6"] { transition-delay: 1.1s; }
.process__step[data-step="7"] { transition-delay: 1.3s; }

.process__step-number {
    width: 60px;
    height: 60px;
    background: var(--primary-dark);
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.25rem; /* Reduzido para aproximar do título */
    font-family: 'DM Serif Display', serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-white);
    transition: all 0.3s ease;
    box-shadow: 0 0 0 0 rgba(216, 171, 113, 0.4);
}

.process__step.animated .process__step-number {
    border-color: var(--secondary);
    background: var(--secondary);
    animation: pulse-ring 2s infinite;
}

@keyframes pulse-ring {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.4);
    }
    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(212, 175, 55, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(216, 171, 113, 0);
    }
}

.process__step-title {
    font-size: 1.375rem; /* Aumentado de 1.125rem para destacar mais */
    color: var(--secondary); /* Mesma cor das bolinhas para destacar */
    margin-bottom: 0.25rem; /* Reduzido para aproximar da descrição */
    margin-top: 0; /* Remove qualquer espaçamento superior */
    font-weight: 400;
}

.process__step-desc {
    font-size: 0.9375rem;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.6;
    margin-top: 0; /* Remove espaçamento superior */
}

@media (max-width: 767px) {
    .process {
        padding: calc(var(--space-lg) + 1rem) 0 calc(var(--space-xl) + 1rem) 0; /* Padding vertical reduzido */
    }
    
    .process__header {
        margin-bottom: calc(var(--space-lg) + 1.5rem); /* Espaçamento inferior reduzido */
    }
    
    .process__timeline {
        flex-direction: column;
    }
    
    .process__timeline::before {
        width: 2px;
        height: 0%; /* Initial state vertical */
        left: 30px;
        top: 0;
        transition: height 1.5s ease-out;
    }

    .process__timeline::after {
        width: 2px;
        height: 100%;
        left: 30px;
        top: 0;
    }

    .process__timeline.animated::before {
        height: 100%;
        width: 2px;
    }
    
    .process__step {
        text-align: left;
        padding-left: 80px;
        order: 0; /* Order padrão */
        margin-bottom: 1.75rem; /* Espaçamento entre os steps reduzido */
    }
    
    .process__step:last-child {
        margin-bottom: 0; /* Remove margem do último step */
    }
    
    .process__step-number {
        position: absolute;
        left: 0;
        top: 0;
    }
    
    .process__step[data-step="1"] {
        order: 1;
    }
    
    .process__call-badge--left[data-call="1-2"] {
        order: 2;
        position: relative;
        top: auto;
        left: 0 !important;
        right: auto;
        margin: -0.75rem auto 0.5rem auto; /* Margin auto para centralizar */
        transform: translateX(-10px); /* Estado inicial: deslocado para esquerda */
        width: fit-content;
        opacity: 0; /* Estado inicial: invisível */
        display: flex; /* Muda para flex para centralizar */
        padding: 0; /* Remove qualquer padding */
        justify-content: center; /* Centraliza o conteúdo */
        transition: opacity 0.5s ease-out, transform 0.5s ease-out;
        transition-delay: 0.8s; /* Aparece quando a linha horizontal chega nele */
    }
    
    /* Animação quando a timeline está animada */
    .process__timeline.animated .process__call-badge--left[data-call="1-2"] {
        opacity: 1;
        transform: translateX(0); /* Volta para posição normal */
    }
    
    /* Esconde o badge da direita 1-2 no mobile */
    .process__call-badge--right[data-call="1-2"] {
        display: none !important;
    }
    
    /* Linha horizontal conectando call badge à linha principal */
    .process__call-badge--left[data-call="1-2"]::before {
        content: '';
        position: absolute;
        left: calc(30px - 50vw); /* Começa na linha vertical (30px) */
        top: 50%;
        width: calc(50vw - 30px); /* Largura da linha da vertical até o início do retângulo centralizado */
        height: 2px;
        background: var(--secondary); /* Mesma cor amarela/laranja da linha vertical */
        transform: translateY(-50%);
    }
    
    /* Bolinha na junção da linha horizontal com a vertical */
    .process__call-badge--left[data-call="1-2"]::after {
        content: '';
        position: absolute;
        left: calc(30px - 50vw); /* Posição da linha vertical (30px) */
        top: 50%;
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: var(--secondary); /* Mesma cor amarela/laranja */
        transform: translate(-50%, -50%);
    }
    
    .process__step[data-step="2"] {
        order: 3;
    }
    
    .process__step[data-step="3"] {
        order: 4;
        margin-bottom: 0.5rem !important; /* Reduz margin-bottom do step 3 para aproximar do call badge */
    }
    
    .process__step[data-step="4"] {
        order: 6;
    }
    
    .process__step[data-step="5"] {
        order: 7;
    }
    
    .process__step[data-step="6"] {
        order: 8;
    }
    
    .process__step[data-step="7"] {
        order: 9;
    }
    
    .process__call-badge--left[data-call="3-4"] {
        order: 5;
        position: relative;
        top: auto;
        left: 0 !important;
        right: auto;
        margin: -0.5rem auto 0.5rem auto; /* Margin auto para centralizar */
        transform: translateX(-10px); /* Estado inicial: deslocado para esquerda */
        width: fit-content;
        opacity: 0; /* Estado inicial: invisível */
        display: flex; /* Muda para flex para centralizar */
        padding: 0; /* Remove qualquer padding */
        justify-content: center; /* Centraliza o conteúdo */
        transition: opacity 0.5s ease-out, transform 0.5s ease-out;
        transition-delay: 1.4s; /* Aparece quando a linha horizontal chega nele */
    }
    
    /* Animação quando a timeline está animada */
    .process__timeline.animated .process__call-badge--left[data-call="3-4"] {
        opacity: 1;
        transform: translateX(0); /* Volta para posição normal */
    }
    
    /* Esconde o badge da direita 3-4 no mobile */
    .process__call-badge--right[data-call="3-4"] {
        display: none !important;
    }
    
    /* Linha horizontal conectando call badge à linha principal */
    .process__call-badge--left[data-call="3-4"]::before {
        content: '';
        position: absolute;
        left: calc(30px - 50vw); /* Começa na linha vertical (30px) */
        top: 50%;
        width: calc(50vw - 30px); /* Largura da linha da vertical até o início do retângulo centralizado */
        height: 2px;
        background: var(--secondary); /* Mesma cor amarela/laranja da linha vertical */
        transform: translateY(-50%);
    }
    
    /* Bolinha na junção da linha horizontal com a vertical */
    .process__call-badge--left[data-call="3-4"]::after {
        content: '';
        position: absolute;
        left: calc(30px - 50vw); /* Posição da linha vertical (30px) */
        top: 50%;
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: var(--secondary); /* Mesma cor amarela/laranja */
        transform: translate(-50%, -50%);
    }
    
    .process__step[data-step="4"] {
        order: 6;
    }
    
    .process__step[data-step="5"] {
        order: 7;
    }
    
    /* Remove quebra de linha e muda para formato retângulo horizontal */
    .process__call-text {
        white-space: nowrap; /* Remove quebra de linha */
        padding: 0.625rem 1.25rem; /* Aumenta padding horizontal para formato retângulo */
        border-radius: var(--radius-sm);
        display: inline-block;
        min-width: auto;
        line-height: 1.2;
    }
    
    /* Remove a seta no mobile */
    .process__call-text::before {
        display: none;
    }
    
    /* Converte <br> em espaço no mobile */
    .process__call-text br {
        display: none;
    }
}
