#cookie-consent-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--banner-color, #000000);
    color: #ffffff;
    padding: 1rem;
    z-index: 9999;
    font-size: 14px;
    max-height: 80px;
    display: flex;
    align-items: center;
}

#cookie-consent-banner[hidden] {
    display: none;
}

.ccl-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    width: 100%;
}

#ccl-banner-text {
    margin: 0;
    padding: 0;
    flex: 1;
}

.ccl-buttons {
    display: flex;
    gap: 1rem;
    flex-shrink: 0;
}

#ccl-accept,
#ccl-refuse {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: opacity 0.2s;
}

#ccl-accept:hover,
#ccl-refuse:hover {
    opacity: 0.9;
}

#ccl-accept {
    background: #4CAF50;
    color: white;
}

#ccl-refuse {
    background: #9e9e9e;
    color: white;
}

/* Lien « Gérer les cookies » : plus de barre fixe. Le JavaScript le range tout en bas du pied de page du site
   (il reprend alors les couleurs du pied de page) ; sans pied de page, il reste à la fin de la page. */
#ccl-change-choice {
    box-sizing: border-box;
    flex: 0 0 100%;
    width: 100%;
    padding: 10px;
    text-align: center;
    font-size: 12px;
}

#ccl-change-choice a {
    color: inherit;
    text-decoration: underline;
    font-size: 0.8em;
    opacity: 0.7;
    transition: opacity 0.2s;
}

#ccl-change-choice a:hover {
    opacity: 1;
}

@media (max-width: 768px) {
    #cookie-consent-banner {
        max-height: none;
    }

    .ccl-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .ccl-buttons {
        width: 100%;
        justify-content: center;
    }
}

#ccl-more {
    color: inherit;
    text-decoration: underline;
    white-space: nowrap;
}

#ccl-more:hover {
    text-decoration: none;
}

#ccl-lightbox {
    position: relative;
    box-sizing: border-box;
    width: calc(100% - 2rem);
    max-width: 560px;
    padding: 24px 28px;
    border: none;
    border-radius: 8px;
    background: #ffffff;
    color: #1d2327;
    font-size: 15px;
    line-height: 1.6;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

#ccl-lightbox::backdrop {
    background: rgba(0, 0, 0, 0.6);
}

#ccl-lightbox h2 {
    margin: 0 2rem 12px 0;
    padding: 0;
    font-size: 20px;
    line-height: 1.3;
    color: inherit;
}

#ccl-lightbox p {
    margin: 0 0 12px;
    color: inherit;
}

#ccl-lightbox p:last-child {
    margin-bottom: 0;
}

#ccl-lightbox-close {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: #1d2327;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

#ccl-lightbox-close:hover {
    background: rgba(0, 0, 0, 0.08);
}

/* ===== Mode « lightbox » : fenêtre centrée sur fond assombri (le site reste lisible derrière). ===== */
#cookie-consent-banner.ccl-mode-lightbox {
    inset: 0;
    top: 0;
    bottom: 0;
    max-height: none;
    padding: 1.5rem;
    box-sizing: border-box;
    justify-content: center;
    background: rgba(10, 12, 16, 0.55);
    color: #1d2327;
    z-index: 99999;
    overflow-y: auto;
    animation: ccl-fade 0.25s ease-out;
}

#cookie-consent-banner.ccl-mode-lightbox[hidden] {
    display: none;
}

.ccl-mode-lightbox .ccl-content {
    box-sizing: border-box;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    width: 100%;
    max-width: 760px;
    min-height: min(62vh, 560px);
    margin: auto;
    padding: 3rem 3.5rem;
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
    text-align: center;
    animation: ccl-pop 0.3s ease-out;
}

.ccl-mode-lightbox .ccl-icon {
    font-size: 56px;
    line-height: 1;
}

.ccl-mode-lightbox #ccl-banner-title {
    margin: 0;
    padding: 0;
    font-size: 30px;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: normal;
    text-transform: none;
    color: #1d2327;
}

/* Police système : indépendante du thème, lisible partout. */
.ccl-mode-lightbox .ccl-content,
.ccl-mode-lightbox .ccl-content * {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.ccl-mode-lightbox #ccl-banner-text {
    flex: none;
    max-width: 560px;
    font-size: 18px;
    line-height: 1.6;
    color: #3c434a;
}

