 /* JS Gerado pelo Customizer V2 - 11/09/2025, 02:13:45 */

(function() {
'use strict';

/* --- JS: Ícone PIX no Preço --- */
(function () {
    "use strict";

    function injectFontAwesome() {
        if (document.querySelector('link[href*="font-awesome"]')) return;
        const faLink = document.createElement('link');
        faLink.rel = 'stylesheet';
        faLink.href = 'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.2/css/all.min.css';
        document.head.appendChild(faLink);
    }

    function addPixIcon() {
        // Alvo específico do HTML fornecido
        const pixParagraphs = document.querySelectorAll('p.sc-284a1cfc-22');
        const textToSearch = 'PIX';

        pixParagraphs.forEach(p => {
            if (p.textContent.includes(textToSearch) && !p.classList.contains('pix-icon-added')) {
                const iconElement = document.createElement('i');
                iconElement.className = 'fa-brands fa-pix';
                iconElement.style.marginRight = '8px';
                iconElement.style.verticalAlign = 'middle';
                iconElement.style.fontSize = '1.1em';
                iconElement.style.color = '#32BCAD';
                p.prepend(iconElement);
                p.classList.add('pix-icon-added');
            }
        });
    }

    injectFontAwesome();
    
    // Roda repetidamente para pegar produtos carregados dinamicamente
    const observer = new MutationObserver(addPixIcon);
    observer.observe(document.body, { childList: true, subtree: true });
    addPixIcon(); // Roda uma vez no início
})();

/* --- JS: Selo de Verificado --- */
(function () {
    'use strict';
    
    function addVerifiedBadge() {
        const storeNameSelector = 'header a[href="/"] span';
        const storeNameElement = document.querySelector(storeNameSelector);

        if (!storeNameElement || storeNameElement.classList.contains('badge-applied')) {
            return;
        }

        const badge = document.createElement('img');
        badge.src = 'https://upload.wikimedia.org/wikipedia/commons/e/e4/Twitter_Verified_Badge.svg';
        badge.alt = 'Verificado';
        badge.style.cssText = 'width: 17px; height: 17px; vertical-align: middle; margin-left: 5px; display: inline-block;';
        
        storeNameElement.appendChild(badge);
        storeNameElement.classList.add('badge-applied');
        storeNameElement.style.display = 'inline-flex';
        storeNameElement.style.alignItems = 'center';
    }

    const observer = new MutationObserver(addVerifiedBadge);
    observer.observe(document.body, { childList: true, subtree: true });

    addVerifiedBadge();
})();

})();