/* ==========================================================================
   1. VARIABLES Y CONFIGURACIÓN GLOBAL
   ========================================================================== */
:root {
    --nav-purple: #2E1A5F;
    --nav-teal: #3BBCA8; /* Celeste de la marca */
    --nav-height: 100px;
    
    --primary-purple: #4a148c;
    --btn-purple: #5836be;
    --btn-green: #25D366; /* Solo para el botón de WhatsApp */
    --green-brand: #3BBCA8; /* EL TURQUESA/CELESTE PRINCIPAL */
    --light-blue-bg: #e3f2fd;
    --text-dark: #333;
    --white: #ffffff;
}

html { scroll-padding-top: var(--nav-height); }

body {
    background-color: var(--light-blue-bg);
    font-family: 'Poppins', sans-serif;
    color: var(--text-dark);
    margin: 0;
    overflow-x: hidden;
}

.container { max-width: 1400px; margin: 0 auto; padding: 0 20px; }

@media (max-width: 1366px) {
    .container { max-width: 1200px; }
}

/* Dropdown Desktop */
.nav-menu li.has-dropdown { position: relative; height: 100%; display: flex; align-items: center; }
.dropdown-menu {
    position: absolute; top: 100%; left: 50%; transform: translateX(-50%) translateY(10px);
    background-color: #ffffff; min-width: 220px; box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    border-radius: 8px; padding: 15px 0; list-style: none; opacity: 0; visibility: hidden;
    transition: all 0.3s ease; z-index: 1100; border-top: 4px solid var(--nav-purple);
}
.nav-menu li.has-dropdown:hover .dropdown-menu { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
.dropdown-menu li a { display: block; padding: 12px 20px; color: #555; border-bottom: 1px solid #f0f0f0; }
.dropdown-menu li a::before, .dropdown-menu li a::after { display: none !important; }
.dropdown-menu li a:hover { background-color: #f9f9f9; color: var(--nav-purple); padding-left: 25px; }

/* Botones Navbar */
.nav-buttons { display: flex; gap: 15px; align-items: center; margin-left: auto; padding-left: 40px; }
.btn-nav-cotiza, .btn-nav-resultados {
    display: inline-block; padding: 10px 25px; border-radius: 8px; text-decoration: none;
    font-weight: 700; font-size: 0.9rem; color: white; transition: all 0.3s ease;
}
.btn-nav-cotiza { background-color: var(--nav-purple); border: 2px solid var(--nav-purple); }
.btn-nav-cotiza:hover { background-color: transparent; color: var(--nav-purple); transform: translateY(-2px); }
.btn-nav-resultados { background-color: var(--nav-teal); border: 2px solid var(--nav-teal); }
.btn-nav-resultados:hover { background-color: transparent; color: var(--nav-teal); transform: translateY(-2px); }

/* Hamburguesa */
.hamburger { display: none; flex-direction: column; background: transparent; border: none; cursor: pointer; gap: 6px; }
.hamburger span { width: 30px; height: 3px; background-color: var(--nav-purple); transition: 0.3s; }

/* ==========================================================================
   3. HERO SECTION (PORTADA)
   ========================================================================== */
.hero-emo {
    position: relative; width: 100%; min-height: 85vh;
    background: linear-gradient(123.79deg, rgba(250, 255, 254, 0) 50.71%, rgba(255, 255, 255, 0.2) 52.17%),
        linear-gradient(280.42deg, rgba(59, 188, 168, 0.176) 13.12%, rgba(255, 251, 251, 0.2) 45.24%),
        linear-gradient(101.84deg, rgba(59, 188, 168, 0.582) 18.18%, rgba(238, 249, 247, 0.6) 46.15%),
        url('https://res.cloudinary.com/dtozni6ik/image/upload/f_auto,q_auto/v1769877676/img_0677_mcsxed.webp');
    background-size: cover; 
    background-position: center;
    background-attachment: fixed;
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    padding: 140px 20px 60px; text-align: center;
}
.hero-content h1 { color: var(--primary-purple); font-weight: 800; font-size: 2.5rem; margin: 0 auto 20px; line-height: 1.2; }
.hero-buttons { margin: 30px 0; display: flex; justify-content: center; gap: 20px; flex-wrap: wrap; }
.btn-hero {
    padding: 16px 45px; border-radius: 8px; font-size: 1.3rem; font-weight: 700; color: white; text-decoration: none;
    border: 2px solid transparent; transition: all 0.3s ease; display: inline-flex; align-items: center; gap: 8px;
    text-transform: uppercase; box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}
.btn-purple { background-color: var(--btn-purple); }
.btn-green { background-color: var(--btn-green); } /* Verde WhatsApp */
.btn-hero:hover { transform: translateY(-3px); box-shadow: 0 12px 25px rgba(0,0,0,0.2); }
.subtitle { padding: 15px 0; color: #2E1A5F; margin-bottom: 40px; font-style: italic; font-size: 1.2rem; }

.stats-container {
    background: #ffffff; border-radius: 20px; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    display: flex; justify-content: space-around; padding: 30px 40px; align-items: center;
    flex-wrap: wrap; max-width: 900px; margin: 0 auto; position: relative;
}
.stat-item { text-align: center; padding: 0 20px; }
.stat-number { font-size: 4.6rem; font-weight: 700; color: var(--green-brand); line-height: 1; margin-bottom: 5px; font-family: 'Poppins', sans-serif; }
.stat-label { font-size: 0.9rem; color: #666; font-weight: 500; max-width: 150px; margin: 0 auto; font-family: 'Poppins', sans-serif; }
.stat-divider { width: 2px; height: 45px; background: #eee; }

/* ==========================================================================
   4. FONDO UNIFICADO Y TARJETAS ACORDEÓN (CORREGIDO)
   ========================================================================== */
.unified-background {
    width: 100%;
    position: relative;
    /* Imagen de fondo que cubre todo desde protocolos hasta timeline */
    background: linear-gradient(135deg, rgba(227, 242, 253, 0.96) 0%, rgba(255, 255, 255, 0.94) 100%),
                url('https://images.unsplash.com/photo-1576091160550-2173dba999ef?q=80&w=1470&auto=format&fit=crop');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    padding-bottom: 50px;
}

/* Hacemos transparentes las secciones para que se vea el fondo unificado */
.types-section, .protocol-section, .timeline-section {
    background: transparent !important;
    padding-top: 60px; padding-bottom: 40px;
}

.section-title { font-size: 2.5rem; color: var(--primary-purple); font-weight: 800; text-transform: uppercase; margin-bottom: 20px; text-align: center; }
.section-desc { max-width: 700px; margin: 0 auto 50px; color: #2E1A5F; font-size: 1.2rem; text-align: center; }

/* --- ESTILOS DE TARJETAS EXPANDIBLES (ACORDEÓN) --- */
.types-list { display: flex; flex-direction: column; gap: 15px; max-width: 800px; margin: 0 auto; }

.type-card {
    /* IMPORTANTE: flex-direction column para que el contenido baje */
    display: flex !important;
    flex-direction: column !important; 
    
    background: white; 
    border-radius: 12px;
    margin-bottom: 15px;
    padding: 0; /* Quitamos padding global para manejarlo por hijos */
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden; /* Clave para el efecto de abrir/cerrar */
}

.type-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

/* Cabecera de la tarjeta (siempre visible) */
.card-header-ocupacional {
    display: flex;
    align-items: center;
    padding: 20px;
    gap: 20px;
    width: 100%;
    box-sizing: border-box;
}

.icon-box {
    background-color: #448aff; color: white; width: 50px; height: 50px; border-radius: 8px;
    display: flex; justify-content: center; align-items: center; font-size: 1.5rem; flex-shrink: 0;
}

.text-box { flex: 1; }
.text-box h3 { margin: 0; font-size: 1.1rem; color: var(--primary-purple); font-weight: bold; }
.text-box p { margin: 5px 0 0; font-size: 0.9rem; color: #666; }

/* Icono de flecha */
.toggle-icon {
    color: #4a148c; 
    transition: transform 0.3s ease;
    margin-left: auto;
}

/* --- Contenido Oculto (Detalles) --- */
.card-details {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease-out, opacity 0.5s ease;
    opacity: 0;
    padding: 0 20px;
    background-color: #f9f9ff;
}

.card-details p {
    font-size: 0.95rem; color: #555; margin-bottom: 15px; line-height: 1.6;
}

.card-details ul {
    list-style: none; padding: 0; margin-bottom: 20px;
}

.card-details ul li {
    position: relative; padding-left: 20px; margin-bottom: 8px; font-size: 0.9rem; color: #444;
}

.card-details ul li::before {
    content: "•"; color: #25D366; font-weight: bold; position: absolute; left: 0;
}

.objetivos-title {
    font-weight: 700; color: #4a148c; margin-bottom: 10px; display: block;
}

/* Botón Cotizar dentro de la tarjeta */
.btn-cotizar-card {
    display: block; width: 100%; background-color: #4a148c; color: white; text-align: center;
    padding: 12px; border-radius: 8px; text-decoration: none; font-weight: bold; text-transform: uppercase;
    margin-bottom: 20px; transition: background 0.3s;
}
.btn-cotizar-card:hover { background-color: #310e66; }

/* --- ESTADO ACTIVO (Cuando se abre con JS) --- */
.type-card.active { border-left: 5px solid #3BBCA8; }
.type-card.active .toggle-icon { transform: rotate(180deg); }
.type-card.active .card-details {
    max-height: 1000px; opacity: 1; padding-bottom: 20px;
}


/* ==========================================================================
   5. PROTOCOLO Y TOOLTIPS
   ========================================================================== */
.protocol-icons { display: flex; justify-content: center; gap: 40px; flex-wrap: wrap; margin-bottom: 50px; }
.p-item { display: flex; flex-direction: column; align-items: center; width: 140px; cursor: pointer; position: relative; z-index: 20; }

.circle-icon {
    width: 130px; height: 130px; border-radius: 20px; background: white; border: 4px solid var(--primary-purple);
    padding: 0; overflow: hidden; display: flex; align-items: center; justify-content: center;
    margin-bottom: 20px; box-shadow: 0 10px 20px rgba(74, 20, 140, 0.15);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.circle-icon img { width: 100%; height: 100%; object-fit: cover; display: block; }
.p-item span { font-weight: 700; color: var(--primary-purple); font-size: 1.1rem; transition: color 0.3s ease; }

/* Tooltip (Cajita flotante) */
.tooltip-box {
    position: absolute; bottom: 125%; left: 50%; transform: translateX(-50%) translateY(15px);
    width: 200px; background-color: #ffffff; padding: 15px; border-radius: 10px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.25); 
    border-bottom: 4px solid var(--green-brand); /* Borde color Marca */
    text-align: center; font-size: 0.9rem; color: #444; opacity: 0; visibility: hidden;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55); pointer-events: none;
}
.tooltip-box::after {
    content: ''; position: absolute; top: 100%; left: 50%; margin-left: -8px;
    border-width: 8px; border-style: solid; border-color: white transparent transparent transparent;
}
.p-item:hover .tooltip-box { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); z-index: 100; }
.p-item:hover .circle-icon { transform: translateY(-10px) scale(1.05); border-color: var(--green-brand); box-shadow: 0 10px 25px rgba(59, 188, 168, 0.3); }
.p-item:hover span { color: var(--green-brand); }

/* ==========================================================================
   6. LÍNEA DE TIEMPO (COLORES CORREGIDOS: SIN ROJOS)
   ========================================================================== */
.steps-container {
    display: flex; justify-content: center; align-items: center; 
    margin-top: 60px; width: 100%; max-width: 1000px; margin-left: auto; margin-right: auto;
    gap: 20px;
    flex-wrap: nowrap;
}
.step { display: flex; flex-direction: column; align-items: center; position: relative; z-index: 2; min-width: 130px; cursor: pointer; }
.step-circle {
    width: 70px; height: 70px; background-color: var(--primary-purple); color: white; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1.8rem;
    margin-bottom: 15px; border: 5px solid white; box-shadow: 0 5px 15px rgba(0,0,0,0.15);
    animation: pulse-purple 2s infinite;
}

/* LÍNEA DE TRÁNSITO: Gris mentolado suave + Turquesa Marca */
.step-line {
    height: 10px; flex-grow: 1; min-width: 40px; margin: 0 -10px; margin-bottom: 40px; z-index: 1; border-radius: 10px;
    /* Fondo limpio que combina con todo */
    background: linear-gradient(90deg, 
        #e0f2f1 0%,          /* Mentolado muy suave */
        var(--green-brand) 50%, /* Turquesa intenso */
        #e0f2f1 100%);
    background-size: 200% 100%; animation: trafficFlow 1.5s linear infinite;
}
.step span { font-weight: 700; color: #333; font-size: 1.1rem; }

/* Tarjetas de información Pasos */
.step-tooltip {
    position: absolute; top: 100%; left: 50%; transform: translateX(-50%) translateY(15px);
    width: 180px; background-color: white; padding: 12px; border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.15); 
    border-top: 4px solid var(--green-brand); /* Borde color Marca */
    font-size: 0.85rem; color: #555; line-height: 1.3; z-index: 10;
    opacity: 0; visibility: hidden; transition: all 0.3s ease; pointer-events: none;
}
.step-tooltip::before {
    content: ''; position: absolute; bottom: 100%; left: 50%; margin-left: -6px;
    border-width: 6px; border-style: solid; border-color: transparent transparent white transparent;
}
.step:hover .step-tooltip { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(5px); }
.step:hover .step-circle { transform: scale(1.1); background-color: var(--green-brand); animation: none; }
.step:hover span { color: var(--green-brand); transform: translateY(-2px); }

/* ==========================================================================
   7. ANIMACIONES Y RESPONSIVE
   ========================================================================== */
@keyframes trafficFlow { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
@keyframes pulse-purple {
    0% { box-shadow: 0 0 0 0 rgba(74, 20, 140, 0.4); }
    70% { box-shadow: 0 0 0 15px rgba(74, 20, 140, 0); }
    100% { box-shadow: 0 0 0 0 rgba(74, 20, 140, 0); }
}
.hidden-state { opacity: 0; transform: translateY(60px); transition: opacity 0.8s ease-out, transform 0.8s ease-out; }
.visible-state { opacity: 1; transform: translateY(0); }
.p-item:nth-child(1) { transition-delay: 0.1s; }
.p-item:nth-child(2) { transition-delay: 0.3s; }
.p-item:nth-child(3) { transition-delay: 0.5s; }
.p-item:nth-child(4) { transition-delay: 0.7s; }
.p-item:nth-child(5) { transition-delay: 0.9s; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: translateY(0); } }

/* Responsive */
@media (max-width: 1200px) { .nav-container { padding: 0 20px; } .nav-menu { gap: 20px; } }
@media (max-width: 992px) {
    .navbar { height: 80px; }
    .hamburger { display: flex; }
    .logo img { height: 50px; }
    .nav-menu {
        position: fixed; top: 80px; right: -100%; width: 100%; height: calc(100vh - 80px);
        background: white; flex-direction: column; align-items: stretch; justify-content: flex-start;
        padding-top: 20px; transition: 0.4s; overflow-y: auto;
    }
    .nav-menu.active { right: 0; }
    .nav-menu > li > a { font-size: 1.5rem; justify-content: center; width: 100%; }
    .nav-menu li.has-dropdown { flex-direction: column; height: auto; width: 100%; display: flex; align-items: center; }
    .dropdown-menu {
        position: static !important; transform: none !important; box-shadow: none !important;
        opacity: 1 !important; visibility: visible !important; display: none; width: 100% !important;
        background-color: #f4f4f4; border-top: none; border-radius: 0; padding: 0;
    }
    .nav-menu li.has-dropdown:hover .dropdown-menu { display: block; animation: fadeIn 0.3s ease; }
    .dropdown-menu li a { text-align: center; justify-content: center !important; padding: 15px 0; width: 100%; padding-left: 0 !important; }
    .nav-buttons { position: fixed; bottom: 0; right: -100%; width: 100%; background: #f9f9f9; padding: 20px; flex-direction: column; transition: 0.4s; z-index: 1001; }
    .nav-buttons.active { right: 0; }
    .btn-nav-cotiza, .btn-nav-resultados { width: 100%; text-align: center; }
    .hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(6px, 7px); }
    .hamburger.active span:nth-child(2) { opacity: 0; }
    .hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(6px, -7px); }
}
/* ===========================================
   FIX: ARREGLO DEL ICONO DE WHATSAPP
   =========================================== */

/* Esto arregla el icono dentro del botón grande del Hero */
.btn-hero i {
    font-weight: 400 !important; /* Restablece el grosor para que el icono se vea nítido */
    margin-right: 10px;          /* Separa el icono del texto "WHATSAPP" */
    font-size: 1.4rem;           /* Lo hace un poquito más grande */
}

/* Asegura que el botón flotante también esté centrado y nítido */
.whatsapp-float i {
    font-weight: 400 !important;
}

@media (max-width: 768px) {
    .hero-emo { padding-top: 120px; background-position: center center; }
    .hero-content h1 { font-size: 1.8rem; }
    .hero-buttons { flex-direction: column; width: 100%; }
    .btn-hero { width: 100%; margin-bottom: 10px; }
    .stats-container { flex-direction: column; gap: 25px; padding: 25px; }
    .stat-divider { display: none; }
    .protocol-icons { gap: 30px; }
    
    /* Arreglar cards de tipos de examen en móvil */
    .card-header-ocupacional {
        flex-wrap: wrap;
    }
    
    .toggle-icon {
        margin-left: auto;
        flex-shrink: 0;
    }
    
    .steps-container { flex-direction: column; gap: 0; margin-top: 30px; padding: 0 16px; align-items: center; overflow-x: hidden; }
    .step-line {
        width: 6px; height: 60px; margin: 0; margin-bottom: 0;
        /* Vertical con los colores corregidos */
        background: linear-gradient(180deg, #e0f2f1, var(--green-brand), #e0f2f1);
        background-size: 100% 200%; animation: trafficFlowVertical 1.5s linear infinite;
    }
    .step { width: 100%; max-width: 360px; margin-bottom: 0; }
    .step-tooltip { 
        position: static !important; 
        width: 100%; 
        max-width: 360px; 
        margin: 0 auto; 
        opacity: 0; 
        visibility: hidden; 
        transform: none !important; 
        box-shadow: none; 
        border: 1px solid #eee; 
        border-top: 4px solid var(--green-brand); 
        left: auto; 
        max-height: 0; 
        overflow: hidden; 
        padding: 0 12px; 
        transition: all 0.3s ease;
        text-align: center;
    }
    .step.active .step-tooltip {
        opacity: 1;
        visibility: visible;
        margin: 10px auto 0;
        max-height: 200px;
        padding: 12px;
    }
    .step span { text-align: center; }
    .step-tooltip::before { display: none; }
    @keyframes trafficFlowVertical { 0% { background-position: 0 100%; } 100% { background-position: 0 -100%; } }
}

.whatsapp-float {
    position: fixed; bottom: 20px; right: 20px; background-color: var(--btn-green); color: white;
    width: 50px; height: 50px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: 24px; box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.3); z-index: 1000; text-decoration: none;
}

@media (max-width: 480px) {
    .card-header-ocupacional {
        display: flex;
        align-items: center;
        flex-wrap: nowrap;
        gap: 10px;
    }
    
    .icon-box {
        flex-shrink: 0;
    }
    
    .text-box {
        flex: 1;
        min-width: 0;
    }
    
    .text-box h3 {
        font-size: 1rem;
        margin: 0;
    }
    
    .text-box p {
        font-size: 0.8rem;
        margin: 3px 0 0;
    }
    
    .toggle-icon {
        flex-shrink: 0;
        margin-left: auto;
        display: flex;
        align-items: center;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .steps-container {
        max-width: 100%;
        padding: 0 10px;
        flex-wrap: wrap;
        gap: 24px 16px;
        justify-content: center;
    }

    .step {
        min-width: 240px;
        flex: 0 1 240px;
        width: 100%;
        max-width: 320px;
    }

    .step-line {
        display: none;
    }

    .step-tooltip {
        position: static !important;
        width: 100%;
        max-width: 320px;
        margin: 0 auto;
        opacity: 0;
        visibility: hidden;
        transform: none !important;
        box-shadow: none;
        border: 1px solid #eee;
        border-top: 4px solid var(--green-brand);
        left: auto;
        max-height: 0;
        overflow: hidden;
        padding: 0 12px;
        transition: all 0.3s ease;
        text-align: center;
    }

    .step.active .step-tooltip {
        opacity: 1;
        visibility: visible;
        margin: 10px auto 0;
        max-height: 200px;
        padding: 12px;
    }
}