/* Mobile Touch-Targets + Tiny-Text Fix (Audit 2026-05-05) — Lädt nach allen anderen CSS */

@media (max-width: 1024px) and (hover: none),
       (max-width: 1024px) and (pointer: coarse) {

  /* ── 1. Standalone Buttons / CTAs: 44×44 mit Padding+Flex ── */
  html body a.btn, html body a.cta, html body a.button,
  html body a.stb-cta, html body a.asm-cta, html body a.asm-tel,
  html body a.mobile-sticky-cta-cta, html body a.mobile-sticky-cta-phone,
  html body a[class*="btn"], html body a[class*="cta"], html body a[class*="button"],
  html body button:not([hidden]):not([disabled]),
  html body [role="button"],
  html body input[type="submit"],
  html body input[type="button"],
  html body input[type="reset"],
  html body .btn, html body .cta, html body .button,
  html body [class*="btn-"], html body [class*="cta-"],
  html body summary {
    min-height: 44px !important;
    min-width: 44px !important;
    padding: max(10px, 0.625em) max(14px, 0.875em) !important;
    box-sizing: border-box !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    touch-action: manipulation;
  }

  /* ── 1b. Catch-All: Block-Level <a> ohne Inline-Text-Parent → 44 ── */
  html body a[href]:not([class*="inline"]):not([style*="display:inline"]):not([style*="display: inline"]) {
    min-height: 44px;
    min-width: 44px;
  }

  /* ── 2. Footer-Link-Cluster ── */
  html body footer a:not(.btn):not(.cta):not(.button),
  html body .footer a:not(.btn):not(.cta):not(.button) {
    display: inline-block !important;
    min-height: 44px !important;
    min-width: 44px !important;
    line-height: 44px !important;
    padding-inline: 8px !important;
  }

  /* ── 3. Tel/WhatsApp/Mail-Links 44×44 ── */
  html body a[href^="tel:"],
  html body a[href^="whatsapp:"],
  html body a[href*="wa.me"],
  html body a[href^="mailto:"] {
    min-height: 44px !important;
    min-width: 44px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 8px 12px !important;
    touch-action: manipulation;
  }

  /* ── 4. Top-Nav / Burger-Menü / Submenu-Links 44 ── */
  html body nav a, html body .nav a, html body .nav-links a,
  html body .topnav a, html body .menu a, html body .submenu a,
  html body .dropdown a, html body .dropdown-menu a {
    min-height: 44px !important;
    min-width: 44px !important;
    display: flex !important;
    align-items: center !important;
    padding: 8px 12px !important;
    touch-action: manipulation;
  }

  /* ── 5. Logo-Link 44 hoch ── */
  html body a.nav-logo-link, html body a.logo,
  html body .nav-logo a, html body .logo-link {
    min-height: 44px !important;
    display: inline-flex !important;
    align-items: center !important;
  }

  /* ── 6. Generic main-Section Links (kein .btn-Klasse) ── */
  html body main > a, html body main section > a, html body main > div > a,
  html body section > a, html body section > div > a,
  html body article > a, html body article section > a {
    min-height: 44px !important;
    min-width: 44px !important;
    display: inline-flex !important;
    align-items: center !important;
    padding: 8px 12px !important;
    touch-action: manipulation;
  }

  /* ── 6d. ALL block/inline-block Links die NICHT in Text-Container sind ── */
  /* Catch-all: Links die nicht in p/li/span/td/th/h*/label sind UND nicht inline display */
  html body a[href]:not(p > a):not(li > a):not(span > a):not(td > a):not(th > a):not(label > a):not(h1 > a):not(h2 > a):not(h3 > a):not(h4 > a):not(h5 > a):not(h6 > a):not(blockquote > a):not(figcaption > a):not(dt > a):not(dd > a) {
    min-height: 44px;
    min-width: 44px;
  }

  /* ── 6b. Block-Level <a> in Banner/Info-Container — höhere Specificity als Inline-Text-Override ── */
  html body p.kk-info-banner > a:not([data-inline]),
  html body p.info-banner > a:not([data-inline]),
  html body .info-banner > a:not(.btn):not(.cta):not(.button):not([data-inline]),
  html body .banner > a:not(.btn):not(.cta):not(.button):not([data-inline]),
  html body p > a[style*="display:block"]:not([data-inline]),
  html body p > a[style*="display: block"]:not([data-inline]),
  html body p[class] > a:only-child:not([href^="tel:"]):not([href^="mailto:"]):not([data-inline]) {
    min-height: 44px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 10px 14px !important;
    line-height: 1.3 !important;
  }

  /* ── 6c. Tel-Icons in Sticky-Bar / Float-Buttons (mit ungefülltem text + svg) ── */
  html body a.asm-tel,
  html body a.wa-float,
  html body a.wa-float.show,
  html body a.mobile-sticky-cta-phone,
  html body a.float-tel, html body a.float-wa, html body a.fab-tel, html body a.fab-wa {
    min-height: 56px !important;
    min-width: 56px !important;
    width: auto !important;
    box-sizing: border-box !important;
    padding: 12px 16px !important;
  }

  /* ── 7. Inline-Text-Links: NICHT 44 (Layout-Bruch verhindert) ── */
  html body p > a:not(.btn):not(.cta):not(.button):not([href^="tel:"]):not([href^="mailto:"]),
  html body li > a:not(.btn):not(.cta):not(.button):not([href^="tel:"]):not([href^="mailto:"]),
  html body span > a:not(.btn):not(.cta):not(.button):not([href^="tel:"]):not([href^="mailto:"]),
  html body td > a:not(.btn):not(.cta):not(.button):not([href^="tel:"]):not([href^="mailto:"]),
  html body th > a:not(.btn):not(.cta):not(.button):not([href^="tel:"]):not([href^="mailto:"]),
  html body label > a:not(.btn):not(.cta):not(.button):not([href^="tel:"]):not([href^="mailto:"]),
  html body h1 > a:not(.btn):not(.cta):not(.button):not([href^="tel:"]):not([href^="mailto:"]),
  html body h2 > a:not(.btn):not(.cta):not(.button):not([href^="tel:"]):not([href^="mailto:"]),
  html body h3 > a:not(.btn):not(.cta):not(.button):not([href^="tel:"]):not([href^="mailto:"]),
  html body h4 > a:not(.btn):not(.cta):not(.button):not([href^="tel:"]):not([href^="mailto:"]),
  html body h5 > a:not(.btn):not(.cta):not(.button):not([href^="tel:"]):not([href^="mailto:"]),
  html body h6 > a:not(.btn):not(.cta):not(.button):not([href^="tel:"]):not([href^="mailto:"]) {
    min-height: 0 !important;
    min-width: 0 !important;
    padding: 4px 2px !important;
    line-height: 1.6 !important;
    display: inline !important;
    touch-action: manipulation;
  }
}

