/*
 * Eulektro Consent - Banner unten auf der Seite (blockiert die Seite nicht).
 *
 * Gestaltung ueber CSS-Variablen (v1.0.0). Jede Website setzt sie in ihrem
 * eigenen Stylesheet auf :root oder .eul-cb, z. B.
 * ":root { --eul-cb-marke: var(--meine-farbe); }" - fuer ein dunkles
 * Farbschema genuegt es, wenn die eigenen Tokens dort umschalten. Die
 * Variablen werden hier nicht gesetzt, nur gelesen (Rueckfall: die
 * eulektro.de-Tokens --eul-*, sonst feste Werte) - die Reihenfolge der
 * Stylesheets spielt deshalb keine Rolle.
 *
 *   --eul-cb-marke         Leitfarbe (Knoepfe, Titel, Linie oben, Links)
 *   --eul-cb-marke-hover   Knopf beim Ueberfahren
 *   --eul-cb-auf-marke     Schrift auf der Leitfarbe
 *   --eul-cb-fokus         Fokusrahmen
 *   --eul-cb-text          Schriftfarbe
 *   --eul-cb-text-leise    Beschreibungen der Kategorien
 *   --eul-cb-linie         Trennlinien und Rahmen
 *   --eul-cb-flaeche       Hintergrund
 *   --eul-cb-schatten      Schatten des Kastens
 *   --eul-cb-schrift       Grundschrift
 *   --eul-cb-schrift-titel Schrift der Ueberschrift
 *   --eul-cb-ecke          Eckenradius des Kastens
 *   --eul-cb-ecke-knopf    Eckenradius der Knoepfe
 *
 * Sitepackages mit globalem button/input-Reset: daher die !important an
 * Knoepfen und Checkboxen. Keine Inline-Styles (Content-Security-Policy).
 */
