/* ── Cookie Consent — Modal + Barre ─────────────────────────────────────── */

/* Overlay */
.cc-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .55);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: cc-fade-in .2s ease;
}

.cc-overlay.cc-hidden {
    display: none;
}

/* Modale */
.cc-modal {
    background: var(--surface);
    border-radius: var(--radius-lg, .75rem);
    box-shadow: 0 8px 40px rgba(0, 0, 0, .25);
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.cc-modal__head {
    padding: 1.5rem 1.5rem .75rem;
    text-align: center;
}

.cc-modal__icon {
    font-size: 2.5rem;
    display: block;
    margin-bottom: .5rem;
}

.cc-modal__title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 .5rem;
}

.cc-modal__desc {
    font-size: .875rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin: 0;
}

/* Catégories (panneau déroulant) */
.cc-categories {
    display: none;
    flex-direction: column;
    gap: .5rem;
    padding: .75rem 1.5rem;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.cc-categories.cc-open {
    display: flex;
}

.cc-category {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    padding: .75rem;
    border-radius: var(--radius);
    background: var(--surface-alt, var(--surface));
    border: 1px solid var(--border);
}

.cc-category__info {
    flex: 1;
}

.cc-category__label {
    font-size: .875rem;
    font-weight: 600;
    color: var(--text);
    display: block;
    margin-bottom: .2rem;
}

.cc-category__desc {
    font-size: .78rem;
    color: var(--text-muted);
    line-height: 1.45;
}

/* Toggle switch */
.cc-toggle {
    position: relative;
    flex-shrink: 0;
    width: 40px;
    height: 22px;
    margin-top: 2px;
}

.cc-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.cc-toggle__track {
    position: absolute;
    inset: 0;
    background: var(--border);
    border-radius: 22px;
    cursor: pointer;
    transition: background .2s;
}

.cc-toggle__track::after {
    content: '';
    position: absolute;
    left: 3px;
    top: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    transition: transform .2s;
    box-shadow: 0 1px 3px rgba(0,0,0,.2);
}

.cc-toggle input:checked + .cc-toggle__track {
    background: var(--primary);
}

.cc-toggle input:checked + .cc-toggle__track::after {
    transform: translateX(18px);
}

.cc-toggle input:disabled + .cc-toggle__track {
    background: var(--primary);
    opacity: .6;
    cursor: not-allowed;
}

/* Boutons */
.cc-modal__actions {
    padding: 1rem 1.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.cc-modal__actions .btn {
    width: 100%;
    justify-content: center;
}

.cc-modal__actions .cc-row {
    display: flex;
    gap: .5rem;
}

.cc-modal__actions .cc-row .btn {
    flex: 1;
}

/* Boutons masqués selon le mode (personnalisation ou non) */
.cc-modal__actions .cc-hidden {
    display: none;
}

.cc-btn-customize {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: .8rem;
    padding: .4rem .75rem;
    border-radius: var(--radius);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .3rem;
    transition: border-color .15s, color .15s;
    width: 100%;
}

.cc-btn-customize:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.cc-btn-customize .cc-arrow {
    transition: transform .2s;
    display: inline-block;
}

.cc-btn-customize.cc-open .cc-arrow {
    transform: rotate(180deg);
}

/* Lien politique */
.cc-modal__footer {
    padding: .5rem 1.5rem 1rem;
    text-align: center;
}

.cc-modal__footer a {
    font-size: .75rem;
    color: var(--text-muted);
    text-decoration: underline;
}

/* ── Barre persistante (après consentement) ──────────────────────────────── */

.cc-bar {
    position: fixed;
    bottom: 1.25rem;
    left: 1.25rem;
    z-index: 8000;
    display: flex;
    align-items: center;
    gap: .5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 2rem;
    padding: .4rem .75rem .4rem .6rem;
    box-shadow: 0 2px 12px rgba(0,0,0,.15);
    cursor: pointer;
    font-size: .8rem;
    color: var(--text-muted);
    transition: box-shadow .15s, color .15s;
    animation: cc-slide-up .25s ease;
}

.cc-bar:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,.2);
    color: var(--text);
}

.cc-bar.cc-hidden {
    display: none;
}

.cc-bar__icon {
    font-size: 1.1rem;
}

/* Smartphone : icône seule (le libellé reste lu via aria-label) */
@media (max-width: 640px) {
    .cc-bar {
        bottom: .75rem;
        left: .75rem;
        padding: .5rem;
    }
    .cc-bar__icon { display: flex; font-size: 1.3rem; }
    .cc-bar__label { display: none; }
}

/* Animations */
@keyframes cc-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes cc-slide-up {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Notice rechargement (révocation) ───────────────────────────────────── */

.cc-reload-notice {
    position: fixed;
    bottom: 1.25rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9100;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 4px 20px rgba(0,0,0,.2);
    padding: .75rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: .875rem;
    color: var(--text);
    white-space: nowrap;
    animation: cc-slide-up .25s ease;
}

.cc-reload-notice button {
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    padding: .35rem .75rem;
    font-size: .8rem;
    cursor: pointer;
    white-space: nowrap;
}

/* Responsive mobile */
@media (max-width: 480px) {
    .cc-modal {
        max-height: 95vh;
    }

    .cc-modal__head {
        padding: 1.25rem 1.25rem .5rem;
    }

    .cc-categories,
    .cc-modal__actions {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}
