/* Cookie-Leiste (gleiche Optik und gleiche Funktionen wie die Startseite, Stand 19.10.2026).
   Abgeleitet aus public/index.html; die Startseite behaelt ihre eigenen Regeln im Seitenkopf. */
:root { --ns-blau: #0071e3; --ns-schwarz: #1d1d1f; --ns-grau: #6e6e73; --ns-linie: #e5e5ea; }
    #cookie-overlay {
      position: fixed; top: 0; left: 0; right: 0; bottom: 0;
      background: rgba(0,0,0,0.4);
      z-index: 9998;
      display: none;
    }
    #cookie-banner {
      position: fixed;
      top: 50%; left: 50%;
      transform: translate(-50%, -50%);
      width: min(560px, calc(100vw - 32px));
      background: var(--white);
      color: var(--black);
      z-index: 9999;
      box-shadow: 0 16px 48px rgba(0,0,0,0.20);
      border: 1px solid rgba(0,0,0,0.08);
      border-radius: 16px;
      padding: 22px 24px;
      display: none;
      flex-direction: column;
      gap: 0;
      font-size: 13px;
      max-height: 85vh;
      overflow-y: auto;
    }
    /* Kompakt-Ansicht (Standard beim ersten Besuch) */
    .cookie-compact { display: flex; flex-direction: column; gap: 16px; }
    .cookie-compact-text { flex: 1; min-width: 200px; font-size: 13px; color: var(--gray); line-height: 1.5; }
    .cookie-compact-text a { color: var(--blue); text-decoration: underline; }
    .cookie-compact-text svg { width: 14px; height: 14px; vertical-align: -2px; margin-right: 4px; fill: none; stroke: var(--gray); stroke-width: 2; }
    .cookie-compact-btns { display: flex; gap: 8px; flex-shrink: 0; flex-wrap: wrap; }
    .cookie-compact-btns .cookie-btn { padding: 10px 18px; font-size: 13px; white-space: nowrap; }
    /* Detail-Ansicht (nur wenn "Einstellungen" geklickt) */
    .cookie-details { display: none; margin-top: 16px; border-top: 1px solid rgba(0,0,0,0.06); padding-top: 16px; }
    .cookie-details.open { display: block; }
    .cookie-title { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
    .cookie-text { color: var(--gray); line-height: 1.6; font-size: 13px; }
    .cookie-text a { color: var(--blue); text-decoration: underline; }
    .cookie-categories { display: flex; flex-direction: column; gap: 0; }
    .cookie-group { background: var(--light-gray); border-radius: 10px; overflow: hidden; }
    .cookie-group + .cookie-group { margin-top: 10px; }
    .cookie-group-header { display: flex; align-items: center; gap: 10px; padding: 14px 16px; cursor: default; }
    .cookie-group-header input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--blue); cursor: pointer; flex-shrink: 0; }
    .cookie-group-header input[disabled] { opacity: 0.5; cursor: default; }
    .cookie-group-info { flex: 1; }
    .cookie-group-name { font-size: 15px; font-weight: 600; color: var(--black); }
    .cookie-group-desc { font-size: 12px; color: var(--gray); line-height: 1.5; margin-top: 2px; }
    .cookie-group-toggle { color: var(--blue); font-size: 12px; font-weight: 500; cursor: pointer; white-space: nowrap; display: flex; align-items: center; gap: 4px; background: none; border: none; font-family: var(--font); padding: 0; }
    .cookie-group-toggle:hover { text-decoration: underline; }
    .cookie-group-toggle svg { width: 14px; height: 14px; fill: var(--blue); transition: transform 0.2s; }
    .cookie-group.open .cookie-group-toggle svg { transform: rotate(180deg); }
    .cookie-group-details { display: none; border-top: 1px solid var(--mid-gray); padding: 0 16px; }
    .cookie-group.open .cookie-group-details { display: block; }
    .cookie-service { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid rgba(0,0,0,0.06); }
    .cookie-service:last-child { border-bottom: none; }
    .cookie-service-name { font-size: 13px; font-weight: 500; color: var(--black); }
    .cookie-service-provider { font-size: 11px; color: var(--gray); }
    .cookie-service-right { display: flex; align-items: center; gap: 10px; }
    .cookie-service-status { font-size: 11px; color: var(--gray); }
    .cookie-switch { position: relative; width: 42px; height: 24px; flex-shrink: 0; }
    .cookie-switch input { opacity: 0; width: 0; height: 0; }
    .cookie-switch-slider { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: var(--mid-gray); border-radius: 24px; cursor: pointer; transition: 0.2s; }
    .cookie-switch-slider::before { content: ''; position: absolute; height: 18px; width: 18px; left: 3px; bottom: 3px; background: white; border-radius: 50%; transition: 0.2s; }
    .cookie-switch input:checked + .cookie-switch-slider { background: var(--blue); }
    .cookie-switch input:checked + .cookie-switch-slider::before { transform: translateX(18px); }
    .cookie-switch input:disabled + .cookie-switch-slider { opacity: 0.5; cursor: default; }
    .cookie-detail-btns { display: flex; gap: 10px; margin-top: 16px; }
    .cookie-btn { border: none; border-radius: 8px; padding: 12px 24px; font-size: 14px; font-weight: 600; cursor: pointer; font-family: var(--font); transition: all 0.2s; flex: 1; text-align: center; }

    .cookie-btn-save { background: var(--light-gray); color: var(--black); }
    .cookie-btn-save:hover { background: var(--mid-gray); color: var(--white); }

    #cookie-settings-btn {
      position: fixed; bottom: 16px; left: 16px; z-index: 998;
      height: 38px; border-radius: 980px;
      background: var(--black); color: var(--white); border: none;
      box-shadow: 0 2px 16px rgba(0,0,0,0.18);
      cursor: pointer; display: flex; align-items: center; gap: 7px;
      padding: 0 14px 0 11px;
      font-family: var(--font); font-size: 12px; font-weight: 600;
      transition: all 0.2s; opacity: 0.85;
    }
    #cookie-settings-btn:hover { opacity: 1; box-shadow: 0 4px 24px rgba(0,0,0,0.25); transform: translateY(-1px); }
    #cookie-settings-btn svg { width: 16px; height: 16px; fill: var(--white); flex-shrink: 0; }
    @media (max-width: 768px) {
      #cookie-banner { padding: 14px 16px; }
      .cookie-compact { flex-direction: column; gap: 12px; align-items: stretch; }
      .cookie-compact-btns { justify-content: stretch; }
      .cookie-compact-btns .cookie-btn { flex: 1; text-align: center; padding: 10px 12px; font-size: 12px; }
      .cookie-group-header { flex-wrap: wrap; }
      .cookie-group-toggle { margin-top: 6px; }
      .cookie-detail-btns { flex-direction: column; }
      .cookie-detail-btns .cookie-btn { width: 100%; text-align: center; }
      .cookie-service { flex-wrap: wrap; gap: 8px; }
    }
    #cookie-banner.ns-cookie { left: 0; right: 0; bottom: 0; top: auto; transform: none; width: auto; max-width: none; border-radius: 0; padding: 0; background: rgba(255,255,255,.97); backdrop-filter: saturate(180%) blur(12px); -webkit-backdrop-filter: saturate(180%) blur(12px); border-top: 1px solid var(--ns-linie); box-shadow: 0 -6px 24px rgba(0,0,0,.06); flex-direction: column; }
    #cookie-banner.ns-cookie .cookie-compact { max-width: 1180px; margin: 0 auto; width: 100%; padding: 12px 40px; display: flex; align-items: center; gap: 20px; flex-direction: row; }
    #cookie-banner.ns-cookie .cookie-compact-text { flex: 1; font-size: 13px; color: var(--ns-grau); line-height: 1.45; display: block; }
    #cookie-banner.ns-cookie .cookie-compact-text svg { display: none; }
    #cookie-banner.ns-cookie .cookie-compact-text a, #cookie-banner.ns-cookie .ns-c-link { color: var(--ns-grau); font: inherit; background: none; border: 0; text-decoration: underline; cursor: pointer; padding: 0; }
    #cookie-banner.ns-cookie .cookie-compact-btns { display: flex; gap: 8px; flex: 0 0 auto; flex-direction: row; width: auto; }
    #cookie-banner.ns-cookie .ns-c-btn { min-width: 128px; border: 1.5px solid var(--ns-schwarz); background: #fff; color: var(--ns-schwarz); border-radius: 12px; padding: 9px 16px; font: 600 14px var(--font); cursor: pointer; flex: 0 0 auto; width: auto; margin: 0; }
    #cookie-banner.ns-cookie .cookie-details { max-width: 520px; margin: 0 auto; width: 100%; }
    #cookie-banner.ns-cookie:has(#cookie-details.open) { left: 50%; right: auto; bottom: auto; top: 50%; transform: translate(-50%, -50%); width: min(560px, calc(100vw - 32px)); border-radius: 16px; padding: 22px 24px; border: 1px solid rgba(0,0,0,.08); box-shadow: 0 16px 48px rgba(0,0,0,.2); background: #fff; }
    #cookie-banner.ns-cookie .cookie-details { margin-top: 0; border-top: 0; padding-top: 0; }
    #cookie-banner.ns-cookie .cookie-detail-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
    #cookie-banner.ns-cookie .cookie-detail-btns .ns-c-btn { min-width: 0; width: 100%; }
    #cookie-banner.ns-cookie .ns-c-speichern { grid-column: 1 / -1; background: var(--ns-schwarz); color: #fff; border: 0; border-radius: 12px; padding: 10px 16px; font: 600 14px var(--font); width: 100%; }
    #cookie-overlay { background: transparent !important; pointer-events: none; }
    body:has(#cookie-details.open) #cookie-overlay { background: rgba(0,0,0,.35) !important; pointer-events: auto; }
    #cookie-settings-btn { display: none !important; }
    @media (max-width: 760px) {
      #cookie-banner.ns-cookie .cookie-compact { padding: 10px 16px 12px; flex-direction: column; align-items: stretch; gap: 8px; }
      #cookie-banner.ns-cookie .cookie-compact-text { font-size: 12px; }
      #cookie-banner.ns-cookie .ns-c-btn { flex: 1; min-width: 0; padding: 9px 10px; }
    }
