/* --- Estilos para el Botón Flotante "Quiero Postular" --- */

/* 1. Contenedor principal */
.floating-postular-button {
    position: fixed !important;
    bottom: 200px !important;    
    right: 0px !important;
    z-index: 9998 !important;    
    overflow: visible !important; 
    padding-top: 10px;          
}

/* 2. Botón principal "Quiero Postular" */
.floating-postular-button .main-button {
    background-color: #e3173e;
    color: white;
    padding: 14px 20px;
    border-radius: 50px;
    font-weight: 500;
    font-size: 13px;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
    transition: all 0.3s ease; /* 'all' incluye el 'transform' del hover */
    margin: 0;
    width: auto;
    height: auto;
    position: relative;
    animation: pulse-shadow 2.5s infinite ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 2b. Icono (Imagen) */
.floating-postular-button .main-button .postular-icon {
    margin-right: 8px;
    width: 35px; 
    height: 35px;
    flex-shrink: 0;
}

/* 2c. Texto (para ocultar en móvil) */
.floating-postular-button .main-button .main-button-text {
    display: inline-block;
    transition: all 0.3s ease;
}

/* 2d. --- AÑADIDO: Efecto Hover (sin cambiar sombra) --- */
.floating-postular-button .main-button:hover {
    /* Mueve el botón 3px hacia arriba */
    transform: translateY(-3px);
    /* No se toca la sombra para respetar la animación 'pulse-shadow' */
}


/* 3. El menú desplegable */
.floating-postular-button .floating-postular-dropdown {
    display: none; /* Oculto por defecto */
    position: absolute;
    bottom: 100%; 
    right: 10px;
    min-width: 200px;
    background-color: white !important; /* Forzar fondo sólido */
    border-radius: 8px;
    box-shadow: 0 6px 15px rgba(0,0,0,0.2);
    list-style: none !important; /* Anular estilos de plantilla */
    padding: 10px 0 !important; /* Anular estilos de plantilla */
    margin: 0 !important; /* Anular estilos de plantilla */
    z-index: 9999 !important; 
    font-weight: 500;
    opacity: 1 !important; /* Forzar opacidad sólida */
}

/* 4. Los items del menú (<li>) */
.floating-postular-button .floating-postular-item {
    padding: 0 !important;
    margin: 0 !important;
    list-style-type: none !important;
    background: none !important;
    
    /* --- MODIFICADO: Esta es la línea de separación --- */
    border-bottom: 1px solid #eee !important;
}

/* 4b. --- AÑADIDO: Quitar borde al último ítem --- */
.floating-postular-button .floating-postular-item:last-child {
    border-bottom: none !important;
}

/* 5. Los enlaces dentro del menú (<a>) */
.floating-postular-button .floating-postular-link {
    display: block !important;
    padding: 5px 10px !important;
    color: #333 !important; 
    opacity: 1 !important; 
    font-weight: 500 !important;
    text-decoration: none !important;
    white-space: nowrap;
    position: relative;
    transition: color 0.3s ease;
    border: none !important; /* Anular bordes heredados */
}

/* 6. Pseudo-elemento para el subrayado */
.floating-postular-button .floating-postular-link::after {
    content: '' !important;
    position: absolute !important;
    bottom: 0 !important;
    left: 10px !important;
    width: 0 !important;  
    height: 2px !important;
    background-color: #e3173e !important;
    transition: width 0.3s ease-in-out;
}

/* 7. Efecto hover de los enlaces del menú */
.floating-postular-button .floating-postular-link:hover {
    background-color: #f5f5ff !important;  /* Ligeramente azulado */
    color: #565454 !important;
}

.floating-postular-button .floating-postular-link:hover::after {
    width: calc(100% - 20px) !important;
}

/* * --- CAMBIO IMPORTANTE: DE :hover A .is-open ---
 * Estas reglas se activarán con JavaScript al hacer clic
 */

/* 8. Mostrar el menú cuando el contenedor tenga la clase .is-open */
.floating-postular-button.is-open .floating-postular-dropdown {
    display: block !important;
}

/* 9. Oscurecer el botón principal cuando el menú está abierto */
.floating-postular-button.is-open .main-button {
    background-color: #565454; 
    /* Detenemos la animación de pulso cuando está abierto */
    animation: none;
}


/* --- ANIMACIÓN DE PULSO --- */
@keyframes pulse-shadow {
    0% {
        box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    }
    50% {
        box-shadow: 0 6px 25px rgba(0,0,0,0.4); 
    }
    100% {
        box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    }
}


/* --- ESTILOS PARA MÓVIL (max-width: 767px) --- */
@media (max-width: 767px) {
    
    .floating-postular-button {
        bottom: 180px !important;
        right: 5px !important; 
        padding-top: 0 !important;
    }

    .floating-postular-button .main-button {
        width: 50px; 
        height: 50px; 
        padding: 0; 
        border-radius: 50%; 
    }
    
    .floating-postular-button .main-button .postular-icon {
        margin-right: 0; 
        width: 35px; 
        height: 35px;
    }
    
    .floating-postular-button .main-button .main-button-text {
        display: none; 
    }

    /* Menú desplegable en móvil */
    .floating-postular-button .floating-postular-dropdown {
        min-width: 180px;
        right: 0;
        bottom: 60px; /* (50px alto botón + 10px margen) */
        opacity: 1 !important; 
    }

    /* Enlaces del menú en móvil */
    .floating-postular-button .floating-postular-link {
        padding: 10px 18px !important;
        font-size: 14px !important;
    }
}