/**
 * Cookie consent banner and preferences modal.
 *
 * @package Clairefontaine_Template
 */

.cf-cookie-consent-root:not([hidden]) {
    display: block;
}

.cf-cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 99990;
    background: #fff;
    border-top: 1px solid rgba(0, 0, 0, 0.12);
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.12);
    padding: 1.25rem 0;
}

.cf-cookie-banner[hidden],
.cf-cookie-modal[hidden] {
    display: none !important;
}

.cf-cookie-banner__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem 1.5rem;
}

.cf-cookie-banner__title {
    margin: 0 0 0.35rem;
    font-size: 1.05rem;
    font-weight: 600;
}

.cf-cookie-banner__desc {
    margin: 0 0 0.5rem;
    font-size: 0.9rem;
    line-height: 1.55;
    max-width: 42rem;
}

.cf-cookie-banner__links {
    margin: 0;
    font-size: 0.85rem;
}

.cf-cookie-banner__links a {
    text-decoration: underline;
    text-underline-offset: 2px;
}

.cf-cookie-banner__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.cf-cookie-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.cf-cookie-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
}

.cf-cookie-modal__panel {
    position: relative;
    width: 100%;
    max-width: 32rem;
    max-height: min(90vh, 640px);
    overflow: auto;
    background: #fff;
    border-radius: 8px;
    padding: 1.25rem 1.5rem 1.5rem;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.2);
}

.cf-cookie-modal__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.cf-cookie-modal__title {
    margin: 0;
    font-size: 1.15rem;
}

.cf-cookie-modal__close {
    border: none;
    background: transparent;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    padding: 0.15rem 0.35rem;
}

.cf-cookie-modal__intro {
    margin: 0 0 1rem;
    font-size: 0.9rem;
    line-height: 1.55;
}

.cf-cookie-prefs {
    list-style: none;
    margin: 0 0 1.25rem;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.cf-cookie-pref__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.25rem;
}

.cf-cookie-pref p {
    margin: 0;
    font-size: 0.85rem;
    line-height: 1.5;
    color: #444;
}

.cf-cookie-pref__badge {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #666;
}

.cf-cookie-modal__footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

body.cf-cookie-modal-open {
    overflow: hidden;
}

@media (max-width: 640px) {
    .cf-cookie-banner__actions {
        width: 100%;
    }

    .cf-cookie-banner__actions .btn {
        flex: 1 1 auto;
        min-width: calc(50% - 0.25rem);
    }
}
