.st-consent-banner {
    --st-consent-primary: #8736f6;
    --st-consent-primary-hover: #7028d4;
    position: fixed;
    inset: 0;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    pointer-events: none;
}

.st-consent-banner * {
    box-sizing: border-box;
}

.st-consent-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.st-consent-overlay.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.st-consent-card {
    position: fixed;
    left: 50%;
    bottom: 20px;
    transform: translateX(-50%);
    width: min(520px, calc(100vw - 32px));
    background: #fff;
    border: 1px solid #ececec;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.16);
    padding: 16px;
    pointer-events: auto;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.st-consent-card.is-hidden {
    opacity: 0;
    transform: translateX(-50%) translateY(10px);
    pointer-events: none;
}

.st-consent-title {
    margin: 0 0 8px;
    font-size: 18px;
    font-weight: 700;
    color: #111;
}

.st-consent-text {
    margin: 0;
    color: #666;
    line-height: 1.5;
    font-size: 13px;
}

.st-consent-links {
    margin-top: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.st-consent-links a {
    color: #555;
    text-decoration: underline;
    font-size: 12px;
}

.st-consent-by {
    color: #888;
    font-size: 12px;
    white-space: nowrap;
}

.st-consent-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.98);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    width: min(720px, calc(100vw - 30px));
    max-height: calc(100vh - 36px);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 14px 48px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.st-consent-modal.is-visible {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.st-consent-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px 10px;
    border-bottom: 1px solid #f2f2f2;
}

.st-consent-modal-header-main {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    min-width: 0;
    flex: 1;
}

.st-consent-logo {
    display: block;
    width: auto;
    max-width: 140px;
    height: 32px;
    object-fit: contain;
    object-position: left center;
}

.st-consent-modal-header-text {
    min-width: 0;
}

.st-consent-modal-header-text .st-consent-title {
    margin-top: 0;
}

.st-consent-categories {
    flex: 1;
    overflow: auto;
    padding: 12px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.st-consent-category {
    border: 1px solid #ececec;
    border-radius: 10px;
    background: #fafafa;
    overflow: hidden;
}

.st-category-header {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    cursor: pointer;
}

.st-category-chevron {
    color: #444;
    transform: rotate(0deg);
    transition: transform 0.2s ease;
    margin-top: 3px;
}

.st-category-header.active .st-category-chevron {
    transform: rotate(90deg);
}

.st-category-info {
    flex: 1;
    min-width: 0;
}

.st-category-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.st-category-name {
    font-size: 14px;
    font-weight: 700;
    color: #111;
}

.st-category-description {
    margin: 6px 0 0;
    color: #666;
    font-size: 12px;
    line-height: 1.5;
}

.st-always-active {
    font-size: 12px;
    color: #2f7d32;
    white-space: nowrap;
}

/* Höhere Spezifität gegen Theme-Regeln (z. B. Twenty Twenty input[type="checkbox"]) */
.st-consent-banner .st-category-switch input.st-category-checkbox {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
    opacity: 0 !important;
    pointer-events: none !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    display: none !important;
    top: auto !important;
    background: transparent !important;
}

.st-switch-track {
    display: inline-flex;
    width: 38px;
    height: 21px;
    border-radius: 999px;
    background: #c8c8c8;
    position: relative;
}

.st-switch-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 17px;
    height: 17px;
    border-radius: 50%;
    background: #fff;
    transition: transform 0.2s ease;
}

.st-category-switch input:checked + .st-switch-track {
    background: #111;
}

.st-category-switch input:checked + .st-switch-track .st-switch-thumb {
    transform: translateX(17px);
}

.st-consent-services {
    display: none;
    border-top: 1px solid #ececec;
    padding: 10px;
    max-height: 300px;
    overflow: auto;
}

.st-consent-services.is-open {
    display: block;
}

.st-consent-service {
    border: 1px solid #e8e8e8;
    background: #fff;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 10px;
}

.st-service-name {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #111;
}

.st-service-meta p,
.st-cookie-detail-grid p,
.st-cookie-detail-card p {
    margin: 4px 0;
    font-size: 12px;
    color: #555;
    line-height: 1.45;
}

.st-service-details {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.st-cookie-detail-card {
    border: 1px solid #ededed;
    background: #fcfcfc;
    border-radius: 8px;
    padding: 10px;
}

.st-cookie-detail-card h5 {
    margin: 0 0 6px;
    font-size: 13px;
    font-weight: 700;
    color: #111;
}

.st-consent-actions,
.st-consent-modal-footer {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.st-consent-modal-footer {
    margin-top: 0;
    border-top: 1px solid #f2f2f2;
    padding: 12px 20px 18px;
}

.st-consent-banner .st-consent-actions button,
.st-consent-banner .st-consent-modal-footer button {
    padding: 10px 12px !important;
    min-height: unset;
    line-height: 1.4;
    box-sizing: border-box;
}

.st-consent-banner button.st-consent-close {
    border: none;
    background: transparent;
    padding: 0 !important;
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    min-height: unset;
    border-radius: 50%;
    cursor: pointer;
    color: #333 !important;
    font-size: 24px;
    line-height: 1;
    text-decoration: none !important;
}

.st-consent-banner button.st-consent-close:hover,
.st-consent-banner button.st-consent-close:focus {
    background: #f2f2f2;
    color: #333 !important;
    text-decoration: none !important;
}

.st-btn-primary,
.st-btn-secondary {
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid transparent;
}

.st-consent-banner .st-btn-primary {
    background: var(--st-consent-primary) !important;
    color: #fff !important;
    text-decoration: none !important;
    border-color: var(--st-consent-primary) !important;
}

.st-consent-banner .st-btn-primary:hover,
.st-consent-banner .st-btn-primary:focus {
    background: var(--st-consent-primary-hover) !important;
    color: #fff !important;
    text-decoration: none !important;
    border-color: var(--st-consent-primary-hover) !important;
}

.st-btn-secondary {
    background: transparent;
    border-color: #666;
    color: #444;
}

.st-btn-secondary:hover {
    background: #f4f4f4;
}

/* Theme button { padding: … } (z. B. Twenty Twenty) überschreiben */
.st-consent-banner button.st-consent-reopen,
button#st-consent-reopen.st-consent-reopen {
    position: fixed;
    left: -12px;
    bottom: 18px;
    width: 48px !important;
    height: 48px !important;
    min-width: 48px !important;
    min-height: 48px !important;
    max-width: 48px !important;
    max-height: 48px !important;
    padding: 0 !important;
    margin: 0;
    border-radius: 50% !important;
    border: 1px solid #222;
    background: #111;
    color: #fff;
    font-size: 20px;
    line-height: 48px;
    text-align: center;
    cursor: pointer;
    z-index: 1000000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    transform: translateX(-6px);
    box-sizing: border-box !important;
    appearance: none;
    -webkit-appearance: none;
}

button#st-consent-reopen.st-consent-reopen.is-visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0);
}

.st-consent-banner.st-is-hidden {
    pointer-events: none;
}

.st-consent-banner.st-is-hidden .st-consent-card,
.st-consent-banner.st-is-hidden .st-consent-modal,
.st-consent-banner.st-is-hidden .st-consent-overlay {
    display: none;
}

@media (max-width: 600px) {
    .st-consent-card {
        width: calc(100vw - 20px);
        bottom: 10px;
    }

    .st-consent-modal {
        width: calc(100vw - 16px);
        max-height: calc(100vh - 16px);
    }

    .st-consent-actions,
    .st-consent-modal-footer {
        flex-direction: column;
    }

    .st-btn-primary,
    .st-btn-secondary {
        width: 100%;
    }
}

.st-consent-banner .st-btn-primary:focus,
.st-btn-secondary:focus,
.st-consent-banner button.st-consent-close:focus,
button#st-consent-reopen.st-consent-reopen:focus,
.st-category-switch input:focus + .st-switch-track {
    outline: 2px solid #135e96;
    outline-offset: 2px;
}

@media print {
    .st-consent-banner,
    .st-consent-reopen {
        display: none !important;
    }
}
