/* ============================================================
   M85 — Consentimento de cookies (LGPD). Banner + modal de
   preferências. Visual no design system; sóbrio e acessível.
   ============================================================ */

/* Enquanto o consentimento está pendente, não competir com o CTA fixo. */
html.cc-pending .sticky-cta { display: none !important; }

/* ---------- Banner ---------- */
.cc-banner {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
  background: rgba(21,17,15,.97);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid rgba(236,230,220,.14);
  box-shadow: 0 -10px 34px rgba(0,0,0,.4);
  transform: translateY(110%);
  transition: transform .45s var(--ease-out-expo);
}
.cc-banner.is-in { transform: none; }
.cc-banner-in {
  max-width: 1180px; margin: 0 auto; padding: 22px 24px;
  display: flex; flex-direction: column; gap: 18px;
}
.cc-banner-text { font-family: var(--font-body); font-size: 14px; line-height: 1.55; color: rgba(236,230,220,.82); margin: 0; max-width: 760px; }
.cc-banner-text strong { color: var(--m85-paper); font-weight: 600; }
.cc-banner-text a { color: var(--m85-paper); text-decoration: underline; text-underline-offset: 2px; }
.cc-banner-text a:hover { color: var(--m85-red-bright); }
.cc-actions { display: flex; flex-direction: column; gap: 10px; }

/* ---------- Botões do consentimento ---------- */
.cc-btn {
  font-family: var(--font-display); font-weight: 600; font-size: 14px; letter-spacing: -.01em;
  border: 1px solid transparent; border-radius: var(--radius-sm); padding: 12px 20px;
  cursor: pointer; white-space: nowrap; text-align: center;
  transition: background var(--dur-state), color var(--dur-state),
              border-color var(--dur-state), transform var(--dur-press) var(--ease-out-quart);
}
.cc-btn:active { transform: translateY(1px) scale(.99); }
.cc-btn-red { background: var(--m85-red); color: var(--m85-paper); }
.cc-btn-red:hover { background: var(--m85-red-deep); }
.cc-btn-ghost { background: transparent; color: var(--m85-paper); border-color: rgba(236,230,220,.3); }
.cc-btn-ghost:hover { background: rgba(236,230,220,.08); }
.cc-btn-text { background: transparent; color: rgba(236,230,220,.82); }
.cc-btn-text:hover { color: var(--m85-paper); }

/* ---------- Modal de preferências (dialog nativo) ---------- */
.cc-dialog {
  width: min(560px, calc(100vw - 32px)); max-height: min(86vh, 720px);
  padding: 0; border: 1px solid rgba(236,230,220,.16); border-radius: var(--radius-lg);
  background: var(--m85-ink); color: var(--m85-paper);
  box-shadow: var(--shadow-raised);
}
.cc-dialog::backdrop { background: rgba(10,8,7,.66); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.cc-dialog[open] { animation: cc-pop .28s var(--ease-out-quart) both; }
@keyframes cc-pop { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
.cc-dialog-in { display: flex; flex-direction: column; max-height: inherit; }
.cc-dialog-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  padding: 26px 26px 16px; border-bottom: 1px solid rgba(236,230,220,.12);
}
.cc-dialog-head h2 { font-family: var(--font-display); font-weight: 700; font-size: 22px; letter-spacing: -.02em; margin: 0; color: var(--m85-paper); }
.cc-dialog-head p { font-family: var(--font-body); font-size: 13.5px; line-height: 1.5; color: rgba(236,230,220,.66); margin: 8px 0 0; }
.cc-close {
  flex-shrink: 0; width: 34px; height: 34px; line-height: 1; font-size: 20px;
  background: transparent; color: rgba(236,230,220,.7); border: 1px solid rgba(236,230,220,.2);
  border-radius: var(--radius-sm); cursor: pointer; transition: color var(--dur-state), border-color var(--dur-state);
}
.cc-close:hover { color: var(--m85-paper); border-color: rgba(236,230,220,.4); }
.cc-cats { padding: 8px 26px; overflow-y: auto; }
.cc-cat { display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; align-items: start; padding: 18px 0; border-bottom: 1px solid rgba(236,230,220,.1); }
.cc-cat:last-child { border-bottom: none; }
.cc-cat-t { font-family: var(--font-display); font-weight: 600; font-size: 15.5px; color: var(--m85-paper); margin: 0; }
.cc-cat-d { font-family: var(--font-body); font-size: 13px; line-height: 1.5; color: rgba(236,230,220,.62); margin: 5px 0 0; grid-column: 1 / 2; }
.cc-fixed { font-family: var(--font-mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--m85-grey); align-self: center; }

/* Switch acessível */
.cc-switch { position: relative; width: 44px; height: 26px; flex-shrink: 0; }
.cc-switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.cc-track { position: absolute; inset: 0; background: rgba(236,230,220,.2); border-radius: var(--radius-pill); transition: background var(--dur-state); }
.cc-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--m85-paper); transition: transform var(--dur-state) var(--ease-out-quart); }
.cc-switch input:checked + .cc-track { background: var(--m85-red); }
.cc-switch input:checked + .cc-track::after { transform: translateX(18px); }
.cc-switch input:focus-visible + .cc-track { outline: 2px solid var(--m85-red-bright); outline-offset: 2px; }
.cc-dialog-foot { display: flex; flex-direction: column; gap: 10px; padding: 18px 26px 24px; border-top: 1px solid rgba(236,230,220,.12); }

/* ---------- Desktop ---------- */
@media (min-width: 720px) {
  .cc-banner-in { flex-direction: row; align-items: center; justify-content: space-between; gap: 28px; padding: 20px 48px; }
  .cc-actions { flex-direction: row; align-items: center; flex-shrink: 0; }
  .cc-dialog-foot { flex-direction: row; justify-content: flex-end; }
  .cc-dialog-foot .cc-btn { min-width: 150px; }
}

/* ---------- Motion reduzido ---------- */
@media (prefers-reduced-motion: reduce) {
  .cc-banner { transition: none; }
  .cc-dialog[open] { animation: none; }
}
