﻿/* Plugin de WhatsApp Flotante */
.whatsapp-plugin {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.whatsapp-button {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #128C7E 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    opacity: 0;
    transform: scale(0);
}

    .whatsapp-button.show {
        animation: whatsappAppear 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    }

    .whatsapp-button:hover {
        transform: scale(1.1);
        box-shadow: 0 6px 25px rgba(37, 211, 102, 0.4);
    }

    .whatsapp-button svg {
        width: 32px;
        height: 32px;
        fill: white;
    }

.whatsapp-chat-bubble {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 320px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    overflow: hidden;
    opacity: 0;
    transform: scale(0.8) translateY(20px);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    pointer-events: none;
}

    .whatsapp-chat-bubble.active {
        opacity: 1;
        transform: scale(1) translateY(0);
        pointer-events: all;
    }

.whatsapp-chat-header {
    background: linear-gradient(135deg, #128C7E 100%);
    padding: 15px 20px;
    color: white;
    display: flex;
    align-items: center;
    gap: 12px;
}

.whatsapp-chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.whatsapp-chat-info h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.whatsapp-chat-info p {
    margin: 0;
    font-size: 12px;
    opacity: 0.9;
}

.whatsapp-chat-body {
    padding: 20px;
    background: #f0f0f0;
    min-height: 120px;
}

.whatsapp-message {
    background: white;
    padding: 12px 16px;
    border-radius: 18px 18px 18px 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 15px;
    position: relative;
    animation: messageSlideIn 0.5s ease-out 0.3s both;
}

    .whatsapp-message::before {
        content: '';
        position: absolute;
        left: -8px;
        bottom: 0;
        width: 0;
        height: 0;
        border-left: 8px solid transparent;
        border-right: 8px solid white;
        border-top: 8px solid white;
    }

    .whatsapp-message p {
        margin: 0;
        color: #333;
        font-size: 14px;
        line-height: 1.4;
    }

.whatsapp-message-time {
    font-size: 11px;
    color: #999;
    margin-top: 5px;
    text-align: right;
}

.whatsapp-send-button {
    background: #25D366;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    margin-top: 10px;
}

    .whatsapp-send-button, a:hover {
        color: white;
    } 

    .whatsapp-send-button:hover {
        background: #128C7E;
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(37, 211, 102, 0.3);
    }

.whatsapp-typing {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #666;
    font-size: 12px;
    margin-bottom: 10px;
    opacity: 0;
    animation: fadeIn 0.5s ease-out 0.8s both;
}

.whatsapp-typing-dots {
    display: flex;
    gap: 3px;
}

.whatsapp-typing-dot {
    width: 6px;
    height: 6px;
    background: #999;
    border-radius: 50%;
    animation: typingDot 1.4s infinite;
}

    .whatsapp-typing-dot:nth-child(2) {
        animation-delay: 0.2s;
    }

    .whatsapp-typing-dot:nth-child(3) {
        animation-delay: 0.4s;
    }

/* Animaciones */
@keyframes whatsappAppear {
    0% {
        opacity: 0;
        transform: scale(0) rotate(-180deg);
    }

    60% {
        opacity: 0.8;
        transform: scale(1.3) rotate(-10deg);
    }

    80% {
        opacity: 1;
        transform: scale(0.9) rotate(5deg);
    }

    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes typingDot {
    0%, 60%, 100% {
        transform: translateY(0);
    }

    30% {
        transform: translateY(-10px);
    }
}

/* Responsive */
@media (max-width: 480px) {
    .whatsapp-plugin {
        right: 15px;
        bottom: 15px;
    }

    .whatsapp-chat-bubble {
        width: 280px;
        right: -10px;
    }
}
