/* ================================================================
   Cookie-Banner – component_cookie_banner.css
   WCAG 2.1 AA konform (angestrebt AAA wo möglich)

   Kontrast-Notizen (Hintergrund #1e293b):
     Text #f1f5f9 auf #1e293b  → 13.5:1  ✓ AAA
     Text #94a3b8 auf #1e293b  →  5.9:1  ✓ AA
     Link #93c5fd auf #1e293b  →  6.5:1  ✓ AA
     Button-Text #fff auf #1a73e8 → 4.6:1  ✓ AA
   ================================================================ */

/* ── Banner-Container ─────────────────────────────────────────── */
.cookie-banner {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9000;

    width: min(640px, calc(100vw - 2rem));

    background: #1e293b;
    color: #f1f5f9;
    border-radius: 0.75rem;
    box-shadow:
        0 4px 6px -1px rgb(0 0 0 / 0.3),
        0 10px 15px -3px rgb(0 0 0 / 0.25);

    padding: 1.25rem 1.5rem;

    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
}

/* ── Sichtbarkeit ────────────────────────────────────────────── */
.cookie-banner[hidden] {
    display: none;
}

/* Einblend-Animation – respektiert prefers-reduced-motion */
@media (prefers-reduced-motion: no-preference) {
    .cookie-banner {
        animation: cookie-banner-slide-up 0.25s ease-out both;
    }

    @keyframes cookie-banner-slide-up {
        from {
            opacity: 0;
            transform: translateX(-50%) translateY(1rem);
        }
        to {
            opacity: 1;
            transform: translateX(-50%) translateY(0);
        }
    }
}

/* ── Icon ────────────────────────────────────────────────────── */
.cookie-banner__icon {
    flex-shrink: 0;
    color: #93c5fd;
    display: flex;
    align-items: center;
}

/* ── Text ────────────────────────────────────────────────────── */
.cookie-banner__text {
    flex: 1;
    min-width: 0;
    font-size: 0.9375rem;
    line-height: 1.55;
    color: #f1f5f9; /* 13.5:1 – AAA ✓ */
}

.cookie-banner__text a {
    color: #93c5fd; /* 6.5:1 auf #1e293b – AA ✓ */
    text-underline-offset: 3px;
    text-decoration: underline;
}

.cookie-banner__text a:hover {
    color: #bfdbfe;
}

.cookie-banner__text a:focus-visible {
    outline: 3px solid #93c5fd;
    outline-offset: 2px;
    border-radius: 2px;
}

/* ── Aktionsbereich ──────────────────────────────────────────── */
.cookie-banner__actions {
    display: flex;
    gap: 0.625rem;
    flex-shrink: 0;
    align-items: center;
}

/* ── Buttons ─────────────────────────────────────────────────── */
.cookie-banner__btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1.1rem;
    border-radius: 0.5rem;
    font-size: 0.9375rem;
    font-family: inherit;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    border: 2px solid transparent;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s;
    white-space: nowrap;
}

.cookie-banner__btn:focus-visible {
    outline: 3px solid #93c5fd;
    outline-offset: 2px;
}

/* Primär – Akzeptieren */
.cookie-banner__btn--accept {
    background: var(--color-primary, #1a73e8);
    color: #ffffff; /* 4.6:1 – AA ✓ */
    border-color: var(--color-primary, #1a73e8);
}

.cookie-banner__btn--accept:hover {
    background: #1557b0;
    border-color: #1557b0;
}

/* Ghost – Ablehnen / Schließen */
.cookie-banner__btn--dismiss {
    background: transparent;
    color: #cbd5e1; /* 8.6:1 – AAA ✓ */
    border-color: #475569;
}

.cookie-banner__btn--dismiss:hover {
    background: #334155;
    border-color: #64748b;
}

/* ── Mobile ──────────────────────────────────────────────────── */
@media (max-width: 540px) {
    .cookie-banner {
        bottom: 0;
        left: 0;
        right: 0;
        transform: none;
        width: 100%;
        border-radius: 0.75rem 0.75rem 0 0;
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        /* Platz für iOS Home-Indicator */
        padding-bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px));
    }

    /* Eigene Animation für Mobile – kein translateX nötig */
    @media (prefers-reduced-motion: no-preference) {
        .cookie-banner {
            animation: cookie-banner-slide-up-mobile 0.25s ease-out both;
        }

        @keyframes cookie-banner-slide-up-mobile {
            from { opacity: 0; transform: translateY(1rem); }
            to   { opacity: 1; transform: translateY(0);    }
        }
    }

    .cookie-banner__actions {
        width: 100%;
    }

    .cookie-banner__btn {
        flex: 1;
        justify-content: center;
    }
}
