/* ================================================================
   Floating Customer Service Button — Premium
   ================================================================ */
.bw-cs-float {
    position: fixed;
    bottom: 32px;
    right: 32px;
    z-index: 999999;
    width: auto;
    min-width: 64px;
    height: auto;
    padding: 10px 14px 8px;
    border-radius: 36px;
    background: linear-gradient(135deg, #1a2744 0%, #0d1d1a 100%);
    border: 2.5px solid #c9a96e;
    box-shadow:
        0 6px 28px rgba(0, 0, 0, 0.3),
        0 0 0 0 rgba(201, 169, 110, 0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275),
                box-shadow 0.35s ease,
                background 0.35s ease;
    text-decoration: none;
}

.bw-cs-float:hover {
    transform: scale(1.08);
    box-shadow:
        0 10px 36px rgba(0, 0, 0, 0.4),
        0 0 0 8px rgba(201, 169, 110, 0.12);
    background: linear-gradient(135deg, #1e3048 0%, #111e1d 100%);
    border-color: #d4af6e;
}

.bw-cs-float:active {
    transform: scale(0.94);
    box-shadow:
        0 4px 16px rgba(0, 0, 0, 0.35),
        0 0 0 4px rgba(201, 169, 110, 0.15);
}

/* ── Icon ── */
.bw-cs-icon {
    width: 38px;
    height: 38px;
    display: block;
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.3));
    transition: transform 0.3s ease;
}

.bw-cs-float:hover .bw-cs-icon {
    transform: scale(1.06);
}

/* ── Label ── */
.bw-cs-label {
    font-size: 10px;
    font-weight: 500;
    color: #ffffff;
    letter-spacing: 0.5px;
    text-align: center;
    white-space: nowrap;
    line-height: 1;
    padding-bottom: 2px;
}

/* ── Pulse ring ── */
.bw-cs-float::after {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 42px;
    border: 2.5px solid #c9a96e;
    opacity: 0.5;
    animation: bw-cs-pulse 2.4s cubic-bezier(0.4, 0, 0.6, 1) infinite;
    pointer-events: none;
}

@keyframes bw-cs-pulse {
    0% { transform: scale(1); opacity: 0.5; }
    50% { opacity: 0.25; }
    100% { transform: scale(1.15); opacity: 0; }
}

/* Hide pulse when chat is open */
.bw-cs-float-active::after { display: none; }

/* ── Mobile tweak ── */
@media (max-width: 640px) {
    .bw-cs-float {
        bottom: 20px;
        right: 16px;
        padding: 8px 12px 6px;
        min-width: 56px;
        border-radius: 32px;
        gap: 3px;
    }
    .bw-cs-icon {
        width: 32px;
        height: 32px;
    }
    .bw-cs-label {
        font-size: 9px;
        letter-spacing: 0.3px;
    }
}

/* ================================================================
   Chat Popup
   ================================================================ */
.bw-chat-popup {
    position: fixed;
    bottom: 104px;
    right: 32px;
    z-index: 999998;
    width: 340px;
    height: 440px;
    max-height: calc(100vh - 140px);
    background: #14141e;
    border: 1px solid #2a2a3a;
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(16px) scale(0.95);
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.bw-chat-popup.bw-chat-open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* Header */
.bw-chat-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: #1a1a28;
    border-bottom: 1px solid #2a2a3a;
    flex-shrink: 0;
}

.bw-chat-header-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #0d0d1a;
    border: 2px solid #c9a96e;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.bw-chat-header-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.bw-chat-header-name {
    font-size: 14px;
    font-weight: 600;
    color: #e8e0d5;
    line-height: 1.3;
}

.bw-chat-header-status {
    font-size: 11px;
    color: #7eb87e;
    line-height: 1.2;
}

.bw-chat-close {
    background: none;
    border: none;
    color: #888;
    font-size: 22px;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: color 0.2s, background 0.2s;
    flex-shrink: 0;
    padding: 0;
    line-height: 1;
}

.bw-chat-close:hover {
    color: #c9a96e;
    background: rgba(201, 169, 110, 0.1);
}

/* Body */
.bw-chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scroll-behavior: smooth;
}

.bw-chat-body::-webkit-scrollbar {
    width: 4px;
}

.bw-chat-body::-webkit-scrollbar-track {
    background: transparent;
}

.bw-chat-body::-webkit-scrollbar-thumb {
    background: #2a2a3a;
    border-radius: 2px;
}

/* Messages */
.bw-chat-msg {
    display: flex;
    max-width: 85%;
}

.bw-chat-msg-bot {
    align-self: flex-start;
}

.bw-chat-msg-user {
    align-self: flex-end;
}

.bw-chat-bubble {
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 13px;
    line-height: 1.55;
    word-break: break-word;
}

.bw-chat-msg-bot .bw-chat-bubble {
    background: #1e1e2e;
    color: #d0d0dc;
    border-bottom-left-radius: 4px;
}

.bw-chat-msg-user .bw-chat-bubble {
    background: #c9a96e;
    color: #0d0d1a;
    border-bottom-right-radius: 4px;
}

/* Footer */
.bw-chat-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-top: 1px solid #2a2a3a;
    background: #1a1a28;
    flex-shrink: 0;
}

.bw-chat-input {
    flex: 1;
    background: #0d0d1a;
    border: 1px solid #2a2a3a;
    border-radius: 20px;
    padding: 8px 14px;
    font-size: 13px;
    color: #e8e0d5;
    outline: none;
    transition: border-color 0.2s;
    font-family: inherit;
}

.bw-chat-input::placeholder {
    color: #666;
}

.bw-chat-input:focus {
    border-color: #c9a96e;
}

.bw-chat-send {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #c9a96e;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.15s;
    flex-shrink: 0;
}

.bw-chat-send:hover {
    background: #b8944a;
}

.bw-chat-send:active {
    transform: scale(0.92);
}

/* ── Mobile ── */
@media (max-width: 640px) {
    .bw-chat-popup {
        right: 8px;
        left: 8px;
        bottom: 80px;
        width: auto;
        height: 400px;
    }
}

/* ── Registration form ── */
.bw-chat-register {
    flex-shrink: 0;
}

.bw-chat-register .bw-chat-input {
    width: 100%;
    border-radius: 8px;
}

.bw-chat-start-btn {
    font-size: 13px;
    font-family: inherit;
    transition: background 0.2s;
}

.bw-chat-start-btn:hover {
    background: #b8944a !important;
}
