// Shared JavaScript across all pages document.addEventListener('DOMContentLoaded', function() { console.log('Lemon Drop App loaded'); // Add to cart functionality const addToCartButtons = document.querySelectorAll('.add-to-cart-btn'); addToCartButtons.forEach(button => { button.addEventListener('click', function() { const productId = this.dataset.productId; const productName = this.dataset.productName; // In a real app, this would add to cart console.log(`Added ${productName} (${productId}) to cart`); // Show confirmation const originalText = this.innerHTML; this.innerHTML = ' Added!'; this.classList.remove('bg-emerald-500'); this.classList.add('bg-green-500'); setTimeout(() => { this.innerHTML = originalText; this.classList.remove('bg-green-500'); this.classList.add('bg-emerald-500'); feather.replace(); }, 2000); }); }); // Weight selector const weightButtons = document.querySelectorAll('[data-weight]'); weightButtons.forEach(button => { button.addEventListener('click', function() { weightButtons.forEach(btn => btn.classList.remove('bg-emerald-500')); this.classList.add('bg-emerald-500'); }); }); });