});
document.getElementById('orderNowBtn').addEventListener('click', (e)=>{
e.preventDefault();
const colorBtn = document.querySelector('.color-option.active');
const chosenColor = colorBtn ? colorBtn.title : 'Black Titanium';
const storageBtn = document.querySelector('.storage-btn.active');
const chosenStorage = storageBtn ? storageBtn.dataset.storage : '128';
const price = priceMap[chosenStorage] || 'FJD 2,900';
const contactUrl = new URL('https://phoneexpertsfiji.com/contact-us/');
contactUrl.searchParams.set('subject',`Inquiry: iPhone 15 Pro Max`);
contactUrl.searchParams.set('message', `Hi, I am interested in iPhone 15 Pro Max — Color: ${chosenColor}, Storage: ${chosenStorage}GB, Price: ${price}.`);
window.open(contactUrl.toString(), '_blank','noopener');
});
})();