/* ════════════════════════════════════════════════
   CHATBOT WIDGET — WhatsApp Floating Bubble
   ════════════════════════════════════════════════ */

.bw-chatbot {
    position: fixed;
    bottom: 90px;
    right: 30px;
    z-index: 950;
    font-family: var(--font-body, 'Inter', sans-serif);
}

/* Floating Bubble */
.chatbot-bubble {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #25D366;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(37, 211, 102, .35);
    transition: all .3s cubic-bezier(.25,.46,.45,.94);
    position: relative;
    animation: chatbot-pulse 2s ease-in-out infinite;
}

.chatbot-bubble:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(37, 211, 102, .5);
}

.chatbot-bubble svg {
    width: 30px;
    height: 30px;
    fill: #fff;
    transition: transform .3s;
}

.chatbot-bubble.is-open svg {
    transform: rotate(90deg);
}

@keyframes chatbot-pulse {
    0%, 100% { box-shadow: 0 4px 20px rgba(37, 211, 102, .35); }
    50% { box-shadow: 0 4px 30px rgba(37, 211, 102, .5), 0 0 0 8px rgba(37, 211, 102, .1); }
}

/* Tooltip */
.chatbot-tooltip {
    position: absolute;
    right: 70px;
    top: 50%;
    transform: translateY(-50%);
    background: #fff;
    color: #1a1a1a;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: .85rem;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 4px 15px rgba(0,0,0,.15);
    opacity: 0;
    visibility: hidden;
    transition: all .3s;
    pointer-events: none;
}

.chatbot-tooltip::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    border: 6px solid transparent;
    border-left-color: #fff;
}

.chatbot-bubble:hover .chatbot-tooltip,
.chatbot-tooltip.show {
    opacity: 1;
    visibility: visible;
}

/* Chat Window */
.chatbot-window {
    position: absolute;
    bottom: 75px;
    right: 0;
    width: 340px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,.25);
    overflow: hidden;
    transform: scale(0.8) translateY(20px);
    transform-origin: bottom right;
    opacity: 0;
    visibility: hidden;
    transition: all .35s cubic-bezier(.25,.46,.45,.94);
}

.chatbot-window.is-open {
    transform: scale(1) translateY(0);
    opacity: 1;
    visibility: visible;
}

/* Chat Header */
.chatbot-header {
    background: #25D366;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: .75rem;
}

.chatbot-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,.2);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.chatbot-avatar svg {
    width: 22px;
    height: 22px;
    fill: #fff;
}

.chatbot-header-info h4 {
    color: #fff;
    font-size: .95rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.3;
}

.chatbot-header-info span {
    color: rgba(255,255,255,.8);
    font-size: .75rem;
}

.chatbot-close {
    margin-left: auto;
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background .3s;
}

.chatbot-close:hover {
    background: rgba(255,255,255,.2);
}

/* Chat Body */
.chatbot-body {
    padding: 1.25rem;
    background: #ECE5DD url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23d4cfc7' fill-opacity='0.15'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    min-height: 120px;
}

.chatbot-message {
    background: #fff;
    padding: .75rem 1rem;
    border-radius: 0 12px 12px 12px;
    font-size: .88rem;
    line-height: 1.5;
    color: #1a1a1a;
    max-width: 85%;
    box-shadow: 0 1px 2px rgba(0,0,0,.08);
    position: relative;
}

.chatbot-message::before {
    content: '';
    position: absolute;
    top: 0;
    left: -8px;
    border: 8px solid transparent;
    border-top-color: #fff;
    border-right-color: #fff;
}

.chatbot-message .time {
    display: block;
    text-align: right;
    font-size: .7rem;
    color: #999;
    margin-top: .25rem;
}

/* Chat Action */
.chatbot-action {
    padding: 1rem 1.25rem;
    background: #fff;
    border-top: 1px solid #eee;
}

.chatbot-action a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    width: 100%;
    padding: .75rem 1.5rem;
    background: #25D366;
    color: #fff;
    border-radius: 24px;
    font-weight: 700;
    font-size: .9rem;
    text-decoration: none;
    transition: all .3s;
}

.chatbot-action a:hover {
    background: #1fb855;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37,211,102,.3);
}

.chatbot-action a svg {
    width: 20px;
    height: 20px;
    fill: #fff;
}

/* Mobile */
@media (max-width: 480px) {
    .bw-chatbot {
        bottom: 80px;
        right: 16px;
    }
    .chatbot-window {
        width: calc(100vw - 32px);
        right: -14px;
    }
    .chatbot-bubble {
        width: 52px;
        height: 52px;
    }
}
