
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 9999;
    padding: 0 0 env(safe-area-inset-bottom);
    pointer-events: none;
    display: flex;
    justify-content: center;
    align-items: flex-end;
}

@media (max-width: 1024px) {
    .cookie-banner {
        bottom: calc(60px + env(safe-area-inset-bottom));
    }
}

.cookie-banner__inner {
    pointer-events: auto;
    background: #fff;
    border: 1px solid var(--c-border);
    border-bottom: none;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    box-shadow: var(--shadow-up);
    padding: 20px 24px;
    width: 100%;
    max-width: 960px;
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;

        transform: translateY(110%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.cookie-banner--visible .cookie-banner__inner {
    transform: translateY(0);
}

.cookie-banner--hiding .cookie-banner__inner {
    transform: translateY(110%);
}

.cookie-banner__text {
    flex: 1;
    min-width: 200px;
}

.cookie-banner__title {
    font-size: var(--text-md);
    font-weight: 600;
    color: var(--c-text);
    margin: 0 0 4px;
}

.cookie-banner__desc {
    font-size: var(--text-sm);
    color: var(--c-muted);
    margin: 0;
    line-height: 1.5;
}

.cookie-banner__link {
    color: var(--c-green);
    text-decoration: underline;
    text-underline-offset: 2px;
    font-weight: 500;
    white-space: nowrap;
}

.cookie-banner__actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
    align-items: center;
    flex-wrap: wrap;
}

.cookie-banner__btn--settings {
    background: none;
    border: none;
    padding: 8px 4px;
    color: var(--c-subtle);
    font-size: var(--text-xs);
    font-weight: 500;
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
    font-family: inherit;
    transition: color 0.15s;
}
.cookie-banner__btn--settings:hover {
    color: var(--c-muted);
}

.cookie-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.cookie-modal--active {
    display: flex;
}

.cookie-modal__box {
    background: #fff;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: cookieModalIn 0.25s ease both;
}

@keyframes cookieModalIn {
    from { opacity: 0; transform: scale(0.96) translateY(10px); }
    to   { opacity: 1; transform: none; }
}

.cookie-modal__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--c-border);
    position: sticky;
    top: 0;
    background: #fff;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.cookie-modal__head h3 {
    font-size: var(--text-lg);
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cookie-modal__close {
    width: 36px;
    height: 36px;
    margin-right: -8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    border-radius: var(--radius-md);
    font-size: var(--text-2xl);
    color: var(--c-subtle);
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.15s, background 0.15s;
}
.cookie-modal__close:hover { color: var(--c-muted); background: var(--c-surface-alt); }

.cookie-modal__body {
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cookie-modal__intro {
    font-size: var(--text-sm);
    color: var(--c-muted);
    line-height: 1.5;
    margin: 0;
}

.cookie-category {
    border: 1.5px solid var(--c-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.cookie-category--required {
    border-color: var(--c-green-tint);
    background: var(--c-green-tint);
}

.cookie-category__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
}

.cookie-category__info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.cookie-category__name {
    font-size: var(--text-md);
    font-weight: 600;
    color: var(--c-text);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 6px;
}

.cookie-category__required-badge {
    font-size: var(--text-2xs);
    font-weight: 600;
    white-space: nowrap;
    background: var(--c-green-tint);
    color: var(--c-green);
    border-radius: var(--radius-lg);
    padding: 2px 8px;
}

.cookie-category__desc {
    font-size: var(--text-xs);
    color: var(--c-muted);
    line-height: 1.5;
    margin: 0;
}

.cookie-switch {
    position: relative;
    flex-shrink: 0;
}
.cookie-switch input { display: none; }
.cookie-switch-track {
    display: block;
    width: 44px;
    height: 24px;
    background: var(--c-border);
    border-radius: var(--radius-pill);
    transition: background 0.2s;
    position: relative;
    cursor: pointer;
}
.cookie-switch input:checked + .cookie-switch-track { background: var(--c-green); }
.cookie-switch input:disabled + .cookie-switch-track {
    background: var(--c-green-light);
    cursor: not-allowed;
    opacity: 0.8;
}
.cookie-switch-thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    transition: left 0.2s;
    box-shadow: var(--shadow-sm);
}
.cookie-switch input:checked + .cookie-switch-track .cookie-switch-thumb { left: 23px; }

.cookie-modal__foot {
    display: flex;
    gap: 10px;
    padding: 16px 24px 20px;
    border-top: 1px solid var(--c-border);
    flex-wrap: wrap;
}

.cookie-modal__foot .btn {
    flex: 1 1 auto;
    min-width: max-content;      /* pas plus étroit que son texte : passe à la ligne (pleine largeur) sur petit écran */
}

@media (max-width: 640px) {
    .cookie-banner__inner {
        padding: 16px 16px;
        gap: 14px;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    }
    .cookie-banner__icon { display: none; }
    .cookie-banner__actions {
        width: 100%;
        justify-content: stretch;
    }
    .cookie-banner__actions .btn {
        flex: 1;
    }
    .cookie-banner__btn--settings {
        width: 100%;
        text-align: center;
    }
    .cookie-modal__box {
        max-height: 85vh;
        border-radius: var(--radius-lg);
    }
}

/* Icône du titre de la fenêtre */
.cookie-modal__head h3 i { display: flex; color: var(--c-green); }