.ccl-mode-lightbox .ccl-buttons {
    gap: 1rem;
    width: 100%;
    max-width: 520px;
}

/* Accepter et Refuser ont le même poids visuel (exigence CNIL). */
.ccl-mode-lightbox #ccl-accept,
.ccl-mode-lightbox #ccl-refuse {
    flex: 1;
    padding: 16px 24px;
    border-radius: 10px;
    font-size: 17px;
}

.ccl-mode-lightbox #ccl-accept {
    background: var(--banner-color, #000000);
    border: 2px solid var(--banner-color, #000000);
}

.ccl-mode-lightbox #ccl-refuse {
    background: #ffffff;
    color: var(--banner-color, #000000);
    border: 2px solid #e2e4e7;
}

@keyframes ccl-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes ccl-pop { from { opacity: 0; transform: translateY(16px) scale(0.98); } to { opacity: 1; transform: none; } }

@media (max-width: 768px) {
    #cookie-consent-banner.ccl-mode-lightbox {
        padding: 1rem;
    }

    .ccl-mode-lightbox .ccl-content {
        min-height: 70vh;
        padding: 2rem 1.5rem;
        gap: 1.25rem;
    }

    .ccl-mode-lightbox .ccl-icon { font-size: 44px; }
    .ccl-mode-lightbox #ccl-banner-title { font-size: 24px; }
    .ccl-mode-lightbox #ccl-banner-text { font-size: 16px; }

    .ccl-mode-lightbox .ccl-buttons {
        flex-direction: column;
    }
}

@media (prefers-reduced-motion: reduce) {
    #cookie-consent-banner.ccl-mode-lightbox,
    .ccl-mode-lightbox .ccl-content { animation: none; }
}

/* La page ne défile plus derrière la lightbox tant qu'aucun choix n'est fait. */
html:has(#cookie-consent-banner.ccl-mode-lightbox:not([hidden])) {
    overflow: hidden;
}

/* Le thème impose majuscules et police aux titres h2 : on les neutralise dans la fenêtre. */
#cookie-consent-banner.ccl-mode-lightbox #ccl-banner-title {
    text-transform: none !important;
    letter-spacing: normal !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
}

/* ===== Fenêtre « En savoir plus » : même style que la lightbox de consentement. ===== */
#ccl-lightbox {
    max-width: 640px;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    padding: 3rem 3.5rem 2.5rem;
    border-radius: 18px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
    color: #3c434a;
    font-size: 17px;
    line-height: 1.65;
}

#ccl-lightbox[open] {
    animation: ccl-pop 0.3s ease-out;
}

/* Plus léger : elle s'ouvre souvent par-dessus la lightbox de consentement, déjà sur fond sombre. */
#ccl-lightbox::backdrop {
    background: rgba(10, 12, 16, 0.35);
}

#ccl-lightbox-ok {
    display: block;
    margin: 1.75rem auto 0;
    min-width: 200px;
    padding: 14px 28px;
    border: 2px solid var(--banner-color, #000000);
    border-radius: 10px;
    background: var(--banner-color, #000000);
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

#ccl-lightbox-ok:hover {
    opacity: 0.9;
}

#ccl-lightbox,
#ccl-lightbox * {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
}

#ccl-lightbox h2#ccl-lightbox-title {
    margin: 0 2rem 1.25rem 0;
    font-size: 26px !important;
    font-weight: 700;
    line-height: 1.25 !important;
    color: #1d2327;
    text-transform: none !important;
    letter-spacing: normal !important;
}

#ccl-lightbox p {
    margin: 0 0 1rem;
}

#ccl-lightbox-close {
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    border: none !important;
    border-radius: 50%;
    background: #f0f0f1;
    color: #1d2327;
    font-size: 26px;
    transition: background 0.2s;
}

#ccl-lightbox-close:hover {
    background: #e2e4e7;
}

@media (max-width: 768px) {
    #ccl-lightbox {
        padding: 2.5rem 1.5rem 2rem;
        font-size: 16px;
    }

    #ccl-lightbox h2#ccl-lightbox-title {
        font-size: 22px !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    #ccl-lightbox[open] { animation: none; }
}
