/* =============================================================================
   Grupo Axia — cookies.css
   Aviso de cookies e central de preferências, compartilhados por TODAS as
   páginas.

   Anda sempre junto de assets/js/cookies.js, que é quem monta a marcação —
   não há HTML deste módulo no index.html de nenhuma página.

   O aviso é deliberadamente pequeno: título curto, uma frase, um link e dois
   botões numa linha só, mais o "X" no canto. Ocupa o canto inferior esquerdo
   no desktop e uma faixa baixa no celular, sem véu e sem travar a rolagem —
   ninguém é obrigado a responder para continuar navegando.

   Sumário
     1. Aviso (banner)          4. Categorias e interruptores
     2. Botões do aviso         5. Ajustes do celular
     3. Central de preferências 6. Movimento reduzido
   ========================================================================== */

/* ============================ 1. Aviso (banner) ==========================
   `padding-right` maior que o esquerdo: é o espaço do "X", que fica
   posicionado por cima do canto.
   ========================================================================== */
.cc-banner {
  position: fixed;
  left: 24px;
  bottom: 24px;
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: calc(100vw - 48px);
  max-width: 360px;
  padding: 18px 20px;
  border: 1px solid var(--line, #dfe6e2);
  border-radius: var(--r-lg, 16px);
  background: #fff;
  box-shadow: 0 12px 32px rgb(3 50 35 / 0.16);
  opacity: 0;
  translate: 0 16px;
  pointer-events: none;
  transition:
    opacity 0.4s ease-out,
    translate 0.4s ease-out;
}

.cc-banner.is-visible {
  opacity: 1;
  translate: 0 0;
  pointer-events: auto;
}

.cc-banner__titulo {
  /* Espaço à direita para o X não encostar no texto */
  padding-right: 28px;
  font-size: 15px;
  line-height: 22px;
  font-weight: 600;
  color: var(--brand-850, #033228);
}

.cc-banner__texto {
  font-size: 13px;
  line-height: 20px;
  font-weight: 300;
  color: var(--ink-muted, #58665f);
  text-wrap: pretty;
}

.cc-link {
  font-weight: 500;
  color: var(--brand-700, #0b6347);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 0.3s ease;
}

.cc-link:hover,
.cc-link:focus-visible {
  color: var(--brand-900, #033223);
}

/* ------------------------------- O "X" ------------------------------------
   Fecha o aviso e nada mais: não grava consentimento nenhum. Discreto em
   repouso, com área de toque de 32px e um fundo suave no hover para ficar
   fácil de acertar.
   ------------------------------------------------------------------------ */
.cc-banner__fechar {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-muted, #58665f);
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    color 0.2s ease;
}

@media (hover: hover) and (pointer: fine) {
  .cc-banner__fechar:hover {
    background: var(--icon-soft, #eef2f0);
    color: var(--brand-900, #033223);
  }
}

.cc-banner__fechar:active {
  background: var(--line, #dfe6e2);
}

/* ========================== 2. Botões do aviso ============================
   Duas ações, lado a lado e do mesmo tamanho:

     [ Gerenciar ]   [ Continuar ]

   "Gerenciar" é secundário (só contorno, fundo transparente) porque abre um
   painel; não decide nada. "Continuar" é o principal e usa o verde dos CTAs
   do site.
   ========================================================================== */
.cc-banner__acoes {
  display: flex;
  gap: 8px;
}

.cc-btn {
  flex: 1 1 0;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: var(--r-sm, 8px);
  font: inherit;
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    filter 0.2s ease;
}

/* Secundário: só stroke */
.cc-btn--secundario {
  background: transparent;
  border-color: var(--brand-700, #0b6347);
  color: var(--brand-700, #0b6347);
}

@media (hover: hover) and (pointer: fine) {
  .cc-btn--secundario:hover {
    background: var(--brand-700, #0b6347);
    color: #fff;
  }
}

.cc-btn--secundario:focus-visible {
  background: var(--brand-700, #0b6347);
  color: #fff;
}

/* Principal: o mesmo verde do .btn--primary do site */
.cc-btn--principal {
  background: var(--brand-700, #0b6347);
  border-color: var(--brand-700, #0b6347);
  color: #fff;
  box-shadow: 0 4px 5px rgb(2 40 28 / 0.15);
}

@media (hover: hover) and (pointer: fine) {
  .cc-btn--principal:hover {
    filter: brightness(1.1);
  }
}

.cc-btn--principal:active {
  filter: brightness(0.9);
}

/* Enquanto o aviso está aberto o card de suporte espera: os dois são fixos na
   base e no celular ficariam empilhados um sobre o outro. */
html[data-cc="aberto"] .support,
html[data-cc="aberto"] .axia-sup {
  opacity: 0;
  translate: 0 32px;
  pointer-events: none;
}

/* =================== 3. Central de preferências (modal) =================== */
.cc-modal {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgb(3 50 35 / 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.cc-modal.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.cc-modal__caixa {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 560px;
  max-height: 100%;
  border-radius: var(--r-lg, 16px);
  background: #fff;
  box-shadow: 0 24px 64px rgb(3 50 35 / 0.28);
  translate: 0 12px;
  transition: translate 0.3s var(--ease-out-soft, cubic-bezier(0.22, 1, 0.36, 1));
}

.cc-modal.is-visible .cc-modal__caixa {
  translate: 0 0;
}

.cc-modal__topo {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 24px 16px;
  border-bottom: 1px solid var(--line, #dfe6e2);
}

.cc-modal__titulo {
  font-size: 20px;
  line-height: 28px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--brand-850, #033228);
}

.cc-modal__desc {
  margin-top: 8px;
  font-size: 14px;
  line-height: 22px;
  font-weight: 300;
  color: var(--ink-muted, #58665f);
  text-wrap: pretty;
}

.cc-modal__fechar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--icon-soft, #eef2f0);
  color: var(--ink, #1a211d);
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    color 0.2s ease;
}

@media (hover: hover) and (pointer: fine) {
  .cc-modal__fechar:hover {
    background: var(--brand-900, #033223);
    color: #fff;
  }
}

/* A lista rola sozinha: em telas baixas o modal inteiro não caberia, e a
   barra de botões precisa continuar visível. */
.cc-modal__corpo {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 8px 24px;
}

.cc-modal__rodape {
  display: flex;
  gap: 8px;
  padding: 16px 24px 24px;
  border-top: 1px solid var(--line, #dfe6e2);
}

/* ==================== 4. Categorias e interruptores ======================= */
.cc-cat {
  padding: 20px 0;
  border-bottom: 1px solid var(--line, #dfe6e2);
}

.cc-cat:last-child {
  border-bottom: 0;
}

.cc-cat__topo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.cc-cat__nome {
  font-size: 15px;
  line-height: 24px;
  font-weight: 600;
  color: var(--ink, #1a211d);
}

.cc-cat__texto {
  margin-top: 8px;
  font-size: 13px;
  line-height: 21px;
  font-weight: 300;
  color: var(--ink-muted, #58665f);
  text-wrap: pretty;
}

/* Categoria sem nenhuma ferramenta em uso hoje. O selo existe para não dar a
   entender que há rastreamento onde não há. */
.cc-cat__selo {
  display: inline-block;
  margin-top: 8px;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--icon-soft, #eef2f0);
  font-size: 12px;
  line-height: 20px;
  font-weight: 500;
  color: var(--ink-muted, #58665f);
}

.cc-cat__fixo {
  flex: 0 0 auto;
  font-size: 13px;
  line-height: 20px;
  font-weight: 500;
  color: var(--brand-700, #0b6347);
}

/* -------------------------- Interruptor ---------------------------------- */
.cc-switch {
  position: relative;
  flex: 0 0 auto;
  width: 48px;
  height: 28px;
}

/* O <input> continua sendo o controle de verdade: recebe foco, responde ao
   teclado e é o que o leitor de tela anuncia. Ele fica por cima do desenho,
   transparente, em vez de escondido — assim o clique cai nele mesmo. */
.cc-switch input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.cc-switch__trilho {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 999px;
  background: #c7d1cb;
  transition: background-color 0.2s ease;
  pointer-events: none;
}

.cc-switch__trilho::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 1px 3px rgb(3 50 35 / 0.3);
  transition: translate 0.2s var(--ease-out-soft, cubic-bezier(0.22, 1, 0.36, 1));
}

.cc-switch input:checked + .cc-switch__trilho {
  background: var(--brand-700, #0b6347);
}

.cc-switch input:checked + .cc-switch__trilho::after {
  translate: 20px 0;
}

.cc-switch input:focus-visible + .cc-switch__trilho {
  outline: 2px solid var(--brand-200, #a0e493);
  outline-offset: 3px;
}

/* ======================= 5. Ajustes do celular ============================ */
@media (max-width: 639px) {
  /* Faixa encostada na base, não um cartão flutuando: ocupa menos altura e
     não cobre o conteúdo do meio da tela. Os cantos de baixo somem porque
     encostam na borda. */
  .cc-banner {
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: none;
    padding: 16px 18px;
    border-inline: 0;
    border-bottom: 0;
    border-radius: var(--r-lg, 16px) var(--r-lg, 16px) 0 0;
  }

  /* Os dois botões continuam lado a lado: com dois rótulos curtos eles cabem
     em qualquer largura, e empilhar faria a faixa dobrar de altura. */
  .cc-banner__acoes {
    gap: 10px;
  }

  .cc-modal {
    padding: 0;
    align-items: flex-end;
  }

  .cc-modal__caixa {
    max-height: 92vh;
    border-radius: var(--r-lg, 16px) var(--r-lg, 16px) 0 0;
  }

  .cc-modal__rodape {
    flex-direction: column;
  }
}

/* ------------------- Botão "Gerenciar cookies" do rodapé ------------------
   É um <button> porque abre um painel, não navega para lugar nenhum — mas
   precisa parecer e se comportar como os links ao lado dele. Estas regras
   ficam aqui, e não no footer.css, porque pertencem a este módulo.
   ------------------------------------------------------------------------ */
.cc-reabrir {
  font: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  color: inherit;
  text-align: left;
}

/* No rodapé, o mesmo tom e a mesma transição dos links vizinhos */
.footer__col .cc-reabrir {
  display: inline-block;
  opacity: 0.75;
  transition:
    opacity 0.3s ease,
    color 0.3s ease;
}

@media (hover: hover) and (pointer: fine) {
  .footer__col .cc-reabrir:hover {
    opacity: 1;
    color: var(--brand-200, #a0e493);
  }
}

.footer__col .cc-reabrir:focus-visible {
  opacity: 1;
  color: var(--brand-200, #a0e493);
}

/* No corpo da política ele aparece no meio de um parágrafo: ali segue o
   sublinhado dos links do documento, senão pareceria texto solto. */
.doc .cc-reabrir {
  color: var(--brand-700, #0b6347);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 0.2s ease;
}

.doc .cc-reabrir:hover,
.doc .cc-reabrir:focus-visible {
  color: var(--brand-900, #033223);
}

/* ======================= 6. Movimento reduzido ============================ */
@media (prefers-reduced-motion: reduce) {
  .cc-banner,
  .cc-modal,
  .cc-modal__caixa,
  .cc-switch__trilho::after {
    transition-duration: 0.01ms !important;
  }
}
