/* ══ Cookie Consent ════════════════════════════════════════════════════════ */

/* Kein Scrollen wenn Banner offen */
body.cc-noscroll { overflow: hidden; }

/* ── Overlay ────────────────────────────────────────────────────────────── */
.cc-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    z-index: 9990;
    opacity: 0;
    transition: opacity .3s ease;
}
.cc-overlay--in {
    opacity: 1;
}

/* ── Banner ─────────────────────────────────────────────────────────────── */
.cc-banner {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%) translateY(30px);
    width: min(660px, calc(100vw - 2rem));
    max-height: calc(100dvh - 3rem);
    overflow-y: auto;
    overscroll-behavior: contain;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0,0,0,.22), 0 2px 8px rgba(0,0,0,.08);
    z-index: 9999;
    opacity: 0;
    transition: opacity .3s ease, transform .35s cubic-bezier(.34,1.4,.64,1);
}
.cc-banner--in {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Scrollbar */
.cc-banner::-webkit-scrollbar { width: 4px; }
.cc-banner::-webkit-scrollbar-track { background: transparent; }
.cc-banner::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 99px; }

.cc-inner {
    padding: 1.5rem;
}

/* ── Header ─────────────────────────────────────────────────────────────── */
.cc-header {
    display: flex;
    align-items: center;
    gap: .6rem;
    margin-bottom: .75rem;
}
.cc-header__icon { font-size: 1.5rem; line-height: 1; flex-shrink: 0; }
.cc-header__title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}

/* ── Text ───────────────────────────────────────────────────────────────── */
.cc-text {
    font-size: .875rem;
    color: #475569;
    line-height: 1.65;
    margin: 0 0 1.25rem;
}
.cc-link {
    color: var(--primary, #2563eb);
    text-decoration: underline;
}

/* ── Kategorien ─────────────────────────────────────────────────────────── */
.cc-details {
    flex-direction: column;
    gap: .75rem;
    border-top: 1px solid #e2e8f0;
    padding-top: 1rem;
    margin-bottom: 1rem;
}
/* Wenn via JS display:flex gesetzt */
#cc-details[style*="flex"] {
    display: flex;
}

