/* 
* N.O. Immobilien - Mobile Scroll Fix
* Author: NAXII | ZamZob
* Version: 1.2
*/

/* Grundlegende Fixes für Scrolling-Probleme auf mobilen Geräten */
html {
    -webkit-overflow-scrolling: touch;
}

body {
    overflow-x: hidden; /* Nur horizontales Scrollen verhindern */
    width: 100%;
    height: auto;
    /* KEIN overflow: hidden auf body! */
    /* KEIN position: fixed auf body! */
    /* KEIN touch-action: none auf body! */
}

/* Nur wenn die Galerie aktiv ist, wird der Body nicht scrollbar */
body.no-scroll {
    overflow: hidden;
}

/* Verbesserte Darstellung der Immobilienseiten auf mobilen Geräten */
.immobilien-page {
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

/* Verbesserte Darstellung der Bildergalerie auf mobilen Geräten */
.property-detail-slider {
    -webkit-overflow-scrolling: touch;
}

.gallery-slider {
    -webkit-overflow-scrolling: touch;
}

/* Verbesserte Darstellung der Thumbnails auf mobilen Geräten */
.gallery-thumbnails {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
    display: flex;
    flex-wrap: nowrap;
}

.gallery-thumbnails::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.gallery-thumbnail {
    flex: 0 0 auto;
}

/* Verbesserte Darstellung der Property-Grid auf mobilen Geräten */
.property-grid {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Verbesserte Darstellung der Property-Detail-Container auf mobilen Geräten */
.property-detail-container {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Optimierungen für iOS-Geräte */
@supports (-webkit-touch-callout: none) {
    html {
        -webkit-text-size-adjust: 100%;
    }
    
    /* Zusätzliche iOS-spezifische Fixes */
    input, textarea, select {
        -webkit-appearance: none;
        border-radius: 0;
        font-size: 16px; /* Verhindert Zoom auf iOS bei Fokus */
    }
    
    /* Verhindert unerwünschtes Verhalten bei Tap-Aktionen */
    a, button, [role="button"] {
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
    }
    
    /* Verbessert die Darstellung von Bildern */
    img {
        -webkit-user-drag: none;
    }
}

/* Verbesserte Darstellung der Bilder in der Detailansicht auf mobilen Geräten */
@media (max-width: 768px) {
    .property-slide img {
        object-fit: contain;
        max-height: 100%;
        max-width: 100%;
        margin: 0 auto;
        display: block;
        -webkit-user-drag: none;
    }
    
    .gallery-slide img {
        object-fit: contain;
        max-height: 100%;
        max-width: 100%;
        margin: 0 auto;
        display: block;
        -webkit-user-drag: none;
    }
    
    /* Verbesserte Darstellung der Thumbnails auf mobilen Geräten */
    .gallery-thumbnails {
        padding: 10px;
        gap: 8px;
        justify-content: flex-start;
    }
    
    /* Verbesserte Darstellung der Galerie auf mobilen Geräten */
    .fullscreen-gallery {
        -webkit-overflow-scrolling: touch;
    }
    
    /* Verbesserte Darstellung des Schließen-Buttons auf mobilen Geräten */
    .close-gallery {
        top: 15px;
        right: 15px;
        width: 40px;
        height: 40px;
    }
    
    /* Verbessert das Scrollverhalten in Listen und Containern */
    .scrollable-container {
        -webkit-overflow-scrolling: touch;
    }
    
    /* Verbessert das Scrollverhalten in Tabs */
    .content-tabs,
    .filter-tabs,
    .nav-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .content-tab,
    .filter-tab,
    .nav-tab {
        flex: 0 0 auto;
    }
}