/* consentManager by techNEO - Frontend-Banner */

#tn-cm-root,
#tn-cm-root * {
    box-sizing: border-box;
}

#tn-cm-root[hidden] {
    display: none;
}

.tn-cm-banner {
    position: fixed;
    z-index: 2147483646; /* nahe Maximum: kein Fremd-Widget darf die Einwilligung verdecken */
    background: #ffffff;
    color: #1e293b;
    border-radius: 14px;
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.12);
    padding: 22px 24px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
}

/* Box-Layout (unten rechts) */
.tn-cm-layout-box .tn-cm-banner {
    right: 20px;
    bottom: 20px;
    width: 500px;
    max-width: calc(100vw - 40px);
}

/* Bar-Layout (volle Breite, Inhalt auf Shop-Containerbreite, Buttons rechts untereinander) */
.tn-cm-layout-bar .tn-cm-banner {
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: none;
    margin: 0;
    border-radius: 0;
    padding: 18px 0;
}
.tn-cm-layout-bar .tn-cm-banner-inner {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    gap: 28px;
    flex-wrap: wrap;
}
.tn-cm-layout-bar .tn-cm-banner-main { flex: 1 1 320px; min-width: 0; }
.tn-cm-layout-bar .tn-cm-banner-text { margin-bottom: 6px; }
.tn-cm-layout-bar .tn-cm-links { margin-bottom: 0; }

.tn-cm-banner-head {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
    color: #0f172a;
}

.tn-cm-banner-text {
    color: #475569;
    margin-bottom: 12px;
}

.tn-cm-links {
    margin-bottom: 14px;
    font-size: 13px;
}

/* Datenschutz-/Impressum-Links nutzen die Shop-Linkfarbe (kein Akzent-Override) */
.tn-cm-links a {
    text-decoration: underline;
}

.tn-cm-sep {
    margin: 0 8px;
    color: #cbd5e1;
}

/* Kategorien */
.tn-cm-details {
    margin: 4px 0 16px;
    max-height: 38vh;
    overflow-y: auto;
    border-top: 1px solid #eef2f6;
    border-bottom: 1px solid #eef2f6;
    padding: 10px 2px;
}

.tn-cm-cat {
    padding: 10px 6px;
    border-bottom: 1px solid #f4f7fa;
}

.tn-cm-cat:last-child {
    border-bottom: none;
}

.tn-cm-cat-head {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    cursor: pointer;
    margin: 0;
}

.tn-cm-cat-head input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    margin: 0;
    border: 2px solid #cbd5e1;
    border-radius: 5px;
    background: #ffffff;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.tn-cm-cat-head input[type="checkbox"]:checked {
    background-color: var(--tn-cm-accent, #14AAF5);
    border-color: var(--tn-cm-accent, #14AAF5);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%23ffffff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round' d='M5 12l5 5 9-11'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 14px;
}

.tn-cm-cat-head input[type="checkbox"]:disabled {
    cursor: not-allowed;
    opacity: 0.65;
}

.tn-cm-cat-name em {
    font-weight: 400;
    font-size: 12px;
    color: #94a3b8;
}

.tn-cm-cat-desc {
    margin-top: 4px;
    padding-left: 28px;
    color: #64748b;
    font-size: 13px;
}

/* Aktionen / Buttons */
.tn-cm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 11px 18px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
    text-align: center;
    white-space: nowrap;
}

