﻿.bw-floating-chat-btn {
    position: relative;
    background: linear-gradient(135deg, #ff0b63 0%, #ff562b 100%) !important;
    color: #fff !important;
    box-shadow: 0 18px 34px rgba(255, 58, 107, 0.34) !important;
}

.bw-chat-launcher-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #15c97f;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1;
    border: 2px solid #fff;
}

.bw-chat-widget {
    position: fixed;
    right: 14px;
    bottom: 16px;
    left: auto;
    width: auto;
    padding: 0;
    display: flex;
    justify-content: flex-end;
    pointer-events: none;
    z-index: 1200;
}

.bw-chat-widget [hidden] {
    display: none !important;
}

.bw-chat-panel {
    width: min(360px, calc(100vw - 18px));
    min-height: 392px;
    height: clamp(392px, 55vh, 440px);
    max-height: calc(100vh - 24px);
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: #e8edf4;
    border: 1px solid #d4dbe6;
    box-shadow: 0 26px 54px rgba(17, 25, 41, 0.34);
    pointer-events: auto;
}

.bw-chat-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 14px;
    color: #fff;
    background: linear-gradient(135deg, #ff0f6f 0%, #ff4026 100%);
}

.bw-chat-header-icon,
.bw-chat-close {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 34px;
}

.bw-chat-header-icon {
    background: rgba(255, 255, 255, 0.2);
    font-size: 0.9rem;
}

.bw-chat-header-copy {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.bw-chat-header-copy strong {
    font-size: 1.62rem;
    font-weight: 800;
    line-height: 1.08;
}

.bw-chat-header-copy span {
    font-size: 0.9rem;
    font-weight: 600;
    opacity: 0.9;
}

.bw-chat-close {
    border: 0;
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    cursor: pointer;
    transition: transform 0.18s ease, background-color 0.18s ease;
}

.bw-chat-close:hover {
    transform: rotate(90deg);
    background: rgba(255, 255, 255, 0.28);
}

.bw-chat-body {
    min-height: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #e7ecf3;
}

.bw-chat-live-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 8px 8px 0;
    background: #e7ecf3;
}

.bw-chat-live-link {
    min-height: 34px;
    border-radius: 999px;
    border: 1px solid #d1d9e5;
    background: #f4f7fb;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 10px;
    font-size: 0.76rem;
    font-weight: 800;
    color: #1f2d42;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bw-chat-live-link i {
    font-size: 0.95rem;
    flex: 0 0 auto;
}

.bw-chat-live-link span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bw-chat-live-link.is-facebook i {
    color: #1877f2;
}

.bw-chat-live-link.is-whatsapp i {
    color: #16a34a;
}

.bw-chat-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 12px 8px 8px;
    scrollbar-width: thin;
    scrollbar-color: #b7bfca transparent;
}

.bw-chat-scroll::-webkit-scrollbar {
    width: 6px;
}

.bw-chat-scroll::-webkit-scrollbar-thumb {
    background: #b7bfca;
    border-radius: 999px;
}

.bw-chat-static-row,
.bw-chat-message-row {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    margin-bottom: 10px;
}

.bw-chat-message-row.is-self {
    justify-content: flex-end;
}

