/* Botão Flutuante de WhatsApp */
.whatsapp-btn {
    position: fixed;
    bottom: 30px;
    left: 30px;
    width: 50px;
    height: 50px;
    background: #25D366; /* Verde do WhatsApp */
    color: #FFFFFF;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
    z-index: 1000;
    cursor: pointer;
    border: none;
}

.whatsapp-btn.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.whatsapp-btn:hover {
    background: #20B358; /* Verde mais escuro */
    transform: translateY(-5px);
}

/* Janela de Chat */
.whatsapp-chat {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 350px;
    height: 300px;
    background: #ECE5DD; /* Fundo de conversa do WhatsApp */
    border-radius: 12px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    z-index: 1001;
    overflow: hidden;
    transition: opacity 0.3s ease, transform 0.3s ease;
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.9);
}

.whatsapp-chat.visible {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.whatsapp-chat.hidden {
    display: none;
}

.chat-header {
    background: #25D366; /* Verde do WhatsApp */
    color: #FFFFFF;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header h3 {
    font-size: 1.1rem;
    font-weight: bold;
}

.close-chat {
    background: none;
    border: none;
    color: #FFFFFF;
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-chat:hover {
    color: #E0E0E0;
}

.chat-body {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    background: #ECE5DD; /* Fundo de conversa */
    display: flex;
    flex-direction: column;
    gap: 12px;
    scrollbar-width: thin;
    scrollbar-color: #25D366 #ECE5DD;
}

.chat-body::-webkit-scrollbar {
    width: 6px;
}

.chat-body::-webkit-scrollbar-track {
    background: #ECE5DD;
}

.chat-body::-webkit-scrollbar-thumb {
    background: #25D366;
    border-radius: 3px;
}

.chat-message {
    max-width: 80%;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.9rem;
    line-height: 1.4;
    word-wrap: break-word;
}

.chat-message.bot {
    background: #FFFFFF; /* Mensagens do bot */
    color: #000000;
    align-self: flex-start;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.chat-message.user {
    background: #DCF8C6; /* Mensagens do usuário */
    color: #000000;
    align-self: flex-end;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.chat-footer {
    display: flex;
    padding: 12px;
    background: #F0F0F0; /* Rodapé claro do WhatsApp */
    border-top: 1px solid #D9D9D9;
}

.chat-footer input {
    flex: 1;
    padding: 8px;
    border: 1px solid #D9D9D9;
    border-radius: 20px;
    background: #FFFFFF;
    color: #000000;
    font-size: 0.9rem;
}

.chat-footer input:focus {
    outline: none;
    border-color: #25D366;
}

.send-message {
    background: #25D366;
    color: #FFFFFF;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 8px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.send-message:hover {
    background: #20B358;
}

/* Botão de Envio para WhatsApp */
.send-message.mt-2 {
    width: auto;
    border-radius: 8px;
    padding: 8px 16px;
    margin: 8px auto;
}

/* Responsividade */
@media (max-width: 640px) {
    .whatsapp-btn {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
        bottom: 20px;
        left: 20px;
    }

    .whatsapp-chat {
        width: 90%;
        height: 80vh;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
    }

    .whatsapp-chat.visible {
        transform: translate(-50%, -50%) scale(1);
    }
}

/* Janela de Chat */
.whatsapp-chat {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 350px;
    height: 400px; /* Aumentado para melhor visualização do conteúdo */
    background: #ECE5DD; /* Fundo de conversa do WhatsApp */
    border-radius: 12px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    z-index: 1001;
    overflow: hidden;
    transition: opacity 0.3s ease, transform 0.3s ease;
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.9);
}

.whatsapp-chat.visible {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.whatsapp-chat.hidden {
    display: none;
}

/* Chat Footer */
.chat-footer {
    display: flex;
    padding: 12px;
    background: #F0F0F0; /* Rodapé claro do WhatsApp */
    border-top: 1px solid #D9D9D9;
}

.chat-footer input {
    flex: 1;
    padding: 8px;
    border: 1px solid #D9D9D9;
    border-radius: 20px;
    background: #FFFFFF;
    color: #000000;
    font-size: 16px; /* Impede o zoom no iOS (mínimo 16px) */
    -webkit-appearance: none; /* Remove estilos nativos do iOS */
    appearance: none;
}

.chat-footer input:focus {
    outline: none;
    border-color: #25D366;
}


/* Responsividade para telas menores */
@media (max-width: 640px) {
    .whatsapp-chat {
        width: 90%; /* Mantém largura proporcional */
        height: 60vh; /* Reduzido para não ocupar toda a tela */
        max-height: 450px; /* Limite para evitar que fique muito alto */
        min-height: 350px; /* Altura mínima para garantir usabilidade */
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
    }

    .whatsapp-chat.visible {
        transform: translate(-50%, -50%) scale(1);
    }
}

@media (max-width: 400px) {
    .whatsapp-chat {
        width: 95%; /* Mais largo em telas muito pequenas */
        height: 55vh; /* Ainda mais compacto */
        max-height: 400px;
        min-height: 300px;
    }

    .whatsapp-chat.visible {
        transform: translate(-50%, -50%) scale(1);
    }

    .chat-header h3 {
        font-size: 1rem; /* Reduz o título */
    }

    .chat-message {
        font-size: 0.85rem; /* Mensagens menores */
    }

    .chat-footer input {
        font-size: 0.85rem; /* Input menor */
    }

    .send-message {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }
}

/* Ajustes para telas menores */
@media (max-width: 640px) {
    .chat-footer {
        padding: 8px;
    }

    .chat-footer input {
        font-size: 16px; /* Mantém 16px para evitar zoom */
        padding: 6px 10px; /* Ajusta padding para melhor proporção */
    }
}

@media (max-width: 400px) {
    .chat-footer input {
        font-size: 16px; /* Mantém 16px */
        padding: 5px 8px;
    }
}