/* ================================================================
   DSGVO / TTDSG Cookie Consent Banner
   ---------------------------------------------------------------
   - Appears on first visit (no consent stored)
   - Equal visual weight for "Akzeptieren" and "Ablehnen"
   - Detail toggle for essential vs. functional categories
   - Choice persisted in localStorage (1 year)
   ================================================================ */

.consent-banner {
    position: fixed;
    left: 50%;
    bottom: 1.25rem;
    transform: translate(-50%, 150%);
    width: min(720px, calc(100% - 2rem));
    max-height: calc(100vh - 2.5rem);
    overflow-y: auto;
    z-index: 9999;
    padding: 1.5rem 1.75rem;
    border-radius: 20px;
    color: var(--title-color);
    font-family: var(--body-font);
    font-size: var(--small-font-size);
    line-height: 1.55;

    /* Glass-morphism to match site */
    background:
        linear-gradient(135deg,
            rgba(20, 20, 20, 0.92) 0%,
            rgba(30, 30, 30, 0.88) 100%);
    backdrop-filter: blur(20px) saturate(140%);
    -webkit-backdrop-filter: blur(20px) saturate(140%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.55),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);

    opacity: 0;
    visibility: hidden;
    transition:
        transform .5s cubic-bezier(.22, .8, .3, 1),
        opacity .45s ease,
        visibility .45s ease;
}

.consent-banner.is-visible {
    transform: translate(-50%, 0);
    opacity: 1;
    visibility: visible;
}

.consent-banner__title {
    font-family: "Playfair Display", serif;
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0 0 .5rem 0;
    color: var(--first-color-light);
    letter-spacing: .3px;
}

.consent-banner__text {
    margin: 0 0 1rem 0;
    color: var(--text-color);
}

.consent-banner__text a {
    color: var(--first-color);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.consent-banner__text a:hover {
    color: var(--first-color-light);
}

.consent-banner__actions {
    display: flex;
    gap: .65rem;
    flex-wrap: wrap;
    align-items: center;
    margin-top: .25rem;
}

.consent-btn {
    flex: 1 1 150px;
    min-height: 44px;
    padding: .75rem 1.1rem;
    border-radius: 12px;
    font-family: var(--body-font);
    font-size: .875rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: transform .2s ease, background .25s ease, border-color .25s ease;
    white-space: nowrap;
}

.consent-btn:hover {
    transform: translateY(-1px);
}

/* Equal visual weight for Accept & Reject — required under DSGVO (no nudging) */
.consent-btn--accept {
    background: linear-gradient(135deg, var(--first-color) 0%, var(--first-color-alt) 100%);
    color: #1a1a1a;
    border-color: transparent;
}

.consent-btn--accept:hover {
    background: linear-gradient(135deg, var(--first-color-light) 0%, var(--first-color) 100%);
}

.consent-btn--reject {
    background: rgba(255, 255, 255, 0.08);
    color: var(--title-color);
}

.consent-btn--reject:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.25);
}

.consent-btn--details {
    flex: 0 0 auto;
    background: transparent;
    color: var(--text-color);
    border: 1px solid rgba(255, 255, 255, 0.15);
    font-weight: 500;
}

.consent-btn--details:hover {
    color: var(--title-color);
    border-color: rgba(255, 255, 255, 0.3);
}

/* ── Details panel ─────────────────────────────────────────── */
.consent-details {
    display: none;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.consent-details.is-open {
    display: block;
}

.consent-category {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding: .75rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.consent-category:last-child {
    border-bottom: none;
}

.consent-category__info h4 {
    margin: 0 0 .25rem 0;
    font-size: .9rem;
    color: var(--title-color);
    font-weight: 600;
}

.consent-category__info p {
    margin: 0;
    font-size: .78rem;
    color: var(--text-color-light);
}

.consent-category__toggle {
    flex-shrink: 0;
}

.consent-toggle {
    position: relative;
    display: inline-block;
    width: 42px;
    height: 24px;
}

.consent-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.consent-toggle__slider {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 24px;
    transition: background .25s ease;
    cursor: pointer;
}

.consent-toggle__slider::before {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    transition: transform .25s ease;
}

.consent-toggle input:checked + .consent-toggle__slider {
    background: var(--first-color);
}

.consent-toggle input:checked + .consent-toggle__slider::before {
    transform: translateX(18px);
}

.consent-toggle input:disabled + .consent-toggle__slider {
    background: rgba(var(--first-color-rgb), 0.6);
    cursor: not-allowed;
    opacity: .7;
}

/* ── Small screens ─────────────────────────────────────────── */
@media (max-width: 520px) {
    .consent-banner {
        bottom: 0;
        left: 0;
        transform: translate(0, 120%);
        width: 100%;
        border-radius: 20px 20px 0 0;
        padding: 1.25rem 1.25rem 1.5rem;
    }

    .consent-banner.is-visible {
        transform: translate(0, 0);
    }

    .consent-banner__actions {
        flex-direction: column;
    }

    .consent-btn {
        width: 100%;
        flex: 1 1 auto;
    }
}

/* ── Footer "manage cookies" link (optional) ──────────────── */
.consent-reopen {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    font: inherit;
    padding: 0;
    text-decoration: underline;
    text-underline-offset: 2px;
    opacity: .8;
}

.consent-reopen:hover {
    opacity: 1;
}
