/*
 * Cookie-Consent & External-Content-Placeholder
 * Design-Token-basiert, AA-Kontrast, OLG-Köln-konform:
 * "Alle akzeptieren" und "Nur notwendige" sind optisch gleichwertig.
 */

.cookie-consent {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: grid;
    place-items: center;
    padding: 1rem;
}

.cookie-consent__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.cookie-consent__modal {
    position: relative;
    max-width: 34rem;
    width: 100%;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    background: var(--color-card-bg, #1e1e1e);
    color: var(--color-text, #e0e0e0);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--border-radius-lg, 16px);
    padding: clamp(1.25rem, 3vw, 2rem);
    box-shadow: var(--shadow-lg, 0 8px 25px rgba(0, 0, 0, 0.45));
    font-family: var(--font-primary);
}

.cookie-consent__title {
    font-family: var(--font-heading);
    font-size: clamp(1.15rem, 2vw, 1.4rem);
    font-weight: 700;
    margin: 0 0 0.75rem;
    color: #ffffff;
    letter-spacing: 0.01em;
}

.cookie-consent__text {
    font-size: 0.95rem;
    line-height: 1.55;
    margin: 0 0 1.25rem;
    color: rgba(255, 255, 255, 0.88);
}

.cookie-consent__link {
    color: var(--color-primary);
    text-decoration: underline;
    text-underline-offset: 2px;
}
.cookie-consent__link:hover,
.cookie-consent__link:focus-visible {
    color: var(--color-primary-hover, #B22222);
}

/* ---------- Kategorie-Sektionen (Settings) ---------- */

.cookie-consent__category {
    padding: 0.9rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.cookie-consent__category:first-of-type {
    border-top: none;
    padding-top: 0.25rem;
}

.cookie-consent__category-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.4rem;
}

.cookie-consent__category-name {
    font-weight: 700;
    font-size: 1rem;
    color: #ffffff;
}

.cookie-consent__category-state {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(255, 255, 255, 0.65);
    padding: 0.25rem 0.55rem;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
}

.cookie-consent__category-desc {
    font-size: 0.88rem;
    line-height: 1.5;
    margin: 0;
    color: rgba(255, 255, 255, 0.75);
}

/* ---------- Toggle-Switch ---------- */

.cookie-consent__toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    width: 100%;
    cursor: pointer;
}

.cookie-consent__toggle input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 1px;
    height: 1px;
}

.cookie-consent__toggle-ui {
    position: relative;
    display: inline-block;
    width: 2.75rem;
    height: 1.5rem;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 999px;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.cookie-consent__toggle-ui::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 0.15rem;
    transform: translateY(-50%);
    width: 1.1rem;
    height: 1.1rem;
    background: #ffffff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
    transition: left 0.2s ease;
}

.cookie-consent__toggle input[type="checkbox"]:checked + .cookie-consent__toggle-ui {
    background: var(--color-primary, #e63946);
    border-color: var(--color-primary, #e63946);
}

.cookie-consent__toggle input[type="checkbox"]:checked + .cookie-consent__toggle-ui::after {
    left: calc(100% - 1.25rem);
}

.cookie-consent__toggle input[type="checkbox"]:focus-visible + .cookie-consent__toggle-ui {
    outline: 2px solid var(--color-primary, #e63946);
    outline-offset: 2px;
}

/* ---------- Buttons ---------- */

.cookie-consent__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 1.25rem;
}

.cookie-consent__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.8rem 1.5rem;
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border: 2px solid transparent;
    border-radius: var(--border-radius, 8px);
    cursor: pointer;
    min-height: 2.75rem;
    flex: 1 1 auto;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

/*
 * OLG Köln: "Alle akzeptieren" und "Nur notwendige" MÜSSEN optisch gleichwertig sein.
 * Beide tragen .cookie-consent__button--primary — identisches Styling.
 */
.cookie-consent__button--primary {
    color: #ffffff;
    background: var(--color-primary, #e63946);
    border-color: var(--color-primary, #e63946);
}
.cookie-consent__button--primary:hover,
.cookie-consent__button--primary:focus-visible {
    background: var(--color-primary-hover, #B22222);
    border-color: var(--color-primary-hover, #B22222);
}

.cookie-consent__button--secondary {
    color: #ffffff;
    background: transparent;
    border-color: rgba(255, 255, 255, 0.55);
}
.cookie-consent__button--secondary:hover,
.cookie-consent__button--secondary:focus-visible {
    background: rgba(255, 255, 255, 0.08);
    border-color: #ffffff;
}

.cookie-consent__button--tertiary {
    color: #ffffff;
    background: transparent;
    border-color: rgba(255, 255, 255, 0.28);
    font-weight: 600;
    letter-spacing: 0.03em;
}
.cookie-consent__button--tertiary:hover,
.cookie-consent__button--tertiary:focus-visible {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.6);
}

.cookie-consent__button:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 3px;
}

/* ---------- Scroll-Lock ---------- */

body.is-modal-open {
    overflow: hidden;
}

/* ---------- Mobile ---------- */

@media (max-width: 480px) {
    .cookie-consent {
        padding: 0.75rem;
    }
    .cookie-consent__title {
        font-size: 1.1rem;
    }
    .cookie-consent__text {
        font-size: 0.9rem;
    }
    .cookie-consent__actions {
        flex-direction: column;
    }
    .cookie-consent__button {
        width: 100%;
        flex: 1 1 auto;
        padding: 0.9rem 1rem;
    }
    .cookie-consent__category-head {
        flex-wrap: wrap;
        gap: 0.6rem;
    }
}

/* ---------- Reduced Motion ---------- */

@media (prefers-reduced-motion: reduce) {
    .cookie-consent__button,
    .cookie-consent__toggle-ui,
    .cookie-consent__toggle-ui::after {
        transition: none;
    }
}

/* ---------- Footer-Trigger als Link-artiger Button ---------- */

.footer__nav #open-cookie-settings {
    appearance: none;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    font-family: inherit;
    padding: var(--spacing-xs, 0.25rem) var(--spacing-sm, 0.5rem);
    border-radius: 6px;
    cursor: pointer;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    transition: color 0.3s ease, background 0.3s ease, transform 0.3s ease;
}
.footer__nav #open-cookie-settings:hover,
.footer__nav #open-cookie-settings:focus-visible {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

/* ---------- External-Content-Placeholder (Google Maps etc.) ---------- */

.external-placeholder {
    position: relative;
    width: 100%;
    min-height: 450px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(30, 30, 30, 0.95), rgba(18, 18, 18, 0.95));
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius, 8px);
    color: var(--color-text, #e0e0e0);
    font-family: var(--font-primary);
}

/* hidden-Attribut respektieren — sonst verdeckt der Placeholder den geladenen iframe. */
.external-placeholder[hidden] {
    display: none;
}

.external-placeholder__content {
    max-width: 32rem;
    text-align: center;
}

.external-placeholder__title {
    font-family: var(--font-heading);
    font-size: clamp(1.1rem, 2vw, 1.35rem);
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 0.75rem;
}

.external-placeholder__text {
    font-size: 0.92rem;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.85);
    margin: 0 0 1.25rem;
}

.external-placeholder__text a {
    color: var(--color-primary, #e63946);
    text-decoration: underline;
}

.external-placeholder__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.8rem 1.75rem;
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #ffffff;
    background: var(--color-primary, #e63946);
    border: 2px solid var(--color-primary, #e63946);
    border-radius: var(--border-radius, 8px);
    cursor: pointer;
    min-height: 2.75rem;
    transition: background 0.2s ease, border-color 0.2s ease;
}
.external-placeholder__button:hover,
.external-placeholder__button:focus-visible {
    background: var(--color-primary-hover, #B22222);
    border-color: var(--color-primary-hover, #B22222);
}
.external-placeholder__button:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 3px;
}

@media (max-width: 480px) {
    .external-placeholder {
        min-height: 320px;
        padding: 1rem;
    }
    .external-placeholder__text {
        font-size: 0.85rem;
    }
    .external-placeholder__button {
        width: 100%;
    }
}
