/* ============================================
   Mobile Touch Fix - Chrome 144+ Compatible
   Sostituisce mobile-overflow-fix.js e overscroll-effects.js
   ============================================ */

/* REGOLA 1: Previeni overflow orizzontale SENZA creare scroll container.
   'clip' non crea scroll container, a differenza di 'hidden' (Chrome 144+ breaking change) */
html {
    overflow-x: clip !important;
}

body {
    overflow-x: clip !important;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* REGOLA 2: Fix critico per homepage - il navbar con pointer-events:none
   crea una superficie invisibile che intercetta i touch sul contenuto */
@media (max-width: 991px) {
    body.homepage #navigation:not(.sticky) {
        pointer-events: none !important;
    }
    body.homepage #navigation.sticky,
    body.homepage #navigation .navbar-toggle,
    body.homepage #navigation .navbar-header {
        pointer-events: auto !important;
    }
}

/* REGOLA 3: Sostituisci overflow:hidden con clip sulle sezioni
   per non creare scroll container in Chrome 144+ */
.modern-section,
.home-section,
.container,
.container-fluid,
.row {
    overflow-x: clip !important;
    overflow-y: clip !important;
}

/* Fix specifico per modern-section che ha overflow:hidden nel CSS minificato */
.modern-section {
    overflow: clip !important;
}

/* REGOLA 4: touch-action pan-y solo su elementi che non devono fare pinch-zoom */
html,
body,
.main-content,
.modern-section,
.home-section,
section,
.container,
.container-fluid,
.row,
.content-card,
.section-heading {
    touch-action: pan-y !important;
}

/* REGOLA 5: Fallback per browser molto vecchi senza supporto 'clip' */
@supports not (overflow-x: clip) {
    html,
    body {
        overflow-x: hidden !important;
    }
    .modern-section,
    .home-section,
    .container,
    .container-fluid,
    .row {
        overflow-x: hidden !important;
    }
}

body.scroll-locked {
    overflow: hidden;
    /* NO position:fixed - causa il bug su Chrome 144+ con pagine corte */
}

.content-card,
.modern-card {
    overflow: clip !important;
}