class CustomFooter extends HTMLElement { connectedCallback() { this.attachShadow({ mode: 'open' }); this.shadowRoot.innerHTML = ` `; // Add click handlers for location buttons const buttons = this.shadowRoot.querySelectorAll('.location-btn'); buttons.forEach(button => { button.addEventListener('click', () => { const city = button.getAttribute('data-city'); const addresses = this.shadowRoot.querySelectorAll('.address'); // Hide all addresses addresses.forEach(addr => addr.classList.remove('active')); // Show selected address this.shadowRoot.getElementById(`${city}-address`).classList.add('active'); }); }); } } customElements.define('custom-footer', CustomFooter);