// Lógica simples para o botão flutuante em mobile const stickyBtn = document.getElementById('sticky-btn'); window.addEventListener('scroll', () => { if (window.scrollY > 800) { stickyBtn?.classList.add('show'); } else { stickyBtn?.classList.remove('show'); } }); // Scroll suave para âncoras (já suportado nativamente pelo CSS scroll-behavior: smooth, // mas garantindo compatibilidade se necessário via JS básico) document.querySelectorAll('a[href^="#"]').forEach(anchor => { anchor.addEventListener('click', function(e) { e.preventDefault(); const targetId = this.getAttribute('href'); if (targetId && targetId !== '#') { document.querySelector(targetId)?.scrollIntoView({ behavior: 'smooth' }); } }); });