/* Bannière cookies (commune aux templates, reprend leurs couleurs) */
.grc, .grc-panel {
  --gc-a: var(--c1, var(--primary, #35b0cf));
  --gc-b: var(--c4, var(--navy, #1f4aa0));
  --gc-ink: var(--ink, #0b0d12);
  --gc-muted: var(--muted, var(--text, #5b6474));
  --gc-line: var(--line, #e7e9ee);
  --gc-r: clamp(10px, var(--radius, 18px), 22px);
  font-family: var(--font, Inter, system-ui, sans-serif); color: var(--gc-ink);
}
.grc[hidden], .grc-panel[hidden] { display: none; }
html.grc-lock { overflow: hidden; }

/* Bannière */
.grc { position: fixed; z-index: 9500; opacity: 0; transform: translateY(16px); transition: opacity .3s ease, transform .35s cubic-bezier(.2, .7, .2, 1); }
.grc.is-open { opacity: 1; transform: none; }
.grc__inner { background: #fff; border-radius: var(--gc-r); box-shadow: 0 24px 60px -18px rgba(8, 17, 31, .4), 0 0 0 1px rgba(8, 17, 31, .05); position: relative; overflow: hidden; }
.grc__inner::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: linear-gradient(90deg, var(--gc-a), var(--gc-b)); }
.grc--bar { left: 16px; right: 16px; bottom: 16px; }
.grc--bar .grc__inner { max-width: 1180px; margin: 0 auto; display: flex; align-items: center; gap: 28px; padding: 20px 24px; }
.grc--box { left: 20px; bottom: 20px; width: min(420px, calc(100vw - 32px)); }
.grc--box .grc__inner { padding: 22px 22px 18px; }
.grc__title { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-weight: 700; font-size: 16px; color: var(--gc-ink); }
.grc__title .i { width: 20px; height: 20px; color: var(--gc-b); flex: none; }
.grc__txt { flex: 1; min-width: 0; }
.grc__txt p { margin: 0; font-size: 14px; line-height: 1.55; color: var(--gc-muted); }
.grc__txt p.grc__title { color: var(--gc-ink); margin-bottom: 6px; }
.grc__txt a, .grc-panel a { color: var(--gc-b); text-decoration: underline; text-underline-offset: 2px; }
.grc__btns { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; flex: none; }
.grc--box .grc__btns { margin-top: 16px; }
.grc--box .grc__btn { flex: 1 1 0; }

/* Boutons : « Tout refuser » et « Tout accepter » ont le même poids visuel (exigence CNIL) */
.grc__btn {
  min-height: 44px; padding: 10px 20px; border-radius: 999px; border: 0; cursor: pointer; font: inherit; font-weight: 600; font-size: 14.5px;
  color: #fff; background: var(--gc-ink); transition: transform .2s, opacity .2s;
}
.grc__btn:hover { transform: translateY(-1px); opacity: .92; }
.grc__btn--ghost { color: var(--gc-ink); background: #fff; box-shadow: inset 0 0 0 1.5px var(--gc-line); }
.grc__btn--ghost:hover { box-shadow: inset 0 0 0 1.5px var(--gc-ink); opacity: 1; }
.grc__link { background: none; border: 0; padding: 8px 4px; cursor: pointer; font: inherit; font-size: 14px; font-weight: 600; color: var(--gc-ink); text-decoration: underline; text-underline-offset: 3px; }
.grc--box .grc__link { flex-basis: 100%; }

/* Panneau de préférences */
.grc-panel { position: fixed; inset: 0; z-index: 9600; display: grid; place-items: center; padding: 16px; }
.grc-panel__backdrop { position: absolute; inset: 0; background: rgba(8, 17, 31, .55); backdrop-filter: blur(3px); opacity: 0; transition: opacity .25s; }
.grc-panel.is-open .grc-panel__backdrop { opacity: 1; }
.grc-panel__box {
  position: relative; width: min(560px, 100%); max-height: calc(100dvh - 32px); overflow: auto; overscroll-behavior: contain; background: #fff;
  border-radius: var(--gc-r); padding: 30px 28px 24px; box-shadow: 0 30px 80px -20px rgba(8, 17, 31, .45);
  opacity: 0; transform: translateY(14px) scale(.98); transition: opacity .25s, transform .3s cubic-bezier(.2, .7, .2, 1);
}
.grc-panel.is-open .grc-panel__box { opacity: 1; transform: none; }
.grc-panel__x { position: absolute; top: 12px; right: 12px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--soft, #f4f6fa); cursor: pointer; display: grid; place-items: center; color: var(--gc-ink); }
.grc-panel__x .i { width: 17px; height: 17px; }
.grc-panel h2 { margin: 0 40px 8px 0; font-family: var(--font-head, inherit); font-size: 22px; letter-spacing: -.01em; color: var(--gc-ink); }
.grc-panel__intro { margin: 0 0 16px; font-size: 14px; color: var(--gc-muted); }
.grc-cat { border: 1px solid var(--gc-line); border-radius: calc(var(--gc-r) * .7); padding: 14px 16px; margin-bottom: 10px; }
.grc-cat__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; cursor: pointer; }
.grc-cat__head strong { font-size: 15px; }
.grc-cat p { margin: 6px 0 0; font-size: 13.5px; line-height: 1.5; color: var(--gc-muted); }
.grc-cat__always { font-size: 12.5px; font-weight: 600; color: var(--gc-b); white-space: nowrap; }
.grc-switch { position: relative; flex: none; width: 46px; height: 26px; }
.grc-switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.grc-switch span { position: absolute; inset: 0; border-radius: 999px; background: #cfd5df; transition: background .2s; }
.grc-switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .2s; }
.grc-switch input:checked + span { background: linear-gradient(90deg, var(--gc-a), var(--gc-b)); }
.grc-switch input:checked + span::after { transform: translateX(20px); }
.grc-switch input:focus-visible + span { outline: 2px solid var(--gc-b); outline-offset: 2px; }
.grc-panel__btns { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.grc-panel__btns .grc__btn { flex: 1 1 auto; }

/* Encart à la place d'un contenu externe bloqué */
.gr-consent-ph {
  display: grid; justify-items: center; gap: 12px; padding: 28px 20px; text-align: center; border: 1px dashed var(--line, #d9dde5);
  border-radius: var(--radius, 16px); background: var(--soft, #f4f6fa); color: var(--muted, var(--text, #5b6474)); font-size: 14.5px;
}
.gr-consent-ph p { margin: 0; max-width: 520px; }
.gr-consent-ph button {
  min-height: 42px; padding: 9px 20px; border-radius: 999px; border: 0; cursor: pointer; font: inherit; font-weight: 600; color: #fff;
  background: var(--ink, #0b0d12);
}

/* Lien « Gestion des cookies » dans les pieds de page */
button.consent-link { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; }
button.consent-link:hover { text-decoration: underline; }

@media (max-width: 860px) {
  .grc--bar .grc__inner { flex-direction: column; align-items: stretch; gap: 14px; padding: 20px 18px 16px; }
  .grc--bar .grc__btns .grc__btn { flex: 1 1 0; }
  .grc--bar .grc__link { flex-basis: 100%; }
}
@media (max-width: 480px) {
  .grc--bar { left: 10px; right: 10px; bottom: 10px; }
  .grc--box { left: 10px; bottom: 10px; width: auto; right: 10px; }
  .grc-panel__box { padding: 26px 18px 18px; }
}
@media (prefers-reduced-motion: reduce) { .grc, .grc-panel__box, .grc-panel__backdrop { transition: none; } }
