/* ============================================
   WHATSAPP CHAT WIDGET
   Floating WhatsApp button with chat bubble
   Bottom-left (LTR): avoids overlap with Nexivo / Hadiya (bottom-right)
   ============================================ */

/* WhatsApp Chat Widget Container */
.whatsapp-chat-widget {
    position: fixed;
    left: 20px;
    right: auto;
    bottom: 20px;
    z-index: 9998;
    font-family: 'Inter', 'Poppins', sans-serif;
}

/* WhatsApp Button */
.whatsapp-chat-button {
    width: 60px;
    height: 60px;
    background: #25D366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: visible;
}

.whatsapp-chat-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.6);
}

.whatsapp-chat-button i {
    color: white;
    font-size: 32px;
}

/* Chat Bubble - Hidden by default */
.whatsapp-chat-bubble {
    position: absolute;
    bottom: 75px;
    left: 0;
    right: auto;
    background: white;
    padding: 16px 20px;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    max-width: 250px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px) scale(0.9);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.whatsapp-chat-bubble::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 20px;
    right: auto;
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid white;
}

/* Show bubble when widget is active */
.whatsapp-chat-widget.active .whatsapp-chat-bubble {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* Chat Bubble Text */
.whatsapp-chat-bubble p {
    margin: 0;
    color: #333;
    font-size: 14px;
    line-height: 1.5;
    font-weight: 500;
}

.whatsapp-chat-bubble .chat-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
    color: #666;
    transition: all 0.2s;
}

.whatsapp-chat-bubble .chat-close:hover {
    background: #e0e0e0;
    color: #333;
}

/* Pulse Animation */
@keyframes whatsapp-pulse {
    0% {
        box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
    }
    50% {
        box-shadow: 0 4px 20px rgba(37, 211, 102, 0.8);
    }
    100% {
        box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
    }
}

.whatsapp-chat-button {
    animation: whatsapp-pulse 2s infinite;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .whatsapp-chat-widget {
        bottom: 15px;
        left: 15px;
        right: auto;
    }

    .whatsapp-chat-button {
        width: 56px;
        height: 56px;
    }

    .whatsapp-chat-button i {
        font-size: 28px;
    }

    .whatsapp-chat-bubble {
        bottom: 70px;
        max-width: 220px;
        padding: 14px 18px;
        font-size: 13px;
    }

    .whatsapp-chat-bubble::after {
        left: 18px;
        right: auto;
    }
}

@media (max-width: 480px) {
    .whatsapp-chat-widget {
        bottom: 10px;
        left: 10px;
        right: auto;
    }

    .whatsapp-chat-button {
        width: 52px;
        height: 52px;
    }

    .whatsapp-chat-button i {
        font-size: 26px;
    }

    .whatsapp-chat-bubble {
        bottom: 65px;
        max-width: 200px;
        padding: 12px 16px;
        font-size: 12px;
    }
}

/* RTL: mirror — WhatsApp bottom-right so it stays opposite the main chat if that widget mirrors too */
body.rtl .whatsapp-chat-widget {
    left: auto;
    right: 20px;
}

body.rtl .whatsapp-chat-bubble {
    left: auto;
    right: 0;
}

body.rtl .whatsapp-chat-bubble::after {
    left: auto;
    right: 20px;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid white;
}

@media (max-width: 768px) {
    body.rtl .whatsapp-chat-widget {
        right: 15px;
        left: auto;
    }

    body.rtl .whatsapp-chat-bubble::after {
        right: 18px;
        left: auto;
    }
}

@media (max-width: 480px) {
    body.rtl .whatsapp-chat-widget {
        right: 10px;
        left: auto;
    }
}
