/* ════════════════════════════════
   COOKIE CONSENT - Aperitiu design
   Reprend l'identité du front : crème, orange/rouge, typo display,
   bord crénelé inspiré du hero, ombre douce.
════════════════════════════════ */

:root {
    --cb-cream:     #fbf4e9;
    --cb-cream-2:   #f3e9d7;
    --cb-orange:    #ffa200;
    --cb-red:       #e85a28;
    --cb-red-dark:  #b22222;
    --cb-dark:      #242323;
    --cb-muted:     #7a6b58;
    --cb-border:    rgba(36, 35, 35, 0.12);
    --cb-shadow:    0 18px 48px rgba(36, 35, 35, 0.18);
    --cb-shadow-sm: 0 8px 20px rgba(232, 90, 40, 0.18);

    --cb-font-display: 'Erica One', 'Anton', Impact, sans-serif;
    --cb-font-body:    'DM Sans', 'Poppins', system-ui, sans-serif;
}

/* ── Banner principal ── */
.cb-banner {
    position: fixed; z-index: 9998;
    background: var(--cb-cream);
    border: 1.5px solid var(--cb-border);
    border-radius: 18px;
    box-shadow: var(--cb-shadow);
    padding: 22px 26px 18px;
    max-width: 480px;
    font-family: var(--cb-font-body);
    animation: cbSlideUp .45s cubic-bezier(.22,.68,0,1.2) both;
    overflow: hidden;
}

/* Bande orange décorative en haut (rappelle le hero crénelé) */
.cb-banner::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 6px;
    background: linear-gradient(90deg, var(--cb-red) 0%, var(--cb-orange) 50%, var(--cb-red) 100%);
}

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

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

.cb-banner h3 {
    font-family: var(--cb-font-display);
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--cb-dark);
    margin: 4px 0 10px;
    letter-spacing: .01em;
    line-height: 1.15;
}

.cb-banner p {
    font-size: .88rem;
    color: var(--cb-muted);
    line-height: 1.55;
    font-weight: 400;
    margin: 0 0 18px;
}

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

/* ── Boutons ── */
.cb-btn {
    padding: 11px 22px;
    border-radius: 999px;
    font-family: var(--cb-font-body);
    font-size: .82rem;
    font-weight: 600;
    cursor: pointer;
    border: 1.5px solid transparent;
    transition: transform .15s ease, box-shadow .2s ease, background .2s ease, color .2s ease, border-color .2s ease;
    letter-spacing: .01em;
    line-height: 1;
}

.cb-btn-accept {
    background: var(--cb-red);
    color: #fff;
    box-shadow: var(--cb-shadow-sm);
}
.cb-btn-accept:hover {
    background: var(--cb-red-dark);
    transform: translateY(-1px);
    box-shadow: 0 12px 26px rgba(178, 34, 34, .28);
}

.cb-btn-refuse,
.cb-btn-necessary {
    background: transparent;
    color: var(--cb-dark);
    border-color: var(--cb-dark);
}
.cb-btn-refuse:hover,
.cb-btn-necessary:hover {
    background: var(--cb-dark);
    color: var(--cb-cream);
}

.cb-btn-customize {
    background: none;
    border: none;
    color: var(--cb-red);
    font-size: .82rem;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
    padding: 4px 6px;
    margin-left: auto;
}
.cb-btn-customize:hover { color: var(--cb-red-dark); }

/* ── Panel personnalisation ── */
.cb-panel-overlay {
    position: fixed; inset: 0; z-index: 9999;
    background: rgba(36, 35, 35, 0.55);
    display: flex; align-items: center; justify-content: center;
    animation: cbFadeIn .22s ease;
    padding: 20px;
}
@keyframes cbFadeIn { from { opacity: 0; } to { opacity: 1; } }

