/* ==========================================================================
   OrFlo cookie consent styles (orflo.nl)
   Loaded from partials/consent-head.php. Uses the brand tokens defined in
   styles.css (:root). The banner starts hidden (`hidden` attribute); consent.js
   reveals it only when consent is needed, so there is no flash and no-JS
   visitors (who also get no tracker) never see it.
   ========================================================================== */

.cc-banner[hidden],
.cc-modal[hidden] { display: none !important; }

/* ---- first layer: banner -------------------------------------------- */

.cc-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2147483000; /* above header, demo lightbox, everything */
    background: var(--bg-white, #fff);
    border-top: 3px solid var(--primary, #00288e);
    box-shadow: 0 -8px 30px -12px rgba(0, 0, 0, 0.28);
    animation: cc-rise 0.28s ease both;
}

@keyframes cc-rise {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    .cc-banner { animation: none; }
}

.cc-banner-inner {
    max-width: 1250px;
    margin: 0 auto;
    padding: 1.15rem 2rem;
    display: flex;
    align-items: center;
    gap: 1.5rem 2rem;
    flex-wrap: wrap;
}

.cc-copy { flex: 1 1 420px; min-width: 260px; }

.cc-title {
    font-family: 'Inter', 'Segoe UI', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-dark, #191c1e);
    margin: 0 0 0.35rem;
}

.cc-desc {
    font-size: 0.9rem;
    line-height: 1.55;
    color: var(--text-light, #444653);
    margin: 0;
}

.cc-inline-links {
    margin: 0.55rem 0 0;
    font-size: 0.82rem;
    color: var(--text-subtle, #64748b);
}

.cc-inline-links a {
    color: var(--primary, #00288e);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.cc-inline-links a:hover { color: var(--primary-dark, #001453); }
.cc-dot { margin: 0 0.4rem; color: var(--border-strong, #c4c5d5); }

.cc-actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    flex: 0 0 auto;
}

/* ---- buttons: reject and accept share one visual weight -------------- */

.cc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.7rem 1.35rem;
    min-width: 128px;
    border-radius: var(--radius-sm, 4px);
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    line-height: 1.1;
    text-transform: uppercase;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
    white-space: nowrap;
}

.cc-btn:focus-visible {
    outline: 3px solid var(--accent, #fd761a);
    outline-offset: 2px;
}

/* Accept and Reject: identical solid style = equal prominence. */
.cc-btn--solid {
    background: var(--primary, #00288e);
    color: #fff;
    border-color: var(--primary, #00288e);
}
.cc-btn--solid:hover {
    background: var(--primary-dark, #001453);
    border-color: var(--primary-dark, #001453);
    transform: translateY(-1px);
}

/* Preferences: secondary, still clearly clickable. */
.cc-btn--ghost {
    background: var(--bg-white, #fff);
    color: var(--primary, #00288e);
    border-color: var(--border-strong, #c4c5d5);
}
.cc-btn--ghost:hover {
    background: var(--surface-container, #f2f4f6);
    border-color: var(--primary, #00288e);
}

/* ---- second layer: preferences modal -------------------------------- */

.cc-modal {
    position: fixed;
    inset: 0;
    z-index: 2147483001;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
}

.cc-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 15, 35, 0.55);
    backdrop-filter: blur(1px);
}

.cc-modal-card {
    position: relative;
    background: var(--bg-white, #fff);
    border-radius: var(--radius-md, 8px);
    box-shadow: var(--shadow-lg, 0 10px 15px -3px rgba(0,0,0,0.1));
    width: 100%;
    max-width: 560px;
    max-height: 92vh;
    max-height: 92dvh;
    overflow-y: auto;
    padding: 1.6rem;
    animation: cc-pop 0.2s ease both;
}

@keyframes cc-pop {
    from { transform: translateY(8px) scale(0.99); opacity: 0; }
    to   { transform: translateY(0) scale(1); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
    .cc-modal-card { animation: none; }
}

.cc-modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.5rem;
}
.cc-modal-head .cc-title { font-size: 1.25rem; margin: 0; }

.cc-close {
    flex: 0 0 auto;
    background: none;
    border: 0;
    padding: 0.25rem;
    color: var(--text-subtle, #64748b);
    cursor: pointer;
    border-radius: var(--radius-sm, 4px);
    line-height: 0;
}
.cc-close:hover { color: var(--text-dark, #191c1e); background: var(--surface-container, #f2f4f6); }
.cc-close:focus-visible { outline: 3px solid var(--accent, #fd761a); outline-offset: 2px; }

.cc-modal-card .cc-desc { margin-bottom: 1.1rem; }

/* categories */
.cc-cats { display: flex; flex-direction: column; gap: 0.75rem; margin-bottom: 1.4rem; }

.cc-cat {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
    background: var(--surface, #f7f9fb);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: var(--radius-md, 8px);
}
.cc-cat-title { font-size: 0.95rem; font-weight: 700; color: var(--text-dark, #191c1e); margin: 0 0 0.25rem; }
.cc-cat-desc { font-size: 0.83rem; line-height: 1.5; color: var(--text-light, #444653); margin: 0; }

/* toggle switch */
.cc-switch {
    flex: 0 0 auto;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    cursor: pointer;
    user-select: none;
}
.cc-switch--locked { cursor: not-allowed; }
.cc-switch input { position: absolute; opacity: 0; width: 0; height: 0; }

.cc-slider {
    position: relative;
    width: 44px;
    height: 24px;
    border-radius: 999px;
    background: var(--border-strong, #c4c5d5);
    transition: background 0.18s ease;
    flex: 0 0 auto;
}
.cc-slider::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
    transition: transform 0.18s ease;
}
.cc-switch input:checked + .cc-slider { background: var(--green, #16a34a); }
.cc-switch input:checked + .cc-slider::after { transform: translateX(20px); }
.cc-switch--locked .cc-slider { background: var(--green, #16a34a); opacity: 0.65; }
.cc-switch input:focus-visible + .cc-slider { outline: 3px solid var(--accent, #fd761a); outline-offset: 2px; }

.cc-switch-state {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-subtle, #64748b);
}
.cc-switch-state--toggle .cc-on { display: none; }
.cc-switch-state--toggle .cc-off { display: inline; }
.cc-switch input:checked ~ .cc-switch-state--toggle .cc-on { display: inline; color: var(--green, #16a34a); }
.cc-switch input:checked ~ .cc-switch-state--toggle .cc-off { display: none; }

.cc-modal-actions {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.cc-modal-actions .cc-btn { flex: 1 1 auto; }

/* ---- footer "Cookievoorkeuren" (withdraw control) ------------------- */

.cc-footer-link {
    background: none;
    border: 0;
    padding: 0;
    margin: 0;
    font: inherit;
    color: inherit;
    cursor: pointer;
    text-decoration: none;
}
.cc-footer-link:hover { text-decoration: underline; }

/* ---- cookie overview table (cookies.php) ---------------------------- */

.cc-cookie-table-wrap { overflow-x: auto; margin: 1rem 0 1.5rem; }
.cc-cookie-table {
    width: 100%;
    min-width: 560px;
    border-collapse: collapse;
    font-size: 0.88rem;
}
.cc-cookie-table th,
.cc-cookie-table td {
    text-align: left;
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--border-color, #e2e8f0);
    vertical-align: top;
}
.cc-cookie-table th {
    background: var(--surface, #f7f9fb);
    font-weight: 700;
    color: var(--text-dark, #191c1e);
}
.cc-cookie-table code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.85em;
    word-break: break-all;
}

/* ---- responsive ----------------------------------------------------- */

@media (max-width: 640px) {
    .cc-banner-inner { padding: 1rem 1.15rem; gap: 0.9rem; }
    .cc-actions { width: 100%; }
    .cc-actions .cc-btn { flex: 1 1 auto; min-width: 0; }
    .cc-modal-card { padding: 1.25rem; }
    .cc-modal-actions .cc-btn { width: 100%; flex: 1 1 100%; }
    .cc-cat { flex-direction: row; }
}
