document.querySelectorAll('.nav-item:has(.nav-section-item)').forEach(trigger => { trigger.addEventListener('click', (e) => { if (e.target.closest('.nav-section-item') === null) { e.preventDefault(); } }); });