.cc-cat {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
}
.cc-cat__row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: .85rem 1rem;
}
.cc-cat__info {
    display: flex;
    align-items: flex-start;
    gap: .55rem;
    flex: 1;
    min-width: 0;
}
.cc-cat__icon { font-size: 1.1rem; margin-top: .1rem; flex-shrink: 0; }
.cc-cat__label { display: block; font-size: .9rem; color: #0f172a; margin-bottom: .2rem; }
.cc-cat__desc { font-size: .79rem; color: #64748b; margin: 0; line-height: 1.5; }

/* "Immer aktiv" Badge */
.cc-always-on {
    font-size: .72rem;
    font-weight: 700;
    color: #059669;
    background: #d1fae5;
    padding: .2rem .7rem;
    border-radius: 99px;
    white-space: nowrap;
    flex-shrink: 0;
    align-self: center;
}

/* Toggle */
.cc-toggle { cursor: pointer; flex-shrink: 0; align-self: center; display: block; }
.cc-toggle__chk { position: absolute; opacity: 0; width: 0; height: 0; }
.cc-toggle__rail {
    display: block;
    width: 44px;
    height: 24px;
    background: #cbd5e1;
    border-radius: 99px;
    position: relative;
    transition: background .2s;
}
.cc-toggle__rail::after {
    content: '';
    position: absolute;
    left: 3px; top: 3px;
    width: 18px; height: 18px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,.2);
    transition: transform .2s;
}
.cc-toggle__chk:checked + .cc-toggle__rail { background: var(--primary, #2563eb); }
.cc-toggle__chk:checked + .cc-toggle__rail::after { transform: translateX(20px); }
.cc-toggle__chk:focus-visible + .cc-toggle__rail { outline: 2px solid var(--primary, #2563eb); outline-offset: 2px; }

/* Cookie-Tabelle */
.cc-cookie-table-wrap { overflow-x: auto; border-top: 1px solid #e2e8f0; }
.cc-cookie-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .79rem;
}
.cc-cookie-table th {
    background: #f1f5f9;
    padding: .4rem .8rem;
    text-align: left;
    font-weight: 600;
    color: #475569;
    white-space: nowrap;
}
.cc-cookie-table td {
    padding: .45rem .8rem;
    border-top: 1px solid #e2e8f0;
    color: #374151;
    vertical-align: top;
}
.cc-cookie-table td:first-child { white-space: nowrap; }
.cc-cookie-table code {
    background: #e2e8f0;
    padding: .1em .4em;
    border-radius: 4px;
    font-size: .85em;
    color: #0f172a;
}

/* ── Aktionen ───────────────────────────────────────────────────────────── */
.cc-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    flex-wrap: wrap;
    border-top: 1px solid #e2e8f0;
    padding-top: 1rem;
    margin-top: .5rem;
}
.cc-actions__right {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
}

/* ── Buttons ────────────────────────────────────────────────────────────── */
.cc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .35rem;
    padding: .55rem 1.15rem;
    border-radius: 8px;
    font-size: .875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, color .15s, border-color .15s, box-shadow .15s;
    border: 2px solid transparent;
    white-space: nowrap;
    line-height: 1.4;
    background: none;
}
.cc-btn:focus-visible { outline: 2px solid var(--primary, #2563eb); outline-offset: 2px; }

/* Primär – Alle akzeptieren */
.cc-btn--primary {
    background: var(--primary, #2563eb);
    color: #fff;
    border-color: var(--primary, #2563eb);
}
.cc-btn--primary:hover { background: #1d4ed8; border-color: #1d4ed8; }

/* Outline – Nur notwendige (gleiche visuelle Gewichtung!) */
.cc-btn--outline {
    background: #fff;
    color: var(--primary, #2563eb);
    border-color: var(--primary, #2563eb);
}
.cc-btn--outline:hover { background: #eff6ff; }

/* Ghost – Einstellungen */
.cc-btn--ghost {
    background: transparent;
    color: #64748b;
    border-color: #e2e8f0;
}
.cc-btn--ghost:hover { background: #f8fafc; color: #0f172a; }

/* ── Footer-Links ───────────────────────────────────────────────────────── */
.cc-footer {
    display: flex;
    gap: 1.25rem;
    margin-top: .85rem;
    padding-top: .75rem;
    border-top: 1px solid #f1f5f9;
}
.cc-footer a {
    font-size: .75rem;
    color: #94a3b8;
    text-decoration: none;
    transition: color .15s;
}
.cc-footer a:hover { color: #475569; }

/* ── Floating Action Button (minimiert) ─────────────────────────────────── */
.cc-fab {
    position: fixed;
    bottom: 1.25rem;
    left: 1.25rem;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #e2e8f0;
    box-shadow: 0 4px 18px rgba(0,0,0,.14);
    font-size: 1.35rem;
    cursor: pointer;
    z-index: 9989;
    display: none; /* wird per JS auf flex gesetzt */
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: transform .18s, box-shadow .18s;
}
.cc-fab:hover { transform: scale(1.12); box-shadow: 0 6px 24px rgba(0,0,0,.2); }
.cc-fab:focus-visible { outline: 2px solid var(--primary,#2563eb); outline-offset: 2px; }

/* ── Mobile ─────────────────────────────────────────────────────────────── */
@media (max-width: 540px) {
    .cc-banner {
        bottom: 0;
        border-radius: 18px 18px 0 0;
        width: 100%;
        transform: translateX(-50%) translateY(40px);
    }
    .cc-banner--in { transform: translateX(-50%) translateY(0); }
    .cc-inner { padding: 1.25rem 1rem 1.5rem; }
    .cc-actions { flex-direction: column; align-items: stretch; }
    .cc-actions__right { flex-direction: column; }
    .cc-btn { width: 100%; justify-content: center; }
    .cc-btn--ghost { width: auto; align-self: flex-start; }
}
