/*
 * Niederhof – Tarteaucitron Branding & Mobile-Optimierung
 * =======================================================
 * Vendor-CSS:  /assets/js/site-consent/css/tarteaucitron.min.css
 * Custom-CSS:  diese Datei (über cookie-consent.php geladen)
 *
 * Geänderte Bereiche:
 *  1. Niederhof-Branding (Farben, Schrift)
 *  2. Mobile-Layout: kompakte Bar am unteren Rand statt großem Modal
 *  3. iOS-Scroll-Lock-Fix
 */

/* === BRANDING (Desktop & Mobile) ============================================ */

#tarteaucitronRoot * {
    font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif;
}

#tarteaucitronAlertBig {
    background: #ffffff !important;
    color: #1a2926 !important;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18) !important;
    border-radius: 12px !important;
    max-width: 560px !important;
}

#tarteaucitronAlertBig #tarteaucitronDisclaimerAlert {
    color: #1a2926 !important;
}

#tarteaucitronAlertBig #tarteaucitronPrivacyUrl,
#tarteaucitronAlertBig #tarteaucitronAllAllowed,
.tarteaucitronCTAButton,
#tarteaucitron .tarteaucitronCTAButton {
    background: #1d6b3d !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    padding: 12px 22px !important;
    transition: background 0.15s ease;
}

#tarteaucitronAlertBig #tarteaucitronPrivacyUrl:hover,
#tarteaucitronAlertBig #tarteaucitronAllAllowed:hover,
.tarteaucitronCTAButton:hover {
    background: #155028 !important;
}

#tarteaucitronAlertBig #tarteaucitronAllDenied {
    background: #b32424 !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    padding: 12px 22px !important;
}

#tarteaucitronAlertBig #tarteaucitronAllDenied:hover {
    background: #8a1a1a !important;
}

#tarteaucitronAlertBig #tarteaucitronCloseAlert {
    background: #f1f1f1 !important;
    color: #333 !important;
    border: none !important;
    border-radius: 8px !important;
    padding: 12px 22px !important;
}

#tarteaucitronAlertBig button:focus-visible {
    outline: 3px solid #f4c400 !important;
    outline-offset: 2px !important;
}

/* === MODAL-CONTENT (Desktop) =============================================== */

#tarteaucitronRoot #tarteaucitronAlertBig #tarteaucitronDisclaimerAlert {
    margin-bottom: 16px;
    font-size: 14px;
    line-height: 1.5;
}

#tarteaucitronServices_mandatory_title,
#tarteaucitronServices_mandatory {
    display: none !important; /* Notwendige Cookies-Sektion ausblenden */
}

#tarteaucitronInfo {
    background: #f9f9f9 !important;
    border-radius: 8px;
    padding: 12px !important;
    margin-top: 12px;
}

#tarteaucitronPercentage {
    background: #1d6b3d !important;
}

/* Cookie-Icon unten links */
#tarteaucitronIcon {
    z-index: 2147483640 !important;
}

/* ============================================================================
   MOBILE BAR LAYOUT + iOS SCROLL-LOCK FIX (Juni 2026)
   ============================================================================
   Auf Mobile wird das Banner zu einer kompakten Bar am unteren Rand,
   die nur die nötigsten Buttons zeigt. Die Dienstleister-Liste wird
   ausgeblendet – wer Detail-Einstellungen will, klickt "Auswählen".
   ============================================================================ */

