/* =========================================================
   Merkurist-Theme für Cookieman
   Farben & Schrift hier oben anpassen
   ========================================================= */
#cookieman-modal {
    --cm-accent: #03c8be;          /* Merkurist-Türkis: Buttons, Linie oben, Punkte, Links */
    --cm-accent-hover: rgb(102,102,102);    /* etwas dunkler beim Drüberfahren */
    --cm-btn-text: #111111;        /* Schrift auf den türkisen Buttons */
    --cm-bg: #ffffff;              /* Hintergrund des Fensters */
    --cm-heading: #111111;         /* Überschrift */
    --cm-text: #444444;            /* Fließtext */
    --cm-border: #e6e6e6;          /* Linien */
    --cm-overlay: rgba(255, 255, 255, .25); /* Tönung über der Seite */
    --cm-blur: 10px;               /* Stärke der Unschärfe im Hintergrund (0px = aus) */
    --cm-radius: 14px;
    --cm-font: inherit;            /* übernimmt die Schrift eurer Seite */
}

/* ---------- Grundgerüst (überschreibt evtl. vorhandene Bootstrap-.modal-Regeln) ---------- */
#cookieman-modal {
    display: none !important;
    position: fixed;
    inset: 0;
    z-index: 100000;
    background: var(--cm-overlay);
    -webkit-backdrop-filter: blur(var(--cm-blur));
    backdrop-filter: blur(var(--cm-blur));
    opacity: 1 !important;
    overflow-y: auto;
    padding: 16px;
    font-family: var(--cm-font);
    color: var(--cm-text);
}
/* Fallback für Browser ohne Blur: etwas kräftiger abdunkeln */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    #cookieman-modal { background: rgba(0, 0, 0, .45); }
}
#cookieman-modal.is-open {
    display: flex !important;
    align-items: center;
    justify-content: center;
}
html.cookieman-open {
    overflow: hidden;
}

.cm-dialog {
    background: var(--cm-bg);
    border-top: 7px solid var(--cm-accent);
    border-radius: var(--cm-radius);
    box-shadow: 0 10px 40px rgba(0, 0, 0, .18);
    width: 100%;
    max-width: 660px;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    padding: 28px 32px 20px;
    font-size: 15px;
    line-height: 1.6;
    outline: none;
    text-align: left;
    animation: cm-in .2s ease-out;
}
@keyframes cm-in {
    from { transform: translateY(12px); opacity: 0; }
    to   { transform: none; opacity: 1; }
}

.cm-logo {
    text-align: center;
    margin-bottom: 18px;
}
.cm-logo img {
    display: inline-block;
    height: 40px;
    width: auto;
    max-width: 70%;
}

.cm-title {
    margin: 0 0 12px;
    font-size: 1.45em;
    line-height: 1.25;
    font-weight: 800;
    color: var(--cm-heading);
}
.cm-intro {
    margin: 0 0 16px;
}
.cm-intro strong {
    color: var(--cm-heading);
}
.cm-intro strong:empty {
    display: none;
}
.cm-dialog a {
    color: var(--cm-heading);
    font-weight: 600;
    text-decoration: none;
    border-bottom: 2px solid var(--cm-accent);
}
.cm-dialog a:hover {
    color: #aaaaaa;
}

/* Aufzählung der Zwecke mit türkisen Punkten */
.cm-purposes {
    list-style: none;
    margin: 0 0 20px;
    padding: 0;
    color: var(--cm-heading);
    font-size: .95em;
}
.cm-purposes li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 6px;
}
.cm-purposes li::before {
    content: "";
    position: absolute;
    left: 0;
    top: .55em;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--cm-accent);
}

/* ---------- Buttons: alle gleich groß ---------- */
.cm-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 18px;
}
.cm-btn {
    flex: 1 1 150px;
    appearance: none;
    font: inherit;
    font-weight: 700;
    font-size: 16px;
    line-height: 1.2;
    padding: 13px 16px;
    border-radius: 10px;
    border: 2px solid var(--cm-accent);
    cursor: pointer;
    transition: background-color .15s, border-color .15s;
}
.cm-btn[hidden] {
    display: none;
}
.cm-btn--primary {
    background: var(--cm-accent);
    color: var(--cm-btn-text);
}
.cm-btn--primary:hover {
    background: #1d1d1d;
    border-color: #1d1d1d;
    color: #03c8be;
    
}
.cm-btn--outline {
    background: var(--cm-bg);
    color: var(--cm-btn-text);
}
.cm-btn--outline:hover {
    background: #f1faf9;
}
.cm-btn:focus-visible,
.cm-details summary:focus-visible,
.cm-switch input:focus-visible + .cm-switch__track,
.cm-dialog a:focus-visible {
    outline: 3px solid var(--cm-heading);
    outline-offset: 2px;
}

