/*
|--------------------------------------------------------------------------
| Overlay
|--------------------------------------------------------------------------
*/

.cookie-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;

    box-sizing: border-box;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 100%;
    height: 100vh;
    height: 100dvh;

    padding: 20px;

    background: rgba(0, 0, 0, 0.78);

    overflow: hidden;
}

.cookie-overlay.hidden {
    display: none;
}


/*
|--------------------------------------------------------------------------
| Modal
|--------------------------------------------------------------------------
*/

.cookie-modal {
    box-sizing: border-box;

    display: grid;
    grid-template-rows:
        auto
        minmax(0, 1fr)
        auto;

    width: 100%;
    max-width: 850px;

    max-height: calc(100vh - 40px);
    max-height: calc(100dvh - 40px);

    overflow: hidden;

    color: #ffffff;

    background: rgba(15, 23, 42, 0.99);

    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;

    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.5),
        0 0 80px rgba(0, 0, 0, 0.2);

    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}


/*
|--------------------------------------------------------------------------
| Kopfbereich
|--------------------------------------------------------------------------
*/

.cookie-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;

    padding: 24px 30px 18px;

    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.cookie-header-icon {
    flex: 0 0 auto;

    font-size: 2rem;
    line-height: 1;
}

.cookie-header h2 {
    margin: 0;

    font-size: 1.6rem;
    line-height: 1.2;

    text-align: center;
}


/*
|--------------------------------------------------------------------------
| Scrollbarer Inhalt
|--------------------------------------------------------------------------
*/

.cookie-scroll {
    min-height: 0;

    padding: 22px 30px;

    overflow-x: hidden;
    overflow-y: auto;

    overscroll-behavior: contain;

    -webkit-overflow-scrolling: touch;
}

.cookie-description {
    margin: 0 0 22px;

    color: rgba(255, 255, 255, 0.85);

    font-size: 0.95rem;
    line-height: 1.6;

    text-align: center;
}


/*
|--------------------------------------------------------------------------
| Cookie-Optionen
|--------------------------------------------------------------------------
*/

.cookie-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;

    padding: 15px 0;

    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.cookie-option > div {
    flex: 1 1 auto;

    min-width: 0;
}

.cookie-option strong {
    display: block;

    margin-bottom: 4px;

    font-size: 1rem;
    line-height: 1.3;
}

.cookie-option small {
    display: block;

    color: rgba(255, 255, 255, 0.7);

    font-size: 0.87rem;
    line-height: 1.4;
}


/*
|--------------------------------------------------------------------------
| Schalter
|--------------------------------------------------------------------------
*/

.cookie-option input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;

    flex: 0 0 58px;

    box-sizing: border-box;

    position: relative;

    width: 58px;
    height: 30px;

    margin: 0;

    border: 0;
    border-radius: 999px;

    background: #475569;

    cursor: pointer;

    transition: background-color 0.25s ease;
}

.cookie-option input[type="checkbox"]::before {
    content: "";

    position: absolute;
    top: 3px;
    left: 3px;

    width: 24px;
    height: 24px;

    border-radius: 50%;

    background: #ffffff;

    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25);

    transition: transform 0.25s ease;
}

.cookie-option input[type="checkbox"]:checked {
    background: #16a34a;
}

.cookie-option input[type="checkbox"]:checked::before {
    transform: translateX(28px);
}

.cookie-option input[type="checkbox"]:disabled {
    background: #2563eb;

    cursor: not-allowed;
    opacity: 1;
}

.cookie-option input[type="checkbox"]:disabled::before {
    transform: translateX(28px);
}

.cookie-option input[type="checkbox"]:focus-visible {
    outline: 3px solid rgba(96, 165, 250, 0.85);
    outline-offset: 3px;
}


/*
|--------------------------------------------------------------------------
| Hinweis
|--------------------------------------------------------------------------
*/

.cookie-note {
    margin: 20px 0 0;

    color: rgba(255, 255, 255, 0.7);

    font-size: 0.87rem;
    line-height: 1.5;

    text-align: center;
}


/*
|--------------------------------------------------------------------------
| Schaltflächen
|--------------------------------------------------------------------------
*/

