(function() { const BRANDS = ['Bentley', 'Audi', 'Maserati', 'Mercedes', 'BMW', 'Land Rover', 'Rolls Royce', 'Lamborghini']; const COMING_SOON = ['Maserati', 'Mercedes', 'BMW', 'Land Rover', 'Rolls Royce', 'Lamborghini']; function init() { const container = document.getElementById('brand-buttons'); const cards = document.querySelectorAll('.product-card'); if (!container || cards.length === 0) { return setTimeout(init, 300); } let message = document.getElementById('comingMessage'); if (!message) { message = document.createElement('div'); message.id = 'comingMessage'; message.className = 'coming-message'; document.body.appendChild(message); } container.innerHTML = ''; BRANDS.forEach(brand => { const btn = document.createElement('button'); btn.className = 'brand-button'; btn.textContent = brand; btn.onclick = () => { document.querySelectorAll('.brand-button').forEach(b => b.classList.remove('active')); btn.classList.add('active'); if (COMING_SOON.includes(brand)) { message.textContent = `🚧 ${brand} - Coming Soon...`; message.classList.add('visible'); cards.forEach(c => c.classList.remove('hidden')); setTimeout(() => message.classList.remove('visible'), 2000); } else { cards.forEach(card => { card.classList.toggle('hidden', card.dataset.brand !== brand); }); message.classList.remove('visible'); } }; container.appendChild(btn); }); const showAll = document.createElement('button'); showAll.className = 'brand-button'; showAll.textContent = 'Show All'; showAll.onclick = () => { document.querySelectorAll('.brand-button').forEach(b => b.classList.remove('active')); showAll.classList.add('active'); cards.forEach(c => c.classList.remove('hidden')); message.classList.remove('visible'); }; container.appendChild(showAll); } document.addEventListener('DOMContentLoaded', init); setTimeout(init, 500); })();