/* SalesFundaa live chat – scoped to #sf-chat-root so site-wide button CSS cannot override */
#sf-chat-root.sf-chat-root {
    --sf-chat-primary: #28a745;
    --sf-chat-primary-dark: #1e7e34;
    --sf-chat-width: 320px;
    --sf-chat-height: 420px;
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 99999;
    font-family: 'Lato', 'PT Sans', Arial, sans-serif;
}

#sf-chat-root .sf-chat-toggle {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    background: #28a745;
    background: var(--sf-chat-primary);
    color: #fff;
    font-size: 22px;
    line-height: 56px;
    padding: 0;
    text-transform: none;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

#sf-chat-root .sf-chat-toggle .fa {
    color: #fff;
    font-size: 22px;
    line-height: 1;
}

#sf-chat-root .sf-chat-toggle:hover {
    background: #1e7e34;
    background: var(--sf-chat-primary-dark);
    color: #fff;
    border: none;
    transform: scale(1.05);
}

#sf-chat-root .sf-chat-panel {
    display: none;
    position: absolute;
    right: 0;
    bottom: 68px;
    width: var(--sf-chat-width);
    max-width: calc(100vw - 24px);
    height: var(--sf-chat-height);
    max-height: calc(100vh - 100px);
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    flex-direction: column;
    overflow: hidden;
}

#sf-chat-root .sf-chat-panel.sf-chat-open {
    display: flex;
}

#sf-chat-root .sf-chat-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 12px 14px;
    background: #28a745;
    background: var(--sf-chat-primary);
    color: #fff;
}

#sf-chat-root .sf-chat-title {
    font-size: 16px;
    display: block;
}

#sf-chat-root .sf-chat-subtitle {
    font-size: 11px;
    opacity: 0.9;
    margin-top: 2px;
}

#sf-chat-root .sf-chat-close {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
    text-transform: none;
    border-radius: 0;
}

#sf-chat-root .sf-chat-close:hover {
    background: transparent;
    color: #fff;
    border: none;
}

#sf-chat-root .sf-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    background: #f7f7f7;
    font-size: 13px;
}

#sf-chat-root .sf-chat-msg {
    margin-bottom: 8px;
    padding: 8px 10px;
    border-radius: 8px;
    max-width: 92%;
    word-wrap: break-word;
}

#sf-chat-root .sf-chat-msg-user {
    background: #dcf8c6;
    margin-left: auto;
    text-align: right;
}

#sf-chat-root .sf-chat-msg-system {
    background: #e9ecef;
    color: #555;
    font-size: 12px;
    text-align: center;
    margin-left: auto;
    margin-right: auto;
}

#sf-chat-root .sf-chat-body {
    padding: 10px 12px 12px;
    border-top: 1px solid #eee;
    background: #fff;
}

#sf-chat-root .sf-chat-input,
#sf-chat-root .sf-chat-textarea {
    width: 100%;
    margin-bottom: 8px;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 13px;
    box-sizing: border-box;
    resize: vertical;
    text-transform: none;
}

#sf-chat-root .sf-chat-primary-btn {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 6px;
    background: #28a745;
    background: var(--sf-chat-primary);
    color: #fff;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    text-transform: none;
}

#sf-chat-root .sf-chat-primary-btn:hover {
    background: #1e7e34;
    background: var(--sf-chat-primary-dark);
    color: #fff;
    border: none;
}

#sf-chat-root .sf-chat-primary-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

#sf-chat-root .sf-chat-alert {
    padding: 8px 12px;
    font-size: 12px;
    color: #842029;
    background: #f8d7da;
    border-top: 1px solid #f5c2c7;
}

@media (max-width: 480px) {
    #sf-chat-root.sf-chat-root {
        right: 10px;
        bottom: 10px;
    }

    #sf-chat-root .sf-chat-panel {
        width: calc(100vw - 20px);
        height: 70vh;
    }
}