.cookie-buttons {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;

    padding: 18px 30px 24px;

    background: #0f172a;

    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.cookie-btn {
    box-sizing: border-box;

    width: 100%;
    min-height: 48px;

    padding: 12px 14px;

    border: 0;
    border-radius: 10px;

    color: #ffffff;

    font: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.2;

    cursor: pointer;

    transition:
        opacity 0.15s ease,
        transform 0.15s ease;
}

.cookie-btn-reject {
    background: #16a34a;
}

.cookie-btn-save {
    background: #334155;
}

.cookie-btn-accept {
    background: #dc2626;
}

.cookie-btn:hover {
    opacity: 0.9;
}

.cookie-btn:active {
    transform: translateY(1px);
}

.cookie-btn:focus-visible {
    outline: 3px solid rgba(96, 165, 250, 0.85);
    outline-offset: 3px;
}


/*
|--------------------------------------------------------------------------
| Footer
|--------------------------------------------------------------------------
*/

.footer-links {
    margin-top: 10px;
}

.footer-links a {
    color: inherit;
}


/*
|--------------------------------------------------------------------------
| Smartphone
|--------------------------------------------------------------------------
*/

@media (max-width: 700px) {

    .cookie-overlay {
        align-items: stretch;

        padding:
            max(8px, env(safe-area-inset-top))
            max(8px, env(safe-area-inset-right))
            max(8px, env(safe-area-inset-bottom))
            max(8px, env(safe-area-inset-left));
    }

    .cookie-modal {
        height: 100%;
        max-height: none;

        border-radius: 12px;
    }

    .cookie-header {
        gap: 8px;

        padding: 14px 14px 12px;
    }

    .cookie-header-icon {
        font-size: 1.4rem;
    }

    .cookie-header h2 {
        font-size: 1.15rem;
    }

    .cookie-scroll {
        padding: 14px;
    }

    .cookie-description {
        margin-bottom: 10px;

        font-size: 0.8rem;
        line-height: 1.4;

        text-align: left;
    }

    .cookie-option {
        gap: 10px;

        padding: 10px 0;
    }

    .cookie-option strong {
        margin-bottom: 2px;

        font-size: 0.9rem;
    }

    .cookie-option small {
        font-size: 0.74rem;
        line-height: 1.3;
    }

    .cookie-option input[type="checkbox"] {
        flex-basis: 46px;

        width: 46px;
        height: 24px;
    }

    .cookie-option input[type="checkbox"]::before {
        top: 3px;
        left: 3px;

        width: 18px;
        height: 18px;
    }

    .cookie-option input[type="checkbox"]:checked::before,
    .cookie-option input[type="checkbox"]:disabled::before {
        transform: translateX(22px);
    }

    .cookie-note {
        margin-top: 12px;

        font-size: 0.74rem;
        line-height: 1.35;

        text-align: left;
    }

    .cookie-buttons {
        grid-template-columns: 1fr;
        gap: 7px;

        padding:
            10px
            14px
            max(10px, env(safe-area-inset-bottom));
    }

    .cookie-btn {
        min-height: 40px;

        padding: 9px 12px;

        font-size: 0.82rem;
    }
}


/*
|--------------------------------------------------------------------------
| Kleine Geräte im Querformat
|--------------------------------------------------------------------------
*/

@media (
    max-height: 550px
) and (
    orientation: landscape
) {

    .cookie-overlay {
        padding: 6px;
    }

    .cookie-modal {
        height: 100%;
        max-height: none;

        border-radius: 8px;
    }

    .cookie-header {
        padding: 8px 12px;
    }

    .cookie-header-icon {
        font-size: 1.1rem;
    }

    .cookie-header h2 {
        font-size: 1rem;
    }

    .cookie-scroll {
        padding: 8px 12px;
    }

    .cookie-description {
        margin-bottom: 6px;

        font-size: 0.72rem;
        line-height: 1.25;
    }

    .cookie-option {
        padding: 6px 0;
    }

    .cookie-option strong {
        font-size: 0.8rem;
    }

    .cookie-option small {
        font-size: 0.68rem;
        line-height: 1.2;
    }

    .cookie-note {
        margin-top: 8px;

        font-size: 0.68rem;
    }

    .cookie-buttons {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 6px;

        padding: 8px 12px;
    }

    .cookie-btn {
        min-height: 34px;

        padding: 7px 8px;

        font-size: 0.72rem;
    }
}