/* ═══════════════════════════════════════════════════
   CQ MOBILE FIXES — F2/F4/F5/F7/F9/F10/F11
   Erstellt: 27.03.2026
   Betrifft: ALLE Seiten auf Mobile (< 768px)
   ═══════════════════════════════════════════════════ */

/* ── F2: Header wird weiß statt dunkel ────────────
   Fix: Opazität erhöhen + Fallback für backdrop-filter
   ─────────────────────────────────────────────────── */
@media (max-width: 1024px) {
    .cq-header.scrolled {
        background: rgba(0, 0, 0, 0.95) !important;
    }
}

/* ── F7: Weiße Hintergründe auf Mobile ────────────
   Erzwingt dunklen Background auf ALLEN Containern
   ─────────────────────────────────────────────────── */
@media (max-width: 768px) {
    body,
    .cq-room-content,
    .cq-room-section,
    .cq-location-content,
    .cq-about-content,
    .cq-faq-content,
    .cq-events-content,
    .cq-contact-content,
    .cq-blog-content,
    .cq-gutschein-content,
    .site-content,
    .entry-content,
    main,
    article {
        background: var(--black, #0a0a0a) !important;
        color: var(--text, rgba(255,255,255,0.85));
    }
}

/* ── F9: Mobile Logo nicht sichtbar ────────────────
   Sicherstellen dass Logo + Hamburger sichtbar sind
   ─────────────────────────────────────────────────── */
@media (max-width: 1024px) {
    .cq-header {
        padding: 0 1rem !important;
        z-index: 1000;
    }

    .cq-logo-img {
        height: 50px !important;
        max-width: 60px;
    }

    .cq-hamburger {
        display: flex !important;
        align-items: center;
        justify-content: center;
        min-width: 44px;
        min-height: 44px;
        -webkit-tap-highlight-color: transparent;
    }

    /* Desktop-Nav und CTA verstecken */
    .cq-nav,
    .cq-header-cta {
        display: none !important;
    }
}

/* ── F5: Mobile-Menü Dropdown funktioniert nicht ──
   Touch-Target vergrößern + sichtbarer aktiver State
   ─────────────────────────────────────────────────── */
@media (max-width: 1024px) {
    .cq-mobile-menu {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 999;
        background: rgba(0, 0, 0, 0.98);
        flex-direction: column;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding-top: calc(var(--header-height-mobile, 70px) + 1rem);
    }

    /* Mobile Nav Links — min 48px Touch-Target */
    .cq-mobile-nav-link {
        display: flex;
        align-items: center;
        justify-content: space-between;
        min-height: 48px;
        padding: 0.8rem 1.5rem;
        font-size: 1rem;
        color: rgba(255,255,255,0.9);
        text-decoration: none;
        border: none;
        background: none;
        width: 100%;
        text-align: left;
        cursor: pointer;
        -webkit-tap-highlight-color: rgba(178, 148, 116, 0.2);
    }

    .cq-mobile-nav-link:active {
        background: rgba(178, 148, 116, 0.1);
    }

    /* Chevron-Rotation für offene Sektionen */
    .cq-mobile-chevron {
        width: 12px;
        height: 12px;
        stroke: var(--gold, #b8956a);
        stroke-width: 2;
        fill: none;
        transition: transform 0.3s;
        flex-shrink: 0;
    }

    .cq-mobile-nav-item.open .cq-mobile-chevron {
        transform: rotate(180deg);
    }

    /* Sub-Menü (Räume/Events) — Accordion */
    .cq-mobile-sub {
        display: none;
        padding: 0 1.5rem 1rem;
    }

    .cq-mobile-nav-item.open .cq-mobile-sub {
        display: block;
    }

    /* Standort-Titel im Mobile Sub */
    .cq-mobile-loc-title {
        font-size: 0.7rem;
        letter-spacing: 0.12em;
        text-transform: uppercase;
        color: var(--gold, #b8956a);
        margin: 1rem 0 0.5rem;
        padding-bottom: 0.4rem;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }

    /* Raum-Links im Sub-Menü — Basis-Styling in header.css (mit Thumbnail-Flex-Layout).
       Hier nur Mobile-spezifische Ergänzung: kleiner Trenner + Touch-Feedback. */
    .cq-mobile-room-link {
        border-bottom: 1px solid rgba(255,255,255,0.05);
    }

    .cq-mobile-room-link:active {
        color: var(--gold);
    }

    .cq-mobile-more-link {
        display: block;
        padding: 0.6rem 0;
        font-size: 0.8rem;
        color: var(--gold, #b8956a);
        text-decoration: none;
    }
}

/* ── F4: Buttons reagieren nicht auf Mobile ────────
   Touch-Targets + pointer-events sicherstellen
   ─────────────────────────────────────────────────── */
@media (max-width: 768px) {
    /* Alle Buttons brauchen min 44px Touch-Target */
    button,
    .cq-btn,
    .cq-cta-btn,
    [role="button"],
    a.cq-btn,
    a.cq-cta-btn,
    .cq-room-book-btn,
    .cq-slot,
    .cq-day {
        min-height: 44px;
        min-width: 44px;
        -webkit-tap-highlight-color: rgba(178, 148, 116, 0.3);
        touch-action: manipulation;
    }

    /* Kein Double-Tap-Zoom auf Buttons */
    button,
    a,
    input,
    select,
    textarea {
        touch-action: manipulation;
    }

    /* Sticky Booking Widget — pointer-events sicherstellen */
    .cq-room-sidebar {
        pointer-events: auto !important;
        z-index: 100;
    }
}

/* ── F10: Standort-Karten passen nicht ins Mobile ──
   Cards volle Breite, Buttons zentriert
   ─────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .cq-location-rooms-grid,
    .cq-room-cards-grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem;
    }

    .cq-location-card,
    .cq-room-card {
        max-width: 100% !important;
        width: 100%;
    }
}

/* ── F11: Buttons zu breit / nicht zentriert ──────
   Buttons auf Mobile kleiner + zentriert
   ─────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .cq-cta-btn,
    .cq-hero-cta,
    .cq-section-cta {
        width: 100%;
        max-width: 320px;
        margin-left: auto;
        margin-right: auto;
        display: block;
        text-align: center;
    }

    /* Section-Titel zentrieren */
    .cq-section-title,
    .cq-section-label {
        text-align: center;
    }
}

/* ── Mobile Book Bar am unteren Rand ──────────────
   Fester "Jetzt buchen" Button am unteren Bildrand
   ─────────────────────────────────────────────────── */
@media (max-width: 1024px) {
    .cq-mobile-book {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 998;
        padding: 0.6rem 1rem;
        background: linear-gradient(transparent, rgba(0,0,0,0.95) 30%);
    }

    .cq-mobile-book-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
        width: 100%;
        padding: 0.9rem;
        background: linear-gradient(135deg, var(--gold, #b8956a), var(--gold-light, #d4af7a));
        color: var(--black, #0a0a0a);
        font-weight: 700;
        font-size: 0.85rem;
        letter-spacing: 0.1em;
        text-transform: uppercase;
        text-decoration: none;
        border-radius: 0;
        -webkit-tap-highlight-color: transparent;
    }

    /* Body-Padding nur dort, wo der feste Buchen-Button wirklich steht.
       Vorher galt die Regel auf jeder Seite unter 1024 px, auch auf
       Warenkorb und Kasse — die tragen den Button nicht (header.php:21,
       schlanker Header-Zweig) und hatten 70 px Leerraum unter dem Footer.
       Dieselbe Regel steht in header.css:725 und ist dort mit umgestellt,
       sonst bliebe der Patch wirkungslos. (Nadja A3, 07.09.2026) */
    body:has(.cq-mobile-book) {
        padding-bottom: 70px;
    }
}

/* ── Generelle Mobile-Verbesserungen ──────────────── */
@media (max-width: 768px) {
    /* Overflow-Schutz für alle Seiten */
    html, body {
        overflow-x: hidden;
        max-width: 100vw;
    }

    /* Bilder maximal volle Breite */
    img {
        max-width: 100%;
        height: auto;
    }

    /* Tabellen horizontal scrollbar */
    table {
        display: block;
        overflow-x: auto;
    }
}
