/* ===== Live Chat Button ===== */
.live-chat-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 9999;
    width: 56px;
    height: 56px;
    background: #786C3B;
    color: #fff;
    border-radius: 50%;
    box-shadow: 0 4px 20px rgba(120, 108, 59, 0.4);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    overflow: hidden;
    white-space: nowrap;
    padding: 0;
}

.live-chat-btn:hover {
    width: 140px;
    border-radius: 28px;
    background: #5a5029;
    box-shadow: 0 6px 24px rgba(120, 108, 59, 0.5);
    padding: 0 1.2rem;
    gap: 0.5rem;
    justify-content: center;
}

.live-chat-btn .chat-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.live-chat-btn .chat-label {
    display: none;
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
}

.live-chat-btn:hover .chat-label {
    display: inline;
}

.live-chat-btn .chat-dot {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 10px;
    height: 10px;
    background: #4ade80;
    border-radius: 50%;
    border: 2px solid #fff;
    animation: chat-pulse 2s infinite;
}

.live-chat-btn:hover .chat-dot {
    display: none;
}

@keyframes chat-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(0.8); }
}

/* ===== Live Chat Popup ===== */
.live-chat-popup {
    position: fixed;
    bottom: 6.5rem;
    right: 2rem;
    z-index: 9998;
    width: 340px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    display: none;
    flex-direction: column;
    max-height: 520px;
    transition: all 0.25s ease;
}

.live-chat-popup.open {
    display: flex;
}

/* Header */
.chat-popup-header {
    background: #786C3B;
    font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif;
    color: #fff;
    padding: 1rem 1.2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.chat-popup-header-left {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.chat-popup-avatar {
    width: 36px;
    height: 36px;
    background: #DAD7C5;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    overflow: hidden;
    flex-shrink: 0;
}

.chat-popup-title {
    font-size: 0.95rem;
    font-weight: 600;
}

.chat-popup-subtitle {
    font-size: 0.75rem;
    opacity: 0.8;
}

.chat-popup-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    opacity: 0.8;
    flex-shrink: 0;
}

.chat-popup-close:hover {
    opacity: 1;
}

/* Messages area */
.chat-popup-body {
    font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif;
    padding: 1rem;
    background: #f9f7f2;
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    min-height: 200px;
    max-height: 340px;
}

.chat-popup-body::-webkit-scrollbar { width: 4px; }
.chat-popup-body::-webkit-scrollbar-track { background: transparent; }
.chat-popup-body::-webkit-scrollbar-thumb { background: #d0cbb8; border-radius: 4px; }

/* Chat bubbles */
.chat-bubble {
    padding: 0.7rem 0.9rem;
    font-size: 0.88rem;
    line-height: 1.5;
    color: #333;
    max-width: 85%;
    word-break: break-word;
}

.chat-bubble-bot {
    background: #fff;
    border-radius: 12px 12px 12px 2px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.07);
    align-self: flex-start;
}

.chat-bubble-user {
    background: #786C3B;
    color: #fff;
    border-radius: 12px 12px 2px 12px;
    align-self: flex-end;
}

.chat-bubble-typing {
    color: #999;
    font-style: italic;
    font-size: 0.85rem;
}

/* Input area */
.chat-popup-input-area {
    display: flex;
    font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 0.9rem;
    border-top: 1px solid #ececec;
    background: #fff;
    flex-shrink: 0;
}

.chat-input {
    flex: 1;
    border: 1px solid #e0ddd5;
    border-radius: 20px;
    padding: 0.55rem 1rem;
    font-size: 0.88rem;
    outline: none;
    background: #f9f7f2;
    color: #333;
    transition: border-color 0.2s;
}

.chat-input:focus {
    border-color: #786C3B;
    background: #fff;
}

.chat-input::placeholder { color: #aaa; }
.chat-input:disabled { opacity: 0.6; cursor: not-allowed; }

.chat-send-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #786C3B;
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.2s;
}

.chat-send-btn:hover { background: #5a5029; }
.chat-send-btn:disabled { background: #ccc; cursor: not-allowed; }

.chat-attach-btn {
    background-color: #8B7D5E;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    cursor: pointer;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background-color 0.2s;
}
.chat-attach-btn:hover {
    background-color: #6e6347;
}
