/**
 * Mobile Horizontal Scroll für Angebots-Boxen mit Dot Navigation
 *
 * Verwendung: Diese CSS-Datei im Theme/Child-Theme einbinden oder in Elementor Custom CSS einfügen
 */

/* Container für horizontales Scrollen auf Mobile - mit ID #mobile-horizontal-slider */
@media (max-width: 767px) {
    #mobile-horizontal-slider {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        scroll-snap-type: x mandatory !important; /* Deaktiviert während des Ziehens */
        -webkit-overflow-scrolling: touch !important;
        scroll-behavior: auto !important; /* Auto für lineares Scrollen beim Ziehen */
        gap: 20px !important;
        padding: 0 20px !important;
        margin-bottom: 20px !important; /* Platz für Dot-Navigation unterhalb */
    }

    /* Scrollbar komplett ausblenden */
    #mobile-horizontal-slider::-webkit-scrollbar {
        display: none;
    }

    #mobile-horizontal-slider {
        -ms-overflow-style: none; /* IE und Edge */
        scrollbar-width: none; /* Firefox */
    }

    #mobile-horizontal-slider .margin-top-auto {
        margin-top: -20px;
    }

    #mobile-horizontal-slider .box-green .margin-top-auto {
        margin-top: 0;
    }

    /* Alle direkten Kinder (angebot-box) */
    #mobile-horizontal-slider > .angebot-box {
        flex: 0 0 85% !important; /* 85% Breite für besseren Side-Scroll-Effekt */
        max-width: 85% !important;
        min-width: 85% !important;
        scroll-snap-align: center !important;
        scroll-snap-stop: always !important;
    }

    /* Dot Navigation Container - wird NACH dem Scroll-Container eingefügt */
    .mobile-scroll-dots {
        position: relative;
        display: flex;
        gap: 8px;
        z-index: 100;
        justify-content: center;
        align-items: center;
        margin-top: -50px; /* Positionierung unterhalb des Scroll-Containers */
        padding: 10px 0;
    }

    /* Einzelne Dots */
    .mobile-scroll-dot {
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background-color: rgba(0, 0, 0, 0.2);
        cursor: pointer;
        transition: all 0.3s ease;
        border: none;
        padding: 0;
    }

    /* Hover-Effekt */
    .mobile-scroll-dot:hover {
        background-color: rgba(0, 0, 0, 0.4);
        transform: scale(1.2);
    }

    /* Aktiver Dot */
    .mobile-scroll-dot.active {
        background-color: #e85d5d; /* Anpassbar an Ihre Markenfarbe */
        width: 24px;
        border-radius: 4px;
    }

    /* Alternative: Grüner Dot für die 4. Box (box-green) */
    .mobile-scroll-dot.active.dot-green {
        background-color: #4a9d5f; /* Grün für die 4. Box */
    }
}

/* Optional: Wrapper für bessere Positionierung falls nötig */
@media (max-width: 767px) {
    .scroll-container-wrapper {
        position: relative;
    }
}
