/* KWM Consent Manager — Stylesheet
   Look nachempfunden dem bisherigen CCM19-Theme "Kiwimo" (Layout 2019, unten rechts). */

.kcm-root, .kcm-root * { box-sizing: border-box; }
.kcm-root {
    font-family: inherit;
    font-size: 15px;
    line-height: 1.45;
    color: #000;
    text-align: left;
}
.kcm-root p { margin: 0 0 15px; }
.kcm-root a { color: #17494d; text-decoration: underline; }
.kcm-root a:hover, .kcm-root a:focus { color: #287379; }

/* ---------- Modal-Grundgerüst ---------- */
.kcm-modal {
    display: block;
    position: fixed;
    top: 0; right: 0; bottom: 0; left: 0;
    inset: 0;
    background: transparent;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    z-index: 2147483647;
    transition: opacity 300ms ease-out;
}
.kcm-modal.kcm-show { pointer-events: auto; opacity: 1; visibility: visible; }
.kcm-modal.kcm-blocking { background-color: rgba(0, 0, 0, .3); }

.kcm-modal-inner {
    display: flex;
    flex-flow: column nowrap;
    position: absolute;
    background: #fff;
    box-shadow: 0 0 20px 0 rgba(0, 0, 0, .4);
    max-height: 100%;
    width: 100%;
}
.kcm-modal--header { padding: 25px 25px 0; background: #fff; }
.kcm-modal--title { font-weight: 500; font-size: 20px; }
.kcm-modal--body {
    flex: 1 1 auto;
    min-height: 0;
    padding: 25px;
    background: #fff;
    border-bottom: 1px solid #c2c2c2;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
}
.kcm-modal--footer {
    display: flex;
    flex-flow: row wrap;
    justify-content: space-around;
    align-items: center;
    gap: 10px;
    padding: 20px 25px;
    background-color: #adadad;
}

/* ---------- Buttons ---------- */
.kcm-root button.kcm-button {
    display: inline-block;
    padding: 10px 20px;
    font: inherit;
    font-size: 1.05em;
    font-weight: 400;
    text-transform: uppercase;
    text-align: center;
    white-space: normal;
    color: #000;
    background: #f7f5f5;
    border: 1px solid #fff;
    cursor: pointer;
    transition: background-color 128ms ease-out, color 128ms ease-out;
}
.kcm-root button.kcm-button:hover, .kcm-root button.kcm-button:focus { background: #edebeb; }
.kcm-root button.kcm-button--primary { color: #fff; background: #17494d; border-color: #17494d; }
.kcm-root button.kcm-button--primary:hover, .kcm-root button.kcm-button--primary:focus { background: #287379; border-color: #287379; }
.kcm-root button:focus-visible { outline: 2px dotted rgba(0, 0, 0, .8); outline-offset: 2px; }

/* Info-Button "?" */
.kcm-root button.kcm-info-button {
    flex: 0 0 auto;
    width: 21px;
    height: 21px;
    padding: 0;
    font: inherit;
    font-weight: 600;
    font-size: 14px;
    line-height: 1;
    color: #666977;
    background: rgba(255, 255, 255, .4);
    border: 2px solid #666977;
    border-radius: 50%;
    cursor: pointer;
}
.kcm-root button.kcm-info-button:hover, .kcm-root button.kcm-info-button:focus { color: #17494d; border-color: #17494d; }

/* ---------- Banner (Hauptfenster, unten rechts) ---------- */
.kcm-widget .kcm-modal-inner {
    right: 40px;
    bottom: 40px;
    left: auto;
    top: auto;
    width: 318px;
    max-width: 318px;
    max-height: min(600px, calc(100% - 80px));
}
.kcm-widget .kcm-modal--body { display: flex; flex-flow: column nowrap; overflow: hidden; border-bottom: 1px solid #c2c2c2; }
.kcm-widget--text { flex: 1 1 auto; position: relative; min-height: 100px; overflow: hidden; }
.kcm-widget--text .kcm-inner-overflow { height: 100%; overflow-y: auto; padding-bottom: 26px; }
.kcm-widget--text::after {
    content: '';
    display: block;
    position: absolute;
    right: 0; bottom: 0; left: 0;
    width: 100%;
    height: 31px;
    background-image: linear-gradient(to top, #ffffff 50%, rgba(255, 255, 255, 0) 100%);
    pointer-events: none;
}
.kcm-widget--title { margin-bottom: 10px; font-weight: 600; font-size: 24px; line-height: 1.05; }
.kcm-widget--introduction { font-size: .875em; }
.kcm-widget--buttons {
    flex: 0 0 auto;
    display: flex;
    flex-flow: column nowrap;
    align-items: stretch;
    gap: 10px;
    margin-top: 15px;
}
.kcm-widget .kcm-modal--footer { flex-flow: row wrap; justify-content: center; padding: 12px 25px; }
.kcm-link-container { display: flex; flex-flow: row wrap; font-size: 14px; }
.kcm-link-container a { position: relative; color: rgba(0, 0, 0, .9); text-decoration: none; }
.kcm-link-container a:hover, .kcm-link-container a:focus { color: #000; text-decoration: underline; }
.kcm-link-container > a:not(:first-child) { margin-left: 16px; }
.kcm-link-container > a:not(:first-child)::before {
    content: '';
    position: absolute;
    top: 4px; bottom: 4px; left: -8px;
    width: 1px;
    background: rgba(0, 0, 0, .6);
    pointer-events: none;
}

/* ---------- Einstellungs-Panel ---------- */
.kcm-panel .kcm-modal-inner, .kcm-details .kcm-modal-inner {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
}
.kcm-panel .kcm-modal-inner { max-width: 640px; max-height: 80%; }
.kcm-details .kcm-modal-inner { max-width: 960px; height: 90%; }

.kcm-purpose { display: flex; flex-flow: row wrap; align-items: flex-start; position: relative; }
.kcm-purpose:not(:last-child) { margin-bottom: 20px; }
.kcm-purpose--label { flex: 1 1 auto; font-size: 20px; color: #000; max-width: calc(100% - 100px); cursor: pointer; }
.kcm-purpose.kcm-mandatory .kcm-purpose--label { font-weight: 600; cursor: default; }
.kcm-purpose .kcm-info-button { position: relative; top: 5px; margin-left: 15px; }
.kcm-purpose--description { flex: 1 0 100%; margin-top: 10px; font-size: .875em; order: 4; }

/* Schalter (Switch) rechts — Track/Knopf sind Pseudo-Elemente des Labels und
   damit klickbar (wie bei CCM19); positioniert relativ zur .kcm-purpose-Zeile */
.kcm-root input[type="checkbox"].kcm-switch {
    position: absolute;
    top: 24px;
    right: 48px;
    width: 0; height: 0;
    margin: 0;
    opacity: 0;
    z-index: -1;
}
.kcm-purpose--label::before {
    content: '';
    display: block;
    position: absolute;
    top: 9px;
    right: 0;
    width: 32px;
    height: 12px;
    background: silver;
    border-radius: 6px;
    transition: background-color 128ms ease-out;
}
.kcm-purpose--label::after {
    content: '';
    display: block;
    position: absolute;
    top: 7px;
    right: 16px;
    width: 16px;
    height: 16px;
    background: #f7f7f7;
    border-radius: 50%;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, .25);
    transition: all 128ms ease-out;
}
.kcm-root input[type="checkbox"].kcm-switch:checked + .kcm-purpose--label::before { background-color: #c9e1e3; }
.kcm-root input[type="checkbox"].kcm-switch:checked + .kcm-purpose--label::after { right: 0; background-color: #17494d; }
.kcm-root input[type="checkbox"].kcm-switch:disabled + .kcm-purpose--label::before { background-color: #a7a7a7; }
.kcm-root input[type="checkbox"].kcm-switch:disabled + .kcm-purpose--label::after { background-color: #676767; }
.kcm-root input[type="checkbox"].kcm-switch:focus-visible + .kcm-purpose--label::before { outline: 2px dotted rgba(0, 0, 0, .8); outline-offset: 4px; }

/* ---------- Details-Fenster ---------- */
.kcm-details h2 { margin: 25px 0 10px; font-size: 20px; font-weight: 600; }
.kcm-details h2:first-child { margin-top: 0; }
.kcm-details h3 { margin: 20px 0 6px; font-size: 16px; font-weight: 600; }
.kcm-details h4 { margin: 14px 0 4px; font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .02em; color: #444; }
.kcm-service { padding: 15px 0; border-bottom: 1px solid #d9d9d9; font-size: .9em; }
.kcm-service:last-child { border-bottom: none; }
.kcm-table-wrap { overflow-x: auto; }
.kcm-details table { width: 100%; border-collapse: collapse; font-size: 13px; margin: 4px 0 8px; }
.kcm-details th, .kcm-details td { padding: 6px 8px; border: 1px solid #d9d9d9; text-align: left; vertical-align: top; }
.kcm-details th { background: #f2f2f2; font-weight: 600; }
.kcm-consent-id { font-size: 12px; color: #444; word-break: break-all; }

/* ---------- Iframe-Blocker ---------- */
.kcm-iframe-blocker {
    display: flex;
    flex-flow: column nowrap;
    justify-content: center;
    align-items: center;
    gap: 12px;
    padding: 25px;
    min-height: 180px;
    color: #f8f8f8;
    background: #111111;
    text-align: center;
    font-size: 14px;
}
.kcm-iframe-blocker p { margin: 0; max-width: 480px; }
.kcm-iframe-blocker button.kcm-button { border-color: #17494d; }

/* ---------- Mobil ---------- */
@media screen and (max-width: 640px) {
    .kcm-widget .kcm-modal-inner {
        right: 0;
        bottom: 0;
        width: 100%;
        max-width: none;
        max-height: 80%;
    }
    .kcm-purpose--label { font-size: 17px; }
    .kcm-panel .kcm-modal-inner, .kcm-details .kcm-modal-inner { width: 100%; max-height: 100%; }
}
