/* ── Overlay principal ───────────────────────────────────── */
#sp-cookie-banner {
    position: fixed;
    inset: 0;
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(0, 0, 0, .55);
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s ease, visibility 0s linear .3s;
}
#sp-cookie-banner.sp-show {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    transition-delay: 0s;
}

/* ── Carte popup ──────────────────────────────────────────── */
.sp-popup {
    position: relative;
    width: min(100%, 680px);
    padding: 2.25rem 2.25rem 1.75rem;
    background: #fff;
    border-radius: 3px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, .4);
    transform: translateY(14px);
    transition: transform .3s ease;
}
#sp-cookie-banner.sp-show .sp-popup {
    transform: translateY(0);
}

/* ── Texte du popup ──────────────────────────────────────── */
#sp-cookie-title {
    margin: 0;
    font-size: .82rem;
    font-weight: 400;
    line-height: 1.65;
    color: #232323;
}

/* ── Footer boutons ──────────────────────────────────────── */
.sp-popup-footer {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    justify-content: center;
    margin-top: 1.75rem;
}

/* ── Boutons communs ─────────────────────────────────────── */
.sp-btn {
    min-height: 44px;
    padding: .65rem 1.4rem;
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .02em;
    border-radius: 2px;
    cursor: pointer;
    transition: background .15s, color .15s, border-color .15s;
}
.sp-btn-settings {
    color: var(--aci-green);
    background: transparent;
    border: 2px solid var(--aci-green);
}
.sp-btn-settings:hover {
    background: rgba(0,0,0,.04);
}
.sp-btn-accept {
    color: #fff;
    background: var(--aci-orange);
    border: 2px solid var(--aci-orange);
}
.sp-btn-accept:hover { background: #d9600f; border-color: #d9600f; }

/* ── Overlay panneau paramètres ──────────────────────────── */
#sp-cookie-overlay {
    position: fixed;
    inset: 0;
    z-index: 9100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(0, 0, 0, .6);
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease, visibility 0s linear .2s;
}
#sp-cookie-overlay.sp-show {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    transition-delay: 0s;
}

/* ── Panneau paramètres (style clair) ────────────────────── */
#sp-cookie-panel {
    width: min(100%, 720px);
    max-height: calc(100vh - 2rem);
    padding: 1.75rem;
    overflow-y: auto;
    color: #232323;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 20px 50px rgba(0,0,0,.3);
}

.sp-panel-header h3 { margin: 0 0 .6rem; font-size: 1rem; }
.sp-panel-header p  { margin: 0; color: #555; font-size: .85rem; line-height: 1.6; }

.sp-category { padding: 1rem 0; border-top: 1px solid #e5e5e5; }
.sp-category-header { display: flex; gap: 1rem; justify-content: space-between; align-items: flex-start; }
.sp-category-info h4 { margin: 0 0 .35rem; font-size: .9rem; display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.sp-category-info p  { margin: 0; font-size: .82rem; color: #555; line-height: 1.55; }

.sp-badge-required {
    display: inline-block;
    padding: .12rem .4rem;
    color: var(--aci-green2);
    font-size: .68rem;
    font-weight: 600;
    background: #e8f8ee;
    border-radius: 3px;
}

/* ── Toggles ─────────────────────────────────────────────── */
.sp-toggle { flex-shrink: 0; padding-top: .15rem; }
.sp-toggle input[type="checkbox"] {
    width: 2.6rem;
    height: 1.35rem;
    accent-color: var(--aci-green);
    cursor: pointer;
}
.sp-toggle input[type="checkbox"]:disabled { cursor: not-allowed; opacity: .5; }

.sp-panel-footer {
    display: flex;
    flex-wrap: wrap;
    gap: .7rem;
    justify-content: flex-end;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e5e5;
}
.sp-panel-footer .sp-btn-settings {
    color: #374151;
    background: #f3f4f6;
    border: 2px solid #d1d5db;
}
.sp-panel-footer .sp-btn-settings:hover { background: #e5e7eb; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 540px) {
    .sp-popup { padding: 2.5rem 1.25rem 1.5rem; }
    .sp-popup-footer { flex-direction: column; }
    .sp-popup-footer .sp-btn { width: 100%; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
    #sp-cookie-banner, #sp-cookie-overlay, .sp-popup { transition: none; }
}