/**
 * MeineSparquote – Cookie-Hinweis (Banner + Einstellungen)
 * Z-Index unter typischen Modals (z. B. 40), über normalem Content.
 */

/*
 * Platz am Seitenende, damit fixiertes Banner nichts verdeckt.
 * Vollflächige App (z. B. Rechner: body.msq-app-layout + flex h-screen): kein padding am body,
 * sonst schrumpft die Sidebar (h-full) sichtbar mit. Stattdessen nur Scroll-Hauptbereich auffüllen.
 */
body.msq-cc-banner-visible {
    padding-bottom: min(200px, 42vh);
}

body.msq-app-layout.msq-cc-banner-visible {
    padding-bottom: 0;
}

body.msq-app-layout.msq-cc-banner-visible #main-scroll-area {
    padding-bottom: max(1.5rem, min(200px, 42vh));
}

#msq-cookie-root {
    --msq-cc-primary: #005940;
    --msq-cc-primary-dark: #003d2b;
    --msq-cc-radius: 14px;
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 14px;
    line-height: 1.45;
    color: #111827;
}

#msq-cookie-root * {
    box-sizing: border-box;
}

#msq-cookie-root button {
    font-family: inherit;
    cursor: pointer;
}

/* Haupt-Banner unten */
.msq-cc-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99990;
    padding: 16px;
    padding-bottom: max(16px, env(safe-area-inset-bottom));
    pointer-events: none;
}

.msq-cc-banner__inner {
    pointer-events: auto;
    max-width: 1100px;
    margin: 0 auto;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: var(--msq-cc-radius);
    box-shadow:
        0 -4px 24px rgba(0, 0, 0, 0.08),
        0 12px 40px rgba(0, 89, 64, 0.1);
    padding: 18px 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.msq-cc-banner__top {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

@media (min-width: 768px) {
    .msq-cc-banner__inner {
        padding: 20px 24px 22px;
    }

    .msq-cc-banner__top {
        flex-direction: row;
        align-items: flex-end;
        justify-content: space-between;
        gap: 20px;
    }
}

.msq-cc-banner__text {
    flex: 1;
    min-width: 0;
}

.msq-cc-banner__title {
    margin: 0 0 8px;
    font-size: 1rem;
    font-weight: 700;
    color: var(--msq-cc-primary-dark);
    display: flex;
    align-items: center;
    gap: 8px;
}

.msq-cc-banner__title i {
    color: var(--msq-cc-primary);
    font-size: 1.1rem;
}

.msq-cc-banner__p {
    margin: 0;
    font-size: 0.875rem;
    color: #4b5563;
}

.msq-cc-banner__p a {
    color: var(--msq-cc-primary);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.msq-cc-banner__p a:hover {
    color: var(--msq-cc-primary-dark);
}

.msq-cc-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-shrink: 0;
}

@media (min-width: 480px) {
    .msq-cc-actions {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: flex-end;
    }
}

.msq-cc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 0.8125rem;
    font-weight: 600;
    border: none;
    transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
    white-space: nowrap;
}

.msq-cc-btn--ghost {
    background: #f3f4f6;
    color: #374151;
}

.msq-cc-btn--ghost:hover {
    background: #e5e7eb;
}

.msq-cc-btn--outline {
    background: transparent;
    color: var(--msq-cc-primary);
    border: 2px solid var(--msq-cc-primary);
}

.msq-cc-btn--outline:hover {
    background: rgba(0, 89, 64, 0.06);
}

.msq-cc-btn--primary {
    background: linear-gradient(140deg, #003d2b 0%, #005940 55%, #007a5a 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 89, 64, 0.25);
}

.msq-cc-btn--primary:hover {
    filter: brightness(1.05);
}

/* Einstellungen-Panel (erweitert) */
.msq-cc-panel {
    margin-top: 4px;
    padding-top: 14px;
    border-top: 1px solid #f3f4f6;
    width: 100%;
}

.msq-cc-panel[hidden] {
    display: none !important;
}

.msq-cc-category {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #f3f4f6;
}

.msq-cc-category:last-of-type {
    border-bottom: none;
}

.msq-cc-category__body {
    flex: 1;
    min-width: 0;
}

.msq-cc-category__name {
    font-weight: 700;
    font-size: 0.875rem;
    color: #111827;
    margin-bottom: 4px;
}

.msq-cc-category__desc {
    font-size: 0.8125rem;
    color: #6b7280;
    margin: 0;
}

.msq-cc-switch {
    position: relative;
    width: 44px;
    height: 26px;
    flex-shrink: 0;
    margin-top: 2px;
}

.msq-cc-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.msq-cc-switch__track {
    position: absolute;
    inset: 0;
    background: #d1d5db;
    border-radius: 999px;
    transition: background 0.2s ease;
}

.msq-cc-switch__thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease;
}

.msq-cc-switch input:checked + .msq-cc-switch__track {
    background: var(--msq-cc-primary);
}

.msq-cc-switch input:checked + .msq-cc-switch__track .msq-cc-switch__thumb {
    transform: translateX(18px);
}

.msq-cc-switch input:disabled + .msq-cc-switch__track {
    opacity: 0.65;
    cursor: not-allowed;
}

.msq-cc-panel-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 16px;
}

/* Mini-Link: Einstellungen erneut öffnen */
.msq-cc-reopen {
    position: fixed;
    right: max(12px, env(safe-area-inset-right));
    left: auto;
    bottom: max(12px, env(safe-area-inset-bottom));
    z-index: 99989;
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    padding: 6px 12px;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: color 0.15s, border-color 0.15s, background 0.15s;
    font-family: 'Inter', system-ui, sans-serif;
}

.msq-cc-reopen:hover {
    color: var(--msq-cc-primary);
    border-color: rgba(0, 89, 64, 0.35);
}

/* Footer / Einstellungen: öffnet dasselbe Banner wie der fixierte Button */
a.msq-cc-footer-link,
button.msq-cc-footer-link {
    cursor: pointer;
}

@media (prefers-reduced-motion: reduce) {
    .msq-cc-btn,
    .msq-cc-switch__track,
    .msq-cc-switch__thumb {
        transition: none;
    }
}
