/*
 * Cookie-Einwilligung - Costa-del-Sol.dev Design
 * Nutzt direkt die Variablen aus assets/css/style.css (--beige-*, --anthrazit-*,
 * --accent, --shadow). Keine Radien (--radius: 0 wie der Rest der Seite).
 * JS schaltet .visible auf .cb-banner und body.cb-active.
 */

body.cb-active { overflow: hidden; }

/* ── Overlay (abgedunkelter Hintergrund) ──────────────────────────────── */
.cb-overlay {
    position: fixed;
    inset: 0;
    z-index: 99998;
    background: rgba(26, 26, 26, 0.65);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    pointer-events: none;
}
.cb-overlay.visible { opacity: 1; visibility: visible; pointer-events: auto; }

/* ── Banner (zentriertes Fenster) ─────────────────────────────────────── */
.cb-banner {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    pointer-events: none;
    font-family: inherit;
}
.cb-banner.visible { opacity: 1; visibility: visible; pointer-events: auto; }

.cb-banner__inner {
    width: 100%;
    max-width: 520px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    background: #FFFFFF;
    color: var(--anthrazit-800, #2D2D2D);
    box-shadow: var(--shadow, 0 4px 24px rgba(0,0,0,0.12));
    padding: 28px 28px 24px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    transform: translateY(10px);
    transition: transform 0.25s ease;
}
.cb-banner.visible .cb-banner__inner { transform: translateY(0); }

.cb-banner__title {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--anthrazit-900, #1A1A1A);
    margin: 0;
}

.cb-banner__text {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.55;
    color: var(--anthrazit-700, #3A3A3A);
}

.cb-banner__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.cb-banner__links {
    display: flex;
    gap: 10px;
    align-items: center;
    font-size: 0.8rem;
    color: var(--anthrazit-500, #5C5C5C);
}
.cb-banner__links a {
    color: var(--anthrazit-500, #5C5C5C);
    text-decoration: underline;
    transition: color 0.2s;
}
.cb-banner__links a:hover { color: var(--accent, #8B7355); }
.cb-banner__sep { opacity: 0.4; }

/* ── Buttons (passen zu .btn-action aus style.css) ────────────────────── */
.cb-banner .btn,
.cb-modal .btn {
    display: inline-block;
    padding: 12px 20px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
    font-family: inherit;
}
.cb-banner .btn--primary,
.cb-modal .btn--primary {
    background: var(--anthrazit-800, #2D2D2D);
    color: var(--beige-100, #F5F3F0);
}
.cb-banner .btn--primary:hover,
.cb-modal .btn--primary:hover {
    background: var(--anthrazit-900, #1A1A1A);
}
.cb-banner .btn--outline,
.cb-modal .btn--outline {
    background: var(--beige-200, #E8E4DE);
    color: var(--anthrazit-700, #3A3A3A);
}
.cb-banner .btn--outline:hover,
.cb-modal .btn--outline:hover {
    background: var(--beige-300, #D4CFC6);
}

.cb-textknopf {
    background: none;
    border: none;
    padding: 12px 0;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--accent, #8B7355);
    cursor: pointer;
    text-decoration: underline;
    font-family: inherit;
    transition: color 0.2s;
}
.cb-textknopf:hover { color: var(--anthrazit-900, #1A1A1A); }

/* ── Modal (Einstellungen) ────────────────────────────────────────────── */
.cb-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    font-family: inherit;
}
.cb-modal[hidden] { display: none; }

.cb-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(26, 26, 26, 0.65);
}

.cb-modal__dialog {
    position: relative;
    width: 100%;
    max-width: 640px;
    max-height: calc(100vh - 40px);
    background: #FFFFFF;
    color: var(--anthrazit-800, #2D2D2D);
    box-shadow: var(--shadow, 0 4px 24px rgba(0,0,0,0.12));
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.cb-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--beige-300, #D4CFC6);
}

.cb-modal__title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--anthrazit-900, #1A1A1A);
}

.cb-modal__close {
    background: none;
    border: none;
    font-size: 1.8rem;
    line-height: 1;
    color: var(--anthrazit-600, #4A4A4A);
    cursor: pointer;
    padding: 0 4px;
    transition: color 0.2s;
}
.cb-modal__close:hover { color: var(--anthrazit-900, #1A1A1A); }

.cb-modal__body {
    padding: 20px 24px;
    overflow-y: auto;
    flex: 1 1 auto;
}

.cb-modal__intro {
    margin: 0 0 20px;
    font-size: 0.95rem;
    line-height: 1.55;
    color: var(--anthrazit-700, #3A3A3A);
}

.cb-modal__footer {
    padding: 16px 24px;
    border-top: 1px solid var(--beige-300, #D4CFC6);
    background: var(--beige-100, #F5F3F0);
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
}

.cb-modal__links {
    display: flex;
    gap: 10px;
    align-items: center;
    font-size: 0.8rem;
}
.cb-modal__links a {
    color: var(--anthrazit-500, #5C5C5C);
    text-decoration: underline;
}
.cb-modal__links a:hover { color: var(--accent, #8B7355); }

.cb-modal__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* ── Kategorien ───────────────────────────────────────────────────────── */
.cb-category {
    border: 1px solid var(--beige-300, #D4CFC6);
    margin-bottom: 10px;
}
.cb-category:last-child { margin-bottom: 0; }

.cb-category__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    gap: 12px;
}

.cb-category__info { flex: 1; min-width: 0; }

.cb-category__toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--anthrazit-900, #1A1A1A);
    text-align: left;
    width: 100%;
}

.cb-category__arrow {
    display: inline-block;
    font-size: 0.7rem;
    color: var(--anthrazit-500, #5C5C5C);
    transition: transform 0.2s;
}
.cb-category.open .cb-category__arrow { transform: rotate(90deg); }

.cb-category__label {
    font-weight: 600;
    color: var(--anthrazit-900, #1A1A1A);
}

.cb-category__badge {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 8px;
    font-size: 0.7rem;
    font-weight: 500;
    background: var(--beige-200, #E8E4DE);
    color: var(--anthrazit-600, #4A4A4A);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cb-category__details {
    padding: 0 14px 14px;
}

.cb-category__desc {
    margin: 0;
    font-size: 0.88rem;
    line-height: 1.5;
    color: var(--anthrazit-600, #4A4A4A);
}

/* ── Toggle-Switch ────────────────────────────────────────────────────── */
.cb-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex: 0 0 auto;
}
.cb-switch__input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}
.cb-switch__slider {
    position: absolute;
    inset: 0;
    background: var(--beige-300, #D4CFC6);
    transition: background 0.2s;
    cursor: pointer;
}
.cb-switch__slider::before {
    content: "";
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    top: 3px;
    background: #FFFFFF;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
.cb-switch__input:checked + .cb-switch__slider {
    background: var(--accent, #8B7355);
}
.cb-switch__input:checked + .cb-switch__slider::before {
    transform: translateX(20px);
}

/* ── Mobile ───────────────────────────────────────────────────────────── */
@media (max-width: 540px) {
    .cb-banner__inner { padding: 22px 20px; gap: 14px; }
    .cb-banner__title { font-size: 1.1rem; }
    .cb-banner__text { font-size: 0.9rem; }
    .cb-banner .btn, .cb-modal .btn { width: 100%; justify-content: center; text-align: center; }
    .cb-banner__actions { flex-direction: column; align-items: stretch; }
    .cb-banner__links { flex-wrap: wrap; }
    .cb-modal__header, .cb-modal__body, .cb-modal__footer { padding-left: 16px; padding-right: 16px; }
    .cb-modal__footer { flex-direction: column; align-items: stretch; }
    .cb-modal__actions { flex-direction: column; }
}
