/**
 * Cookie Consent CSS (Optimized)
 */

/* Business-Suite-iFrame / Embed-Vorschau (Klasse per Inline-Script) */
html.fbm-suite-iframe-hide #fbm-cookie-consent-banner,
html.fbm-suite-iframe-hide #fbm-cookie-consent-popup,
html.fbm-suite-iframe-hide #fbm-cookie-consent-popup-overlay,
html.fbm-suite-iframe-hide .fbm-cookie-popup,
html.fbm-suite-iframe-hide .fbm-cookie-popup-overlay,
html.fbm-suite-iframe-hide .fbm-cookie-banner,
html.fbm-suite-iframe-hide .fbm-cookie-settings-toggle,
html.fbm-suite-iframe-hide #fbm-cookie-consent-settings {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* ============ Banner ============ */
.fbm-cookie-banner {
  position: fixed;
  left: 0;
  right: 0;
  z-index: 2147483647;
  background: #fff;
  box-shadow: 0 -2px 10px rgba(0,0,0,.1);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.fbm-cookie-banner-top { top: 0; border-bottom: 1px solid #e0e0e0; }
.fbm-cookie-banner-bottom { bottom: 0; border-top: 1px solid #e0e0e0; }

.fbm-cookie-banner-container { max-width: 1200px; margin: 0 auto; padding: 20px; }
.fbm-cookie-banner-content { display:flex; flex-direction:column; gap:20px; }

.fbm-cookie-banner-header {
  display:flex;
  justify-content:center;
  align-items:center;
  position:relative;
}
.fbm-cookie-banner-title { margin:0; font-size:24px; font-weight:600; color:#333; text-align:center; }

.fbm-cookie-banner-close {
  position:absolute;
  top:20px;
  right:20px;
  background:none;
  border:none;
  font-size:28px;
  line-height:1;
  color:#666;
  cursor:pointer;
  padding:0;
  width:30px;
  height:30px;
  display:flex;
  align-items:center;
  justify-content:center;
  transition: color .2s;
}
.fbm-cookie-banner-close:hover { color:#000; }

.fbm-cookie-banner-description {
  margin:0 0 20px 0;
  font-size:14px;
  line-height:1.6;
  color:#666;
}

/* ============ Kategorien ============ */
.fbm-cookie-categories { margin-top:20px; }

.fbm-cookie-category {
  margin-bottom:15px;
  border:1px solid #e0e0e0;
  border-radius:4px;
  overflow:hidden;
}

.fbm-cookie-category-header {
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:15px;
  background:#f9f9f9;
}

.fbm-cookie-category-label {
  display:flex;
  align-items:center;
  gap:10px;
  cursor:pointer;
  flex:1;
}

.fbm-cookie-category-checkbox { width:18px; height:18px; cursor:pointer; }
.fbm-cookie-category-checkbox:disabled { opacity:.5; cursor:not-allowed; }

.fbm-cookie-category-name { font-weight:600; font-size:16px; color:#333; }

.fbm-cookie-category-toggle {
  background:none; border:none; font-size:16px; color:#666; cursor:pointer;
  padding:5px 10px; transition: transform .2s, color .2s;
}
.fbm-cookie-category-toggle:hover { color:#000; }

.fbm-cookie-toggle-icon.active { transform: rotate(180deg); }

.fbm-cookie-category-description {
  padding:15px;
  background:#fff;
  font-size:14px;
  line-height:1.6;
  color:#666;
  border-top:1px solid #e0e0e0;
}

/* ============ Footer ============ */
.fbm-cookie-banner-footer {
  display:flex;
  justify-content:space-between;
  align-items:center;
  flex-wrap:wrap;
  gap:15px;
  padding-top:20px;
  border-top:1px solid #e0e0e0;
}

.fbm-cookie-banner-links { display:flex; gap:20px; flex-wrap:wrap; }
.fbm-cookie-link { color:#0073aa; text-decoration:none; font-size:14px; transition: color .2s; }
.fbm-cookie-link:hover { color:#005177; text-decoration:underline; }

.fbm-cookie-banner-buttons { display:flex; gap:10px; flex-wrap:wrap; }

/* Buttons */
.fbm-cookie-btn {
  padding:12px 24px;
  border:none;
  border-radius:4px;
  font-size:14px;
  font-weight:600;
  cursor:pointer;
  transition: all .2s;
  text-decoration:none;
  display:inline-block;
}

.fbm-cookie-btn-primary { background:#0073aa; color:#fff; }
.fbm-cookie-btn-primary:hover { background:#005177; color:#fff; }

.fbm-cookie-btn-secondary { background:#f0f0f0; color:#333; }
.fbm-cookie-btn-secondary:hover { background:#e0e0e0; color:#000; }

/* ============ Floating Button ============ */
.fbm-cookie-settings {
  position: fixed;
  z-index: 2147483647;
}

.fbm-cookie-settings-left-center,
.fbm-cookie-settings-right-center { transform: translateY(-50%); }

/* Mobile disable (hoch spezifisch) */
@media (max-width: 768px) {
  .fbm-cookie-settings.fbm-cookie-settings-mobile-disable {
    display:none !important;
    visibility:hidden !important;
    opacity:0 !important;
    pointer-events:none !important;
    height:0 !important;
    width:0 !important;
    overflow:hidden !important;
  }
}

.fbm-cookie-settings-toggle {
  display:flex;
  align-items:center;
  gap:8px;
  padding:12px 20px;
  background:#0073aa;
  color:#fff;
  border:none;
  border-radius:25px;
  font-size:14px;
  font-weight:600;
  cursor:pointer;
  box-shadow:0 2px 10px rgba(0,0,0,.2);
  transition: all .2s;
}

.fbm-cookie-settings-toggle:hover {
  background:#005177;
  box-shadow:0 4px 15px rgba(0,0,0,.3);
}

.fbm-cookie-settings-icon { font-size:18px; display:inline-block; }

/* Nur Icon (Backend: Beschriftung ausblenden) — kompakte runde Bubble */
.fbm-cookie-settings--hide-label .fbm-cookie-settings-toggle {
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 10px;
  border-radius: 50%;
}

/* Mobile: Text ausblenden (wenn Beschriftung im Backend sichtbar ist) */
@media (max-width: 768px) {
  .fbm-cookie-settings:not(.fbm-cookie-settings--hide-label) .fbm-cookie-settings-text { display:none; }
}

/* ============ Popup ============ */
.fbm-cookie-popup-overlay {
  position:fixed;
  top:0; left:0; right:0; bottom:0;
  background: rgba(0,0,0,.5);
  z-index: 2147483646;
  backdrop-filter: blur(10px);
}

.fbm-cookie-popup {
  position:fixed;
  top:50%;
  left:50%;
  transform: translate(-50%, -50%);
  z-index: 2147483647;
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,.3);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.fbm-cookie-popup-header {
  display:flex;
  justify-content:center;
  align-items:center;
  padding:20px;
  border-bottom: 1px solid #e0e0e0;
  position:relative;
}

.fbm-cookie-popup-title { margin:0; font-size:24px; font-weight:600; color:#333; text-align:center; }

.fbm-cookie-popup-close,
.fbm-cookie-banner-close {
  background:none;
  border:none;
  font-size:28px;
  line-height:1;
  color:#666;
  cursor:pointer;
  padding:0;
  width:30px;
  height:30px;
  display:flex;
  align-items:center;
  justify-content:center;
  transition: color .2s;
  position:absolute;
  top:20px;
  right:20px;
}

.fbm-cookie-popup-close:hover,
.fbm-cookie-banner-close:hover { color:#000; }

.fbm-cookie-popup-body,
.fbm-cookie-banner-body {
  text-align: center;
}

.fbm-cookie-icon-wrapper {
  display: flex;
  justify-content: center;
  margin-bottom: 15px;
}

.fbm-cookie-icon {
  display: inline-block;
}

.fbm-cookie-icon-image {
  display: inline-block;
  max-width: none;
  max-height: none;
  object-fit: contain;
}

.fbm-cookie-popup-body { padding:20px; }
.fbm-cookie-popup-description { margin:0 0 20px 0; font-size:14px; line-height:1.6; color:#666; }

.fbm-cookie-popup-footer {
  padding:20px;
  border-top: 1px solid #e0e0e0;
  display:flex;
  flex-direction:column;
  gap:15px;
}

.fbm-cookie-popup-links,
.fbm-cookie-banner-links {
  display:flex;
  justify-content:center;
  gap:20px;
  flex-wrap:wrap;
}
.fbm-cookie-popup-buttons,
.fbm-cookie-banner-buttons {
  display:flex;
  justify-content:center;
  gap:10px;
  flex-wrap:wrap;
}

@media (max-width: 768px) {
  .fbm-cookie-popup { width:95%; max-height:95vh; }
  .fbm-cookie-popup-header { padding:15px; }
  .fbm-cookie-popup-title { font-size:20px; }
  .fbm-cookie-popup-body { padding:15px; }
  .fbm-cookie-popup-footer { padding:15px; }
  .fbm-cookie-popup-buttons { flex-direction:column; }
  .fbm-cookie-btn { width:100%; text-align:center; }
}

/* ============ State: Customize ============ */
/* Startzustand: Kategorien in Banner/Popup verstecken */
#fbm-cookie-consent-banner .fbm-cookie-categories,
#fbm-cookie-consent-popup .fbm-cookie-categories {
  display: none;
}

/* Wenn Customize aktiv: Kategorien anzeigen */
#fbm-cookie-consent-banner.fbm-cookie-customize-active .fbm-cookie-categories,
#fbm-cookie-consent-popup.fbm-cookie-customize-active .fbm-cookie-categories {
  display: block;
}

/* ============ Scroll-Lock bei Popup und Banner ============ */
body.fbm-cookie-popup-active,
body.fbm-cookie-banner-active {
  overflow: hidden;
  touch-action: none;
}

/* ============ Dark Mode (System) ============ */
@media (prefers-color-scheme: dark) {
  body:not(.fbm-cookie-consent-light) .fbm-cookie-banner,
  body:not(.fbm-cookie-consent-light) .fbm-cookie-popup {
    background:#1e1e1e;
    color:#e0e0e0;
  }

  body:not(.fbm-cookie-consent-light) .fbm-cookie-banner-title,
  body:not(.fbm-cookie-consent-light) .fbm-cookie-popup-title { color:#fff; }

  body:not(.fbm-cookie-consent-light) .fbm-cookie-banner-description,
  body:not(.fbm-cookie-consent-light) .fbm-cookie-popup-description { color:#ccc; }

  body:not(.fbm-cookie-consent-light) .fbm-cookie-category { border-color:#444; }
  body:not(.fbm-cookie-consent-light) .fbm-cookie-category-header { background:#2a2a2a; }
  body:not(.fbm-cookie-consent-light) .fbm-cookie-category-name { color:#fff; }
  body:not(.fbm-cookie-consent-light) .fbm-cookie-category-toggle { color:#ccc; }

  body:not(.fbm-cookie-consent-light) .fbm-cookie-category-description {
    background:#1e1e1e;
    border-color:#444;
    color:#ccc;
  }

  body:not(.fbm-cookie-consent-light) .fbm-cookie-link { color:#4a9eff; }
  body:not(.fbm-cookie-consent-light) .fbm-cookie-link:hover { color:#6bb3ff; }

  body:not(.fbm-cookie-consent-light) .fbm-cookie-btn-secondary { background:#333; color:#fff; }
  body:not(.fbm-cookie-consent-light) .fbm-cookie-btn-secondary:hover { background:#444; }
}