.bw-chat-avatar {
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: linear-gradient(135deg, #ff472c 0%, #ff0b62 100%);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 800;
}

.bw-chat-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bw-chat-static-copy,
.bw-chat-message-copy {
    display: flex;
    flex-direction: column;
    max-width: calc(100% - 38px);
}

.bw-chat-message-row.is-self .bw-chat-message-copy {
    align-items: flex-end;
}

.bw-chat-bubble {
    max-width: 100%;
    padding: 11px 13px;
    border-radius: 14px;
    font-size: 0.95rem;
    line-height: 1.5;
    word-break: break-word;
    box-shadow: 0 2px 0 rgba(17, 25, 41, 0.02);
}

.bw-chat-bubble-admin {
    border-top-left-radius: 8px;
    background: #f3f5f8;
    color: #2a3548;
    border: 1px solid #e2e7ee;
}

.bw-chat-bubble-self {
    border-bottom-right-radius: 8px;
    background: linear-gradient(135deg, #ff0f6f 0%, #ff4a2a 100%);
    color: #fff;
}

.bw-chat-time {
    margin-top: 4px;
    padding: 0 4px;
    color: #8a92a1;
    font-size: 0.7rem;
    font-weight: 600;
}

.bw-chat-quick-replies {
    display: grid;
    gap: 8px;
    margin: 8px 0 10px;
}

.bw-chat-quick-reply {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d3dae5;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    background: #f3f5f8;
    color: #273446;
    font-size: 0.9rem;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
}

.bw-chat-quick-reply:hover {
    transform: translateY(-1px);
    border-color: #bcc8d8;
    background: #f7f9fc;
}

.bw-chat-quick-reply i {
    color: #667386;
    font-size: 0.82rem;
}

.bw-chat-message-list:empty {
    display: none;
}

.bw-chat-auth-box,
.bw-chat-attachment-preview {
    margin: 0 8px 8px;
    padding: 12px;
    border-radius: 12px;
    background: #f3f5f8;
    border: 1px solid #d3dae5;
}

.bw-chat-auth-box p {
    margin: 0;
    color: #4b5566;
    font-size: 0.88rem;
    line-height: 1.5;
}

.bw-chat-auth-actions {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

.bw-chat-auth-btn {
    padding: 10px 14px;
    border-radius: 999px;
    border: 1px solid #d3dae5;
    color: #20324a;
    font-size: 0.84rem;
    font-weight: 800;
    text-decoration: none;
    background: #fff;
}

.bw-chat-auth-btn-primary {
    border-color: transparent;
    background: linear-gradient(135deg, #ff0f6f 0%, #ff4a2a 100%);
    color: #fff;
}

.bw-chat-attachment-preview {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: #344055;
    font-size: 0.82rem;
    font-weight: 700;
}

.bw-chat-attachment-preview button {
    border: 0;
    background: transparent;
    color: #ff3358;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 800;
}

.bw-chat-attachment-link {
    margin-top: 8px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: inherit;
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 800;
}

.bw-chat-composer {
    position: relative;
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 8px;
    background: #e7ecf3;
    border-top: 1px solid #ccd4e0;
}

.bw-chat-composer-btn,
.bw-chat-send {
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.18s ease, background-color 0.18s ease, color 0.18s ease;
}

.bw-chat-composer-btn {
    background: transparent;
    color: #8f98a8;
}

.bw-chat-composer-btn:disabled,
.bw-chat-send:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.bw-chat-send {
    background: #d7dde7;
    color: #8f98a8;
}

.bw-chat-send.is-ready {
    background: linear-gradient(135deg, #ff0f6f 0%, #ff4b2a 100%);
    color: #fff;
    box-shadow: 0 8px 18px rgba(255, 61, 95, 0.22);
}

.bw-chat-composer-btn:hover,
.bw-chat-send:hover {
    transform: translateY(-1px);
}

.bw-chat-input {
    flex: 1;
    min-width: 0;
    height: 36px;
    padding: 0 12px;
    border: 1px solid #d4dbe6;
    border-radius: 999px;
    background: #f2f5f9;
    color: #2b3549;
    font-size: 0.84rem;
    outline: none;
}

.bw-chat-input:focus {
    border-color: rgba(255, 71, 97, 0.32);
    box-shadow: 0 0 0 3px rgba(255, 71, 97, 0.1);
}

.bw-chat-emoji-wrap {
    position: relative;
}

.bw-chat-emoji-picker {
    position: absolute;
    left: 0;
    bottom: calc(100% + 8px);
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    width: 132px;
    padding: 10px;
    border: 1px solid #d3dae5;
    border-radius: 12px;
    background: #f4f7fb;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.12);
}

.bw-chat-emoji-picker button {
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 10px;
    background: #fff;
    font-size: 1rem;
    cursor: pointer;
}

.bw-chat-is-loading::after {
    content: '';
    width: 16px;
    height: 16px;
    border-radius: 999px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    animation: bw-chat-spin 0.7s linear infinite;
}

@keyframes bw-chat-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 1024px) {
    .bw-chat-widget {
        right: 10px;
        bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    }

    .bw-chat-panel {
        width: min(360px, calc(100vw - 14px));
        max-height: calc(100vh - 24px - env(safe-area-inset-bottom, 0px));
    }
}

@media (max-width: 768px) {
    .bw-chat-widget {
        left: auto;
        right: 8px;
        bottom: calc(72px + env(safe-area-inset-bottom, 0px));
        display: flex;
        justify-content: flex-end;
        width: auto;
        padding: 0;
    }

    .bw-chat-panel {
        width: min(348px, calc(100vw - 16px));
        min-height: 372px;
        height: min(560px, calc(100vh - 134px - env(safe-area-inset-bottom, 0px)));
        max-height: calc(100vh - 134px - env(safe-area-inset-bottom, 0px));
        border-radius: 18px;
        box-shadow: 0 24px 42px rgba(17, 25, 41, 0.3);
    }

    .bw-chat-header {
        gap: 10px;
        padding: 11px 12px;
    }

    .bw-chat-header-icon,
    .bw-chat-close {
        width: 32px;
        height: 32px;
        flex-basis: 32px;
    }

    .bw-chat-scroll {
        padding: 10px 8px 8px;
    }

    .bw-chat-live-links {
        gap: 6px;
        padding: 7px 8px 0;
    }

    .bw-chat-live-link {
        min-height: 32px;
        padding: 0 8px;
        font-size: 0.72rem;
    }

    .bw-chat-header-copy strong {
        font-size: 1.06rem;
        line-height: 1.12;
    }

    .bw-chat-header-copy span {
        font-size: 0.82rem;
        line-height: 1.2;
    }

    .bw-chat-bubble {
        font-size: 0.88rem;
    }

    .bw-chat-quick-reply {
        padding: 9px 12px;
        font-size: 0.84rem;
    }

    .bw-chat-composer {
        padding: 8px 7px;
    }

    .bw-chat-input {
        height: 34px;
        font-size: 0.82rem;
    }

    .bw-chat-composer-btn,
    .bw-chat-send {
        width: 28px;
        height: 28px;
    }

    .bw-chat-time {
        font-size: 0.66rem;
    }

    .bw-chat-attachment-preview,
    .bw-chat-auth-box p {
        font-size: 0.8rem;
    }
}
