/*
  Aviso de cookies + modal de preferências — visual v5 (global/cookie-consent.njk).
  Paper: "S27 Cookies · aviso (1ª visita)" e "S27b Cookies · preferências".
  Todas as cores e fontes têm fallback: o componente também aparece em página
  sem o site-v5.css (chromeLegacy), onde os tokens não existem.
*/
.rcc,
.rcc-modal {
  --rcc-ink: var(--color-ink, #09090B);
  --rcc-amber: var(--color-amber, #F7B731);
  --rcc-amber-700: var(--color-amber-700, #8A5A00);
  --rcc-teal: var(--color-teal, #1BAFBF);
  --rcc-line: var(--color-hairline, #E2E8F0);
  --rcc-ok: var(--color-success-700, #047857);
  --rcc-muted: var(--dk-muted, #A1A1AA);
  --rcc-display: var(--font-display, "Plus Jakarta Sans", system-ui, sans-serif);
  --rcc-body: var(--font-body, "Inter", system-ui, sans-serif);
  --rcc-mono: var(--font-mono, "JetBrains Mono", ui-monospace, monospace);
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
}
.rcc *,
.rcc-modal * { box-sizing: border-box; }
.rcc[hidden],
.rcc-modal[hidden] { display: none !important; }
.rcc p,
.rcc h2,
.rcc-modal p,
.rcc-modal h2 { margin: 0; }

/* ---------- Aviso (barra flutuante embaixo) ---------- */
.rcc {
  position: fixed;
  z-index: 10050;
  left: 0;
  right: 0;
  bottom: 32px;
  padding-inline: 16px;
  pointer-events: none;
}
.rcc__bar {
  display: flex;
  align-items: center;
  gap: 32px;
  max-width: 1200px;
  margin-inline: auto;
  padding: 24px 28px;
  border: 2px solid var(--rcc-ink);
  border-radius: 20px;
  background: var(--rcc-ink);
  box-shadow: var(--rcc-amber) 8px 8px 0;
  pointer-events: auto;
  animation: rcc-sobe .35s cubic-bezier(.22, 1, .36, 1);
}
@keyframes rcc-sobe {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: none; }
}
.rcc__ico {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  border-radius: 999px;
  background: var(--rcc-amber);
}
.rcc__txt { display: flex; flex: 1 1 0; flex-direction: column; gap: 4px; min-width: 0; }
.rcc__title {
  font-family: var(--rcc-display);
  font-size: 20px;
  font-weight: 800;
  line-height: 24px;
  letter-spacing: normal;
  color: #fff;
}
.rcc__desc {
  font-family: var(--rcc-body);
  font-size: 15px;
  line-height: 22px;
  color: var(--rcc-muted);
}
.rcc__desc a {
  color: #fff;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  white-space: nowrap;
}
.rcc__actions { display: flex; flex-shrink: 0; gap: 10px; }

.rcc__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 13px 18px;
  border: 2px solid #FAFAFA;
  border-radius: 12px;
  background: transparent;
  font-family: var(--rcc-display);
  font-size: 15px;
  font-weight: 700;
  line-height: 20px;
  color: #fff;
  white-space: nowrap;
  cursor: pointer;
  transition: transform .15s ease, background-color .15s ease, box-shadow .15s ease;
}
.rcc__btn:hover { transform: translateY(-2px); }
.rcc__btn:active { transform: translate(1px, 1px); }
.rcc__btn:focus-visible { outline: 3px solid var(--rcc-teal); outline-offset: 2px; }
.rcc__btn--line:hover { background: rgba(255, 255, 255, .08); }
.rcc__btn--amber {
  padding-inline: 20px;
  border-color: var(--rcc-amber);
  background: var(--rcc-amber);
  font-weight: 800;
  color: var(--rcc-ink);
}
.rcc__btn--ink-line { border-color: var(--rcc-ink); color: var(--rcc-ink); }
.rcc__btn--ink-line:hover { background: #F4F4F5; }
.rcc__btn--shadow { border-color: var(--rcc-ink); box-shadow: var(--rcc-ink) 3px 3px 0; }

/* ---------- Modal de preferências ---------- */
.rcc-modal {
  position: fixed;
  z-index: 10060;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(9, 9, 11, .55);
  overflow-y: auto;
  animation: rcc-fundo .2s ease;
}
@keyframes rcc-fundo { from { opacity: 0; } to { opacity: 1; } }
.rcc-modal__box {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 600px;
  max-width: 100%;
  margin: auto;
  padding: 32px;
  border: 2px solid var(--rcc-ink);
  border-radius: 24px;
  background: #fff;
  box-shadow: var(--rcc-amber) 10px 10px 0;
  outline: none;
  animation: rcc-sobe .3s cubic-bezier(.22, 1, .36, 1);
}
.rcc-modal__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.rcc-modal__head > div { display: flex; flex-direction: column; gap: 6px; }
.rcc-modal__kicker {
  font-family: var(--rcc-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  line-height: 16px;
  text-transform: uppercase;
  color: var(--rcc-amber-700);
}
.rcc-modal__title {
  font-family: var(--rcc-display);
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 36px;
  color: var(--rcc-ink);
}
.rcc-modal__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  padding: 0;
  border: 2px solid var(--rcc-ink);
  border-radius: 999px;
  background: #fff;
  color: var(--rcc-ink);
  cursor: pointer;
}
.rcc-modal__close:focus-visible { outline: 3px solid var(--rcc-teal); outline-offset: 2px; }
.rcc-modal__rows { display: flex; flex-direction: column; border-top: 1.5px solid var(--rcc-line); }
.rcc-modal__row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-block: 16px;
  border-bottom: 1.5px solid var(--rcc-line);
}
.rcc-modal__row:last-child { border-bottom: 0; }
.rcc-modal__row-txt { display: flex; flex: 1 1 0; flex-direction: column; gap: 4px; min-width: 0; }
.rcc-modal__row-title {
  font-family: var(--rcc-display);
  font-size: 17px;
  font-weight: 800;
  line-height: 22px;
  color: var(--rcc-ink);
}
.rcc-modal__row-desc {
  font-family: var(--rcc-body);
  font-size: 14px;
  line-height: 20px;
  color: #52525B;
}
.rcc-modal__always {
  flex-shrink: 0;
  font-family: var(--rcc-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  line-height: 14px;
  text-transform: uppercase;
  color: var(--rcc-ok);
}
.rcc-modal__foot { display: flex; justify-content: flex-end; gap: 10px; }

/* Interruptor: botão role=switch (aria-checked é o estado). */
.rcc-switch {
  display: flex;
  align-items: center;
  width: 48px;
  height: 28px;
  flex-shrink: 0;
  margin: 0;
  padding: 2px;
  border: 2px solid var(--rcc-ink);
  border-radius: 999px;
  background: var(--rcc-line);
  cursor: pointer;
  transition: background-color .2s ease;
}
.rcc-switch span {
  width: 20px;
  height: 20px;
  border: 2px solid var(--rcc-ink);
  border-radius: 999px;
  background: #fff;
  transition: transform .2s cubic-bezier(.3, 1.6, .5, 1);
}
.rcc-switch[aria-checked="true"] { background: var(--rcc-teal); }
.rcc-switch[aria-checked="true"] span { transform: translateX(20px); }
.rcc-switch:focus-visible { outline: 3px solid var(--rcc-teal); outline-offset: 2px; }

/* Rolagem da página travada enquanto o modal está aberto. */
html.rcc-travado { overflow: hidden; }

/* ---------- Telas médias: botões descem para baixo do texto ---------- */
@media (max-width: 1099.98px) {
  .rcc__bar { flex-wrap: wrap; gap: 16px 24px; }
  .rcc__txt { flex-basis: calc(100% - 80px); }
  .rcc__actions { width: 100%; justify-content: flex-end; }
}

/* ---------- Celular ---------- */
@media (max-width: 899.98px) {
  .rcc { bottom: 12px; padding-inline: 12px; }
  .rcc__bar {
    gap: 14px;
    padding: 18px 16px 16px;
    border-radius: 18px;
    box-shadow: var(--rcc-amber) 5px 5px 0;
  }
  .rcc__ico { width: 40px; height: 40px; }
  .rcc__ico svg { width: 22px; height: 22px; }
  .rcc__txt { flex-basis: calc(100% - 54px); }
  .rcc__title { font-size: 17px; line-height: 21px; }
  .rcc__desc { font-size: 13.5px; line-height: 19px; }
  /* "Aceitar todos" em cima, com largura total; os outros dois dividem a linha. */
  .rcc__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .rcc__actions .rcc__btn--amber { grid-column: 1 / -1; grid-row: 1; }
  .rcc__btn { min-height: 46px; padding: 10px 12px; font-size: 14px; }

  .rcc-modal { align-items: flex-end; padding: 0; }
  .rcc-modal__box {
    width: 100%;
    margin: 0;
    padding: 24px 18px calc(18px + env(safe-area-inset-bottom));
    gap: 14px;
    border-radius: 22px 22px 0 0;
    border-bottom: 0;
    box-shadow: none;
    max-height: 92vh;
    overflow-y: auto;
  }
  .rcc-modal__title { font-size: 26px; line-height: 30px; }
  .rcc-modal__row { padding-block: 14px; }
  .rcc-modal__foot { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .rcc-modal__foot .rcc__btn { min-height: 48px; padding-inline: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .rcc__bar,
  .rcc-modal,
  .rcc-modal__box { animation: none; }
  .rcc__btn,
  .rcc-switch,
  .rcc-switch span { transition: none; }
}

@media print {
  .rcc,
  .rcc-modal { display: none !important; }
}