@media (max-width: 768px) {

  /* 1. Scroll-Lock auf Mobile deaktivieren – Seite immer scrollbar */
  html.tarteaucitron-modal-open-noscroll,
  html.tarteaucitron-modal-open,
  body.tarteaucitron-modal-open-noscroll,
  body.tarteaucitron-modal-open {
    overflow: visible !important;
    height: auto !important;
    position: static !important;
  }

  /* 2. Modal-Wrapper auf volle Breite */
  #tarteaucitronRoot {
    position: static !important;
  }

  /* 3. Banner als kompakte Bar am unteren Rand */
  #tarteaucitronAlertBig {
    position: fixed !important;
    bottom: 0 !important;
    top: auto !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    max-height: 50vh !important; /* niemals mehr als halber Bildschirm */
    margin: 0 !important;
    padding: 18px 16px 22px !important;
    border-radius: 14px 14px 0 0 !important;
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.22) !important;
    overflow-y: auto !important;
    transform: none !important;
    animation: slideUpBar 0.25s ease-out !important;
  }

  @keyframes slideUpBar {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
  }

  /* 4. Liste der Dienstleister auf Mobile ausblenden (User klickt "Auswählen" für Details) */
  #tarteaucitronAlertBig #tarteaucitronInfo,
  #tarteaucitronAlertBig #tarteaucitronPartnersList,
  #tarteaucitronAlertBig .tarteaucitronCookie {
    display: none !important;
  }

  /* 5. Banner-Text kompakter */
  #tarteaucitronAlertBig #tarteaucitronDisclaimerAlert {
    font-size: 14px !important;
    line-height: 1.4 !important;
    margin-bottom: 14px !important;
    max-height: 8em !important;
    overflow-y: auto !important;
  }

  /* 6. Button-Block: stacked, volle Breite, kompakte Touch-Targets */
  #tarteaucitronAlertBig #tarteaucitronAllAllowed,
  #tarteaucitronAlertBig #tarteaucitronAllDenied,
  #tarteaucitronAlertBig #tarteaucitronCloseAlert,
  #tarteaucitronAlertBig button.tarteaucitronCTAButton {
    display: block !important;
    width: 100% !important;
    margin: 5px 0 !important;
    padding: 11px 14px !important;
    font-size: 15px !important;
    min-height: 44px !important;
    line-height: 1.2 !important;
    box-sizing: border-box !important;
  }

  /* 6b. Datenschutzerklärung als kleiner Textlink (kein Button) */
  #tarteaucitronAlertBig #tarteaucitronPrivacyUrl,
  #tarteaucitronAlertBig #tarteaucitronPrivacyUrlDialog {
    display: inline-block !important;
    width: auto !important;
    background: transparent !important;
    color: #1d6b3d !important;
    text-decoration: underline !important;
    padding: 8px 4px !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    min-height: 0 !important;
    margin: 4px 0 0 !important;
  }

  /* 7. X-Button (Banner schließen) deutlich größer – iOS Touch-Target Minimum */
  #tarteaucitronCloseCross {
    width: 44px !important;
    height: 44px !important;
    line-height: 44px !important;
    font-size: 22px !important;
    top: 8px !important;
    right: 8px !important;
    text-align: center !important;
    border-radius: 50% !important;
    background: rgba(0, 0, 0, 0.06) !important;
    color: #1a2926 !important;
  }

  /* 8. Modal-Title kompakter */
  #tarteaucitronAlertBig #tarteaucitronTitle {
    font-size: 17px !important;
    margin-bottom: 8px !important;
    padding-right: 50px !important; /* Platz für X-Button */
  }

  /* 9. Cookie-Icon unten links auf Mobile etwas kleiner */
  #tarteaucitronIcon {
    width: 40px !important;
    height: 40px !important;
  }
}

/* ============================================================================
   FAIL-SAFE GEGEN CONTENT-BLOCKER
   Falls die vendor-tarteaucitron.min.css blockiert wird, soll
   trotzdem nie ein dauerhafter Scroll-Lock entstehen.
   Diese Regel ist im Custom-CSS – wenn das auch geblockt wird,
   greift der Inline-Fail-Safe in cookie-consent.php.
   ============================================================================ */

@media all {
  html.tarteaucitron-modal-open-noscroll:not(:has(#tarteaucitronAlertBig)),
  html.tarteaucitron-modal-open:not(:has(#tarteaucitronAlertBig)) {
    overflow: visible !important;
    height: auto !important;
  }
}
