  function smoothScrollTo(element, duration) {
    const start = window.pageYOffset;
    const end = element.getBoundingClientRect().top + start;
    const startTime = performance.now();

    function scroll(currentTime) {
      const timeElapsed = currentTime - startTime;
      const progress = Math.min(timeElapsed / duration, 1);
      window.scrollTo(0, start + (end - start) * easeInOutQuad(progress));
      if (progress < 1) requestAnimationFrame(scroll);
    }

    function easeInOutQuad(t) {
      return t < 0.5 ? 2*t*t : -1+(4-2*t)*t;
    }

    requestAnimationFrame(scroll);
  }

  document.querySelectorAll('a[href^="#"]').forEach(anchor => {
    anchor.addEventListener('click', function (e) {
      const target = document.querySelector(this.getAttribute('href'));
      if (target) {
        e.preventDefault();
        smoothScrollTo(target, 1200); // Durata in ms → 1200 = 1.2 secondi
      }
    });
  });

.t-cookie-notification,
.t-privacy-notification,
.t-gdpr-notification {
    display: none !important;
}

#iubenda-cs-banner, 
#iubenda-policy-embed,
.iubenda-cs-floating-policy {
    display: none !important;
}
