/*
  Estilos do banner de cookies (montado por /js/consentimento.js) e do link
  "Preferências de cookies" do rodapé. Compartilhado por todas as páginas.
  Depende das variáveis --bg, --text, --text-soft, --border e --giles-blue da página.
*/

/* O atributo hidden precisa vencer os display: grid/flex do banner */
.cookie-banner[hidden],
.cookie-banner [hidden] { display: none !important; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---- banner de cookies ---- */
.cookie-banner {
  position: fixed;
  z-index: 50;
  left: 16px; bottom: 16px;
  width: min(440px, calc(100% - 32px));
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 16px 40px -12px rgba(4,10,26,0.35);
  font-family: 'Inter', system-ui, sans-serif;
}
.cookie-inner { padding: 18px 20px; }
.cookie-titulo { font-size: 16px; font-weight: 700; margin: 0 0 6px; outline: none; }
.cookie-texto { font-size: 13.5px; line-height: 1.5; color: var(--text-soft); margin: 0 0 14px; }
.cookie-texto a { color: var(--giles-blue); }
.cookie-opcoes { border: none; margin: 0 0 14px; padding: 0; display: grid; gap: 10px; }
.cookie-opcao { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; cursor: pointer; }
.cookie-opcao input { margin-top: 3px; width: 18px; height: 18px; flex-shrink: 0; accent-color: var(--giles-blue); }
.cookie-opcao small { display: block; color: var(--text-soft); font-size: 12.5px; line-height: 1.4; }
.cookie-acoes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
/* Aceitar e Recusar: mesma classe, mesmo tamanho, mesmo peso visual */
.cookie-btn {
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1.5px solid var(--text);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.cookie-link {
  grid-column: 1 / -1;
  justify-self: center;
  min-height: 36px;
  background: none; border: none;
  color: var(--text-soft);
  font: inherit; font-size: 13.5px;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

/* Botão com cara de link (reabre o banner de cookies a partir do rodapé) */
.link-botao {
  background: none; border: none; padding: 0;
  font: inherit; cursor: pointer;
  color: var(--text-soft);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.link-botao:hover { color: var(--text); }

.cookie-btn:focus-visible, .cookie-link:focus-visible, .link-botao:focus-visible,
.cookie-titulo:focus-visible { outline: 2px solid var(--giles-blue); outline-offset: 2px; }

@media (max-width: 860px) {
  /* Mobile: fixo no rodapé, até ~30% da tela, sem overlay — a página continua rolando */
  .cookie-banner {
    left: 0; right: 0; bottom: 0;
    width: auto;
    max-height: 30vh;
    max-height: 30dvh;
    border-radius: 16px 16px 0 0;
    border-bottom: none;
  }
  .cookie-inner { padding: 14px 16px calc(14px + env(safe-area-inset-bottom)); }
  .cookie-titulo { font-size: 15px; margin-bottom: 4px; }
  .cookie-texto { font-size: 13px; margin-bottom: 10px; }
  /* Personalizar na mesma linha dos botões para caber nos ~30% da tela */
  .cookie-acoes { grid-template-columns: 1fr 1fr auto; }
  .cookie-link { grid-column: auto; min-height: 44px; }

  /* Banner aberto → some o CTA fixo (Home) e o WhatsApp flutuante (todas as páginas) */
  body.cookies-aberto .wa-fab,
  body.cookies-aberto .cta-fixo { display: none !important; }
}
