<script>
        let chatOpen = false;

        function toggleChat() {
            const chatBox = document.getElementById("chatBox");
            const whatsappIcon = document.getElementById("whatsappIcon");

            if (!chatOpen) {
                chatBox.style.display = "flex";
                whatsappIcon.innerHTML = '<path d="M6 19l12-12M6 7l12 12" stroke="white" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"/>';
            } else {
                chatBox.style.display = "none";
                whatsappIcon.innerHTML = '<path d="M19.05 4.91a9.91 9.91 0 0 0-14.04 0 9.9 9.9 0 0 0-2.9 7.04c0 1.74.45 3.44 1.31 4.94l-1.36 4.97 5.03-1.32a9.87 9.87 0 0 0 4.92 1.32c2.65 0 5.16-1.04 7.04-2.9a9.89 9.89 0 0 0 0-14.05z"/>';
            }
            chatOpen = !chatOpen;
        }

        function sendMessage() {
            const inputField = document.getElementById("chatInput");
            const message = encodeURIComponent(inputField.value.trim());
            if (message) {
                window.open(`https://wa.me/09061643031?text=${message}`, "_blank");
                inputField.value = "";
            }
        }

        document.getElementById("chatInput").addEventListener("keypress", function (event) {
            if (event.key === "Enter") sendMessage();
        });
    </script>
