${x.title}
$${x.price.toFixed(2)} each
Course selection
Total: $0.00
No payment has been processed. This demonstration confirms the selected learning items locally.
$${x.price.toFixed(2)} each
Your cart is empty. Select a practical course from the catalog.
'; cartTotal.textContent='$'+rows.reduce((sum,x)=>sum+x.price*x.quantity,0).toFixed(2); } cartList.addEventListener('change',function(e){ if(e.target.dataset.qty){ const row=cart.find(x=>x.id===e.target.dataset.qty); if(row){row.quantity=Math.max(1,Number(e.target.value)||1);localStorage.setItem('pnc-cart',JSON.stringify(cart));renderCart();} } }); cartList.addEventListener('click',function(e){ if(e.target.dataset.remove){ cart=cart.filter(x=>x.id!==e.target.dataset.remove); localStorage.setItem('pnc-cart',JSON.stringify(cart)); renderCart(); } }); checkoutBtn.addEventListener('click',function(){ confirmModal.classList.remove('hidden'); confirmModal.classList.add('flex'); }); confirmClose.addEventListener('click',function(){ confirmModal.classList.remove('flex'); confirmModal.classList.add('hidden'); }); confirmModal.addEventListener('click',function(e){ if(e.target===confirmModal){confirmModal.classList.remove('flex');confirmModal.classList.add('hidden');} }); document.addEventListener('DOMContentLoaded',renderCart); // theme & nav logic (same as other pages) const html=document.documentElement; const themeBtn=document.getElementById('themeToggle'); if(localStorage.getItem('theme')==='dark'){html.classList.add('dark');} themeBtn.addEventListener('click',function(){html.classList.toggle('dark');localStorage.setItem('theme',html.classList.contains('dark')?'dark':'light');}); const menuBtn=document.getElementById('menuToggle'); const nav=document.getElementById('siteNav'); menuBtn.addEventListener('click',function(){nav.classList.toggle('hidden');}); const loginBtn=document.getElementById('loginOpen'); const regBtn=document.getElementById('registerOpen'); function createLoginModal(){const m=document.createElement('div');m.className='fixed inset-0 z-50 flex items-center justify-center bg-slate-950/70 p-4';m.innerHTML=`