/* Cookiebanner: balk (ontwerp A) en keuzescherm (ontwerp C). Markup in includes/cookie_consent.html.
   De waarden zijn die van het designsysteem (tokens in shared.css). Niet elke pagina laadt shared.css
   (de creatorpagina's niet), dus elk token heeft hier zijn eigen alias met dezelfde waarde als terugval. */

.cc-bar,
.cc-dialog {
    --cc-sea-50: var(--sea-50, #E4F4EF);
    --cc-sea-100: var(--sea-100, #BFE7DD);
    --cc-sea-700: var(--sea-700, #0B6E54);
    --cc-sea-900: var(--sea-900, #0B4A39);
    --cc-tang-500: var(--tang-500, #F28123);
    --cc-char-100: var(--char-100, #F0F0EB);
    --cc-char-200: var(--char-200, #E5E4DF);
    --cc-char-500: var(--char-500, #666663);
    --cc-char-900: var(--char-900, #191919);
    --cc-radius-xl: var(--radius-xl, 28px);
    --cc-radius-full: var(--radius-full, 9999px);
    --cc-font-body: var(--font-body, 'Inter', sans-serif);
    --cc-font-headline: var(--font-headline, 'Sora', sans-serif);
    --cc-font-mono: var(--font-mono, 'JetBrains Mono', monospace);
}

.cc-bar,
.cc-dialog {
    font-family: var(--cc-font-body);
    color: var(--cc-char-900);
}

.cc-bar[hidden] { display: none; }

/* ── Balk ─────────────────────────────────────────────────────────── */
.cc-bar {
    position: fixed;
    z-index: 9000;
    left: 32px;
    right: 32px;
    bottom: 32px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    gap: 40px;
    padding: 28px 36px;
    background: #fff;
    border-radius: var(--cc-radius-xl);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    overflow: hidden;
    isolation: isolate;
}

.cc-bg-icon {
    position: absolute;
    z-index: -1;
    pointer-events: none;
}
.cc-bar .cc-bg-icon {
    width: 220px;
    height: 220px;
    right: -40px;
    bottom: -64px;
    color: var(--cc-sea-700);
    opacity: 0.12;
}

.cc-bar-copy { flex: 1 1 auto; min-width: 0; }

.cc-eyebrow {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--cc-font-mono);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--cc-sea-700);
}
.cc-dot {
    width: 8px;
    height: 8px;
    border-radius: var(--cc-radius-full);
    background: var(--cc-tang-500);
}

.cc-title {
    margin: 10px 0 0;
    font-family: var(--cc-font-headline);
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.cc-text {
    margin: 8px 0 0;
    max-width: 62ch;
    font-size: 14px;
    line-height: 1.6;
    color: var(--cc-char-500);
}
.cc-text a,
.cc-dialog-intro a {
    font-weight: 600;
    color: var(--cc-sea-700);
}
.cc-text a:hover,
.cc-dialog-intro a:hover { color: var(--cc-sea-900); }

.cc-actions {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ── Knoppen: gelijk van maat, ook in de volgorde van gewicht ─────── */
.cc-btn {
    box-sizing: border-box;
    height: 48px;
    padding: 0 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid;
    border-radius: var(--cc-radius-full);
    font: 600 15px/1 var(--cc-font-body);
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, transform 0.2s;
}
.cc-btn-primary {
    background: var(--cc-sea-700);
    border-color: var(--cc-sea-700);
    color: #fff;
}
.cc-btn-primary:hover { background: var(--cc-sea-900); border-color: var(--cc-sea-900); transform: translateY(-1px); }
.cc-btn-secondary {
    background: transparent;
    border-color: var(--cc-char-900);
    color: var(--cc-char-900);
}
.cc-btn-secondary:hover { background: var(--cc-char-100); transform: translateY(-1px); }
.cc-btn:active { transform: none; }

.cc-bar :focus-visible,
.cc-dialog :focus-visible {
    outline: 2px solid var(--cc-sea-700);
    outline-offset: 3px;
}

/* ── Keuzescherm ──────────────────────────────────────────────────── */
.cc-dialog {
    /* De site-reset zet elke margin op 0, ook de `margin: auto` waarmee de browser een modal centreert. */
    position: fixed;
    inset: 0;
    margin: auto;
    height: fit-content;
    box-sizing: border-box;
    width: min(620px, calc(100vw - 32px));
    max-width: calc(100vw - 32px);
    max-height: calc(100dvh - 48px);
    padding: 0;
    border: 0;
    border-radius: var(--cc-radius-xl);
    background: #fff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    overflow: hidden;
}
.cc-dialog[open] { display: flex; flex-direction: column; }
.cc-dialog::backdrop { background: rgba(25, 25, 25, 0.55); }
body:has(dialog.cc-dialog[open]) { overflow: hidden; }

.cc-dialog-head {
    position: relative;
    flex: 0 0 auto;
    isolation: isolate;
    overflow: hidden;
    padding: 28px 36px 24px;
    background: var(--cc-sea-100);
}
.cc-dialog-head .cc-bg-icon {
    width: 260px;
    height: 260px;
    right: -64px;
    top: 50%;
    margin-top: -130px;
    color: var(--cc-sea-900);
    opacity: 0.16;
}
.cc-dialog-title {
    margin: 10px 0 0;
    font-family: var(--cc-font-headline);
    font-size: 30px;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.03em;
    color: var(--cc-sea-900);
}
.cc-dialog-intro {
    margin: 10px 0 0;
    max-width: 50ch;
    font-size: 14px;
    line-height: 1.6;
    color: var(--cc-sea-900);
}
.cc-close {
    position: absolute;
    top: 20px;
    right: 24px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: var(--cc-radius-full);
    background: rgba(255, 255, 255, 0.6);
    color: var(--cc-sea-900);
    cursor: pointer;
}
.cc-close:hover { background: rgba(255, 255, 255, 0.9); }

.cc-rows {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 8px 36px 0;
}
.cc-row {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 18px 0;
    border-bottom: 1px solid var(--cc-char-200);
}
.cc-row-copy { flex: 1 1 auto; min-width: 0; }
.cc-row h3 {
    margin: 0;
    font-family: var(--cc-font-body);
    font-size: 16px;
    font-weight: 600;
    color: var(--cc-char-900);
}
.cc-row p {
    margin: 3px 0 0;
    font-size: 14px;
    line-height: 1.55;
    color: var(--cc-char-500);
}
.cc-row .cc-who {
    margin-top: 6px;
    font-family: var(--cc-font-mono);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.04em;
}
.cc-always {
    flex: 0 0 auto;
    padding: 6px 14px;
    border-radius: var(--cc-radius-full);
    background: var(--cc-sea-50);
    color: var(--cc-sea-900);
    font-size: 12px;
    font-weight: 600;
}

/* Schakelaar: een echte checkbox (role=switch) onder een getekend spoor. */
.cc-switch {
    position: relative;
    flex: 0 0 auto;
    width: 52px;
    min-height: 44px;
    display: flex;
    align-items: center;
}
.cc-switch input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}
.cc-track {
    position: relative;
    width: 52px;
    height: 30px;
    border-radius: var(--cc-radius-full);
    background: var(--cc-char-500);
    transition: background 0.2s;
    pointer-events: none;
}
.cc-track::after {
    content: "";
    position: absolute;
    top: 4px;
    left: 4px;
    width: 22px;
    height: 22px;
    border-radius: var(--cc-radius-full);
    background: #fff;
    transition: left 0.2s;
}
.cc-switch input:checked + .cc-track { background: var(--cc-sea-700); }
.cc-switch input:checked + .cc-track::after { left: 26px; }
.cc-switch input:focus-visible + .cc-track {
    outline: 2px solid var(--cc-sea-700);
    outline-offset: 3px;
}

.cc-dialog-foot {
    flex: 0 0 auto;
    display: flex;
    gap: 10px;
    padding: 24px 36px 32px;
}
.cc-dialog-foot .cc-btn { flex: 1 1 0; padding: 0 12px; }

/* Footerlink "Cookie-instellingen": ziet eruit als de andere footerlinks. */
.footer-nav-row .cc-footer-btn {
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    font-size: 13px;
    font-weight: 500;
    color: var(--footer-nav);
    cursor: pointer;
    transition: color 0.2s;
}
.footer-nav-row .cc-footer-btn:hover,
.is-hover-forced .footer-nav-row .cc-footer-btn { color: var(--footer-nav-hover, var(--footer-hover)); }

@media (prefers-reduced-motion: reduce) {
    .cc-btn, .cc-track, .cc-track::after { transition: none; }
    .cc-btn:hover { transform: none; }
}

/* ── Mobiel ───────────────────────────────────────────────────────── */
@media (max-width: 720px) {
    .cc-bar {
        left: 12px;
        right: 12px;
        bottom: max(12px, env(safe-area-inset-bottom));
        flex-direction: column;
        align-items: stretch;
        gap: 18px;
        padding: 22px 20px 20px;
        border-radius: 24px;
    }
    .cc-bar .cc-bg-icon { width: 150px; height: 150px; right: -26px; top: -36px; bottom: auto; }
    .cc-title { font-size: 20px; }
    /* Drie even grote knoppen onder elkaar, "Alles accepteren" bovenaan zoals in het keuzescherm. */
    .cc-actions { flex-direction: column-reverse; align-items: stretch; gap: 10px; }
    .cc-actions .cc-btn { flex: 0 0 auto; width: 100%; padding: 0 12px; }

    .cc-dialog {
        width: 100%;
        max-width: none;
        max-height: calc(100dvh - 56px);
        margin: auto 0 0;
        border-radius: 28px 28px 0 0;
    }
    .cc-dialog-head { padding: 24px 20px 20px; }
    .cc-dialog-head .cc-bg-icon { width: 200px; height: 200px; right: -50px; margin-top: -100px; }
    .cc-dialog-title { font-size: 26px; }
    .cc-close { top: 12px; right: 12px; }
    .cc-rows { padding: 4px 20px 0; }
    .cc-row { align-items: flex-start; gap: 16px; padding: 16px 0; }
    .cc-dialog-foot {
        flex-direction: column-reverse;
        padding: 16px 20px max(28px, env(safe-area-inset-bottom));
        border-top: 1px solid var(--cc-char-200);
    }
    /* In een kolom is `flex: 1 1 0` een hoogte van nul: hier volle breedte, vaste hoogte. */
    .cc-dialog-foot .cc-btn { flex: 0 0 auto; width: 100%; }
}
