/* ============================================
   MOBILE SCROLL FIX
   Ensures smooth scrolling on mobile devices
   ============================================ */

/* Enable smooth scrolling on all devices */
html {
    -webkit-overflow-scrolling: touch !important;
    overflow-scrolling: touch !important;
    scroll-behavior: smooth;
}

body {
    -webkit-overflow-scrolling: touch !important;
    overflow-scrolling: touch !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    position: relative !important;
    width: 100% !important;
    height: auto !important;
    min-height: 100vh !important;
}

/* Ensure main content area is scrollable */
.site-main,
main#main {
    overflow: visible !important;
    position: relative !important;
    min-height: 100vh !important;
}

/* Fix for mobile menu - allow scrolling when menu is open */
@media (max-width: 768px) {
    /* Always allow body scrolling on mobile */
    body.menu-open {
        overflow-y: auto !important;
        overflow-x: hidden !important;
        position: relative !important;
        height: auto !important;
        width: 100% !important;
        -webkit-overflow-scrolling: touch !important;
    }
    
    /* Ensure mobile menu doesn't block scroll */
    .main-menu.active {
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        max-height: calc(100vh - 80px) !important;
        touch-action: pan-y !important;
    }
    
    /* Ensure main content is always scrollable */
    body.menu-open .site-main,
    body.menu-open main#main {
        overflow: visible !important;
        touch-action: pan-y !important;
    }
}

/* Touch action improvements for better scrolling */
* {
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
    touch-action: manipulation;
}

/* Allow scrolling on scrollable elements */
.scrollable,
[style*="overflow-y: auto"],
[style*="overflow-y: scroll"] {
    -webkit-overflow-scrolling: touch !important;
    overflow-scrolling: touch !important;
    touch-action: pan-y !important;
}

/* Fix for sticky header not interfering with scroll */
.site-header {
    touch-action: none !important;
}

/* Ensure no fixed positioning blocks scroll on mobile */
@media (max-width: 768px) {
    .sticky-appointment-cta {
        touch-action: manipulation !important;
    }
    
    /* Prevent parallax from interfering with scroll */
    .hero-section {
        transform: none !important;
        will-change: auto !important;
    }
}

/* Fix for iOS Safari bounce scroll */
@supports (-webkit-touch-callout: none) {
    body {
        position: relative !important;
        -webkit-overflow-scrolling: touch !important;
    }
}

/* Ensure all sections are scrollable */
section {
    position: relative !important;
overflow: visible !important;
}

/* Fix for any elements that might block touch events */
button,
a,
input,
select,
textarea {
    touch-action: manipulation !important;
}
