/* ── Cookie banner ── */
.cb-banner {
    position: fixed; z-index: 9998;
    background: rgba(255,255,255,.92);
    border: 1.5px solid rgba(255,255,255,.95);
    backdrop-filter: blur(18px);
    box-shadow: 0 -4px 32px rgba(30,40,80,.12);
    border-radius: 16px;
    padding: 24px 28px;
    max-width: 540px;
    font-family: 'DM Sans', sans-serif;
    animation: cbSlideUp .4s cubic-bezier(.22,.68,0,1.2) both;
}

.cb-banner.bottom-center { bottom: 20px; left: 50%; transform: translateX(-50%); }
.cb-banner.bottom-left   { bottom: 20px; left: 20px; }
.cb-banner.bottom-right  { bottom: 20px; right: 20px; }

@keyframes cbSlideUp {
    from { opacity: 0; transform: translateX(-50%) translateY(30px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.cb-banner.bottom-left  { animation-name: cbSlideUpLeft; }
.cb-banner.bottom-right { animation-name: cbSlideUpRight; }
@keyframes cbSlideUpLeft  { from { opacity:0; transform:translateY(30px); } to { opacity:1; transform:translateY(0); } }
@keyframes cbSlideUpRight { from { opacity:0; transform:translateY(30px); } to { opacity:1; transform:translateY(0); } }

/* En-tête : le cookie à gauche, le texte à droite */
.cb-head {
    display: flex; align-items: flex-start; gap: 14px;
    margin-bottom: 18px;
}
.cb-mascot {
    flex-shrink: 0; width: 44px; height: 44px;
    display: block; margin-top: 2px;
    filter: drop-shadow(0 3px 8px rgba(160, 110, 40, .28));
}
.cb-mascot svg { width: 100%; height: 100%; display: block; }

.cb-banner h3 {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1.02rem; font-weight: 700; letter-spacing: -.01em;
    color: var(--text, #1a1a2e);
    margin-bottom: 6px;
}

.cb-banner p {
    font-size: .82rem; color: var(--muted, #8a8fa8);
    line-height: 1.6; font-weight: 400; margin: 0;
}

.cb-buttons {
    display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
}

.cb-btn {
    padding: 10px 18px; border-radius: 10px;
    font-family: 'DM Sans', sans-serif; font-size: .82rem; font-weight: 600;
    cursor: pointer; border: none; transition: all .18s;
}

/* CNIL : refuser doit être aussi simple qu'accepter. Les deux boutons ont donc
   la même taille, la même graisse et la même place — seul le remplissage diffère.
   Le dimensionnement est limité à .cb-buttons : le pied du panneau
   « Personnaliser » réutilise ces classes et doit rester aligné à droite. */
.cb-buttons .cb-btn-accept,
.cb-buttons .cb-btn-refuse {
    flex: 1 1 0; min-width: 140px;
}

.cb-btn-accept {
    background: var(--color-primary, #5B4BDB);
    color: #fff; box-shadow: 0 2px 10px rgba(91,75,219,.28);
}
.cb-btn-accept:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(91,75,219,.38); }

.cb-btn-refuse, .cb-btn-necessary {
    background: #fff; border: 1.5px solid rgba(91,75,219,.35);
    color: var(--color-primary, #5B4BDB);
}
.cb-btn-refuse:hover, .cb-btn-necessary:hover {
    transform: translateY(-1px);
    border-color: var(--color-primary, #5B4BDB);
    background: rgba(91,75,219,.05);
}

/* Actions secondaires : une seule ligne centrée sous les deux boutons */
.cb-links {
    display: flex; flex-wrap: wrap;
    align-items: center; justify-content: center;
    gap: 6px 18px;
    margin-top: 14px;
}

.cb-btn-customize {
    background: none; border: none; padding: 0; cursor: pointer;
    font-family: 'DM Sans', sans-serif; font-size: .78rem; font-weight: 500;
    color: var(--text, #1a1a2e);
    text-decoration: underline; text-underline-offset: 3px;
    transition: color .18s;
}
.cb-btn-customize:hover { color: var(--color-primary, #5B4BDB); }

.cb-policy {
    font-size: .78rem; color: var(--muted, #8a8fa8);
    text-decoration: underline; text-underline-offset: 3px;
    transition: color .18s;
}
.cb-policy:hover { color: var(--color-primary, #5B4BDB); }

@media (max-width: 560px) {
    .cb-banner { padding: 20px; max-width: none; text-align: center; }
    .cb-banner.bottom-center,
    .cb-banner.bottom-left,
    .cb-banner.bottom-right {
        left: 12px; right: 12px; bottom: 12px;
        transform: none; max-width: none;
        /* cbSlideUp contient un translateX(-50%) qui décalerait le bandeau
           maintenant qu'il est calé sur left+right */
        animation-name: cbSlideUpLeft;
    }
    /* Le cookie passe au-dessus du texte, tout est centré */
    .cb-head { flex-direction: column; align-items: center; gap: 10px; }
    .cb-mascot { width: 48px; height: 48px; margin-top: 0; }
    .cb-buttons { flex-direction: column; align-items: stretch; }
    .cb-buttons .cb-btn-accept,
    .cb-buttons .cb-btn-refuse { flex: 1 1 auto; width: 100%; }
    .cb-links { flex-direction: column; gap: 10px; margin-top: 16px; }
}

/* ── Customize panel ── */
.cb-panel-overlay {
    position: fixed; inset: 0; z-index: 9999;
    background: rgba(26,26,46,.4);
    backdrop-filter: blur(3px);
    display: flex; align-items: center; justify-content: center;
    animation: cbFadeIn .2s;
}
@keyframes cbFadeIn { from { opacity:0 } to { opacity:1 } }

.cb-panel {
    width: 480px; max-height: 80vh;
    background: rgba(255,255,255,.92);
    border: 1.5px solid rgba(255,255,255,.95);
    border-radius: 18px;
    backdrop-filter: blur(24px);
    box-shadow: 0 16px 48px rgba(30,40,80,.15);
    display: flex; flex-direction: column;
    animation: cbPanelIn .3s cubic-bezier(.22,.68,0,1.2);
}
@keyframes cbPanelIn { from { opacity:0; transform:scale(.96) translateY(10px); } to { opacity:1; transform:scale(1) translateY(0); } }

.cb-panel-head {
    padding: 20px 24px 14px;
    border-bottom: 1px solid rgba(180,190,220,.2);
    display: flex; align-items: center; justify-content: space-between;
}
.cb-panel-head h3 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.1rem; font-weight: 400; color: var(--text, #1a1a2e);
    margin: 0;
}
.cb-panel-close {
    width: 28px; height: 28px; border-radius: 8px;
    background: rgba(0,0,0,.05); border: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
.cb-panel-close svg { width: 12px; height: 12px; stroke: var(--muted, #8a8fa8); fill: none; stroke-width: 2; }
.cb-panel-close:hover { background: rgba(255,107,138,.1); }

.cb-panel-body {
    flex: 1; overflow-y: auto; padding: 16px 24px;
}

.cb-category {
    padding: 14px 0; border-bottom: 1px solid rgba(180,190,220,.15);
}
.cb-category:last-child { border-bottom: none; }

.cb-category-head {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.cb-category-info h4 { font-size: .88rem; font-weight: 500; color: var(--text, #1a1a2e); margin-bottom: 2px; }
.cb-category-info p { font-size: .75rem; color: var(--muted, #8a8fa8); font-weight: 300; line-height: 1.5; }
.cb-category-badge {
    font-size: .6rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase;
    padding: 2px 8px; border-radius: 20px;
    background: rgba(94,207,174,.12); color: #5ecfae; border: 1px solid rgba(94,207,174,.22);
}

.cb-toggle { position: relative; width: 36px; height: 20px; flex-shrink: 0; }
.cb-toggle input { opacity: 0; width: 0; height: 0; }
.cb-toggle-slider {
    position: absolute; inset: 0; border-radius: 20px;
    background: rgba(180,190,220,.3); cursor: pointer;
    transition: background .2s;
}
.cb-toggle-slider::before {
    content: ''; position: absolute; width: 16px; height: 16px;
    border-radius: 50%; background: #fff;
    left: 2px; top: 2px; transition: transform .2s;
    box-shadow: 0 1px 3px rgba(0,0,0,.15);
}
.cb-toggle input:checked + .cb-toggle-slider { background: var(--accent, #7C9EFF); }
.cb-toggle input:checked + .cb-toggle-slider::before { transform: translateX(16px); }
.cb-toggle input:disabled + .cb-toggle-slider { opacity: .6; cursor: not-allowed; }

.cb-panel-foot {
    padding: 14px 24px 18px;
    border-top: 1px solid rgba(180,190,220,.2);
    display: flex; justify-content: flex-end; gap: 8px;
}

/* ── Responsive ── */
@media (max-width: 600px) {
    .cb-banner { max-width: calc(100% - 24px); left: 12px; right: 12px; transform: none; padding: 18px 20px; }
    .cb-banner.bottom-center { transform: none; }
    .cb-panel { width: calc(100% - 24px); max-height: 90vh; }
    .cb-buttons { flex-direction: column; }
}
