/* ========================================
   Chatbot Widget Styles
   ======================================== */

/* Floating chat button */
.chatbot-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary-green, #6b9c37);
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    z-index: 1050;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, background 0.2s;
}

.chatbot-btn:hover {
    background: var(--hover-green, #5a8530);
    transform: scale(1.08);
}

.chatbot-btn.hidden {
    display: none;
}

/* Chat popup window */
.chatbot-popup {
    position: fixed;
    bottom: 92px;
    right: 24px;
    width: 360px;
    max-height: 480px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
    z-index: 1050;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(16px) scale(0.95);
    pointer-events: none;
    transition: opacity 0.25s, transform 0.25s;
}

.chatbot-popup.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* Header */
.chatbot-header {
    background: var(--dark-green, #1a472a);
    color: #fff;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.chatbot-header-title {
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chatbot-header-title i {
    font-size: 18px;
}

.chatbot-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.15s;
}

.chatbot-close:hover {
    opacity: 1;
}

/* Messages area */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 200px;
    max-height: 320px;
    background: #f8f9fa;
}

/* Message bubbles */
.chatbot-msg {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 0.9rem;
    line-height: 1.45;
    word-wrap: break-word;
}

.chatbot-msg.bot {
    align-self: flex-start;
    background: #fff;
    color: #333;
    border: 1px solid #e0e0e0;
    border-bottom-left-radius: 4px;
}

.chatbot-msg.user {
    align-self: flex-end;
    background: var(--primary-green, #6b9c37);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.chatbot-msg a {
    color: var(--primary-green, #6b9c37);
    font-weight: 600;
    text-decoration: underline;
}

.chatbot-msg.bot a {
    color: var(--primary-green, #6b9c37);
}

.chatbot-msg.user a {
    color: #fff;
}

/* Input area */
.chatbot-input-area {
    display: flex;
    padding: 12px;
    gap: 8px;
    border-top: 1px solid #e9ecef;
    background: #fff;
    flex-shrink: 0;
}

.chatbot-input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
}

.chatbot-input:focus {
    border-color: var(--primary-green, #6b9c37);
}

.chatbot-input::placeholder {
    color: #aaa;
}

.chatbot-send {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--primary-green, #6b9c37);
    border: none;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    flex-shrink: 0;
}

.chatbot-send:hover {
    background: var(--hover-green, #5a8530);
}

/* Lift chat button above sticky bottom bars (checkout, cart) on mobile */
@media (max-width: 991.98px) {
    .chatbot-btn.chatbot-btn-raised {
        bottom: 90px;
    }
}

/* Mobile responsive */
@media (max-width: 480px) {
    .chatbot-popup {
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        max-height: 100vh;
        height: 100vh;
        border-radius: 0;
    }

    .chatbot-messages {
        max-height: none;
        flex: 1;
    }

    .chatbot-btn {
        bottom: 16px;
        right: 16px;
    }

    .chatbot-btn.chatbot-btn-raised {
        bottom: 90px;
    }
}
