/* Contenedor principal para todos los elementos de WhatsApp */
.whatsapp-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
}

/* Burbuja principal de WhatsApp */
.whatsapp-bubble {
    position: relative;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.whatsapp-bubble-inner {
    width: 60px;
    height: 60px;
    background-color: #25d366;
    border-radius: 50%;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.whatsapp-bubble-inner:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    background-color: #22c15e;
}

.whatsapp-bubble-inner a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: white;
    text-decoration: none;
}

.whatsapp-bubble-inner i {
    font-size: 30px;
}

/* Efecto de pulso alrededor del icono */
.whatsapp-pulse {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.5);
    animation: pulse 2s infinite;
    z-index: -1;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7);
    }
    70% {
        transform: scale(1.15);
        box-shadow: 0 0 0 10px rgba(37, 211, 102, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
    }
}

/* Botón para cerrar */
.whatsapp-close {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    background-color: #f8f9fa;
    border: none;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    color: #dc3545;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 2;
}

.whatsapp-close:hover {
    background-color: #dc3545;
    color: white;
    transform: scale(1.1);
}

/* Texto flotante que aparece al pasar el cursor */
.whatsapp-tooltip {
    position: absolute;
    right: 70px;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(255, 255, 255, 0.95);
    color: #333;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 14px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
}

.whatsapp-tooltip:after {
    content: '';
    position: absolute;
    right: -8px;
    top: 50%;
    transform: translateY(-50%);
    border-left: 8px solid rgba(255, 255, 255, 0.95);
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
}

.whatsapp-bubble-inner:hover .whatsapp-tooltip {
    opacity: 1;
    right: 75px;
}

/* Botón para mostrar cuando está oculto */
.whatsapp-show-btn {
    position: fixed;
    bottom: 30px;
    right: -180px; /* Inicialmente fuera de la pantalla */
    background-color: #f8f9fa;
    border-radius: 30px 0 0 30px;
    padding: 10px 15px 10px 20px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    z-index: 999;
    opacity: 0;
}

.whatsapp-show-btn.active {
    right: 0;
    opacity: 1;
}

.whatsapp-show-icon {
    display: flex;
    align-items: center;
}

.whatsapp-show-icon i {
    color: #25d366;
    font-size: 20px;
    margin-right: 8px;
}

.whatsapp-show-icon span {
    color: #333;
    font-size: 14px;
    font-weight: 500;
}

/* Estados */
.whatsapp-bubble.visible {
    transform: translateX(0);
}

.whatsapp-bubble.hidden {
    transform: translateX(200px);
}

/* Animación para dispositivos pequeños */
@media (max-width: 767.98px) {
    .whatsapp-container {
        bottom: 20px;
        right: 20px;
    }

    .whatsapp-bubble-inner {
        width: 50px;
        height: 50px;
    }

    .whatsapp-bubble-inner i {
        font-size: 25px;
    }

    .whatsapp-show-btn {
        bottom: 20px;
    }
}