/* GB Cookies */
.gbc,
.gbc-reopen {
    --gbc-bg: #1f2420;
    --gbc-text: #fff;
    --gbc-muted: #aaaaaa;
    --gbc-border: rgba(255, 66, 66, 0.85);
    --gbc-radius: 0;
    --gbc-accent: #ffffff;
}
.gbc {
    position: fixed;
    z-index: 99999;
    left: 0;
    right: 0;
    bottom: 0;
    font: inherit;
    font-size: 15px;
    line-height: 1.5;
    color: var(--gbc-text);
    opacity: 0;
    transform: translateY(16px);
    transition: opacity .25s ease, transform .25s ease;
}
.gbc[hidden] { display: none; }
.gbc.is-visible { opacity: 1; transform: none; }
.gbc *, .gbc *::before, .gbc *::after { box-sizing: border-box; }

.gbc__inner {
    background: var(--gbc-bg);

    max-height: 85vh;
    overflow-y: auto;
}

/* Barre */
.gbc--bar .gbc__inner { padding: 18px 24px; }
.gbc--bar .gbc__main {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px 32px;
    flex-wrap: wrap;
}
.gbc--bar .gbc__panel { max-width: 1200px; margin: 0 auto; }

/* Encart */
.gbc--box { left: 20px; right: auto; bottom: 20px; width: min(420px, calc(100vw - 40px)); }
.gbc--box .gbc__inner { padding: 22px; border-radius: var(--gbc-radius); box-shadow: 0 6px 32px rgba(0, 0, 0, .18); }
.gbc--box .gbc__main { display: block; }
.gbc--box .gbc__actions { margin-top: 16px; }

/* Petit carré en bas au milieu */
.gbc--center {
    left: 50%;
    right: auto;
    bottom: 20px;
    width: 440px;
    transform: translate(-50%, 16px);
    text-align: center;
    font-size: 14px;
}
.gbc--center.is-visible { transform: translate(-50%, 0); }
.gbc--center.is-expanded { width: 440px; text-align: left; }

@media (max-width: 640px) {
    .gbc--center,
    .gbc--center.is-expanded {
        left: 15px;
        right: 15px;
        bottom: 15px;
        width: auto;
        transform: translateY(16px);
    }
    .gbc--center.is-visible { transform: none; }
}
.gbc--center .gbc__inner { padding: 20px; border-radius: var(--gbc-radius); border: solid 1px black; }
.gbc--center .gbc__main { display: block; }
.gbc--center .gbc__more { display: inline-block; margin: 4px 0 0; }
.gbc--center .gbc__actions { margin-top: 16px; justify-content: center; }
.gbc--center .gbc__actions .gbc__btn--primary,
.gbc--center .gbc__actions .gbc__btn--ghost { flex: 1 1 0; padding-left: 12px; padding-right: 12px; }
.gbc--center .gbc__actions .gbc__btn--link { order: 3; flex: 1 0 100%; padding-top: 4px; padding-bottom: 4px; }

.gbc__msg { margin: 0; flex: 1 1 320px; }
.gbc__more { color: inherit; text-decoration: underline; text-underline-offset: 2px; margin-left: 4px; }
.gbc__more:hover { color: var(--gbc-accent); }

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

.gbc__btn {
    appearance: none;
    font: inherit;
    font-size: 14px;
    line-height: 1.2;
    padding: 11px 20px;
    border-radius: var(--gbc-radius);
    border: 1px solid var(--gbc-accent);
    cursor: pointer;
    transition: background .2s, color .2s, opacity .2s;
    margin: 0;
    letter-spacing: normal;
    text-transform: none;
}
.gbc__btn--primary { background: var(--gbc-accent); color: var(--gbc-bg, #fff); }
.gbc__btn--primary:hover { opacity: .88; }
.gbc__btn--ghost { background: transparent; color: var(--gbc-accent); }
.gbc__btn--ghost:hover { background: var(--gbc-accent); color: var(--gbc-bg); }
.gbc__btn--link {
    background: none;
    border-color: transparent;
    color: var(--gbc-text);
    text-decoration: underline;
    text-underline-offset: 3px;
    padding-left: 6px;
    padding-right: 6px;
}
.gbc__btn--link:hover { color: var(--gbc-accent); }
.gbc__btn:focus-visible, .gbc__switch input:focus-visible + .gbc__slider { outline: 2px solid var(--gbc-accent); outline-offset: 2px; }

/* Panneau de réglages */
.gbc__panel { border-top: 1px solid var(--gbc-border); margin-top: 18px; padding-top: 8px; }
.gbc__panel[hidden] { display: none; }
.gbc__cat { padding: 12px 0; border-bottom: 1px solid var(--gbc-border); }
.gbc__cat-desc { margin: 4px 0 0 56px; font-size: 13px; color: var(--gbc-muted); }
.gbc__panel-actions { padding-top: 16px; display: flex; justify-content: flex-end; }

.gbc__switch { display: flex; align-items: center; gap: 14px; cursor: pointer; font-weight: 600; }
.gbc__switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.gbc__slider {
    position: relative;
    flex: 0 0 42px;
    height: 24px;
    border-radius: 24px;
    background: #c9cdca;
    transition: background .2s;
}
.gbc__slider::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
    transition: transform .2s;
}
.gbc__switch input:checked + .gbc__slider { background: var(--gbc-accent); }
.gbc__switch input:checked + .gbc__slider::after { transform: translateX(18px); background: var(--gbc-bg); }
.gbc__switch input:disabled + .gbc__slider { opacity: .55; cursor: not-allowed; }

/* Bouton flottant */
.gbc-reopen {
    position: fixed;
    z-index: 99998;
    left: 16px;
    bottom: 16px;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--gbc-bg);
    color: var(--gbc-accent, #2f3a33);
    box-shadow: 0 2px 12px rgba(0, 0, 0, .18);
    cursor: pointer;
    display: grid;
    place-items: center;
    opacity: .85;
    transition: opacity .2s, transform .2s;
}
.gbc-reopen:hover { opacity: 1; transform: scale(1.06); }
.gbc-reopen[hidden] { display: none; }

/* Contenus externes bloqués */
.gbc-embed { position: relative; }
.gbc-embed iframe[data-gbc-src] { display: none; }
.gbc-embed.is-allowed iframe { display: block; }
.gbc-embed__placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 220px;
    padding: 24px;
    text-align: center;
    background: #f2f3f1;
    border-radius: var(--gbc-radius, 6px);
    font-size: 14px;
}
.gbc-embed__placeholder p { margin: 0; }
.gbc-embed.is-allowed .gbc-embed__placeholder { display: none; }

@media (max-width: 640px) {
    .gbc--bar .gbc__inner { padding: 16px; }
    .gbc__actions { width: 100%; }
    .gbc__actions .gbc__btn--primary, .gbc__actions .gbc__btn--ghost { flex: 1 1 auto; }
    .gbc__actions .gbc__btn--link { order: 3; width: 100%; }
    .gbc__cat-desc { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .gbc, .gbc__slider, .gbc__slider::after { transition: none; }
}