
.whatsapp-widget {
    position: fixed;
    bottom: 25px;
    right: 25px;
    z-index: 9999;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Botón principal de WhatsApp */
.whatsapp-button {
    width: 65px;
    height: 65px;
    background: linear-gradient(135deg, #25D366, #128C7E);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 30px rgba(37, 211, 102, 0.4);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    animation: pulse-whatsapp 2s infinite;
}

.whatsapp-button:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 12px 40px rgba(37, 211, 102, 0.6);
}

.whatsapp-button:active {
    transform: scale(0.95);
}

/* Icono de WhatsApp */
.whatsapp-button svg {
    width: 36px;
    height: 36px;
    fill: white;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

/* Animación de pulso */
@keyframes pulse-whatsapp {
    0%, 100% {
        box-shadow: 0 8px 30px rgba(37, 211, 102, 0.4), 
                    0 0 0 0 rgba(37, 211, 102, 0.4);
    }
    50% {
        box-shadow: 0 8px 30px rgba(37, 211, 102, 0.4), 
                    0 0 0 15px rgba(37, 211, 102, 0);
    }
}

/* Badge de notificación */
.whatsapp-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: linear-gradient(135deg, #FF4444, #CC0000);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    border: 3px solid var(--dark);
    animation: bounce-badge 1s infinite;
}

@keyframes bounce-badge {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-5px) scale(1.1); }
}

/* Tooltip flotante */
.whatsapp-tooltip {
    position: absolute;
    right: 75px;
    bottom: 15px;
    background: rgba(10, 14, 39, 0.95);
    backdrop-filter: blur(10px);
    color: white;
    padding: 12px 20px;
    border-radius: 12px;
    white-space: nowrap;
    font-size: 14px;
    font-weight: 500;
    opacity: 0;
    pointer-events: none;
    transform: translateX(10px);
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(37, 211, 102, 0.3);
}

.whatsapp-tooltip::after {
    content: '';
    position: absolute;
    right: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid rgba(10, 14, 39, 0.95);
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
}

.whatsapp-button:hover .whatsapp-tooltip {
    opacity: 1;
    transform: translateX(0);
}


.whatsapp-popup {
    position: absolute;
    bottom: 85px;
    right: 0;
    width: 320px;
    background: rgba(10, 14, 39, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0;
    transform: translateY(20px) scale(0.9);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: none;
    overflow: hidden;
}

.whatsapp-popup.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

/* Header del popup */
.whatsapp-popup-header {
    background: linear-gradient(135deg, #25D366, #128C7E);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.whatsapp-popup-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.whatsapp-popup-info h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: white;
}

.whatsapp-popup-info p {
    margin: 4px 0 0;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
}

/* Contenido del popup */
.whatsapp-popup-body {
    padding: 20px;
}

.whatsapp-message-bubble {
    background: rgba(37, 211, 102, 0.1);
    border: 1px solid rgba(37, 211, 102, 0.3);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
    font-size: 14px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.9);
}

.whatsapp-message-bubble::before {
    content: '💬';
    margin-right: 8px;
}

/* Botón de acción en popup */
.whatsapp-action-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #25D366, #128C7E);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.3);
}

.whatsapp-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(37, 211, 102, 0.5);
}

.whatsapp-action-btn:active {
    transform: translateY(0);
}

/* Botón de cerrar popup */
.whatsapp-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 30px;
    height: 30px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    transition: all 0.3s;
}

.whatsapp-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}



@media (max-width: 768px) {
    .whatsapp-widget {
        bottom: 20px;
        right: 20px;
    }

    .whatsapp-button {
        width: 60px;
        height: 60px;
    }

    .whatsapp-button svg {
        width: 32px;
        height: 32px;
    }

    .whatsapp-popup {
        width: calc(100vw - 40px);
        right: -20px;
        bottom: 75px;
    }

    .whatsapp-tooltip {
        display: none; 
    }
}

@media (max-width: 480px) {
    .whatsapp-button {
        width: 55px;
        height: 55px;
    }

    .whatsapp-button svg {
        width: 28px;
        height: 28px;
    }

    .whatsapp-popup {
        bottom: 70px;
    }
}

/* Animación de entrada del widget */
@keyframes slideInWidget {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.whatsapp-widget {
    animation: slideInWidget 0.6s ease-out 0.5s backwards;
}
