/* ── VitaPront Chat Widget ── */
#gls-chat-widget {
    position: fixed;
    bottom: 92px;
    right: 24px;
    z-index: 9998;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.4;
}

/* Botão flutuante */
#gls-chat-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--chat-color, #1470C6);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 18px rgba(20, 112, 198, .4);
    transition: transform .2s, box-shadow .2s;
    overflow: hidden;
    padding: 0;
}
#gls-chat-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 24px rgba(20, 112, 198, .5);
}
#gls-chat-btn img {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
}
#gls-chat-btn svg {
    width: 26px;
    height: 26px;
    fill: #fff;
}
#gls-chat-btn.gls-open {
    background: #555;
}
#gls-chat-btn.gls-open svg {
    fill: #fff;
}

/* Janela do chat */
#gls-chat-window {
    position: absolute;
    bottom: 70px;
    right: 0;
    width: 340px;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 8px 40px rgba(0,0,0,.18);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: glsChatIn .22s ease;
}
#gls-chat-window[hidden] {
    display: none;
}
@keyframes glsChatIn {
    from { opacity: 0; transform: translateY(10px) scale(.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Header */
#gls-chat-header {
    background: var(--chat-color, #1470C6);
    color: #fff;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
#gls-chat-header .gls-hdr-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255,255,255,.35);
    flex-shrink: 0;
}
#gls-chat-header .gls-hdr-info {
    flex: 1;
    overflow: hidden;
}
#gls-chat-header .gls-hdr-info strong {
    display: block;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
#gls-chat-header .gls-hdr-info span {
    font-size: 11px;
    opacity: .85;
}
#gls-chat-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    opacity: .75;
    padding: 4px;
    flex-shrink: 0;
}
#gls-chat-close:hover { opacity: 1; }

/* Mensagens */
#gls-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 14px 12px;
    display: flex;
    flex-direction: column;
    gap: 9px;
    min-height: 180px;
    max-height: 280px;
    background: #f4f7fb;
}
.gls-msg {
    max-width: 83%;
    padding: 8px 12px;
    border-radius: 14px;
    word-wrap: break-word;
    font-size: 13.5px;
}
.gls-msg-user {
    align-self: flex-end;
    background: var(--chat-color, #1470C6);
    color: #fff;
    border-bottom-right-radius: 4px;
}
.gls-msg-assistant {
    align-self: flex-start;
    background: #fff;
    color: #1a1a1a;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 4px rgba(0,0,0,.08);
}

/* Indicador de digitação */
#gls-chat-typing {
    padding: 8px 14px 4px;
    display: flex;
    gap: 4px;
    align-items: center;
    background: #f4f7fb;
    flex-shrink: 0;
}
#gls-chat-typing span {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #aaa;
    animation: glsBounce 1.2s infinite ease-in-out;
}
#gls-chat-typing span:nth-child(2) { animation-delay: .2s; }
#gls-chat-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes glsBounce {
    0%, 80%, 100% { transform: translateY(0); }
    40%           { transform: translateY(-6px); }
}

/* Área de input */
#gls-chat-input-area {
    display: flex;
    padding: 10px 10px;
    border-top: 1px solid #eaeaea;
    gap: 8px;
    background: #fff;
    flex-shrink: 0;
}
#gls-chat-input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 8px 13px;
    font-size: 13px;
    outline: none;
    background: #fafafa;
    transition: border-color .15s;
}
#gls-chat-input:focus {
    border-color: var(--chat-color, #1470C6);
    background: #fff;
}
#gls-chat-send {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--chat-color, #1470C6);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background .15s;
    align-self: center;
}
#gls-chat-send:hover { background: #0F5AA8; }
#gls-chat-send:disabled { opacity: .45; cursor: default; }
#gls-chat-send svg {
    width: 17px;
    height: 17px;
    fill: #fff;
}

/* Mobile */
@media (max-width: 480px) {
    #gls-chat-widget {
        right: 12px;
        bottom: 82px;
    }
    #gls-chat-window {
        width: calc(100vw - 24px);
        right: -12px;
    }
}
