/*
 * Bandeau de consentement cookies + centre de préférences.
 * Consomme les tokens du site public (tokens.css) — aucune valeur en dur.
 */

.cookie-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9998;
    background: var(--color-surface-dark);
    color: var(--color-text-on-dark);
    box-shadow: 0 -8px 32px rgba(11, 27, 43, 0.28);
    padding: var(--space-5);
    transform: translateY(120%);
    transition: transform var(--transition-normal);
}
.cookie-banner.is-visible { transform: translateY(0); }
.cookie-banner__inner {
    max-width: var(--container-width);
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: var(--space-6);
    flex-wrap: wrap;
}
.cookie-banner__icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(231, 185, 62, 0.16);
    color: var(--color-gold-500);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}
.cookie-banner__text { flex: 1 1 380px; min-width: 0; }
.cookie-banner__text h2 {
    font-family: var(--font-heading);
    font-size: var(--fs-md);
    margin: 0 0 4px;
    color: var(--color-text-on-dark);
}
.cookie-banner__text p {
    font-size: var(--fs-xs);
    line-height: var(--lh-normal);
    color: var(--color-text-on-dark-muted);
    margin: 0;
}
.cookie-banner__text a { color: var(--color-gold-500); text-decoration: underline; }
.cookie-banner__actions {
    display: flex;
    gap: var(--space-3);
    flex-wrap: wrap;
    flex-shrink: 0;
}
.cookie-banner__actions .btn { padding: 11px 20px; }

.cookie-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: var(--space-4);
    background: rgba(23, 21, 15, 0.55);
    backdrop-filter: blur(3px);
}
.cookie-modal.is-open { display: flex; }
.cookie-modal__box {
    background: var(--color-surface);
    color: var(--color-text);
    border-radius: var(--radius-lg);
    max-width: 560px;
    width: 100%;
    max-height: 86vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}
.cookie-modal__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    padding: var(--space-5) var(--space-5) var(--space-3);
    border-bottom: 1px solid var(--color-border);
}
.cookie-modal__head h2 {
    font-family: var(--font-heading);
    font-size: var(--fs-lg);
    margin: 0;
}
.cookie-modal__close {
    border: none;
    background: var(--color-surface-alt);
    color: var(--color-text-muted);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    flex-shrink: 0;
}
.cookie-modal__close:hover { background: var(--color-gray-200); }
.cookie-modal__intro {
    padding: var(--space-4) var(--space-5) 0;
    font-size: var(--fs-xs);
    color: var(--color-text-muted);
    line-height: var(--lh-normal);
}
.cookie-modal__list { padding: var(--space-3) var(--space-5); }
.cookie-cat {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-4);
    padding: var(--space-4) 0;
    border-bottom: 1px solid var(--color-border);
}
.cookie-cat:last-child { border-bottom: none; }
.cookie-cat__info h3 {
    font-size: var(--fs-sm);
    margin: 0 0 4px;
    color: var(--color-text);
}
.cookie-cat__info p {
    font-size: var(--fs-xs);
    color: var(--color-text-muted);
    line-height: var(--lh-normal);
    margin: 0;
}
.cookie-cat__badge {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-text-muted);
    margin-left: var(--space-2);
}

/* Toggle switch */
.cookie-switch {
    position: relative;
    flex-shrink: 0;
    width: 44px;
    height: 24px;
    display: inline-block;
}
.cookie-switch input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    cursor: pointer;
}
.cookie-switch__track {
    position: absolute;
    inset: 0;
    background: var(--color-gray-300);
    border-radius: var(--radius-pill);
    transition: background var(--transition-fast);
}
.cookie-switch__track::before {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--color-white);
    transition: transform var(--transition-fast);
    box-shadow: var(--shadow-sm);
}
.cookie-switch input:checked + .cookie-switch__track { background: var(--color-gold-500); }
.cookie-switch input:checked + .cookie-switch__track::before { transform: translateX(20px); }
.cookie-switch input:disabled + .cookie-switch__track { background: var(--color-gray-400); opacity: 0.7; cursor: not-allowed; }
.cookie-switch input:focus-visible + .cookie-switch__track { outline: 2px solid var(--color-gold-600); outline-offset: 2px; }

.cookie-modal__footer {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-5) var(--space-5);
    border-top: 1px solid var(--color-border);
}
.cookie-modal__footer .btn { flex: 1 1 auto; }

@media (max-width: 640px) {
    .cookie-banner__inner { flex-direction: column; align-items: stretch; text-align: center; }
    .cookie-banner__actions { justify-content: stretch; }
    .cookie-banner__actions .btn { flex: 1 1 auto; }
}