.cb-panel {
    width: 540px; max-width: 100%; max-height: 86vh;
    background: var(--cb-cream);
    border-radius: 22px;
    box-shadow: var(--cb-shadow);
    display: flex; flex-direction: column;
    overflow: hidden;
    animation: cbPanelIn .35s cubic-bezier(.22,.68,0,1.2);
    position: relative;
    font-family: var(--cb-font-body);
}
.cb-panel::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 6px;
    background: linear-gradient(90deg, var(--cb-red) 0%, var(--cb-orange) 50%, var(--cb-red) 100%);
}
@keyframes cbPanelIn {
    from { opacity: 0; transform: scale(.95) translateY(20px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.cb-panel-head {
    padding: 26px 28px 18px;
    display: flex; align-items: center; justify-content: space-between;
    gap: 14px;
}
.cb-panel-head h3 {
    font-family: var(--cb-font-display);
    font-size: 1.6rem;
    font-weight: 400;
    color: var(--cb-dark);
    margin: 0;
    line-height: 1.1;
    letter-spacing: .01em;
}
.cb-panel-close {
    width: 34px; height: 34px;
    border-radius: 50%;
    background: rgba(36, 35, 35, 0.06);
    border: none;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    transition: background .18s ease, transform .18s ease;
}
.cb-panel-close svg { width: 14px; height: 14px; stroke: var(--cb-dark); fill: none; stroke-width: 2.2; }
.cb-panel-close:hover { background: var(--cb-red); transform: rotate(90deg); }
.cb-panel-close:hover svg { stroke: #fff; }

.cb-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 4px 28px 18px;
}
.cb-panel-body::-webkit-scrollbar { width: 8px; }
.cb-panel-body::-webkit-scrollbar-thumb {
    background: rgba(232, 90, 40, 0.3);
    border-radius: 4px;
}
.cb-panel-body::-webkit-scrollbar-thumb:hover { background: var(--cb-red); }

.cb-category {
    padding: 16px 0;
    border-bottom: 1px dashed var(--cb-border);
}
.cb-category:last-child { border-bottom: none; }

.cb-category-head {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 14px;
}
.cb-category-info {
    flex: 1;
    min-width: 0;
}
.cb-category-info h4 {
    font-family: var(--cb-font-display);
    font-size: 1.1rem;
    font-weight: 400;
    color: var(--cb-dark);
    margin: 0 0 4px;
    letter-spacing: .01em;
}
.cb-category-info p {
    font-size: .82rem;
    color: var(--cb-muted);
    font-weight: 400;
    line-height: 1.5;
    margin: 0;
}

.cb-category-badge {
    font-size: .62rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    padding: 5px 12px;
    border-radius: 999px;
    background: var(--cb-red);
    color: #fff;
    flex-shrink: 0;
    align-self: flex-start;
    margin-top: 4px;
}

/* Toggle switch - style cohérent avec le bouton accent du site */
.cb-toggle {
    position: relative;
    width: 42px; height: 24px;
    flex-shrink: 0;
    align-self: flex-start;
    margin-top: 2px;
}
.cb-toggle input { opacity: 0; width: 0; height: 0; }
.cb-toggle-slider {
    position: absolute; inset: 0;
    border-radius: 999px;
    background: rgba(36, 35, 35, 0.2);
    cursor: pointer;
    transition: background .22s ease;
    border: 1.5px solid transparent;
}
.cb-toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px; height: 18px;
    border-radius: 50%;
    background: #fff;
    left: 2px; top: 50%;
    transform: translateY(-50%);
    transition: transform .22s ease;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}
.cb-toggle input:checked + .cb-toggle-slider { background: var(--cb-red); }
.cb-toggle input:checked + .cb-toggle-slider::before { transform: translate(18px, -50%); }
.cb-toggle input:disabled + .cb-toggle-slider { opacity: .55; cursor: not-allowed; }

/* Liste des cookies sous chaque catégorie */
.cb-category > div:last-child {
    margin-top: 10px !important;
    padding: 8px 12px !important;
    padding-left: 12px !important;
    background: rgba(243, 233, 215, 0.5);
    border: 1px solid var(--cb-border);
    border-radius: 10px;
    font-size: .76rem !important;
    color: var(--cb-muted) !important;
    line-height: 1.7 !important;
}

.cb-panel-foot {
    padding: 18px 28px 22px;
    border-top: 1px solid var(--cb-border);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    background: rgba(243, 233, 215, 0.4);
}

/* ── Responsive ── */
@media (max-width: 600px) {
    .cb-banner {
        max-width: calc(100% - 24px);
        left: 12px;
        right: 12px;
        transform: none;
        padding: 20px 22px 16px;
    }
    .cb-banner.bottom-center { transform: none; }
    .cb-buttons { flex-direction: column; align-items: stretch; }
    .cb-btn,
    .cb-btn-customize { width: 100%; text-align: center; margin-left: 0; }

    .cb-panel-overlay { padding: 12px; }
    .cb-panel { max-height: 92vh; border-radius: 18px; }
    .cb-panel-head { padding: 22px 22px 14px; }
    .cb-panel-body { padding: 4px 22px 16px; }
    .cb-panel-foot { padding: 16px 22px 18px; flex-direction: column-reverse; }
    .cb-panel-foot .cb-btn { width: 100%; }
}