/* ── 7b. Cookie-Banner Buttons (auch alte Implementierungen) ── */
@media (max-width: 1024px) and (hover: none),
       (max-width: 1024px) and (pointer: coarse) {
  html body button[class*="cookie"],
  html body button[id*="cookie"],
  html body [class*="cookie"] button,
  html body [id*="cookie"] button,
  html body .cookie-accept, html body .cookie-decline,
  html body button[class*="consent"],
  html body [class*="consent"] button {
    min-height: 44px !important;
    min-width: 44px !important;
    padding: 10px 16px !important;
    box-sizing: border-box !important;
  }
}

/* ── 7c. Overlay-Konflikt-Fix (Cookie-Banner vs Sticky-CTA) ─────── */
/* Cookie-Banner hat höchsten z-index. Wenn er sichtbar ist, sticky-CTAs verstecken. */
html.cc-visible #autark-sticky-mobile,
html.cc-visible #mobileStickyCta,
html.cc-visible .mobile-sticky-cta,
html.cc-visible .float-cta,
html.cc-visible .wa-float,
body:has(.cc-visible) #autark-sticky-mobile,
body:has(.cc-visible) #mobileStickyCta,
body:has(.cc-visible) .mobile-sticky-cta,
body:has(.cc-visible) .float-cta,
body:has(.cc-visible) .wa-float {
  display: none !important;
}

/* float-cta (Bottom-CTA) und wa-float (rechts unten) — wa-float oberhalb */
@media (max-width: 1024px) {
  html body .wa-float,
  html body .wa-float.show {
    bottom: 90px !important;
    z-index: 90 !important;
  }
  html body .float-cta {
    z-index: 80 !important;
  }
}

/* Sticky-Top-Bar reduzieren (zu viele sticky-elements auf index) */
@media (max-width: 768px) {
  html body .stb-bar {
    display: none !important;
  }
}

/* ── 8. Mindest-Schriftgrößen Mobile ── */
@media (max-width: 768px) {
  html body, html body p, html body li, html body td, html body th,
  html body span:not([class*="icon"]):not([class*="emoji"]):not([class*="badge"]):not([class*="tag"]):not(.nav-logo-sub),
  html body a, html body button, html body div {
    font-size: max(14px, 1em) !important;
  }
  html body small, html body .small, html body .footnote,
  html body .legal, html body .meta, html body .byline,
  html body .micro, html body .cc-text,
  html body .kf-disclaimer, html body .kf-help, html body .form-help {
    font-size: max(12px, 0.75rem) !important;
  }
  /* Logo-Untertitel etwas größer als 9-12px */
  html body .nav-logo-sub {
    font-size: 0.78rem !important;
  }
  /* Sehr kleine Badges/Tags (NEU-Marker etc.) — bewusst klein bleiben, aber min 11px */
  html body .badge, html body .tag, html body .sgb-tag,
  html body [class*="-tag"], html body [class*="-badge"] {
    font-size: max(11px, 0.6875rem) !important;
  }
  /* iOS-Auto-Zoom verhindern: Inputs ≥ 16px */
  html body input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="range"]),
  html body textarea, html body select {
    font-size: max(16px, 1rem) !important;
  }
}
