/* ---------- Cookie banner (first layer) ---------- */

.cookie-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
    display: none;
    padding: 1.5rem;
}

.cookie-banner.is-visible {
    display: block;
}

.cookie-banner__inner {
    max-width: 1273px;
    margin: 0 auto;
    background-color: #0A1A2F;
    color: #F5F2ED;
    border-radius: 1.5rem;
    padding: 1.75rem 2rem;
    box-shadow: 0 10px 40px rgba(10, 26, 47, 0.35);
    display: flex;
    align-items: center;
    gap: 2rem;
    font-family: 'Soehne';
}

.cookie-banner__text {
    flex: 1;
}

.cookie-banner__text p {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.6;
}

.cookie-banner__text a {
    color: #86BADE;
    text-decoration-color: rgba(134, 186, 222, 0.9);
    text-underline-offset: 0.15em;
}

.cookie-banner__text a:hover {
    opacity: 0.8;
}

.cookie-banner__actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* ---------- Shared buttons ---------- */

.cookie-btn {
    font-family: 'Soehne';
    font-size: 0.95rem;
    padding: 0.6rem 1.6rem;
    border-radius: 3rem;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
    white-space: nowrap;
}

.cookie-btn--dark {
    background-color: #F5F2ED;
    color: #0A1A2F;
    border-color: #F5F2ED;
}

.cookie-btn--dark:hover {
    background-color: #86BADE;
    border-color: #86BADE;
}

.cookie-btn--outline {
    background-color: transparent;
    color: #F5F2ED;
    border-color: #F5F2ED;
}

.cookie-btn--outline:hover {
    background-color: #F5F2ED;
    color: #0A1A2F;
}

.cookie-link-btn {
    background: none;
    border: none;
    padding: 0;
    color: #F5F2ED;
    font-family: 'Soehne';
    font-size: 0.9rem;
    text-decoration: underline;
    text-underline-offset: 0.2rem;
    cursor: pointer;
    white-space: nowrap;
}

.cookie-link-btn:hover {
    color: #86BADE;
}

/* ---------- Preferences modal (second layer) ---------- */

.cookie-modal {
    position: fixed;
    inset: 0;
    z-index: 2100;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.cookie-modal.is-visible {
    display: flex;
}

.cookie-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 26, 47, 0.55);
}

.cookie-modal__panel {
    position: relative;
    background-color: #F5F2ED;
    color: #0A1A2F;
    border-radius: 1.5rem;
    max-width: 560px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    padding: 2.5rem;
    font-family: 'Soehne';
}

.cookie-modal__panel h2 {
    font-family: 'Kleisch';
    font-style: italic;
    font-size: 1.8rem;
    margin: 0 0 1rem;
    padding-right: 2rem;
}

.cookie-modal__panel > p {
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0 0 1.5rem;
}

.cookie-modal__close {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    background: none;
    border: none;
    font-size: 1.8rem;
    line-height: 1;
    cursor: pointer;
    color: #0A1A2F;
    padding: 0.25rem;
}

.cookie-category {
    border-top: 1px solid rgba(10, 26, 47, 0.15);
    padding: 1.25rem 0;
}

.cookie-category:last-of-type {
    border-bottom: 1px solid rgba(10, 26, 47, 0.15);
    margin-bottom: 1.5rem;
}

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

.cookie-category__title {
    font-weight: bold;
    font-size: 1.05rem;
}

.cookie-category__badge {
    font-size: 0.75rem;
    letter-spacing: 0.4px;
    background-color: rgba(10, 26, 47, 0.1);
    color: #0A1A2F;
    padding: 0.3rem 0.8rem;
    border-radius: 3rem;
    white-space: nowrap;
}

.cookie-category p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.6;
    color: #333;
}

/* Toggle switch */

.cookie-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    flex-shrink: 0;
}

.cookie-switch input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}

.cookie-switch__label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
}

.cookie-switch__track {
    width: 46px;
    height: 26px;
    background-color: rgba(10, 26, 47, 0.25);
    border-radius: 999px;
    position: relative;
    transition: background-color 0.25s ease;
}

.cookie-switch__track::before {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background-color: #F5F2ED;
    border-radius: 50%;
    transition: transform 0.25s ease;
}

.cookie-switch input:checked + .cookie-switch__track {
    background-color: #0A1A2F;
}

.cookie-switch input:checked + .cookie-switch__track::before {
    transform: translateX(20px);
}

.cookie-switch input:focus-visible + .cookie-switch__track {
    outline: 2px solid #86BADE;
    outline-offset: 2px;
}

.cookie-modal__actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.cookie-modal__actions .cookie-btn {
    background-color: transparent;
}

.cookie-modal__actions .cookie-btn--outline {
    color: #0A1A2F;
    border-color: #0A1A2F;
}

.cookie-modal__actions .cookie-btn--outline:hover {
    background-color: #0A1A2F;
    color: #F5F2ED;
}

.cookie-modal__actions .cookie-btn--dark {
    background-color: #0A1A2F;
    color: #F5F2ED;
    border-color: #0A1A2F;
}

.cookie-modal__actions .cookie-btn--dark:hover {
    background-color: #86BADE;
    border-color: #86BADE;
    color: #0A1A2F;
}

.cookie-modal__link {
    margin-top: 1.5rem !important;
    font-size: 0.85rem !important;
}

.cookie-modal__link a {
    color: #0A1A2F;
    text-decoration-color: rgba(134, 186, 222, 0.9);
    text-underline-offset: 0.15em;
}

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

@media (max-width: 900px) {
    .cookie-banner {
        padding: 0;
    }

    .cookie-banner__inner {
        border-radius: 1.25rem 1.25rem 0 0;
        flex-direction: column;
        align-items: stretch;
        gap: 1.25rem;
        padding: 1.5rem;
    }

    .cookie-banner__actions {
        flex-direction: column-reverse;
        align-items: stretch;
        gap: 0.75rem;
    }

    .cookie-banner__actions .cookie-btn,
    .cookie-banner__actions .cookie-link-btn {
        width: 100%;
        text-align: center;
    }

    .cookie-banner__actions .cookie-link-btn {
        padding: 0.5rem 0;
    }

    .cookie-modal__panel {
        padding: 2rem 1.5rem;
        border-radius: 1.25rem;
        max-height: 90vh;
    }

    .cookie-modal__actions {
        flex-direction: column;
    }

    .cookie-modal__actions .cookie-btn {
        width: 100%;
        text-align: center;
    }
}
