/* =========================================================================
   PAGEDINX RESPONSIVE SYSTEM (Mobile & Tablet Adjustments)
   Fokus: Behält das Desktop-Erlebnis 100% bei und optimiert Touch & Lesbarkeit
   auf Mobilgeräten und Tablets.
   ========================================================================= */

/* ======= Tablet (<= 991.98px) ======= */
@media (max-width: 991.98px) {
    /* Navbar Toggler & Collapse */
    .navbar-toggler {
        border: 1px solid var(--border-color) !important;
        border-radius: var(--radius-pill) !important;
        padding: 0.45rem 0.75rem !important;
        background-color: var(--bg-content) !important;
        color: var(--text-main) !important;
        transition: all var(--transition-fast) !important;
        outline: none !important;
        box-shadow: var(--shadow-sm) !important;
    }

    .navbar-toggler:hover,
    .navbar-toggler:focus {
        box-shadow: 0 0 0 3px rgba(100, 116, 139, 0.2) !important;
        border-color: var(--custom1-color) !important;
    }

    .navbar-toggler-icon {
        background-image: none !important;
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        width: 1.25rem;
        height: 1.25rem;
        position: relative;
    }

    .navbar-toggler-icon::before {
        content: "\f0c9";
        font-family: "Font Awesome 6 Pro", "Font Awesome 6 Free", "FontAwesome", sans-serif;
        font-weight: 900;
        font-size: 1.1rem;
        color: var(--text-main);
    }

    .navbar-collapse {
        background-color: var(--bg-content);
        border: 1px solid var(--border-color);
        border-radius: var(--radius-xl);
        box-shadow: var(--shadow-xl);
        padding: 1rem;
        margin-top: 0.75rem;
        max-height: calc(100vh - 160px);
        overflow-y: auto;
    }

    .navbar-nav {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.4rem !important;
    }

    .navbar-nav .nav-link {
        text-align: center !important;
        padding: 0.6rem 1rem !important;
        border-radius: var(--radius-pill) !important;
        font-size: 0.95rem !important;
    }

    /* Grids auf Tablets in 2 Spalten aufteilen */
    .grid-list-posts .col-lg-4,
    .grid-list-galleries .col-lg-4 {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

/* ======= Mobile / Smartphones (<= 767.98px) ======= */
@media (max-width: 767.98px) {
    /* Header & Linkbar */
    #linkbar {
        height: auto !important;
        min-height: 2.5rem;
        padding: 0.35rem 0.5rem !important;
    }

    .nav-top.app {
        font-size: 0.75rem !important;
        padding: 0.2rem 0.65rem !important;
    }

    .theme-toggle-btn {
        width: 28px !important;
        height: 28px !important;
    }

    .theme-icon-box {
        width: 15px !important;
        height: 15px !important;
    }

    .theme-icon-box .moon-icon,
    .theme-icon-box .sun-icon {
        font-size: 0.85rem !important;
    }

    #navbar {
        min-height: 4rem !important;
        padding: 0.4rem 0 !important;
    }

    #navbar.sticky {
        min-height: 3.5rem !important;
    }

    nav .navbar-brand img {
        max-height: 2.75rem !important;
        max-width: 3.25rem !important;
    }

    nav.sticky .navbar-brand img {
        max-height: 2.25rem !important;
    }

    /* Channels Bar: Smooth Mobile Swipe */
    .nav-channel {
        padding: 0.3rem 0 !important;
    }

    .nav-channel .navbar-nav {
        -webkit-overflow-scrolling: touch !important;
        scroll-snap-type: x proximity;
        padding: 0.2rem 2rem 0.2rem 0.75rem !important;
        gap: 0.4rem !important;
        -webkit-mask-image: linear-gradient(to right, #000 0%, #000 calc(100% - 36px), transparent 100%);
        mask-image: linear-gradient(to right, #000 0%, #000 calc(100% - 36px), transparent 100%);
    }

    .nav-channel li.channel-item,
    .nav-channel li {
        scroll-snap-align: start;
        padding: 0.3rem 0.85rem !important;
        font-size: 0.75rem !important;
    }

    /* Content Layout Spacing & Margins */
    .picNoChannel {
        margin-top: 108px !important;
        padding-top: 0 !important;
        min-height: calc(100vh - 200px) !important;
    }

    .picAndChannel {
        margin-top: 152px !important;
        padding-top: 0 !important;
        min-height: calc(100vh - 240px) !important;
    }

    .noPicNoChannel {
        margin-top: 108px !important;
        padding-top: 1.25rem !important;
        min-height: calc(100vh - 200px) !important;
    }

    .noPicAndChannel {
        margin-top: 152px !important;
        padding-top: 1.25rem !important;
        min-height: calc(100vh - 240px) !important;
    }

    /* Tops Carousel auf Mobile */
    .grid-list-tops .col-lg-12,
    .grid-list-tops .col-lg-6 {
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }

    .carousel-tops .carousel-item {
        min-height: 260px !important;
        max-height: 320px !important;
    }

    .carousel-tops .carousel-item > img {
        height: 280px !important;
    }

    .carousel-caption-bg {
        padding: 3rem 1.25rem 1.25rem 1.25rem !important;
        min-height: 55% !important;
    }

    .carousel-caption h2 {
        font-size: 1.2rem !important;
        margin-bottom: 0.25rem !important;
    }

    .carousel-caption p {
        font-size: 0.85rem !important;
        margin-bottom: 0.5rem !important;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    /* Posts & Galleries Grids (1 Spalte) */
    .grid-list-posts .col-lg-4,
    .grid-list-galleries .col-lg-4,
    .grid-list-posts .col-md-6,
    .grid-list-galleries .col-md-6,
    .grid-list-posts .col-12,
    .grid-list-galleries .col-12 {
        flex: 0 0 100% !important;
        max-width: 100% !important;
        margin-bottom: 1.25rem;
    }

    /* Horizontale Karten (Events, Products, Latest-Content, Coupons) auf Mobile vertikal stapeln */
    .grid-list-events .grid-item,
    .grid-list-products .grid-item,
    .grid-list-latest .grid-item {
        flex-direction: column !important;
        height: auto !important;
        min-height: auto !important;
        max-height: none !important;
        margin-bottom: 1.25rem !important;
    }

    .grid-list-events .grid-item .grid-item-img,
    .grid-list-products .grid-item .grid-item-img,
    .grid-list-latest .grid-item .grid-item-img {
        width: 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 auto !important;
        height: auto !important;
        max-height: none !important;
        aspect-ratio: 16 / 9 !important;
        border-top-left-radius: var(--radius-xl) !important;
        border-top-right-radius: var(--radius-xl) !important;
        border-bottom-left-radius: 0 !important;
    }

    .grid-list-events .grid-item-content,
    .grid-list-products .grid-item-content,
    .grid-list-latest .grid-item-content {
        flex: 1 1 auto !important;
        height: auto !important;
        max-height: none !important;
        padding: 1.1rem 1.25rem !important;
    }

    /* Coupons auf Mobile */
    .grid-list-coupons .grid-item:not(.grid-item-detail) {
        flex-direction: column !important;
        height: auto !important;
        max-height: none !important;
        padding-top: 2rem !important;
    }

    .grid-list-coupons .grid-item:not(.grid-item-detail) .grid-item-img {
        width: 100px !important;
        height: 100px !important;
        min-width: 100px !important;
        margin: 0.5rem auto !important;
    }

    .grid-list-coupons .grid-item:not(.grid-item-detail) .grid-item-content {
        padding: 0.75rem 1rem 1.25rem 1rem !important;
        text-align: center;
    }

    .grid-list-coupons .grid-item .grid-item-disruptor {
        top: 8px !important;
        font-size: 0.75rem !important;
        padding: 3px 12px !important;
    }

    /* Kontakte auf Mobile */
    .grid-list-contacts .grid-item {
        flex-direction: column !important;
        text-align: center;
        padding: 1rem !important;
    }

    .grid-list-contacts .grid-item .grid-item-img {
        margin: 0 auto 0.75rem auto !important;
    }

    .grid-list-contacts .grid-item-content {
        padding: 0 !important;
    }

    /* FAQ auf Mobile */
    .faq-question {
        padding: 1.1rem 1.25rem !important;
        font-size: 0.975rem !important;
    }

    .faq-answer {
        padding: 1.1rem 1.25rem 1.35rem 1.25rem !important;
        font-size: 0.9125rem !important;
    }

    /* Galerie-Detail Raster auf Mobile */
    .grid-item-galleries {
        margin-bottom: 0.75rem;
    }

    /* Detail Banner Carousel & Swipe Series */
    .carousel-item.item-sm {
        height: 240px !important;
        min-height: 240px !important;
        max-height: 240px !important;
    }

    .carousel-item.item-sm .swipeSeriesPicture,
    .carousel-item.item-sm > div.first-slide {
        min-height: unset !important;
    }

    .swipeSeries i {
        width: 36px !important;
        height: 36px !important;
        font-size: 0.95rem !important;
    }

    .swipeSeries-indicators {
        bottom: 0.75rem !important;
        padding: 3px 8px !important;
        gap: 5px !important;
    }

    .swipeSeries-dot {
        width: 6px !important;
        height: 6px !important;
    }

    .swipeSeries-dot.active {
        width: 18px !important;
    }

    /* Detail Page Typography */
    body h2 {
        font-size: 1.4rem !important;
    }

    body h3 {
        font-size: 1.15rem !important;
    }

    /* Chatbot Window auf Mobile */
    .chatbot-body {
        height: calc(100vh - 360px) !important;
        min-height: 350px !important;
        padding: 1rem !important;
    }

    .chat-bubble-ai,
    .chat-bubble-user {
        max-width: 90% !important;
        padding: 0.75rem 1rem !important;
        font-size: 0.9rem !important;
    }

    .chatbot-footer {
        padding: 0.75rem 1rem !important;
    }

    .chatbot-input {
        padding: 0.6rem 1rem !important;
        font-size: 0.9rem !important;
    }

    .chatbot-send-btn {
        padding: 0.6rem 1rem !important;
        font-size: 0.85rem !important;
    }

    /* Download App Modal auf Mobile */
    .modal.modal-download-app .oldCenter {
        margin-bottom: 0.75rem !important;
        padding: 1rem !important;
    }

    .modal.modal-download-app i.fab {
        font-size: 2.5rem !important;
    }

    .modal.modal-download-app img {
        max-width: 120px !important;
    }

    /* Footer auf Mobile */
    footer p.float-end {
        float: none !important;
        justify-content: center !important;
        margin-top: 0.5rem !important;
    }

    footer p {
        justify-content: center !important;
        text-align: center !important;
    }

    /* Scroll To Top Button auf Mobile */
    #scrollToTopBtn {
        bottom: 18px !important;
        right: 18px !important;
        width: 40px !important;
        height: 40px !important;
        font-size: 14px !important;
    }
}

/* ======= Kleine Smartphones (<= 380px) ======= */
@media (max-width: 380px) {
    .nav-top.app {
        font-size: 0.7rem !important;
        padding: 0.15rem 0.5rem !important;
    }

    .navbar-nav.nav-links {
        display: none !important; /* Externe Social Links auf kleinsten Displays ausblenden um Platz für App Laden + Theme zu lassen */
    }

    #navbar {
        min-height: 3.5rem !important;
    }

    .chatbot-body {
        min-height: 300px !important;
    }
}
