/* =========================================================
 * CH Cookie Consent - modal styles
 * Colors and fonts come from Settings → Cookie Consent
 * ========================================================= */

#cookievoorkeuren {
    --ch-bg: #15120f;
    --ch-text: #f3eee6;
    --ch-gold: #e0ac3a;
    --ch-font-heading: 'Playfair Display', Georgia, serif;
    --ch-font-body: 'Inter', system-ui, -apple-system, sans-serif;

    --ch-muted: color-mix(in srgb, var(--ch-text) 68%, var(--ch-bg));
    --ch-border: color-mix(in srgb, var(--ch-text) 14%, var(--ch-bg));
    --ch-line: color-mix(in srgb, var(--ch-text) 10%, var(--ch-bg));
    --ch-off: color-mix(in srgb, var(--ch-text) 20%, var(--ch-bg));
    --ch-knob-off: color-mix(in srgb, var(--ch-text) 50%, var(--ch-bg));
    --ch-gold-hover: color-mix(in srgb, var(--ch-gold) 85%, #fff);

    width: min(486px, calc(100% - 32px));
    max-width: none;
    max-height: calc(100dvh - 32px);
    overflow-y: auto;
    margin: auto;
    padding: 28px 24px 24px;
    background: var(--ch-bg);
    color: var(--ch-text);
    border: 1px solid var(--ch-border);
    border-radius: 2px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.6);
    font-family: var(--ch-font-body);
    font-size: 16px;
    line-height: 1.5;
    text-align: left;
}

#cookievoorkeuren:not([open]) {
    display: none;
}

#cookievoorkeuren[open] {
    animation: chCookieIn 0.22s ease-out;
}

#cookievoorkeuren::backdrop {
    background: rgba(0, 0, 0, 0.65);
}

@keyframes chCookieIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    #cookievoorkeuren[open] { animation: none; }
    #cookievoorkeuren .ch-switch,
    #cookievoorkeuren .ch-switch__knob,
    #cookievoorkeuren .ch-btn { transition: none; }
}

html:has(#cookievoorkeuren[open]) {
    overflow: hidden;
}

#cookievoorkeuren *,
#cookievoorkeuren *::before,
#cookievoorkeuren *::after {
    box-sizing: border-box;
}

#cookievoorkeuren p {
    margin: 0;
}

/* Close */
#cookievoorkeuren .ch-cookie__close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    padding: 0;
    margin: 0;
    background: none;
    border: 0;
    border-radius: 0;
    color: var(--ch-muted);
    cursor: pointer;
    transition: color 0.2s;
}

#cookievoorkeuren .ch-cookie__close:hover {
    color: var(--ch-text);
    background: none;
}

/* Heading + intro */
#cookievoorkeuren .ch-cookie__title {
    margin: 0 32px 8px 0;
    padding: 0;
    font-family: var(--ch-font-heading);
    font-size: 26px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.01em;
    text-transform: none;
    color: var(--ch-text);
}

#cookievoorkeuren .ch-cookie__intro {
    margin-bottom: 6px;
    font-size: 15px;
    line-height: 1.55;
    color: var(--ch-muted);
}

#cookievoorkeuren .ch-cookie__intro a {
    color: var(--ch-gold);
    text-decoration: none;
}

#cookievoorkeuren .ch-cookie__intro a:hover {
    text-decoration: underline;
}

/* Category rows */
#cookievoorkeuren .ch-cookie__row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
    padding: 22px 0;
}

#cookievoorkeuren .ch-cookie__row + .ch-cookie__row {
    border-top: 1px solid var(--ch-line);
}

#cookievoorkeuren .ch-cookie__name {
    margin-bottom: 6px;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--ch-text);
}

#cookievoorkeuren .ch-cookie__desc {
    font-size: 13px;
    line-height: 1.6;
    color: var(--ch-muted);
}

#cookievoorkeuren .ch-cookie__badge {
    flex-shrink: 0;
    padding: 5px 9px;
    border: 1px solid var(--ch-gold);
    color: var(--ch-gold);
    font-size: 11px;
    line-height: 1;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    white-space: nowrap;
}

/* Toggle switch */
#cookievoorkeuren .ch-switch {
    flex-shrink: 0;
    position: relative;
    width: 36px;
    height: 20px;
    min-width: 0;
    margin: 2px 0 0;
    padding: 0;
    border: 0;
    border-radius: 20px;
    background: var(--ch-off);
    cursor: pointer;
    transition: background 0.2s;
}

#cookievoorkeuren .ch-switch__knob {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--ch-knob-off);
    transition: transform 0.2s, background 0.2s;
}

#cookievoorkeuren .ch-switch[aria-checked="true"] {
    background: var(--ch-gold);
}

#cookievoorkeuren .ch-switch[aria-checked="true"] .ch-switch__knob {
    transform: translateX(16px);
    background: var(--ch-bg);
}

#cookievoorkeuren button:focus-visible,
#cookievoorkeuren a:focus-visible {
    outline: 2px solid var(--ch-gold);
    outline-offset: 3px;
}

/* Buttons */
#cookievoorkeuren .ch-cookie__actions {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 8px;
}

#cookievoorkeuren .ch-cookie__actions.has-accept [data-ch-save] {
    margin-left: auto;
}

#cookievoorkeuren .ch-btn {
    margin: 0;
    padding: 14px 24px;
    border-radius: 0;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}

#cookievoorkeuren .ch-btn--ghost {
    background: transparent;
    border: 1px solid var(--ch-off);
    color: var(--ch-text);
}

#cookievoorkeuren .ch-btn--ghost:hover {
    background: transparent;
    border-color: var(--ch-gold);
    color: var(--ch-text);
}

