:root {
    --primary-color: #f57c00; /* Laranja Oficial */
    --bg-color: #f9f9f9;
    --chat-bg: #ffffff;
    --bot-msg-bg: #f1f1f1;
    --user-msg-bg: #f57c00;
    --text-main: #333333;
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
    font-family: var(--font-main); 
}

/* Ajuste no Body para não sobrar espaço */
body {
    background-color: var(--bg-color);
    display: flex;
	/* height: 100dvh;  <-- Remova ou comente */
    /* overflow: hidden; <-- Remova ou comente */
    flex-direction: column; /* Alinhamento vertical */
}

#chat-container {
    width: 380px;      /* Largura de um chat flutuante */
    height: 550px;     /* Altura fixa */
    position: fixed;   /* Fixa na tela */
    bottom: 20px;      /* Distância do fundo */
    right: 20px;       /* Distância da direita */
    background: var(--chat-bg);
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    border-radius: 15px;
    z-index: 99999;    /* Para ficar na frente de tudo */
    overflow: hidden;
}

/* Cabeçalho */
.chat-header {
    background: var(--primary-color);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0; /* Impede o header de encolher */
}

.header-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chat-header h1 {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.status-indicator {
    width: 10px; height: 10px;
    background: #4ade80;
    border-radius: 50%;
    box-shadow: 0 0 8px #4ade80;
}

/* Banner do Catálogo (Fixo no topo) */
#catalog-banner {
    flex-shrink: 0;
}

/* Janela de Mensagens - CORREÇÃO AQUI */
#chat-window {
    flex: 1; /* Ocupa TODO o espaço restante */
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scroll-behavior: smooth;
    background: var(--chat-bg);
}

/* Custom Scrollbar */
#chat-window::-webkit-scrollbar {
    width: 4px;
}
#chat-window::-webkit-scrollbar-thumb {
    background: #e0e0e0;
    border-radius: 10px;
}

.message {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 0.95rem;
    line-height: 1.4;
    animation: fadeIn 0.3s ease forwards;
}

.bot-message {
    align-self: flex-start;
    background: var(--bot-msg-bg);
    color: var(--text-main);
    border-bottom-left-radius: 4px;
}

.user-message {
    align-self: flex-end;
    background: var(--user-msg-bg);
    color: white;
    border-bottom-right-radius: 4px;
}

/* Entrada de Texto */
.chat-input-area {
    padding: 15px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 10px;
    background: white;
    flex-shrink: 0; /* Impede o input de sumir */
}

#user-input {
    flex: 1;
    border: 1px solid #ddd;
    padding: 12px 18px;
    border-radius: 25px;
    outline: none;
    font-size: 0.95rem;
}

#user-input:disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
}

#send-btn {
    background: var(--primary-color);
    border: none;
    color: white;
    width: 45px; height: 45px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Opções */
.options-container {
    animation: fadeIn 0.5s ease;
    margin: 5px 0 15px 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.option-btn {
    background: white;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    padding: 10px 15px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    text-align: left;
}

.option-btn:hover {
    background: var(--primary-color);
    color: white;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1.0); }
}

/* Efeito Digitando */
.typing {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: var(--bot-msg-bg);
    border-radius: 18px;
    width: fit-content;
}

.typing span {
    width: 6px; height: 6px;
    background: #999;
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}
/* Botão Flutuante */
#btn-televendas {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 140px;
    height: 50px;
    background-color: #f57c00;
    border-radius: 30px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 999999;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.btn-icon span {
    font-size: 0.9rem;
    position: relative;
    z-index: 2;
}

/* Efeito de Ondas */
.waves {
    position: absolute;
    width: 100%;
    height: 100%;
    background: #f57c00;
    border-radius: 30px;
    opacity: 0.7;
    animation: pulse-waves 2s infinite;
    z-index: 1;
}

@keyframes pulse-waves {
    0% { transform: scale(1); opacity: 0.7; }
    100% { transform: scale(1.4); opacity: 0; }
}

/* Esconder o container do chat por padrão */
#chat-container {
    display: none; /* Começa escondido */
    position: fixed;
    bottom: 80px;
    right: 20px;
    z-index: 10000;
}
/* Faz o botão de falar com vendedora pulsar levemente ou ter uma cor diferente */
.option-btn {
    background-color: #25d366; /* Verde WhatsApp */
    color: white;
    font-weight: bold;
    border: none;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
    transition: transform 0.2s;
}

.option-btn:hover {
    transform: scale(1.05);
    background-color: #128c7e;
}
/* Ajustes para Telas Pequenas (Mobile) */
@media (max-width: 480px) {
    #chat-container {
        width: 90% !important; /* Ocupa 90% da largura da tela */
        height: 70vh !important; /* Ocupa 70% da altura da tela */
        right: 5% !important;   /* Centraliza lateralmente */
        bottom: 85px !important;
        border-radius: 15px;
    }

    #btn-televendas {
        bottom: 15px;
        right: 15px;
        width: 120px; /* Um pouco menor no mobile */
        font-size: 0.8rem;
    }

    .message {
        max-width: 90%; /* Mensagens um pouco mais largas no mobile */
    }
}