.tn-cm-btn-primary {
    background: var(--tn-cm-primary-bg, linear-gradient(135deg, #14AAF5 0%, #0d8bd4 100%));
    color: var(--tn-cm-primary-text, #fff);
}

.tn-cm-btn-secondary {
    background: var(--tn-cm-secondary-bg, #f1f5f9);
    color: var(--tn-cm-secondary-text, #334155);
    border-color: #d6dee5;
}

.tn-cm-btn-ghost {
    background: var(--tn-cm-ghost-bg, #ffffff);
    color: var(--tn-cm-ghost-text, var(--tn-cm-accent-dark, #0b6aa2));
    border-color: #cdd9e5;
}

.tn-cm-btn-save {
    background: var(--tn-cm-save-bg, #f1f5f9);
    color: var(--tn-cm-save-text, #334155);
    border-color: #d6dee5;
}

/* Einheitlicher Hover für alle Buttons (kein Verschieben) */
.tn-cm-btn:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    filter: brightness(0.97);
}

.tn-cm-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* Box & Center: Buttons in einer Reihe, kein Umbruch (Dialog ist breit genug) */
.tn-cm-layout-box .tn-cm-actions,
.tn-cm-layout-center .tn-cm-actions {
    flex-wrap: nowrap;
}
.tn-cm-layout-box .tn-cm-actions .tn-cm-btn,
.tn-cm-layout-center .tn-cm-actions .tn-cm-btn {
    flex: 1 1 0;
    min-width: 0;
}

/* Bar: Buttons als rechte Spalte untereinander */
.tn-cm-layout-bar .tn-cm-actions {
    flex: 0 0 auto;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    min-width: 200px;
}
.tn-cm-layout-bar .tn-cm-actions .tn-cm-btn { width: 100%; }

/* Re-Open-Button (fixiert unten links) */
.tn-cm-reopen {
    position: fixed;
    left: 18px;
    bottom: 18px;
    z-index: 2147483640; /* Wieder-öffnen-Button hoch, aber unter Banner/Popup */
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: none;
    background: #ffffff;
    color: var(--tn-cm-accent-dark, #0b6aa2);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s ease;
}

.tn-cm-reopen:hover {
    transform: scale(1.08);
}

@media (max-width: 520px) {
    .tn-cm-layout-box .tn-cm-banner {
        right: 10px;
        left: 10px;
        bottom: 10px;
        width: auto;
    }
    .tn-cm-actions {
        flex-direction: column-reverse;
        align-items: stretch;
    }
    .tn-cm-actions .tn-cm-btn {
        width: 100%;
        flex: 1 1 auto;
    }
    .tn-cm-layout-bar .tn-cm-actions .tn-cm-btn-ghost { margin-right: 0; }
}

/* Center-Layout (mittiger Dialog mit Overlay) */
#tn-cm-root.tn-cm-layout-center:not([hidden]) {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 2147483646; /* mittiger Dialog inkl. Overlay immer oben */
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.55);
    padding: 20px;
}
.tn-cm-layout-center .tn-cm-banner {
    position: relative;
    top: auto; left: auto; right: auto; bottom: auto;
    width: 560px;
    max-width: 100%;
}

/* Einstellungen-Popup (Kategorien) – für alle Layouts */
.tn-cm-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 2147483647; /* Einstellungen-Popup ganz oben (über dem Banner) */
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.6);
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
.tn-cm-modal-box {
    background: #ffffff;
    color: #1e293b;
    width: 600px;
    max-width: 100%;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    border-radius: 12px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4);
    overflow: hidden;
}
.tn-cm-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    font-size: 17px;
    font-weight: 700;
    color: #0f172a;
    border-bottom: 1px solid #eef2f6;
}
.tn-cm-modal-close {
    background: none;
    border: none;
    font-size: 26px;
    line-height: 1;
    color: #94a3b8;
    cursor: pointer;
}
.tn-cm-modal-close:hover { color: #0f172a; }
.tn-cm-modal-body {
    padding: 12px 22px 18px;
    overflow-y: auto;
    flex: 1 1 auto;
    font-size: 14px;
    line-height: 1.5;
}
.tn-cm-modal-foot {
    padding: 14px 22px;
    border-top: 1px solid #eef2f6;
    background: #fbfcfe;
}
.tn-cm-modal-foot .tn-cm-btn { flex: 1 1 0; min-width: 0; white-space: nowrap; padding-left: 12px; padding-right: 12px; }

/* iFrame-Platzhalter (Opt-in-Blocking) */
.tn-cm-ph {
    background: #f1f5f9;
    border: 1px dashed #cbd5e1;
    border-radius: 10px;
    min-height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    text-align: center;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
.tn-cm-ph-inner { max-width: 460px; }
.tn-cm-ph-text {
    color: #475569;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 14px;
}
.tn-cm-ph-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}
/* Dienste-/Quellenliste im Einstellungen-Popup */
.tn-cm-cat-services { margin: 8px 0 2px; padding-left: 30px; }
.tn-cm-svc-item { padding: 6px 0; border-top: 1px solid #f1f5f9; }
.tn-cm-svc-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; }
.tn-cm-svc-name { color: #334155; }
.tn-cm-svc-more { color: var(--tn-cm-accent-dark, #0b6aa2); text-decoration: none; font-size: 12px; white-space: nowrap; }
.tn-cm-svc-more:hover { text-decoration: underline; }
.tn-cm-svc-info { margin-top: 6px; padding: 8px 10px; background: #f8fafc; border-radius: 6px; font-size: 12px; color: #64748b; line-height: 1.5; }
.tn-cm-svc-meta { margin-bottom: 3px; }
.tn-cm-svc-meta a { color: var(--tn-cm-accent-dark, #0b6aa2); }
/* Liste (Container unten): zentrierte Leiste auf Containerbreite, Buttons rechts untereinander */
.tn-cm-layout-container .tn-cm-banner {
    left: 0; right: 0; bottom: 0;
    width: 100%; max-width: 1320px; margin: 0 auto;
    border-radius: 14px 14px 0 0;
    padding: 18px 24px;
}
.tn-cm-layout-container .tn-cm-banner-inner {
    display: flex; align-items: center; gap: 28px; flex-wrap: wrap;
}
.tn-cm-layout-container .tn-cm-banner-main { flex: 1 1 320px; min-width: 0; }
.tn-cm-layout-container .tn-cm-banner-text { margin-bottom: 6px; }
.tn-cm-layout-container .tn-cm-links { margin-bottom: 0; }
.tn-cm-layout-container .tn-cm-actions { flex: 0 0 auto; flex-direction: column; align-items: stretch; gap: 8px; min-width: 200px; }
.tn-cm-layout-container .tn-cm-actions .tn-cm-btn { width: 100%; }

/* ==================== Dark Mode ==================== */
/* Aktiv über die Klasse .tn-cm-dark am <body> (gesetzt per JS: Auto/Hell/Dunkel) */
.tn-cm-dark .tn-cm-banner { background: #1e293b; color: #e2e8f0; }
.tn-cm-dark .tn-cm-banner-head { color: #f1f5f9; }
.tn-cm-dark .tn-cm-banner-text { color: #cbd5e1; }
.tn-cm-dark .tn-cm-sep { color: #475569; }

.tn-cm-dark .tn-cm-details { border-color: #334155; }
.tn-cm-dark .tn-cm-cat { border-bottom-color: #334155; }
.tn-cm-dark .tn-cm-cat-desc { color: #94a3b8; }
.tn-cm-dark .tn-cm-cat-head input[type="checkbox"] { background: #0f172a; border-color: #475569; }

/* Einstellungen-Popup */
.tn-cm-dark .tn-cm-modal-box { background: #1e293b; color: #e2e8f0; }
.tn-cm-dark .tn-cm-modal-body { color: #e2e8f0; }
.tn-cm-dark .tn-cm-svc-item { border-color: #334155; }
.tn-cm-dark .tn-cm-svc-name { color: #e2e8f0; }
.tn-cm-dark .tn-cm-svc-meta { color: #cbd5e1; }
.tn-cm-dark .tn-cm-svc-info { background: #0f172a; border-color: #334155; }

/* Buttons: Sekundär/Ghost dunkel (Primär nutzt die Akzentfarbe) */
.tn-cm-dark .tn-cm-btn-secondary,
.tn-cm-dark .tn-cm-btn-save { background: #334155; color: #e2e8f0; border-color: #475569; }
.tn-cm-dark .tn-cm-btn-ghost { background: #1e293b; color: #7cc7f0; border-color: #475569; }

/* iFrame-Platzhalter */
.tn-cm-dark .tn-cm-ph { background: #0f172a; border-color: #334155; color: #cbd5e1; }

/* Wieder-öffnen-Button */
.tn-cm-dark .tn-cm-reopen { background: #1e293b; color: #7cc7f0; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5); }