/* Site Merx: estilos globais. O layout de cada seção está nos atributos style do HTML. */
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font-family: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif; }
img { max-width: 100%; }
[hidden] { display: none !important; }
.dc-if { display: contents; }
summary { cursor: pointer; }
section[id] { scroll-margin-top: 16px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 3px solid #2BF59A; outline-offset: 2px;
}

.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 10px 16px; border-radius: 8px; background: #FFFFFF; color: #070B14; font-weight: 600; text-decoration: none; }
.skip-link:focus { top: 12px; }

/* Menu no celular */
.nav-toggle { display: none; align-items: center; justify-content: center; width: 44px; height: 44px; border: 1px solid #26324A; border-radius: 10px; background: transparent; color: #FFFFFF; cursor: pointer; }
@media (max-width: 900px) {
  header nav .nav-links { display: none !important; }
  header.nav-open nav .nav-links { display: flex !important; flex-direction: column; align-items: stretch !important; flex-basis: 100% !important; order: 3; gap: 0 !important; padding: 8px 0 4px; border-top: 1px solid rgba(148,163,184,0.18); }
  header.nav-open nav .nav-links a { padding: 4px 0; }
  .nav-toggle { display: inline-flex; }
}

/* Formulários */
.form-msg { grid-column: 1 / -1; margin: 0; padding: 12px 14px; border-radius: 10px; font-size: 14px; line-height: 1.5; }
.form-msg.ok { background: #DDFBEA; color: #053B29; }
.form-msg.erro { background: #FEE2E2; color: #7F1D1D; }
button[disabled] { opacity: 0.6; cursor: progress !important; }
.link-btn { padding: 0; border: 0; background: none; color: #94A3B8; font: inherit; text-decoration: underline; cursor: pointer; }

/* Aviso de cookies (LGPD) */
.cookie-banner { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 50; max-width: 720px; margin: 0 auto; padding: 18px 20px; border-radius: 16px; background: #070B14; color: #E2E8F0; box-shadow: 0 16px 40px rgba(7,11,20,0.35); font-size: 14px; line-height: 1.55; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
.cookie-banner p { margin: 0; flex: 1 1 320px; }
.cookie-banner a { color: #9FF2C8; }
.cookie-banner .acoes { display: flex; gap: 10px; flex-wrap: wrap; }
.cookie-banner button { min-height: 44px; padding: 0 18px; border-radius: 10px; font: inherit; font-weight: 600; cursor: pointer; }
.cookie-banner .aceitar { border: 0; background: #2BF59A; color: #070B14; }
.cookie-banner .recusar { border: 1px solid #33415C; background: transparent; color: #FFFFFF; }

/* ---------- Celular: layout compacto ---------- */
.m-only { display: none !important; }
.m-cta { display: none; }
@media (max-width: 760px) {
  .m-hide { display: none !important; }
  .m-only { display: inline-flex !important; }
  .m-2col { grid-template-columns: 1fr 1fr !important; gap: 22px 16px !important; }

  /* Carrossel horizontal: o próximo card aparece pela metade para indicar que há mais */
  .m-carousel { display: flex !important; flex-direction: row !important; flex-wrap: nowrap !important; align-items: stretch !important; gap: 14px !important; overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: none; margin-right: -24px; padding: 2px 24px 14px 0; }
  .m-carousel::-webkit-scrollbar { display: none; }
  .m-carousel > * { flex: 0 0 84% !important; max-width: 84%; scroll-snap-align: start; box-sizing: border-box; }

  /* Sanfonas (catálogo da plataforma e rodapé) */
  .m-acc-head { position: relative; padding-right: 44px; cursor: pointer; -webkit-tap-highlight-color: transparent; }
  .m-acc-head::after { content: '+'; position: absolute; right: 4px; top: 50%; transform: translateY(-50%); font-size: 26px; font-weight: 400; line-height: 1; color: #64748B; }
  .m-acc.open > .m-acc-head::after { content: '\2212'; }
  .m-acc:not(.open) > .m-acc-body { display: none !important; }
  .m-acc.open .m-only { display: none !important; }
  footer .m-acc { border-bottom: 1px solid rgba(148, 163, 184, 0.18); flex-basis: 100% !important; gap: 0 !important; }
  footer .m-acc-head { min-height: 52px; display: flex; align-items: center; }
  footer .m-acc-head::after { color: #94A3B8; }
  footer .m-acc-body { padding-bottom: 18px; }

  /* Barra fixa de ação */
  .m-cta { display: flex; gap: 10px; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px)); background: rgba(7, 11, 20, 0.97); border-top: 1px solid #151F33; transition: transform 0.25s ease; }
  .m-cta.off { transform: translateY(120%); }
  .m-cta a { min-height: 48px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; font-weight: 600; font-size: 15px; text-decoration: none; }
  .m-cta-main { flex: 1; background: #2BF59A; color: #070B14; }
  .m-cta-zap { padding: 0 18px; border: 1px solid #33415C; color: #FFFFFF; }
  body { padding-bottom: 72px; }
  .cookie-banner { bottom: 84px; }
}
@media (max-width: 760px) and (prefers-reduced-motion: reduce) { .m-cta { transition: none; } }
@media (max-width: 760px) {
  img.m-short { width: 100% !important; max-height: 230px; object-fit: cover; object-position: center top; }
  .m-scrollx { flex-wrap: nowrap !important; overflow-x: auto; scrollbar-width: none; margin-right: -24px; padding-right: 24px; -webkit-overflow-scrolling: touch; }
  .m-scrollx::-webkit-scrollbar { display: none; }
  .m-scrollx > * { flex: 0 0 auto !important; white-space: nowrap; }
}
@media (max-width: 760px) {
  .m-hero-img { min-height: 240px !important; }
  .m-tight { padding-top: 40px !important; padding-bottom: 40px !important; gap: 32px !important; }
}
@media (max-width: 760px) {
  .m-minw0 { min-width: 0 !important; max-width: 100%; }
}

/* ---------- Home: filme atrás do título e entrada com logo ---------- */
.home-video .hero-wrap { position: relative; }
.home-video header { position: fixed; top: 0; left: 0; right: 0; z-index: 4; background: transparent !important; border-bottom: 1px solid rgba(255,255,255,0.10) !important; }
.home-video header nav .nav-links a { color: #F4F7FB !important; text-shadow: 0 1px 8px rgba(0,0,0,0.45); }
.hero-video { min-height: min(94vh, 900px); display: flex; align-items: flex-end; }
.hero-video > .m-tight { position: relative; z-index: 2; width: 100%; padding-top: 220px !important; padding-bottom: 88px !important; }
.hero-video h1 { font-size: clamp(38px, 5.4vw, 68px) !important; text-shadow: 0 2px 24px rgba(0,0,0,0.35); }
.hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 60% center; z-index: 0; background: #070B14 url(/assets/img/hero-produtor.webp) 60% center / cover no-repeat; }
.hero-shade { position: absolute; inset: 0; z-index: 1; background: linear-gradient(180deg, rgba(7,11,20,0.55) 0%, rgba(7,11,20,0.25) 38%, rgba(7,11,20,0.82) 100%), linear-gradient(90deg, rgba(7,11,20,0.75) 0%, rgba(7,11,20,0.15) 70%); }
.hero-pause { position: absolute; right: 20px; bottom: 20px; z-index: 3; width: 44px; height: 44px; border-radius: 999px; border: 1px solid rgba(255,255,255,0.35); background: rgba(7,11,20,0.55); color: #FFFFFF; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.nav-logo { height: 32px !important; }
@media (max-width: 760px) {
  .nav-logo { height: 26px !important; }
  .hero-video { min-height: 88svh; }
  .hero-video > .m-tight { padding-top: 200px !important; padding-bottom: 56px !important; }
  .hero-bg { object-position: 65% center; }
}
/* Assinatura da logo: acontece no próprio header, a cada carregamento da home. Não esconde nada da página. */
.home-video .nav-logo, .logo-anima .nav-logo { animation: navLogoIn 1.6s cubic-bezier(0.22, 1, 0.36, 1) 0.25s both; }
@keyframes navLogoIn {
  0%   { opacity: 0; clip-path: inset(-20% 100% -20% 0); filter: blur(6px); transform: translateX(-10px); }
  45%  { opacity: 1; filter: blur(0); }
  100% { opacity: 1; clip-path: inset(-20% -5% -20% 0); filter: blur(0); transform: none; }
}
@media (prefers-reduced-motion: reduce) { .home-video .nav-logo, .logo-anima .nav-logo { animation: none; } }
@media (max-width: 960px) {
  header nav { column-gap: 12px !important; justify-content: space-between; }
  header:not(.nav-open) nav { flex-wrap: nowrap !important; }
  .home-video header.nav-open { background: #070B14 !important; }
}
@media (max-width: 380px) { header nav a[href="#contato"] { padding: 0 12px !important; font-size: 13px !important; } }
@media (max-width: 960px) {
  header nav > div:last-child { flex: 0 0 auto !important; margin-left: auto; gap: 10px !important; }
  header nav > div:last-child a[href="#contato"] { white-space: nowrap; }
}
@media (max-width: 380px) { .nav-logo { height: 22px !important; } header nav { padding-left: 18px !important; padding-right: 18px !important; } }
/* ---------- Faixa EUDR: escura, texto verde, uma linha no celular ---------- */
a[data-eudr-banner] { background: #0D1424 !important; color: #CBD5E1 !important; border-bottom: 1px solid rgba(43,245,154,0.22); }
a[data-eudr-banner] > span { font-weight: 400 !important; font-size: 13px !important; padding-top: 8px !important; padding-bottom: 8px !important; }
a[data-eudr-banner] strong { color: #2BF59A; font-weight: 600 !important; }
a[data-eudr-banner] > span > span:last-child { color: #2BF59A; font-weight: 500 !important; text-decoration: none !important; }
a[data-eudr-banner]:hover > span > span:last-child { text-decoration: underline !important; }
.home-video a[data-eudr-banner] { background: rgba(7,11,20,0.72) !important; }
@media (max-width: 760px) {
  a[data-eudr-banner] > span { flex-wrap: nowrap !important; gap: 10px !important; padding-left: 16px !important; padding-right: 16px !important; white-space: nowrap; }
  a[data-eudr-banner] > span > span:not(:last-child) { display: none; }
}

/* ---------- Cursor: tudo que é clicável mostra a "mãozinha" ---------- */
a[href], button:not([disabled]), [role="button"], [role="tab"], summary, label[for], select,
input[type="submit"], input[type="button"], input[type="checkbox"], input[type="radio"], .m-acc-head, [data-cookie-prefs] {
  cursor: pointer;
}
a[href] *, button:not([disabled]) * { cursor: inherit; }

/* ---------- Carrossel de logos (clientes e imprensa) ----------
   A faixa tem a lista duplicada; a animação anda 50% e recomeça sem emenda. Pausa ao passar o mouse. */
.logo-marquee { position: relative; overflow: hidden; flex: 1 1 600px; min-width: 0;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.logo-track { display: flex; align-items: center; width: max-content; animation: logoScroll var(--dur, 40s) linear infinite; }
.logo-marquee:hover .logo-track, .logo-marquee:focus-within .logo-track { animation-play-state: paused; }
.logo-item { flex: 0 0 auto; display: flex; align-items: center; justify-content: center; height: 64px; padding: 0 28px; }
/* Cada <img> tem width/height calculados pela proporção do arquivo (mesma área visual para todas). */
.logo-item img { display: block; object-fit: contain; }
.logo-item.txt { font-size: 19px; font-weight: 700; color: #334155; letter-spacing: -0.01em; white-space: nowrap; }
@keyframes logoScroll { to { transform: translateX(-50%); } }
@media (max-width: 760px) { .logo-track { zoom: 0.8; } .logo-item { padding: 0 20px; } }
@media (prefers-reduced-motion: reduce) { .logo-track { animation: none; } .logo-marquee { overflow-x: auto; scrollbar-width: none; } }
/* Logo branca (feita para fundo escuro): vira silhueta escura para aparecer no fundo claro */
.logo-item img.on-light { filter: brightness(0); opacity: 0.8; }
/* Logos da imprensa são links para a reportagem */
a.logo-item { text-decoration: none; border-radius: 10px; }
a.logo-item img { transition: transform 0.2s ease; }
a.logo-item:hover img, a.logo-item:focus-visible img { transform: translateY(-2px) scale(1.04); }

/* ---------- Header fixo: ao rolar vira barra translúcida compacta ----------
   .is-scrolled é colocada pelo site.js. Nas páginas internas o body ganha padding-top
   com a altura do header (--header-h) para o conteúdo não ficar por baixo. */
.site-header { position: fixed; top: 0; left: 0; right: 0; z-index: 45;
  transition: background-color 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease, -webkit-backdrop-filter 0.35s ease, backdrop-filter 0.35s ease; }
body:not(.home-video) { padding-top: var(--header-h, 0px); }
html { scroll-padding-top: 80px; }
.site-header nav { transition: padding 0.3s ease; }
.site-header .nav-logo { transition: height 0.3s ease; }
.site-header [data-eudr-banner] { overflow: hidden; max-height: 90px; transition: max-height 0.35s ease, opacity 0.25s ease, border-width 0.35s ease; }
.site-header.is-scrolled { background: rgba(7, 11, 20, 0.78) !important; border-bottom-color: rgba(255, 255, 255, 0.08) !important;
  -webkit-backdrop-filter: saturate(160%) blur(14px); backdrop-filter: saturate(160%) blur(14px); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28); }
.site-header.is-scrolled [data-eudr-banner] { max-height: 0; opacity: 0; border-bottom-width: 0; pointer-events: none; }
.site-header.is-scrolled nav { padding-top: 6px !important; padding-bottom: 6px !important; }
.site-header.is-scrolled .nav-logo { height: 26px !important; }
.site-header.nav-open { max-height: 100vh; overflow-y: auto; }
@media (max-width: 760px) { .site-header.is-scrolled .nav-logo { height: 22px !important; } }
@media (prefers-reduced-motion: reduce) { .site-header, .site-header nav, .site-header .nav-logo, .site-header [data-eudr-banner] { transition: none; } }
/* Faixa da EUDR: some depois do prazo (classe colocada pelo config.js) */
html.eudr-encerrada [data-eudr-banner] { display: none !important; }
/* Formulário de contato (fundo claro) */
#contato input::placeholder { color: #94A3B8; }
#contato input:hover, #contato select:hover { border-color: #94A3B8 !important; }
#contato button[type="submit"]:hover { background: #1FE08A !important; }

/* ---------- Menu: item da página/seção atual em destaque ----------
   O site.js marca o link com aria-current="page" (página) ou "location" (seção da home). */
header nav .nav-links a { position: relative; transition: color 0.2s ease; }
header nav .nav-links a::after { content: ''; position: absolute; left: 0; right: 0; bottom: 8px; height: 2px; border-radius: 2px;
  background: #2BF59A; transform: scaleX(0); transform-origin: left center; transition: transform 0.25s ease; }
header nav .nav-links a:hover { color: #FFFFFF !important; }
header nav .nav-links a:hover::after { transform: scaleX(0.4); opacity: 0.6; }
header nav .nav-links a[aria-current] { color: #2BF59A !important; font-weight: 600; }
header nav .nav-links a[aria-current]::after { transform: scaleX(1); opacity: 1; }
@media (max-width: 900px) {
  /* menu aberto no celular: barra lateral em vez de sublinhado */
  header.nav-open nav .nav-links a::after { left: -12px; right: auto; top: 50%; bottom: auto; width: 3px; height: 22px; transform: translateY(-50%) scaleY(0); }
  header.nav-open nav .nav-links a[aria-current]::after { transform: translateY(-50%) scaleY(1); }
}
@media (prefers-reduced-motion: reduce) { header nav .nav-links a::after { transition: none; } }

/* ---------- Carrossel de cases (home) ----------
   3 cards visíveis no computador, 2 no tablet e 1 e pouco no celular; setas + arraste lateral. */
.cases-carousel { display: flex; gap: 20px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth;
  scrollbar-width: none; -webkit-overflow-scrolling: touch; padding: 4px 2px 8px; margin: -4px -2px -8px; outline: none; }
.cases-carousel::-webkit-scrollbar { display: none; }
.cases-carousel > * { flex: 0 0 calc((100% - 40px) / 3); scroll-snap-align: start; box-sizing: border-box; }
@media (max-width: 1000px) { .cases-carousel > * { flex-basis: calc((100% - 20px) / 2); } }
@media (max-width: 760px) {
  .cases-carousel { gap: 14px; margin-right: -24px; padding-right: 24px; }
  .cases-carousel > * { flex-basis: 84%; }
}
.cases-carousel:focus-visible { outline: 3px solid #2BF59A; outline-offset: 4px; border-radius: 18px; }
.carousel-nav { display: flex; gap: 10px; }
.carousel-btn { width: 44px; height: 44px; border-radius: 999px; border: 1px solid #CBD5E1; background: #FFFFFF; color: #070B14;
  display: inline-flex; align-items: center; justify-content: center; transition: background 0.2s ease, border-color 0.2s ease, opacity 0.2s ease; }
.carousel-btn:hover:not([disabled]) { background: #070B14; border-color: #070B14; color: #FFFFFF; }
.carousel-btn[disabled] { opacity: 0.35; cursor: default !important; }
@media (prefers-reduced-motion: reduce) { .cases-carousel { scroll-behavior: auto; } }

/* ---------- Animações ao rolar (scroll reveal) ----------
   O site.js coloca .anim no <html> e marca os elementos com .reveal; ao entrarem na tela ganham .is-in.
   Sem JavaScript, ou com "reduzir movimento", nada fica escondido. */
html.anim .reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.7s ease, transform 0.8s cubic-bezier(0.22, 1, 0.36, 1); transition-delay: var(--rd, 0ms); will-change: opacity, transform; }
html.anim .reveal.reveal-zoom { transform: translateY(18px) scale(0.96); }
html.anim .reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { html.anim .reveal { opacity: 1 !important; transform: none !important; transition: none !important; } }

/* ---------- Números da Merx (home): no celular, cartões 2 x 2 e o último em linha inteira ---------- */
@media (max-width: 760px) {
  .numeros { grid-template-columns: 1fr 1fr !important; gap: 10px !important; padding: 28px 16px 36px !important; }
  .numeros > div { padding: 16px 14px; border-radius: 14px; background: #0D1424; border: 1px solid #1F2A40; min-width: 0; }
  .numeros > div > div:first-child { font-size: 24px !important; line-height: 1.15; white-space: nowrap; }
  .numeros > div > div:last-child { font-size: 13px !important; line-height: 1.35; margin-top: 4px; }
  .numeros > div:last-child:nth-child(odd) { grid-column: 1 / -1; display: flex; align-items: baseline; gap: 10px; }
  .numeros > div:last-child:nth-child(odd) > div:last-child { margin-top: 0; }
}
.form-msg.erro-campos { color: #B42318; }