.eul-cb {
    position: fixed;
    z-index: 2147483000;
    left: 16px;
    right: 16px;
    bottom: 16px;
    display: flex;
    justify-content: center;
    pointer-events: none;
    font-family: var(--eul-cb-schrift, var(--eul-font-body, "Source Sans 3", ui-sans-serif, system-ui, sans-serif));
    color: var(--eul-cb-text, var(--eul-ink, #212529));
}
.eul-cb__box {
    pointer-events: auto;
    width: 100%;
    max-width: 720px;
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
    overflow-y: auto;
    padding: 20px 24px;
    background: var(--eul-cb-flaeche, var(--eul-surface, #fff));
    border: 1px solid var(--eul-cb-linie, var(--eul-line, rgba(0, 0, 0, 0.15)));
    border-top: 4px solid var(--eul-cb-marke, var(--eul-brand, #21697c));
    border-radius: var(--eul-cb-ecke, 0);
    box-shadow: var(--eul-cb-schatten, 0 12px 40px rgba(4, 13, 16, 0.28));
}
.eul-cb__box:focus {
    outline: none;
}
.eul-cb__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 8px;
}
.eul-cb__title {
    margin: 0;
    font-family: var(--eul-cb-schrift-titel, var(--eul-font-heading, "Montserrat", ui-sans-serif, system-ui, sans-serif));
    font-size: 1.125rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--eul-cb-marke, var(--eul-brand, #21697c));
}
.eul-cb__text {
    margin: 0 0 16px;
    font-size: 0.95rem;
    line-height: 1.5;
}
.eul-cb__text a {
    color: var(--eul-cb-marke, var(--eul-brand, #21697c));
    text-decoration: underline;
}
.eul-cb__text a:focus-visible {
    outline: 2px solid var(--eul-cb-fokus, var(--eul-brand-light, #4db4d0));
    outline-offset: 2px;
}
.eul-cb__services {
    list-style: none;
    margin: 0 0 16px;
    padding: 0;
    border-top: 1px solid var(--eul-cb-linie, var(--eul-line, rgba(0, 0, 0, 0.15)));
}
.eul-cb__services[hidden],
.eul-cb__btn[hidden] {
    display: none !important;
}
.eul-cb__service {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 12px 0;
    border-bottom: 1px solid var(--eul-cb-linie, var(--eul-line, rgba(0, 0, 0, 0.15)));
}
.eul-cb__check {
    appearance: auto !important;
    -webkit-appearance: checkbox !important;
    flex: 0 0 auto;
    width: 18px !important;
    height: 18px !important;
    margin: 3px 0 0 !important;
    accent-color: var(--eul-cb-marke, var(--eul-brand, #21697c));
    cursor: pointer;
}
.eul-cb__check:disabled {
    cursor: not-allowed;
}
.eul-cb__service label {
    display: block;
    margin: 0;
    cursor: pointer;
    font-weight: 400;
}
.eul-cb__service-title {
    display: block;
    font-weight: 700;
}
.eul-cb__service-text {
    display: block;
    font-size: 0.875rem;
    line-height: 1.45;
    color: var(--eul-cb-text-leise, var(--eul-ink-muted, #6a6a64));
}
.eul-cb__actions {
    /* Nur notwendige links, Alle akzeptieren rechts, beide gleich breit.
       Auswahl speichern (nach "Einstellungen") steht davor. */
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}
.eul-cb__actions [data-cb="reject"],
.eul-cb__actions [data-cb="accept"] {
    min-width: 11rem;
}
/* "Nur notwendige" und "Alle akzeptieren" bewusst gleich gestaltet. */
.eul-cb__btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    min-height: 44px !important;
    margin: 0 !important;
    padding: 10px 20px !important;
    border: 2px solid var(--eul-cb-marke, var(--eul-brand, #21697c)) !important;
    border-radius: var(--eul-cb-ecke-knopf, 0) !important;
    background: var(--eul-cb-marke, var(--eul-brand, #21697c)) !important;
    color: var(--eul-cb-auf-marke, var(--eul-on-brand, #fff)) !important;
    font: inherit !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    text-transform: none !important;
    cursor: pointer;
}
.eul-cb__btn:hover {
    background: var(--eul-cb-marke-hover, var(--eul-brand-hover, #1c5969)) !important;
    border-color: var(--eul-cb-marke-hover, var(--eul-brand-hover, #1c5969)) !important;
}
.eul-cb__btn:focus-visible {
    outline: 3px solid var(--eul-cb-fokus, var(--eul-brand-light, #4db4d0)) !important;
    outline-offset: 2px;
}
.eul-cb__btn--link {
    flex: 0 0 auto;
    background: transparent !important;
    border-color: transparent !important;
    color: var(--eul-cb-marke, var(--eul-brand, #21697c)) !important;
    font-weight: 600 !important;
    text-decoration: underline;
    padding-left: 8px !important;
    padding-right: 0 !important;
}
.eul-cb__btn--link:hover {
    background: transparent !important;
    border-color: transparent !important;
    color: var(--eul-cb-marke-hover, var(--eul-brand-hover, #1c5969)) !important;
}

/* Desktop: flache Leiste ueber die volle Breite, Text links, Knoepfe
   rechts - deckt die Hero-Knoepfe nicht mehr ab (2026-10-27). */
@media (min-width: 992px) {
    .eul-cb__box {
        max-width: 1200px;
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        column-gap: 32px;
        align-items: end;
        padding: 16px 24px;
    }
    .eul-cb__head,
    .eul-cb__text,
    .eul-cb__services {
        grid-column: 1;
    }
    .eul-cb__text {
        margin-bottom: 0;
    }
    .eul-cb__services:not([hidden]) {
        margin: 12px 0 0;
    }
    .eul-cb__actions {
        grid-column: 2;
        grid-row: 1 / span 3;
        align-self: end;
        flex-wrap: nowrap;
    }
}

/* Handy: kleiner Text, Knoepfe nebeneinander - Ziel hoechstens ~30 % des
   Bildschirms. */
@media (max-width: 560px) {
    .eul-cb {
        left: 8px;
        right: 8px;
        bottom: 8px;
    }
    .eul-cb__box {
        padding: 14px 16px 16px;
        max-height: calc(100vh - 16px);
        max-height: calc(100dvh - 16px);
    }
    .eul-cb__head {
        gap: 8px;
    }
    .eul-cb__title {
        font-size: 0.9375rem;
        white-space: nowrap;
    }
    .eul-cb__head .eul-cb__btn--link {
        min-height: 36px !important;
        padding-top: 4px !important;
        padding-bottom: 4px !important;
        font-size: 0.875rem !important;
    }
    .eul-cb__text {
        margin-bottom: 10px;
        font-size: 0.875rem;
        line-height: 1.4;
    }
    /* Hinweis auf die cookielose Zaehlung: am Handy weglassen (Hoehe) */
    .eul-cb__zusatz {
        display: none;
    }
    .eul-cb__actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    .eul-cb__actions [data-cb="reject"],
    .eul-cb__actions [data-cb="accept"] {
        min-width: 0;
        padding-left: 8px !important;
        padding-right: 8px !important;
    }
    .eul-cb__actions [data-cb="save"] {
        grid-column: 1 / -1;
    }
}

/* Weniger Bewegung: keine Uebergaenge (der Banner hat keine Animation;
   Sitepackages mit globalen Uebergaengen an button werden hier gebremst). */
@media (prefers-reduced-motion: reduce) {
    .eul-cb * {
        transition: none !important;
    }
}

@media print {
    .eul-cb {
        display: none !important;
    }
}