#cookievoorkeuren .ch-btn--gold {
    background: var(--ch-gold);
    border: 1px solid var(--ch-gold);
    color: var(--ch-bg);
}

#cookievoorkeuren .ch-btn--gold:hover {
    background: var(--ch-gold-hover);
    border-color: var(--ch-gold-hover);
    color: var(--ch-bg);
}

/* Three buttons need more room */
@media (max-width: 640px) {
    #cookievoorkeuren .ch-cookie__actions.has-accept {
        flex-direction: column-reverse;
    }
    #cookievoorkeuren .ch-cookie__actions.has-accept .ch-btn {
        width: 100%;
        margin-left: 0;
    }
}

@media (max-width: 480px) {
    #cookievoorkeuren {
        padding: 24px 18px 18px;
    }
    #cookievoorkeuren .ch-cookie__title {
        font-size: 22px;
    }
    #cookievoorkeuren .ch-cookie__actions {
        flex-direction: column-reverse;
    }
    #cookievoorkeuren .ch-btn {
        width: 100%;
    }
}


/* =========================================================
 * Cookie bar (first visit)
 * ========================================================= */

.ch-bar {
    --ch-bg: #15120f;
    --ch-text: #f3eee6;
    --ch-gold: #e0ac3a;
    --ch-font-body: 'Inter', system-ui, -apple-system, sans-serif;

    --ch-muted: color-mix(in srgb, var(--ch-text) 68%, var(--ch-bg));
    --ch-border: color-mix(in srgb, var(--ch-text) 14%, var(--ch-bg));
    --ch-off: color-mix(in srgb, var(--ch-text) 20%, var(--ch-bg));
    --ch-gold-hover: color-mix(in srgb, var(--ch-gold) 85%, #fff);

    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99990;
    padding: 20px 24px calc(20px + env(safe-area-inset-bottom, 0px));
    background: var(--ch-bg);
    color: var(--ch-text);
    border-top: 1px solid var(--ch-border);
    box-shadow: 0 -16px 48px rgba(0, 0, 0, 0.35);
    font-family: var(--ch-font-body);
    font-size: 16px;
    line-height: 1.5;
    text-align: left;
    transform: translateY(100%);
    transition: transform 0.3s ease-out;
}

.ch-bar[hidden] {
    display: none !important;
}

.ch-bar.is-visible {
    transform: none;
}

.ch-bar *,
.ch-bar *::before,
.ch-bar *::after {
    box-sizing: border-box;
}

.ch-bar .ch-bar__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    max-width: 1200px;
    margin: 0 auto;
}

.ch-bar .ch-bar__text {
    margin: 0;
    max-width: 64ch;
    font-size: 14px;
    line-height: 1.6;
    color: var(--ch-muted);
}

.ch-bar .ch-bar__text a {
    color: var(--ch-gold);
    text-decoration: none;
}

.ch-bar .ch-bar__text a:hover {
    text-decoration: underline;
}

.ch-bar .ch-bar__actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

/* "Zelf instellen": quiet text button */
.ch-bar .ch-bar__settings {
    margin: 0 8px 0 0;
    padding: 8px 4px;
    background: none;
    border: 0;
    border-radius: 0;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.2;
    color: var(--ch-text);
    text-decoration: underline;
    text-decoration-color: var(--ch-off);
    text-underline-offset: 5px;
    cursor: pointer;
    transition: text-decoration-color 0.2s;
}

.ch-bar .ch-bar__settings:hover {
    background: none;
    color: var(--ch-text);
    text-decoration-color: var(--ch-gold);
}

/* Buttons: same size, so rejecting is as easy as accepting */
.ch-bar .ch-btn {
    margin: 0;
    min-width: 172px;
    padding: 13px 22px;
    border-radius: 0;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-align: center;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.ch-bar .ch-btn--ghost {
    background: transparent;
    border: 1px solid var(--ch-muted);
    color: var(--ch-text);
}

.ch-bar .ch-btn--ghost:hover {
    background: transparent;
    border-color: var(--ch-gold);
    color: var(--ch-text);
}

.ch-bar .ch-btn--gold {
    background: var(--ch-gold);
    border: 1px solid var(--ch-gold);
    color: var(--ch-bg);
}

.ch-bar .ch-btn--gold:hover {
    background: var(--ch-gold-hover);
    border-color: var(--ch-gold-hover);
    color: var(--ch-bg);
}

.ch-bar button:focus-visible,
.ch-bar a:focus-visible {
    outline: 2px solid var(--ch-gold);
    outline-offset: 3px;
}

/* Tablet: text above, buttons below */
@media (max-width: 960px) {
    .ch-bar .ch-bar__inner {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
    }
    .ch-bar .ch-bar__text {
        max-width: none;
    }
    .ch-bar .ch-bar__actions {
        justify-content: flex-end;
    }
}

/* Phone: reject + accept side by side, settings link below */
@media (max-width: 560px) {
    .ch-bar {
        padding: 18px 16px calc(16px + env(safe-area-inset-bottom, 0px));
    }
    .ch-bar .ch-bar__text {
        font-size: 13px;
    }
    .ch-bar .ch-bar__actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        grid-template-areas:
            "reject accept"
            "settings settings";
        gap: 10px;
    }
    .ch-bar [data-ch-bar-reject]   { grid-area: reject; }
    .ch-bar [data-ch-bar-accept]   { grid-area: accept; }
    .ch-bar [data-ch-bar-settings] { grid-area: settings; margin: 0; justify-self: center; }
    .ch-bar .ch-btn {
        min-width: 0;
        padding: 13px 10px;
        letter-spacing: 0.06em;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ch-bar { transition: none; }
    .ch-bar .ch-btn,
    .ch-bar .ch-bar__settings { transition: none; }
}
