/* Optimización del Botón Flotante de WhatsApp */

/* Sobrescribir estilos del botón flotante */
.btn-floating.btn-wha {
    background: #25D366 !important; /* Color oficial de WhatsApp */
    border-color: #25D366 !important;
    width: 56px !important;
    height: 56px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: fixed !important; /* Mantener flotante */
    bottom: 90px !important; /* Posición original */
    right: 10px !important; /* Movido más hacia el centro */
    z-index: 11 !important; /* Mantener por encima */
    overflow: visible !important; /* Para permitir el efecto de destello */
}

/* Centrado perfecto del ícono */
.btn-floating.btn-wha i {
    font-size: 3.2rem !important; /* Más grande */
    line-height: 1 !important;
    width: auto !important;
    text-align: center !important;
    color: #fff !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    padding: 0 !important;
    position: relative;
    top: 0 !important;
    animation: whatsappHeartbeat 2.5s ease-in-out infinite;
}

/* Efecto de destello suave - anillo exterior */
.btn-floating.btn-wha::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    background: radial-gradient(circle, rgba(37, 211, 102, 0.3) 0%, rgba(37, 211, 102, 0.1) 50%, transparent 70%);
    border-radius: 50%;
    animation: whatsappGlow 3s ease-in-out infinite;
    z-index: -1;
}

/* Efecto de destello suave - anillo interior */
.btn-floating.btn-wha::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: rgba(37, 211, 102, 0.2);
    border-radius: 50%;
    animation: whatsappPulse 2s ease-in-out infinite alternate;
    z-index: -1;
}

/* Animación de destello principal */
@keyframes whatsappGlow {
    0% {
        opacity: 0.7;
        transform: scale(1);
    }
    50% {
        opacity: 0.9;
        transform: scale(1.08);
    }
    100% {
        opacity: 0.7;
        transform: scale(1);
    }
}

/* Animación de pulso sutil */
@keyframes whatsappPulse {
    0% {
        opacity: 0.3;
        transform: scale(1);
    }
    100% {
        opacity: 0.5;
        transform: scale(1.03);
    }
}

/* Animación de palpitación del ícono */
@keyframes whatsappHeartbeat {
    0% {
        transform: scale(1);
    }
    14% {
        transform: scale(1.1);
    }
    28% {
        transform: scale(1);
    }
    42% {
        transform: scale(1.1);
    }
    70% {
        transform: scale(1);
    }
    100% {
        transform: scale(1);
    }
}

/* Hover effect mejorado */
.btn-floating.btn-wha:hover {
    background: #1ebe57 !important; /* Tono más oscuro en hover */
    transform: scale(1.05);
    box-shadow: 0 8px 16px 0 rgba(37, 211, 102, 0.3),
                0 6px 20px 0 rgba(37, 211, 102, 0.2) !important;
}

/* Pausa todas las animaciones en hover para no ser molesto */
.btn-floating.btn-wha:hover::before,
.btn-floating.btn-wha:hover::after {
    animation-play-state: paused;
}

.btn-floating.btn-wha:hover i {
    animation-play-state: paused;
    transform: scale(1.05); /* Ligero crecimiento en hover */
}

/* Responsive - ajustar tamaño en móviles */
@media (max-width: 768px) {
    .btn-floating.btn-wha {
        width: 52px !important;
        height: 52px !important;
        bottom: 85px !important; /* Un poco más arriba del scroll-top */
        right: 15px !important; /* Alineado con scroll-top */
    }

    .btn-floating.btn-wha i {
        font-size: 2.8rem !important; /* Más grande también en móviles */
    }
}

/* Accesibilidad - reduce motion para usuarios que lo prefieren */
@media (prefers-reduced-motion: reduce) {
    .btn-floating.btn-wha::before,
    .btn-floating.btn-wha::after,
    .btn-floating.btn-wha i {
        animation: none !important;
    }

    .btn-floating.btn-wha i {
        transform: none !important;
    }
}