/* Cookie consent — GDPR notice + preferences modal.
   The accent colour is set per-install via inline :root { --cc-btn: ... } in footer.php. */

#cc-notice {
    position: fixed;
    z-index: 99998;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    color: #1e293b;
}

[data-position="bottom"]#cc-notice {
    bottom: 0; left: 0; right: 0;
    background: #fff;
    box-shadow: 0 -2px 20px rgba(0,0,0,0.08);
    border-top: 1px solid #e2e8f0;
}
[data-position="bottom"] #cc-notice-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 24px;
}
[data-position="bottom"] .cc-notice-text { flex: 1; min-width: 0; }

[data-position="center"]#cc-notice {
    inset: 0;
    background: rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
}
[data-position="center"] #cc-notice-inner {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    max-width: 480px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}

.cc-notice-msg { color: #374151; font-size: 13px; line-height: 1.6; margin: 0; }
.cc-notice-link { color: #1d4ed8; font-size: 13px; text-decoration: underline; font-weight: 500; }
.cc-notice-link:hover { text-decoration: underline; }
.cc-notice-actions { display: flex; gap: 8px; flex-shrink: 0; }

@media (max-width: 768px) {
    [data-position="bottom"] #cc-notice-inner { flex-direction: column; align-items: stretch; }
    .cc-notice-actions { justify-content: stretch; }
}

#cc-prefs-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 99998; }
#cc-prefs-modal {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    z-index: 99999;
    background: #fff;
    border-radius: 12px;
    width: 90%;
    max-width: 580px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    color: #1e293b;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.cc-prefs-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 0;
    flex-shrink: 0;
}
.cc-prefs-title { font-size: 18px; font-weight: 700; margin: 0; }
.cc-prefs-close { background: none; border: none; font-size: 24px; color: #94a3b8; cursor: pointer; padding: 0 4px; line-height: 1; }
.cc-prefs-close:hover { color: #1e293b; }

.cc-prefs-body { padding: 16px 24px; overflow-y: auto; flex: 1; }
.cc-prefs-desc { color: #64748b; font-size: 13px; line-height: 1.6; margin: 0 0 12px; }

.cc-categories { border-top: 1px solid #e2e8f0; margin-top: 8px; }
.cc-cat-item { border-bottom: 1px solid #e2e8f0; }
.cc-cat-header {
    display: flex;
    align-items: center;
    padding: 14px 0;
    cursor: pointer;
    gap: 10px;
    user-select: none;
}
.cc-cat-arrow { color: #94a3b8; transition: transform .2s; display: flex; align-items: center; flex-shrink: 0; }
.cc-cat-item.open .cc-cat-arrow { transform: rotate(90deg); }
.cc-cat-label { font-weight: 600; font-size: 14px; flex: 1; }
.cc-cat-toggle { flex-shrink: 0; }
.cc-always-active { color: #22c55e; font-weight: 600; font-size: 13px; }
.cc-cat-body { padding: 0 0 14px 22px; }
.cc-cat-body p { color: #64748b; font-size: 13px; line-height: 1.6; margin: 0; }

.cc-cookie-table { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 12px; }
.cc-cookie-table th { text-align: left; font-weight: 600; color: #475569; padding: 6px 8px; border-bottom: 1px solid #e2e8f0; white-space: nowrap; }
.cc-cookie-table td { color: #64748b; padding: 6px 8px; border-bottom: 1px solid #f1f5f9; vertical-align: top; }
.cc-cookie-table tr:last-child td { border-bottom: none; }

.cc-switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.cc-switch input { opacity: 0; width: 0; height: 0; }
.cc-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #cbd5e1;
    border-radius: 24px;
    transition: .2s;
}
.cc-slider:before {
    content: "";
    position: absolute;
    height: 18px; width: 18px;
    left: 3px; bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: .2s;
}
.cc-switch input:checked + .cc-slider { background: var(--cc-btn); }
.cc-switch input:checked + .cc-slider:before { transform: translateX(20px); }
.cc-switch-sm { width: 34px; height: 18px; }
.cc-switch-sm .cc-slider:before { height: 14px; width: 14px; left: 2px; bottom: 2px; }
.cc-switch-sm input:checked + .cc-slider:before { transform: translateX(16px); }

.cc-prefs-footer {
    display: flex;
    gap: 8px;
    padding: 16px 24px;
    border-top: 1px solid #e2e8f0;
    flex-shrink: 0;
    justify-content: stretch;
}

.cc-btn {
    flex: 1;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: opacity .15s;
    border: none;
    white-space: nowrap;
}
.cc-btn:hover { opacity: .85; }
.cc-btn-primary { background: var(--cc-btn); color: #fff; }
.cc-btn-outline { background: #fff; color: var(--cc-btn); border: 2px solid var(--cc-btn); }

#cc-settings-btn {
    position: fixed;
    bottom: 20px; left: 20px;
    z-index: 99997;
    width: 44px; height: 44px;
    border-radius: 50%;
    border: none;
    background: #1e293b;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    transition: transform .15s;
}
#cc-settings-btn:hover { transform: scale(1.1); }

@media (max-width: 640px) {
    #cc-prefs-modal { width: 95%; max-height: 90vh; }
    .cc-prefs-footer { flex-wrap: wrap; }
    .cc-prefs-footer .cc-btn { min-width: calc(50% - 4px); }
    .cc-notice-actions { flex-wrap: wrap; }
    .cc-notice-actions .cc-btn { min-width: calc(50% - 4px); }
}
