/* Banner de cookies - Paula Avante Psicologia (usado por /assets/consent.js)
   Layout compacto (26/11/2026):
   - celular (até 600px): faixa fixa no rodapé, texto curto e 3 botões em uma linha;
   - desktop: caixa pequena no canto inferior esquerdo (máx. 420px), longe do botão
     flutuante do WhatsApp, que fica à direita.
   Não é modal: sem overlay e sem bloquear a rolagem. */

.pa-consent {
  position: fixed; left: 16px; bottom: 16px; right: auto;
  z-index: 2147483000;
  box-sizing: border-box;
  width: calc(100% - 32px); max-width: 420px;
}
.pa-consent[hidden], .pa-consent [hidden] { display: none !important; }

.pa-consent__box {
  box-sizing: border-box;
  width: 100%;
  max-height: calc(100vh - 32px); overflow-y: auto; overscroll-behavior: contain;
  background: #fffdf9; color: #2f3a36;
  border: 1px solid #e3ddd1; border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.16);
  padding: 14px 16px;
  font-family: inherit; font-size: 14px; line-height: 1.45; text-align: left;
}
.pa-consent__box:focus { outline: none; }
.pa-consent__box:focus-visible { outline: 3px solid #c97b63; outline-offset: -3px; }

.pa-consent__title {
  font-family: inherit; font-size: 15px; font-weight: 600; line-height: 1.3;
  color: #1e3d36; margin: 0 0 4px;
}
.pa-consent__text, .pa-consent__note {
  margin: 0 0 10px; color: #3d4643; font-size: 14px; line-height: 1.45;
}
.pa-consent a { color: #2c554c; text-decoration: underline; }

.pa-consent__prefs { border-top: 1px solid #ebe4d6; padding-top: 10px; margin-bottom: 10px; }
.pa-consent__note { font-size: 13px; margin-bottom: 6px; }
.pa-consent__cat {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 8px 0; border-bottom: 1px dashed #ebe4d6;
}
.pa-consent__cat:last-of-type { margin-bottom: 10px; }
.pa-consent__cat input {
  width: 20px; height: 20px; margin: 2px 0 0; padding: 0; flex: 0 0 auto;
  accent-color: #2c554c; cursor: pointer;
}
.pa-consent__cat label {
  display: block; margin: 0; cursor: pointer;
  font-size: 13px; font-weight: 400; color: #3d4643; line-height: 1.45;
}
.pa-consent__cat label strong { display: block; color: #1e3d36; font-weight: 600; }

/* Botões: os três têm exatamente o mesmo estilo (sem destaque para "Aceitar").
   A classe .pa-consent__btn também é usada fora do banner (botão da política). */
.pa-consent__btn {
  flex: 1 1 140px;
  min-height: 44px; margin: 0; padding: 10px 16px;
  background: #ffffff; color: #1e3d36;
  border: 1.5px solid #2c554c; border-radius: 10px;
  font-family: inherit; font-size: 0.95rem; font-weight: 600; line-height: 1.2;
  cursor: pointer; transform: none; box-shadow: none;
}
.pa-consent__btn:hover { background: #eef3f1; }

.pa-consent__actions { display: flex; flex-wrap: nowrap; gap: 8px; }
.pa-consent__actions .pa-consent__btn {
  flex: 1 1 0; min-width: 0;
  min-height: 44px; padding: 8px 10px;
  font-size: 14px; white-space: nowrap;
}

.pa-consent__btn:focus-visible,
.pa-consent a:focus-visible,
.pa-consent__cat input:focus-visible,
[data-consent-open]:focus-visible {
  outline: 3px solid #c97b63; outline-offset: 2px;
}

/* Enquanto o banner está aberto, o fim da página pode rolar para cima dele.
   --pa-consent-h é medido pelo consent.js (distância do topo do banner até o fim da tela). */
html.pa-consent-aberto body { padding-bottom: var(--pa-consent-h, 0px); }

/* ---------- Celular ---------- */
@media (max-width: 600px) {
  .pa-consent { left: 0; right: 0; bottom: 0; width: 100%; max-width: none; }
  .pa-consent__box {
    border-width: 1px 0 0; border-radius: 12px 12px 0 0;
    box-shadow: 0 -4px 18px rgba(0, 0, 0, 0.12);
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
    font-size: 13px; line-height: 1.4;
    max-height: 70vh; /* só passa da faixa compacta quando a pessoa abre "Preferências" */
  }
  /* Título só para leitores de tela (continua sendo o rótulo do diálogo). */
  .pa-consent__title {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
  }
  .pa-consent__text { font-size: 13px; line-height: 1.4; margin-bottom: 8px; }
  .pa-consent__actions { gap: 6px; }
  .pa-consent__actions .pa-consent__btn { font-size: 13.5px; padding: 6px 6px; border-radius: 8px; }

  /* Botão flutuante do WhatsApp sempre acima do banner.
     bottom original = 24px em /brasil (.float-whatsapp) e em / (.whatsapp-float). */
  html.pa-consent-aberto .float-whatsapp,
  html.pa-consent-aberto .whatsapp-float {
    bottom: calc(24px + var(--pa-consent-h, 0px));
  }
}

/* Telas muito estreitas: "Preferências" vira link de texto;
   "Recusar" e "Aceitar" continuam idênticos entre si. */
@media (max-width: 359px) {
  .pa-consent__actions .pa-consent__btn--prefs {
    flex: 0 0 auto; padding: 6px 4px;
    background: transparent; border-color: transparent;
    color: #2c554c; text-decoration: underline; font-weight: 600;
  }
  .pa-consent__actions .pa-consent__btn--prefs:hover { background: transparent; }
}
