/* ==========================================================================
   Componentes reutilizáveis: cabeçalho flutuante, navegação, botões,
   links, badges, listas e cabeçalhos de seção
   ========================================================================== */

/* ---------- Cabeçalho flutuante ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  padding: 0.75rem var(--gutter) 0;
  pointer-events: none; /* só a barra recebe cliques */
}

/* Estados da barra controlados por variáveis:
   topo da página → branca quase sólida
   .is-scrolled   → vidro fosco translúcido
   .is-on-dark    → vidro escuro com texto e logo brancos (sobre seções escuras) */
.site-header {
  --header-bg: rgb(255 255 255 / 0.88);
  --header-border: rgb(29 106 157 / 0.12);
  --header-shadow: var(--shadow-sm);
  --header-blur: 12px;
  --header-text: var(--text);
  --header-hover: var(--blue-soft);
  --header-chip: var(--blue-soft);
}
.site-header.is-scrolled {
  --header-bg: rgb(255 255 255 / 0.38);
  --header-border: rgb(255 255 255 / 0.6);
  --header-shadow: 0 8px 32px -12px rgb(11 42 64 / 0.25);
  --header-blur: 18px;
  --header-hover: rgb(255 255 255 / 0.55);
  --header-chip: rgb(255 255 255 / 0.6);
}
/* Vidro escuro: sobre seções escuras ou em todo o modo escuro */
.site-header.is-scrolled.is-on-dark,
[data-theme="dark"] .site-header {
  --header-bg: rgb(11 42 64 / 0.35);
  --header-border: rgb(255 255 255 / 0.14);
  --header-shadow: 0 8px 32px -12px rgb(0 0 0 / 0.45);
  --header-text: #fff;
  --header-hover: rgb(255 255 255 / 0.12);
  --header-chip: rgb(255 255 255 / 0.12);
  --color-focus: var(--pcj-green-vibrant);
}
[data-theme="dark"] .site-header:not(.is-scrolled) { --header-bg: rgb(14 28 39 / 0.88); }

.site-header__bar {
  pointer-events: auto;
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
  max-width: var(--container);
  height: 3.75rem;
  margin-inline: auto;
  padding: 0 0.5rem 0 1.25rem;
  border-radius: var(--radius-pill);
}
/* O vidro fica num pseudo-elemento: backdrop-filter na própria barra
   prenderia o menu mobile (position: fixed) dentro dela. */
.site-header__bar::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: var(--header-bg);
  border: 1px solid var(--header-border);
  box-shadow: var(--header-shadow);
  -webkit-backdrop-filter: saturate(180%) blur(var(--header-blur));
  backdrop-filter: saturate(180%) blur(var(--header-blur));
  transition: background-color 0.35s, border-color 0.35s, box-shadow 0.35s;
}

.site-header__brand { position: relative; display: block; flex: none; border-radius: 8px; }
.site-header__brand img { width: auto; height: 2.25rem; transition: opacity 0.35s; }
.site-header__logo--white { position: absolute; inset: 0; opacity: 0; }
.site-header.is-scrolled.is-on-dark .site-header__logo--white,
[data-theme="dark"] .site-header__logo--white { opacity: 1; }
.site-header.is-scrolled.is-on-dark .site-header__logo--color,
[data-theme="dark"] .site-header__logo--color { opacity: 0; }

/* ---------- Botão de tema (claro/escuro) ---------- */
.theme-toggle {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 2.75rem;
  height: 2.75rem;
  margin-left: auto;
  border: 0;
  border-radius: 50%;
  background: var(--header-chip);
  color: var(--header-text);
  transition: background-color 0.2s, color 0.2s, transform 0.3s var(--ease);
}
.theme-toggle:hover { transform: rotate(-15deg); }
.theme-toggle .icon { width: 1.25rem; height: 1.25rem; }
/* Mostra a lua no modo claro (ação: escurecer) e o sol no escuro */
.theme-toggle__sun { display: none; }
[data-theme="dark"] .theme-toggle__sun { display: block; }
[data-theme="dark"] .theme-toggle__moon { display: none; }
/* O botão só funciona com JS: sem ele, fica oculto */
html:not(.js) .theme-toggle { display: none; }

