/* ==========================================================================
   die mallorcamaklerin — gemeinsame Mobile-/UX-Verbesserungen
   Wird auf jeder Seite zusätzlich zu den Inline-Styles geladen.
   Keine Markenfarben, kein Layout-Reset — nur Cross-Cutting-Concerns:
   1. Sichere Mobile-Defaults (kein iOS-Auto-Zoom, kein Tap-Highlight)
   2. Hamburger-Mobile-Navigation für alle Sub-Pages
   3. Sicherheits-Padding gegen den Cookie-Banner
   4. Konsistente Touch-Target-Größen
   ========================================================================== */

/* iOS Safari zoomt automatisch bei <16px Inputs. Verhindern. */
input,
select,
textarea,
button {
    font-size: 16px;
}

/* Native blue tap highlight unterdrücken — wir nutzen :hover/:active selber */
* {
    -webkit-tap-highlight-color: transparent;
}

/* Keine horizontale Scroll-Achse durch unsichere Margins */
html, body {
    overflow-x: hidden;
    max-width: 100vw;
}

/* Bilder responsive standardmäßig */
img {
    max-width: 100%;
    height: auto;
}

/* ── Hamburger-Toggle für nav-mini (Sub-Pages) ──────────────────────── */
.nav-mini-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--charcoal, #2A2A2A);
    padding: 0.5rem;
    margin-left: auto;
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
}

.nav-mini-toggle svg {
    width: 24px;
    height: 24px;
}

/* ── WhatsApp-Float — Platz für Cookie-Banner machen ────────────────── */
.whatsapp-float,
.wa-float {
    transition: bottom 0.3s ease, transform 0.2s ease !important;
}

body.cookie-visible .whatsapp-float,
body.cookie-visible .wa-float {
    bottom: 7rem !important;
}

/* ── Cookie-Banner — responsive Verbesserungen ──────────────────────── */
@media (max-width: 600px) {
    #cookieBanner > div {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px !important;
    }
    #cookieBanner p {
        font-size: 13px !important;
    }
    #cookieBanner button {
        width: 100% !important;
        padding: 12px 16px !important;
    }
}

/* ── Mobile Navigation für nav-mini (Sub-Pages) ─────────────────────── */
@media (max-width: 800px) {
    .nav-mini {
        position: relative;
        flex-wrap: wrap;
    }

    .nav-mini-toggle {
        display: inline-flex;
    }

    /* Wenn ein Toggle existiert, hide nav-mini-links by default,
       show as drawer when .open class is set. */
    .nav-mini:has(.nav-mini-toggle) .nav-mini-links {
        display: none;
        flex-basis: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
        margin-top: 1rem;
        padding-top: 1rem;
        border-top: 1px solid var(--sand, #E8DDD0);
    }

    .nav-mini:has(.nav-mini-toggle) .nav-mini-links.open {
        display: flex;
    }

    .nav-mini:has(.nav-mini-toggle) .nav-mini-links a {
        padding: 0.85rem 0.5rem;
        font-size: 1rem !important;
        border-radius: 8px;
    }

    .nav-mini:has(.nav-mini-toggle) .nav-mini-links a:hover {
        background: rgba(140, 32, 69, 0.08);
    }

    .nav-mini:has(.nav-mini-toggle) .nav-mini-links .cta {
        text-align: center;
        margin-top: 0.4rem;
    }
}

/* ── Touch-Target-Mindestgröße auf allen klickbaren Elementen ───────── */
@media (max-width: 800px) {
    .btn,
    .paket-btn,
    .nav-cta,
    .filter-btn,
    .immo-cta,
    .tip-cta,
    .s-cta,
    .weg-link,
    .explore-card {
        min-height: 44px;
    }
}

/* ── Sehr kleine Phones (≤ 380px) ───────────────────────────────────── */
@media (max-width: 380px) {
    .hero,
    .hero-sub,
    section,
    .container,
    .nav,
    .nav-mini {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
}

/* ── Print-Hilfen ───────────────────────────────────────────────────── */
@media print {
    .whatsapp-float,
    .wa-float,
    #cookieBanner {
        display: none !important;
    }
}

/* ── Accessibility: Focus-Indicator ──────────────────────────────────── */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--terra, #8C2045);
    outline-offset: 2px;
}

/* Reduce Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
