/**
 * X-Hunter Consent Manager – Frontend-Styles
 * Farben kommen aus CSS-Variablen (im Backoffice einstellbar).
 */

#xh-cc-root {
    --xhcc-primary: #dd0e0e;
    --xhcc-primary-text: #ffffff;
    --xhcc-secondary: #f1f1f1;
    --xhcc-secondary-text: #222222;
    display: none;
}
#xh-cc-root.is-visible { display: block; }

html.xh-cc-lock { overflow: hidden; }

/* ----- Overlay (nur Dialog-Box / center) ----- */
#xh-cc-root .xh-cc-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .55);
    z-index: 2147483000;
}
#xh-cc-root[data-layout="bar"] .xh-cc-overlay,
#xh-cc-root[data-position="bottom-left"] .xh-cc-overlay,
#xh-cc-root[data-position="bottom-right"] .xh-cc-overlay {
    background: transparent;
    pointer-events: none;
}

/* ----- Box ----- */
#xh-cc-root .xh-cc-box {
    position: fixed;
    z-index: 2147483001;
    box-sizing: border-box;
    width: 92%;
    max-width: 560px;
    max-height: 88vh;
    overflow-y: auto;
    background: #fff;
    color: #1c1c1c;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, .35);
    padding: 22px 24px;
    font-size: 14px;
    line-height: 1.5;
}
#xh-cc-root .xh-cc-box * { box-sizing: border-box; }

/* Positionen der Dialog-Box */
#xh-cc-root[data-position="center"] .xh-cc-box {
    top: 50%; left: 50%; transform: translate(-50%, -50%);
}
#xh-cc-root[data-position="bottom-left"] .xh-cc-box {
    bottom: 20px; left: 20px;
}
#xh-cc-root[data-position="bottom-right"] .xh-cc-box {
    bottom: 20px; right: 20px;
}

/* Leisten-Layout */
#xh-cc-root[data-layout="bar"] .xh-cc-box {
    top: auto; bottom: 0; left: 0; right: 0;
    transform: none;
    width: 100%;
    max-width: 100%;
    border-radius: 0;
    max-height: 90vh;
}

/* ----- Inhalt ----- */
#xh-cc-root .xh-cc-header h2 {
    margin: 0 0 10px;
    font-size: 19px;
    line-height: 1.3;
    color: #111;
}
#xh-cc-root .xh-cc-desc { margin-bottom: 14px; }
#xh-cc-root .xh-cc-desc a { color: var(--xhcc-primary); }

/* ----- Kategorien ----- */
#xh-cc-root .xh-cc-cats { margin: 6px 0 14px; }
#xh-cc-root .xh-cc-cat {
    border: 1px solid #e6e6e6;
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 8px;
    background: #fafafa;
}
#xh-cc-root .xh-cc-cat-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
#xh-cc-root .xh-cc-cat-name { font-weight: 600; }
#xh-cc-root .xh-cc-cat-desc { margin-top: 6px; color: #555; font-size: 13px; }

/* Schalter */
#xh-cc-root .xh-cc-switch {
    position: relative;
    flex: 0 0 auto;
    width: 44px; height: 24px;
    display: inline-block;
}
#xh-cc-root .xh-cc-switch input {
    position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer;
}
#xh-cc-root .xh-cc-slider {
    position: absolute; inset: 0;
    background: #c4c4c4;
    border-radius: 24px;
    transition: background .2s;
}
#xh-cc-root .xh-cc-slider::before {
    content: ""; position: absolute;
    height: 18px; width: 18px; left: 3px; top: 3px;
    background: #fff; border-radius: 50%;
    transition: transform .2s;
}
#xh-cc-root .xh-cc-switch input:checked + .xh-cc-slider { background: var(--xhcc-primary); }
#xh-cc-root .xh-cc-switch input:checked + .xh-cc-slider::before { transform: translateX(20px); }
#xh-cc-root .xh-cc-switch.is-essential .xh-cc-slider { background: var(--xhcc-primary); opacity: .55; }
#xh-cc-root .xh-cc-switch input:focus-visible + .xh-cc-slider { outline: 2px solid var(--xhcc-primary); outline-offset: 2px; }

/* ----- Buttons ----- */
#xh-cc-root .xh-cc-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
    align-items: center;
}
.xh-cc-btn {
    font: inherit;
    cursor: pointer;
    border: 1px solid transparent;
    border-radius: 6px;
    padding: 10px 16px;
    line-height: 1.2;
    transition: filter .15s, background .15s;
}
.xh-cc-btn:hover { filter: brightness(.95); }
.xh-cc-btn-primary {
    background: var(--xhcc-primary);
    color: var(--xhcc-primary-text);
    font-weight: 600;
}
.xh-cc-btn-secondary {
    background: var(--xhcc-secondary);
    color: var(--xhcc-secondary-text);
    border-color: rgba(0, 0, 0, .12);
}
.xh-cc-btn-link {
    background: transparent;
    color: #555;
    text-decoration: underline;
    padding: 10px 8px;
    margin-right: auto; /* "Einstellungen" links ausrichten */
}

/* ----- Rechtslinks ----- */
#xh-cc-root .xh-cc-legal {
    margin-top: 12px;
    font-size: 12px;
    color: #777;
    text-align: center;
}
#xh-cc-root .xh-cc-legal a { color: #777; }
#xh-cc-root .xh-cc-sep { margin: 0 6px; }

/* ----- Schwebende "Cookie-Einstellungen"-Schaltfläche ----- */
#xh-cc-reopen {
    position: fixed;
    bottom: 18px; left: 18px;
    z-index: 2147482000;
    width: 44px; height: 44px;
    border-radius: 50%;
    border: none;
    background: var(--xhcc-primary, #dd0e0e);
    color: var(--xhcc-primary-text, #fff);
    box-shadow: 0 3px 12px rgba(0, 0, 0, .3);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
#xh-cc-reopen:hover { filter: brightness(.93); }

/* ----- Platzhalter für blockierte externe Medien ----- */
.xh-cc-embed-ph {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    padding: 24px;
    text-align: center;
    background: #1e1e1e;
    color: #f3f3f3;
    border-radius: 8px;
}
.xh-cc-embed-ph-inner { max-width: 420px; }
.xh-cc-embed-ph-text { margin: 0 0 14px; font-size: 14px; line-height: 1.5; }
.xh-cc-embed-ph-btns { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.xh-cc-embed-ph .xh-cc-btn-link { color: #cfcfcf; }

/* Responsive 16:9-Wrapper für nachgeladene Embeds */
.xh-cc-embed-wrap {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
}
.xh-cc-embed-wrap .xh-cc-embed-frame {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* ----- Mobile ----- */
@media (max-width: 480px) {
    #xh-cc-root .xh-cc-box { padding: 18px 16px; }
    #xh-cc-root .xh-cc-actions { justify-content: stretch; }
    #xh-cc-root .xh-cc-actions .xh-cc-btn-primary,
    #xh-cc-root .xh-cc-actions .xh-cc-btn-secondary { flex: 1 1 100%; }
    #xh-cc-root .xh-cc-btn-link { margin-right: 0; flex: 1 1 100%; text-align: center; }
}
