/* =====================================================================
   site-nav.css — cabeçalho público expansivo (mega-menu com categorias).
   Injetado por assets/js/site-nav.js em todas as páginas públicas.
   Mobile-first: barra + menu full-screen com acordeão no mobile; barra
   horizontal com dropdowns no desktop (≥901px).
   ===================================================================== */
.site-nav {
  position: sticky; top: 0; z-index: 120;
  background: rgba(255, 253, 249, 0.97);
  border-bottom: 1px solid rgba(15, 46, 28, 0.08);
  transition: box-shadow 0.25s ease, background 0.25s ease;
  /* NÃO usar backdrop-filter aqui: ele cria containing-block para o
     .snav-menu (position:fixed) do mobile, prendendo o menu ao header.
     O blur é reaplicado só no desktop (onde o dropdown é position:absolute). */
}
.site-nav[data-elevated="true"] { box-shadow: 0 10px 34px rgba(15, 46, 28, 0.1); background: rgba(255, 253, 249, 0.96); }
.snav-inner {
  width: min(100% - 32px, 1240px); margin: 0 auto;
  min-height: 66px; display: flex; align-items: center; gap: 14px;
}

/* ---- marca ---- */
.snav-brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; margin-right: auto; flex: 0 0 auto; }
.snav-brand img {
  width: 42px; height: 42px; border-radius: 50%; padding: 3px; object-fit: contain;
  background: #fffdf9; border: 1px solid rgba(15, 46, 28, 0.1); box-shadow: 0 6px 16px rgba(15, 46, 28, 0.12);
}
.snav-brand-txt { display: flex; flex-direction: column; line-height: 1.15; }
.snav-brand-txt strong { font-family: var(--font-display, Fraunces), serif; font-size: 17px; color: var(--verde-700, #1f4d2e); }
.snav-brand-txt small { font-size: 10.5px; letter-spacing: 0.13em; text-transform: uppercase; color: #8a7d72; }

/* ---- hambúrguer (mobile): botão verde da marca com barras brancas ---- */
.snav-burger {
  width: 48px; height: 48px; flex: 0 0 auto; cursor: pointer; margin-left: auto; padding: 0;
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  border: 0; border-radius: 15px;
  background: linear-gradient(140deg, var(--verde-600, #2e7d46), var(--verde-700, #1f4d2e));
  box-shadow: 0 8px 20px rgba(46, 125, 70, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transition: transform 0.14s ease, box-shadow 0.2s ease, filter 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}
.snav-burger:hover { filter: brightness(1.06); }
.snav-burger:active { transform: scale(0.93); }
.snav-burger:focus-visible { outline: 2px solid var(--verde-700, #1f4d2e); outline-offset: 3px; }
/* barras brancas, com a do meio mais curta (toque criativo e refinado) */
.snav-burger span { display: block; height: 2.5px; border-radius: 3px; background: #fff; transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease, width 0.28s ease; }
.snav-burger span:nth-child(1) { width: 22px; }
.snav-burger span:nth-child(2) { width: 14px; align-self: flex-start; margin-left: 13px; }
.snav-burger span:nth-child(3) { width: 22px; }
.site-nav.snav-open .snav-burger span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.site-nav.snav-open .snav-burger span:nth-child(2) { opacity: 0; }
.site-nav.snav-open .snav-burger span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); width: 22px; }

/* ---- menu (mobile: overlay full-screen) ---- */
.snav-menu {
  position: fixed; inset: 0; z-index: 130;
  display: flex; flex-direction: column;
  background: #fffdf9; overflow-y: auto;
  padding: 0 18px calc(env(safe-area-inset-bottom, 0px) + 22px);
  transform: translateX(100%); transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  visibility: hidden;
}
.site-nav.snav-open .snav-menu { transform: none; visibility: visible; }
.snav-menu-head {
  position: sticky; top: 0; display: flex; align-items: center; justify-content: space-between;
  padding: 18px 2px 12px; margin-bottom: 6px; background: #fffdf9;
  border-bottom: 1px solid rgba(15, 46, 28, 0.08);
  font-size: 11px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: #a4927a;
}
.snav-close { width: 40px; height: 40px; border: 1px solid rgba(15, 46, 28, 0.14); border-radius: 10px; background: #fff; color: #5a4a3a; font-size: 16px; cursor: pointer; }

.snav-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.snav-cat { position: relative; }
/* Item "Início" (link direto — primeiro do menu, tanto no drawer quanto na barra) */
.snav-home { display: flex; align-items: center; gap: 10px; text-decoration: none; padding: 14px 6px; font-size: 17px; font-weight: 600; color: #26332b; border-bottom: 1px solid rgba(15, 46, 28, 0.06); }
.snav-home .snav-home-ico { color: var(--verde-600, #2e7d46); flex: 0 0 auto; }
.snav-home:hover, .snav-home:focus-visible { color: var(--verde-700, #1f4d2e); }
.snav-cat-btn {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 14px 6px; border: 0; background: transparent; cursor: pointer;
  font: inherit; font-size: 17px; font-weight: 600; color: #26332b; text-align: left;
  border-bottom: 1px solid rgba(15, 46, 28, 0.06);
}
.snav-chev { transition: transform 0.22s ease; color: var(--verde-600, #2e7d46); }
.snav-cat.open > .snav-cat-btn .snav-chev { transform: rotate(180deg); }

.snav-panel { max-height: 0; overflow: hidden; padding-left: 8px; transition: max-height 0.28s ease; }
.snav-cat.open > .snav-panel { max-height: 520px; }
.snav-link {
  display: block; padding: 11px 12px; border-radius: 12px; text-decoration: none; color: #2c3a31;
}
.snav-link strong { display: block; font-size: 15.5px; font-weight: 600; color: var(--verde-700, #1f4d2e); }
.snav-link small { display: block; font-size: 12.5px; color: #7c8a80; margin-top: 1px; }
.snav-link:hover, .snav-link:focus-visible { background: rgba(46, 125, 70, 0.08); }

.snav-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }
.snav-login {
  text-align: center; padding: 13px; border-radius: 12px; text-decoration: none; font-weight: 700; font-size: 15px;
  color: var(--verde-700, #1f4d2e); border: 1.5px solid rgba(46, 125, 70, 0.4); background: #fff;
}
.snav-login:hover { background: rgba(46, 125, 70, 0.08); }
.snav-cta {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px; border-radius: 12px; text-decoration: none; font-weight: 700; font-size: 15px;
  color: #fff; background: linear-gradient(135deg, var(--verde-600, #2e7d46), var(--verde-700, #1f4d2e));
  box-shadow: 0 10px 24px rgba(46, 125, 70, 0.28);
}
.snav-cta:hover { filter: brightness(1.05); }

body.snav-lock { overflow: hidden; }

/* =====================================================================
   DESKTOP (≥901px): barra horizontal + dropdowns
   ===================================================================== */
@media (min-width: 901px) {
  .site-nav { background: rgba(255, 253, 249, 0.9); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
  .snav-burger { display: none; }
  .snav-brand { margin-right: 22px; }

  .snav-menu {
    position: static; inset: auto; transform: none; visibility: visible; z-index: auto;
    flex-direction: row; align-items: center; gap: 18px; flex: 1 1 auto;
    background: transparent; padding: 0; overflow: visible;
  }
  .snav-menu-head { display: none; }

  .snav-list { flex-direction: row; align-items: center; gap: 2px; margin-right: auto; }
  .snav-cat-btn {
    width: auto; padding: 9px 14px; border: 0; border-radius: 10px; font-size: 15px; font-weight: 600; color: #2a3a30;
    transition: background 0.15s ease, color 0.15s ease;
  }
  .snav-cat-btn:hover { background: rgba(46, 125, 70, 0.08); color: var(--verde-700, #1f4d2e); }
  .snav-cat.open > .snav-cat-btn,
  .snav-cat:hover > .snav-cat-btn,
  .snav-cat:focus-within > .snav-cat-btn { background: rgba(46, 125, 70, 0.1); color: var(--verde-700, #1f4d2e); }
  /* "Início" como link inline na barra desktop */
  .snav-home { padding: 9px 13px 9px 11px; border: 0; border-radius: 10px; font-size: 15px; gap: 6px; color: #2a3a30; transition: background 0.15s ease, color 0.15s ease; }
  .snav-home:hover { background: rgba(46, 125, 70, 0.08); color: var(--verde-700, #1f4d2e); }

  /* dropdown flutuante */
  .snav-panel {
    position: absolute; top: calc(100% + 10px); left: 0; z-index: 140;
    display: block; max-height: none; overflow: visible;
    min-width: 268px; padding: 8px;
    background: #fffdfa; border: 1px solid rgba(15, 46, 28, 0.1); border-radius: 16px;
    box-shadow: 0 24px 60px rgba(15, 46, 28, 0.16);
    opacity: 0; visibility: hidden; transform: translateY(-6px);
    transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s ease;
  }
  /* Abre por SOBREPOSIÇÃO DO MOUSE (hover) e por foco de teclado. */
  .snav-cat.open > .snav-panel,
  .snav-cat:hover > .snav-panel,
  .snav-cat:focus-within > .snav-panel { opacity: 1; visibility: visible; transform: none; }
  /* Ponte invisível cobrindo o gap botão↔painel: evita que o dropdown feche
     quando o mouse atravessa o espaço até ele. */
  .snav-panel::after { content: ""; position: absolute; top: -14px; left: 0; right: 0; height: 14px; }
  .snav-panel::before { /* seta */
    content: ""; position: absolute; top: -6px; left: 22px; width: 12px; height: 12px;
    background: #fffdfa; border-left: 1px solid rgba(15, 46, 28, 0.1); border-top: 1px solid rgba(15, 46, 28, 0.1);
    transform: rotate(45deg);
  }
  .snav-link { border-radius: 10px; }

  .snav-actions { flex-direction: row; align-items: center; gap: 10px; margin: 0; flex: 0 0 auto; }
  .snav-login { padding: 9px 16px; font-size: 14px; border-radius: 10px; white-space: nowrap; }
  .snav-cta { padding: 9px 18px; font-size: 14px; border-radius: 10px; white-space: nowrap; box-shadow: 0 8px 20px rgba(46, 125, 70, 0.26); }
}

/* Ajuste fino p/ telas médias (901–1100px): reduz gaps para caber tudo */
@media (min-width: 901px) and (max-width: 1120px) {
  .snav-inner { gap: 10px; }
  .snav-cat-btn { padding: 8px 10px; font-size: 14px; }
  .snav-brand-txt small { display: none; }
}

/* Na home (body.portal-home) o `a { color: inherit }` do home.css escurecia o
   texto do CTA. Estes seletores (0,2,0) vencem e garantem o Doar em BRANCO
   (mais evidente) e o "Entrar" em verde. */
.site-nav .snav-cta, .site-nav .snav-cta:hover { color: #fff; }
.site-nav .snav-cta svg { color: #fff; }
.site-nav .snav-login { color: var(--verde-700, #1f4d2e); }