/* ---------- Navegação ---------- */
.site-nav__list {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav__list a {
  display: inline-block;
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-pill);
  color: var(--text);
  font-weight: 600;
  font-size: 0.9375rem;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.2s, color 0.2s;
}
.site-nav__list a:hover { background: var(--blue-soft); color: var(--accent-text); }
.site-nav__list a[aria-current="true"] { background: var(--blue-soft); color: var(--accent-text); }

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 0;
  border-radius: 50%;
  background: var(--header-chip);
  color: var(--accent-text);
}
.site-header.is-scrolled.is-on-dark .nav-toggle,
[data-theme="dark"] .nav-toggle { color: #fff; }
.nav-toggle .icon { width: 1.35rem; height: 1.35rem; }
.nav-toggle__close { display: none; }
.nav-toggle[aria-expanded="true"] .nav-toggle__open { display: none; }
.nav-toggle[aria-expanded="true"] .nav-toggle__close { display: block; }

@media (min-width: 72.0625em) {
  /* Ordem visual: logo · menu · botão de tema */
  .site-nav { order: 1; display: flex; align-items: center; gap: var(--space-4); margin-left: auto; }
  .theme-toggle { order: 2; margin-left: 0; }
  .site-nav__list a { color: var(--header-text); }
  .site-nav__list a:hover,
  .site-nav__list a[aria-current="true"] { background: var(--header-hover); color: var(--header-text); }
  .site-header.is-on-dark.is-scrolled .site-nav__cta,
  [data-theme="dark"] .site-nav__cta { background: var(--pcj-green-vibrant); color: var(--ink); }
}
/* Telas médias: links mais compactos para os 6 itens caberem numa linha */
@media (min-width: 72.0625em) and (max-width: 80em) {
  .site-nav { gap: var(--space-3); }
  .site-nav__list { gap: 0.1rem; }
  .site-nav__list a { padding-inline: 0.5rem; }
}

@media (max-width: 72em) {
  .site-header__bar { padding-right: 0.5rem; gap: var(--space-2); }
  .nav-toggle { display: inline-flex; }

  .site-nav {
    pointer-events: auto;
    position: fixed;
    top: calc(var(--header-h) + 0.25rem);
    left: var(--gutter);
    right: var(--gutter);
    max-height: calc(100dvh - var(--header-h) - 1rem);
    overflow-y: auto;
    padding: var(--space-4) var(--space-5) var(--space-5);
    border-radius: var(--radius-lg);
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-lg);
    display: none;
  }
  .site-nav.is-open { display: block; animation: nav-in 0.25s var(--ease); }

  .site-nav__list { flex-direction: column; align-items: stretch; gap: 0.15rem; }
  .site-nav__list a { display: block; padding: 0.85rem 1rem; font-size: var(--fs-md); border-radius: var(--radius); }
  .site-nav__cta { width: 100%; margin-top: var(--space-4); }
}

/* Botão flutuante do WhatsApp (injetado pelo RD Station): some enquanto o menu
   mobile está aberto, para não cobrir os links. !important porque o RD aplica
   estilos inline no elemento. */
body.is-locked .rdstation-popup-position-bottom_right.floating-button { display: none !important; }
@media print {
  [id^="bricks-component"] { display: none !important; }
}

@keyframes nav-in {
  from { opacity: 0; transform: translateY(-8px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

/* ---------- Botões ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 2.75rem;
  padding: 0.65rem 1.35rem;
  border: 1.5px solid transparent;
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: 0.9375rem;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), background-color 0.2s, color 0.2s, border-color 0.2s;
}
/* Em telas muito estreitas o texto do botão pode quebrar linha em vez de vazar */
@media (max-width: 22.5em) {
  .btn { white-space: normal; text-align: center; }
}
.btn .icon { width: 1.1em; height: 1.1em; transition: transform 0.2s var(--ease); }
.btn:hover .icon { transform: translateX(3px); }
.btn:active { transform: translateY(1px); }

.btn--lg { min-height: 3.25rem; padding: 0.85rem 1.75rem; font-size: 1rem; }
.btn--block { width: 100%; }

/* Azul principal + texto branco: 5,8:1 */
.btn--primary {
  background: var(--pcj-blue-primary);
  color: #fff;
  box-shadow: 0 8px 20px -10px color-mix(in srgb, var(--pcj-blue-primary) 80%, transparent);
}
.btn--primary:hover { background: var(--ink-2); }

.btn--ghost {
  background: transparent;
  color: var(--heading);
  border-color: var(--line);
}
.btn--ghost:hover { border-color: var(--accent-text); color: var(--accent-text); }

/* Verde vibrante + texto ink: 9,3:1 (uso em fundos escuros) */
.btn--accent { background: var(--pcj-green-vibrant); color: var(--ink); }
.btn--accent:hover { background: var(--pcj-green-complementary); box-shadow: 0 10px 28px -10px var(--pcj-green-complementary); }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--accent-text);
  font-weight: 700;
  text-decoration: none;
}
.link-arrow .icon { width: 1em; height: 1em; transition: transform 0.2s var(--ease); }
.link-arrow:hover .icon { transform: translateX(3px); }
.link-arrow:hover { text-decoration: underline; }

/* ---------- Badge ---------- */
.badge {
  display: inline-block;
  margin-left: var(--space-2);
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-pill);
  background: var(--pcj-green-vibrant);
  color: var(--ink);
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  vertical-align: 0.15em;
}

/* ---------- Lista com checks ---------- */
.check-list {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 0.6rem;
}
.check-list li { position: relative; padding-left: 2rem; }
.check-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.1em;
  width: 1.3rem;
  height: 1.3rem;
  border-radius: 50%;
  background: var(--green-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231c9463' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 0.75rem no-repeat;
}

/* ---------- Cabeçalho de seção ---------- */
.section-head {
  display: grid;
  gap: var(--space-4);
  margin-bottom: clamp(2rem, 1.5rem + 2vw, 3.5rem);
}
.section-head--split {
  grid-template-columns: 1fr 1fr;
  align-items: end;
  gap: var(--space-5) var(--space-7);
}
.section-head--split > div { display: grid; gap: var(--space-3); justify-items: start; }
.section-head__lead { font-size: var(--fs-md); color: var(--text-muted); max-width: 40rem; }

@media (max-width: 56em) {
  .section-head--split { grid-template-columns: 1fr; }
}