/* Links unten */
.cm-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px 14px;
    font-size: .92em;
    color: #999;
}
.cm-links a {
    font-weight: 400;
}

/* ---------- Einstellungen ---------- */
.cm-settings {
    margin: 0 0 18px;
}
.cm-settings[hidden] {
    display: none;
}
.cm-group {
    border: 1px solid var(--cm-border);
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 10px;
}
.cm-group__desc {
    margin: 6px 0 0 56px;
    font-size: .93em;
}
.cm-group__title {
    font-weight: 700;
    color: var(--cm-heading);
}
.cm-group__always {
    display: inline-block;
    margin-left: 6px;
    font-weight: 400;
    color: #888;
}
.cm-dnt:empty {
    display: none;
}
.cm-dnt {
    margin: 8px 0 0 56px;
    font-size: .9em;
}

/* Schalter */
.cm-switch {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    margin: 0;
}
.cm-switch input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}
.cm-switch__track {
    flex: 0 0 44px;
    height: 24px;
    border-radius: 12px;
    background: #c9c9c9;
    position: relative;
    transition: background-color .15s;
}
.cm-switch__track::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    transition: transform .15s;
}
.cm-switch input:checked + .cm-switch__track {
    background: var(--cm-accent);
}
.cm-switch input:checked + .cm-switch__track::after {
    transform: translateX(20px);
}
.cm-switch input:disabled + .cm-switch__track {
    opacity: .6;
    cursor: not-allowed;
}

/* Cookie-Tabelle */
.cm-details {
    margin: 10px 0 0 56px;
    font-size: .88em;
}
.cm-details summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--cm-heading);
}
.cm-table-wrap {
    overflow-x: auto;
    margin-top: 8px;
}
.cm-table {
    width: 100%;
    border-collapse: collapse;
}
.cm-table th,
.cm-table td {
    text-align: left;
    vertical-align: top;
    padding: 6px 8px;
    border-bottom: 1px solid var(--cm-border);
}
.cm-table th {
    font-weight: 600;
    white-space: nowrap;
}

/* ---------- Smartphone: kompakt, Buttons immer sichtbar ---------- */
@media (max-width: 600px) {
    #cookieman-modal {
        padding: 10px;
    }
    .cm-dialog {
        max-height: calc(100vh - 20px);
        max-height: calc(100dvh - 20px);
        padding: 16px 16px 0;
        font-size: 13px;
        line-height: 1.45;
        border-top-width: 6px;
    }
    .cm-logo {
        margin-bottom: 10px;
    }
    .cm-logo img {
        height: 28px;
    }
    .cm-title {
        font-size: 1.3em;
        margin-bottom: 8px;
    }
    .cm-intro {
        margin-bottom: 10px;
    }
    .cm-purposes {
        margin-bottom: 12px;
        font-size: 12.5px;
        line-height: 1.35;
    }
    .cm-purposes li {
        margin-bottom: 4px;
        padding-left: 16px;
        line-height: 1.35;
    }
    .cm-purposes li::before {
        width: 8px;
        height: 8px;
        top: .4em;
    }
    /* Buttons nebeneinander und beim Scrollen immer unten sichtbar */
    .cm-actions {
        position: sticky;
        bottom: 0;
        z-index: 1;
        background: var(--cm-bg);
        flex-wrap: wrap;
        gap: 6px;
        margin: 0 -16px;
        padding: 10px 16px;
        box-shadow: 0 -8px 12px -8px rgba(0, 0, 0, .12);
    }
    .cm-btn {
        flex: 1 1 28%;
        min-width: 0;
        font-size: 13px;
        padding: 10px 4px;
        border-radius: 8px;
    }
    /* Reihenfolge: Alle akzeptieren | Alles ablehnen | Einstellungen */
    .cm-btn[data-cookieman-accept-all] { order: -2; }
    .cm-btn[data-cookieman-accept-none] { order: -1; }
    .cm-links {
        font-size: 12px;
        padding: 4px 0 12px;
    }
    .cm-group {
        padding: 10px 12px;
    }
    .cm-group__desc,
    .cm-dnt,
    .cm-details {
        margin-left: 0;
    }
}