/* ============================================ */
/* GLOBAL.CSS — Transfé Transportes             */
/* Compartilhado por TODAS as páginas           */
/* ============================================ */

/* @font-face movido para css/fonts.css (carregado sync em cada página)        */
/* Removido daqui para evitar dupla-declaração: global.css carrega async via   */
/* rel=preload+onload → quando aplica, re-declara @font-face → novo block      */
/* period → fontes (cacheadas do preload) chegam imediatamente → swap → CLS   */
/* Solução: @font-face declarado UMA VEZ, antes do primeiro paint:             */
/*   index.html → inline <style> (zero custo de rede)                         */
/*   outras páginas → <link rel="stylesheet" href="/css/fonts.css"> (sync)    */

/* ============================================ */
/* VIEW TRANSITIONS API (CSS puro)              */
/* Transição suave ao navegar entre páginas     */
/* Compatível: Chrome 111+, Edge 111+           */
/* ============================================ */
@view-transition {
  navigation: auto;
}
@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*),
  ::view-transition-image-pair(*),
  ::view-transition-old(*),
  ::view-transition-new(*) {
    animation-duration: 0.01ms !important;
  }
}

:root {
  /* Navy + Orange Classic Freight */
  --navy-deep: #0A1628;
  --navy: #1B3A5C;
  --navy-mid: #1E3A5F;
  --blue: #2563EB;
  --blue-light: #3B82F6;
  --orange: #F97316;
  --orange-hover: #EA580C;
  --orange-light: #FDBA74;
  --orange-glow: rgba(249,115,22,0.15);
  --white: #F8FAFC;
  --gray-50: #F1F5F9;
  --gray-100: #E2E8F0;
  --gray-200: #CBD5E1;
  --gray-400: #94A3B8;
  --gray-500: #64748B;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1E293B;
  --gray-900: #0F172A;
  --green: #22C55E;
  --red: #EF4444;

  /* Typography */
  --font-headline: 'Barlow Condensed', sans-serif;
  --font-data: 'Space Grotesk', sans-serif;
  --font-body: 'Manrope', sans-serif;
  --font-cta: 'Plus Jakarta Sans', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  /* overflow-x: clip em vez de hidden — clip não cria scroll container (não força
     overflow-y:auto no html), mantendo o Chrome reconhecer html como root scroller
     nativo. Isso é necessário para position:sticky funcionar corretamente no mobile
     quando a barra de URL do Chrome aparece/esconde (dynamic viewport). */
  overflow-x: clip;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
body {
  font-family: var(--font-body);
  color: var(--gray-800);
  background: var(--white);
  line-height: 1.6;
  /* overflow-x removido do body — causava bug do Chrome onde body::before
     (progress bar com position:fixed + transform) fazia o browser tratar body como
     scroll container, quebrando position:sticky da nav. O html usa overflow-x:clip
     (não hidden!) para clipar overflow horizontal sem criar scroll container. */
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }

/* ============================================ */
/* TOP BAR                                      */
/* ============================================ */
.top-bar {
  background: var(--navy-deep);
  padding: 8px 24px;
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--font-data);
  font-size: 12px; color: var(--gray-500);
}
.top-bar-left { display: flex; gap: 20px; align-items: center; }
.top-bar-item { display: flex; align-items: center; gap: 6px; }
.top-bar-item svg { width: 13px; height: 13px; flex-shrink: 0; }
.top-bar-right { display: flex; gap: 12px; }
.top-bar-social {
  width: 28px; height: 28px; border-radius: 6px;
  background: rgba(255,255,255,0.05); display: flex;
  align-items: center; justify-content: center;
  transition: background 0.3s; cursor: pointer;
  position: relative; z-index: 1;
}
.top-bar-social:hover { background: var(--orange); }
.top-bar-social svg { width: 14px; height: 14px; pointer-events: none; }

/* ============================================ */
/* NAV                                          */
/* ============================================ */
nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--gray-100);
  padding: 0 24px;
  /* will-change isola a layer da nav — o browser pré-aloca a compositing layer
     evitando que invalidações de outras layers forcem re-composição da nav */
  will-change: backdrop-filter;
}
/* Breadcrumb não deve ser sticky — exclui da regra acima */
nav[aria-label="Breadcrumb"] {
  position: static;
  background: none;
  backdrop-filter: none;
  border-bottom: none;
  padding: 0;
  z-index: auto;
}
.nav-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; justify-content: space-between; align-items: center;
  height: 68px;
}
.nav-logo {
  display: flex; align-items: center;
}
.nav-logo-img {
  height: 44px; width: auto; display: block;
  aspect-ratio: 586 / 284; /* reserva espaço antes da imagem carregar — elimina CLS */
}
.nav-logo-accent { color: var(--orange); }
.nav-links { display: flex; gap: 28px; align-items: center; list-style: none; }
.nav-links a {
  font-family: var(--font-cta); font-size: 14px; font-weight: 500;
  color: var(--gray-600); transition: color 0.3s;
  position: relative;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px; left: 0;
  width: 100%; height: 2px;
  background: var(--orange);
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.nav-links a:hover { color: var(--navy-deep); }
.nav-links a:hover::after { transform: scaleX(1); }
.nav-links a[aria-current="page"] { color: var(--navy-deep); font-weight: 700; }
.nav-links a[aria-current="page"]::after { transform: scaleX(1); }
.nav-cta {
  font-family: var(--font-cta) !important; font-size: 13px !important;
  font-weight: 700 !important; color: #fff !important;
  background: var(--orange) !important; padding: 10px 22px;
  border-radius: 10px; display: inline-flex; align-items: center; gap: 8px;
  transition: background 0.3s, transform 0.3s; box-shadow: 0 4px 12px rgba(249,115,22,0.25);
}
.nav-cta:hover { background: var(--orange-hover) !important; transform: translateY(-1px); }
.nav-cta svg { width: 16px; height: 16px; }
.nav-hamburger {
  display: none; background: none; border: none; cursor: pointer;
  padding: 8px; z-index: 201; position: relative;
}
.nav-hamburger svg { width: 24px; height: 24px; color: var(--navy-deep); }
.nav-hamburger .icon-close { display: none; }
.nav-hamburger.active .icon-open { display: none; }
.nav-hamburger.active .icon-close { display: block; }

/* Mobile Menu Overlay */
.mobile-overlay {
  position: fixed; inset: 0; background: rgba(10,22,40,0.5);
  backdrop-filter: blur(4px); z-index: 190;
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s ease;
}
.mobile-overlay.active { opacity: 1; pointer-events: auto; }

/* Mobile Drawer */
.mobile-menu {
  position: fixed; top: 0; right: 0; z-index: 200;
  width: 300px; max-width: 85vw; height: 100dvh;
  background: var(--white);
  box-shadow: -8px 0 32px rgba(10,22,40,0.15);
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.4,0,0.2,1);
  display: flex; flex-direction: column;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
}
.mobile-menu.active { transform: translateX(0); }
.mobile-menu-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px 24px; border-bottom: 1px solid var(--gray-100);
}
.mobile-menu-logo {
  font-family: var(--font-headline); font-size: 22px;
  font-weight: 800; color: var(--navy-deep);
}
.mobile-menu-logo span { color: var(--orange); }
.mobile-menu-logo img { display: block; }
.mobile-menu-logo-img {
  height: 32px;
  width: auto;
}
.mobile-menu-close {
  width: 44px; height: 44px; border-radius: 10px;
  background: var(--gray-50); border: 1px solid var(--gray-100);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background 0.2s;
}
.mobile-menu-close:hover { background: var(--gray-100); }
.mobile-menu-close svg { width: 18px; height: 18px; color: var(--gray-600); }

.mobile-menu-links { list-style: none; }
.mobile-menu-links li { border-bottom: 1px solid var(--gray-50); }
.mobile-menu-links a {
  display: flex; align-items: center; gap: 16px;
  padding: 16px 24px;
  color: var(--gray-700);
  font-family: var(--font-cta); font-size: 15px;
  font-weight: 500; text-decoration: none;
  transition: background 0.2s, color 0.2s;
}
.mobile-menu-links a:hover,
.mobile-menu-links a:active { background: var(--gray-50); color: var(--orange); }
.mobile-menu-links a[aria-current="page"] { background: var(--gray-50); color: var(--orange); font-weight: 700; }
.mobile-menu-links a svg {
  width: 20px; height: 20px; flex-shrink: 0; opacity: 0.6;
}
.mobile-menu-links a:hover svg { opacity: 1; stroke: var(--orange); }
.mobile-menu-links a[aria-current="page"] svg { opacity: 1; stroke: var(--orange); }
.mobile-menu-bottom,
.mobile-menu-cta-group {
  padding: 20px 24px; border-top: 1px solid var(--gray-100);
  display: flex; flex-direction: column; gap: 10px;
  margin-top: auto;
}
.mobile-menu-cta {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 16px; border-radius: 12px;
  font-family: var(--font-cta); font-size: 15px; font-weight: 700;
  transition: background 0.3s, color 0.3s, border-color 0.3s; cursor: pointer; border: none;
  text-align: center;
}
.mobile-menu-cta.primary {
  background: var(--orange); color: #fff;
  box-shadow: 0 6px 20px rgba(249,115,22,0.3);
}
.mobile-menu-cta.primary:hover { background: var(--orange-hover); }
.mobile-menu-cta.secondary {
  background: var(--gray-50); color: var(--navy-deep);
  border: 1px solid var(--gray-200);
}
.mobile-menu-cta.secondary:hover { border-color: var(--orange); color: var(--orange); }
.mobile-menu-cta svg { width: 20px; height: 20px; }
.mobile-menu-info {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 0 0; justify-content: center;
}
.mobile-menu-info svg { width: 14px; height: 14px; color: var(--green); flex-shrink: 0; }
.mobile-menu-info span {
  font-family: var(--font-data); font-size: 11px; color: var(--gray-500);
}
.mobile-link {
  display: flex; align-items: center; gap: 16px;
  padding: 16px 24px; color: var(--gray-800);
  font-family: var(--font-body); font-size: 16px;
  font-weight: 500; text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease; border-bottom: 1px solid var(--gray-100);
}
.mobile-link svg {
  width: 20px; height: 20px; color: var(--gray-500);
  flex-shrink: 0; transition: color 0.2s ease;
}
.mobile-link:hover,
.mobile-link:active { background: var(--gray-50); color: var(--orange); }
.mobile-link[aria-current="page"] { background: var(--gray-50); color: var(--orange); font-weight: 700; border-left: 3px solid var(--orange); }
.mobile-link:hover svg,
.mobile-link:active svg { color: var(--orange); }

/* ============================================ */
/* SECTIONS COMMON                              */
/* ============================================ */
section { padding: 80px 24px; }
.container { max-width: 1200px; margin: 0 auto; }
.section-label {
  font-family: var(--font-data); font-size: 12px; font-weight: 700;
  letter-spacing: 2px; text-transform: uppercase;
  color: var(--orange); margin-bottom: 12px;
  display: flex; align-items: center; gap: 10px;
}
.section-label::before {
  content: ''; width: 24px; height: 2px; background: var(--orange);
}
.section-title {
  font-family: var(--font-headline); font-size: clamp(32px, 4vw, 48px);
  font-weight: 800; color: var(--navy-deep);
  line-height: 0.95; text-transform: uppercase; letter-spacing: -0.5px;
}
.section-desc {
  font-family: var(--font-body); font-size: 16px;
  color: var(--gray-500); margin-top: 14px;
  max-width: 560px; line-height: 1.7;
}
.section-header { margin-bottom: 48px; }

/* ============================================ */
/* BUTTONS                                      */
/* ============================================ */
.btn-primary {
  font-family: var(--font-cta); font-size: 15px; font-weight: 700;
  color: #fff; background: var(--orange);
  padding: 16px 32px; border-radius: 12px; border: none; cursor: pointer;
  display: inline-flex; align-items: center; gap: 10px;
  transition: background 0.3s, transform 0.3s, box-shadow 0.3s; box-shadow: 0 8px 24px rgba(249,115,22,0.35);
}
.btn-primary:hover { background: var(--orange-hover); transform: translateY(-2px); box-shadow: 0 12px 32px rgba(249,115,22,0.4); }
.btn-primary svg { width: 20px; height: 20px; }
.btn-secondary {
  font-family: var(--font-cta); font-size: 15px; font-weight: 600;
  color: var(--white); background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  padding: 16px 28px; border-radius: 12px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 10px;
  transition: background 0.3s, border-color 0.3s;
}
.btn-secondary:hover { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.2); }
.btn-secondary svg { width: 18px; height: 18px; }

/* ============================================ */
/* FINAL CTA                                    */
/* ============================================ */
.final-cta {
  background: linear-gradient(135deg, var(--navy-deep), var(--navy));
  text-align: center; position: relative; overflow: hidden;
}
.final-cta::before {
  content: ''; position: absolute; inset: 0; opacity: 0.04;
  background-image:
    linear-gradient(rgba(255,255,255,0.4) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.4) 1px, transparent 1px);
  background-size: 40px 40px;
}
.final-cta .section-title { color: var(--white); }
.final-cta-sub {
  font-family: var(--font-body); font-size: 17px;
  color: var(--gray-500); margin: 16px auto 32px;
  max-width: 500px; line-height: 1.7;
}
.final-cta-buttons {
  display: flex; gap: 16px; justify-content: center; flex-wrap: wrap;
  position: relative;
}
.final-cta-phone {
  font-family: var(--font-data); font-size: 28px;
  font-weight: 700; color: var(--white);
  margin-bottom: 8px; position: relative;
}

/* ============================================ */
/* FOOTER                                       */
/* ============================================ */
footer {
  background: var(--gray-900); padding: 48px 24px 24px;
}
.footer-inner {
  max-width: 1200px; margin: 0 auto;
  display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 48px;
}
.footer-brand-name {
  margin-bottom: 12px;
}
.footer-logo-img {
  height: 48px; width: auto; display: block;
  filter: brightness(0) invert(1);
}
.footer-brand-name span { color: var(--orange); }
.footer-desc {
  font-family: var(--font-body); font-size: 14px;
  color: var(--gray-500); line-height: 1.7; margin-bottom: 20px;
}
.footer-social { display: flex; gap: 10px; }
.footer-social-link {
  width: 38px; height: 38px; border-radius: 10px;
  background: rgba(255,255,255,0.05);
  display: flex; align-items: center; justify-content: center;
  transition: background 0.3s;
}
.footer-social-link:hover { background: var(--orange); }
.footer-social-link svg { width: 18px; height: 18px; color: var(--gray-500); }
.footer-social-link:hover svg { color: #fff; }
.footer-col-title {
  font-family: var(--font-headline); font-size: 14px;
  font-weight: 700; color: var(--white); text-transform: uppercase;
  letter-spacing: 1px; margin-bottom: 16px;
}
.footer-link {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-body); font-size: 14px;
  color: var(--gray-500); padding: 6px 0; transition: color 0.3s;
}
.footer-link:hover { color: var(--orange); }
.footer-link svg { width: 16px; height: 16px; flex-shrink: 0; }
.footer-bottom {
  max-width: 1200px; margin: 32px auto 0;
  padding-top: 24px; border-top: 1px solid rgba(255,255,255,0.06);
  text-align: center;
}
.footer-copy {
  font-family: var(--font-data); font-size: 12px; color: var(--gray-500);
}

/* ============================================ */
/* FLOATING WHATSAPP                            */
/* ============================================ */
.whatsapp-float {
  position: fixed; bottom: 24px; right: 24px; z-index: 999;
  width: 64px; height: 64px; border-radius: 50%;
  background: #25D366; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 24px rgba(37,211,102,0.4);
  transition: transform 0.3s, box-shadow 0.3s; cursor: pointer;
  /* whatsappBounce removido — 2 animações simultâneas em position:fixed = jank */
}
.whatsapp-float:hover { transform: scale(1.1); box-shadow: 0 12px 32px rgba(37,211,102,0.5); }
.whatsapp-float svg { width: 32px; height: 32px; color: #fff; }
.whatsapp-float-label {
  position: absolute; right: 76px; top: 50%; transform: translateY(-50%);
  background: #fff; padding: 10px 18px; border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  font-family: var(--font-cta); font-size: 13px; font-weight: 700;
  color: var(--navy-deep); white-space: nowrap;
  opacity: 0; pointer-events: none; transition: opacity 0.3s;
}
.whatsapp-float:hover .whatsapp-float-label { opacity: 1; }
.whatsapp-float-label::after {
  content: ''; position: absolute; right: -6px; top: 50%;
  transform: translateY(-50%);
  border: 6px solid transparent; border-left-color: #fff;
}
body:has(.mobile-menu.active) .whatsapp-float {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.8);
}
/* @keyframes whatsappBounce removido — substituído por wa-pulse apenas */

/* ============================================ */
/* REVEAL ANIMATIONS                            */
/* ============================================ */
.reveal {
  opacity: 0; transform: translateY(24px);
  transition: opacity 0.6s cubic-bezier(0.4,0,0.2,1), transform 0.6s cubic-bezier(0.4,0,0.2,1);
}
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ============================================ */
/* ACCESSIBILITY                                */
/* ============================================ */
.skip-link {
  position: absolute; top: -48px; left: 16px;
  background: #F97316; color: #fff;
  padding: 10px 20px; border-radius: 0 0 8px 8px;
  font-family: var(--font-cta); font-weight: 700; font-size: 14px;
  z-index: 10000; text-decoration: none;
  transition: top 0.2s;
}
.skip-link:focus { top: 0; }
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 3px;
  border-radius: 4px;
}

.link-arrow:hover { gap: 12px !important; }

/* ============================================ */
/* ANIMATIONS                                   */
/* ============================================ */

/* WhatsApp pulse ring */
.whatsapp-float { isolation: isolate; }
.whatsapp-float::before {
  content: ''; position: absolute; inset: 0;
  border-radius: 50%; background: #25D366;
  animation: wa-pulse 2.5s ease-out infinite;
  z-index: -1;
}
@keyframes wa-pulse {
  0%   { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(1.8); opacity: 0; }
}

/* btn-shimmer removido — will-change:transform criava GPU layer por botão
   + skewX infinito durante scroll = custo desnecessário */
.btn-primary { position: relative; overflow: hidden; }

/* Service icon hover animation */
.service-icon svg {
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.service-card:hover .service-icon svg {
  transform: scale(1.2) rotate(-8deg);
}

/* content-visibility: auto removido — causava CLS 0.359 (layout shift ao entrar na viewport) */

/* ============================================ */
/* SCROLL PROGRESS BAR (Scroll-Driven)          */
/* Barra laranja no topo indica progresso       */
/* ============================================ */
@supports (animation-timeline: scroll()) {
  /* min-width: 769px — scroll-driven animations desativadas no mobile.
     Motivo: animation-timeline não é resetado pelo shorthand animation:none,
     então mesmo com animation:none na media query mobile, o Chrome mantém
     a compositing layer scroll-linked ativa, quebrando position:sticky da nav. */
  @media (prefers-reduced-motion: no-preference) and (min-width: 769px) {
    body::before {
      content: '';
      position: fixed;
      top: 0; left: 0; z-index: 9999;
      height: 3px; width: 100%;
      background: linear-gradient(90deg, var(--orange), var(--orange-hover));
      transform-origin: left center;
      transform: scaleX(0);
      animation: reading-progress linear both;
      animation-timeline: scroll(root block);
    }
    @keyframes reading-progress {
      from { transform: scaleX(0); }
      to   { transform: scaleX(1); }
    }
  }
}

/* ============================================ */
/* NAV SHRINK ON SCROLL — REMOVIDO              */
/* Animava `height` (propriedade de layout),    */
/* forçando layout recalculation em cada frame  */
/* de scroll → principal causa de scroll jank.  */
/* Nav permanece em 68px (comportamento padrão).*/
/* ============================================ */

/* ============================================ */
/* PREFERS-REDUCED-MOTION                       */
/* Para quem ativou essa preferência no SO:     */
/* mantém fade elegante, apenas remove o        */
/* movimento vertical (translateY) que pode     */
/* causar desconforto visual                    */
/* ============================================ */
@media (prefers-reduced-motion: reduce) {
  /* Mantém fade suave mas sem deslocamento */
  .reveal {
    transform: none;
    transition: opacity 0.4s ease;
  }
  /* Remove animações decorativas em loop */
  .whatsapp-float { animation: none; }
  .whatsapp-float::before { animation: none; }
}

/* ============================================ */
/* MEDIA QUERIES — GLOBAL                       */
/* ============================================ */
@media (max-width: 768px) {
  .top-bar { display: none; }
  .nav-links { display: none !important; }
  .nav-hamburger { display: block; }
  /* Desabilita scroll-driven animations no mobile — competem com position:sticky
     no Chrome mobile ao recalcular viewport ao mostrar/esconder a barra de URL.
     body::before = barra de progresso de leitura: content:none remove o pseudo-elemento
     inteiramente (inclui o transform:scaleX(0) que permaneceria com animation:none),
     impedindo que o Chrome trate body como containing block para sticky/fixed. */
  body::before { content: none; }
  .nav-inner { animation: none; height: 68px; }
  .nav-logo-img { height: 36px; animation: none; }
  section { padding: 56px 20px; }
  .footer-inner { grid-template-columns: 1fr; gap: 32px; }
  .final-cta-phone { font-size: 22px; }
  .final-cta-buttons { flex-direction: column; align-items: center; }
  .btn-primary, .btn-secondary { width: 100%; justify-content: center; }
}

@media (max-width: 375px) {
  .nav-cta {
    padding: 8px 16px !important;
    font-size: 11px !important;
    gap: 6px !important;
  }
  .nav-cta svg {
    width: 14px !important;
    height: 14px !important;
  }
  .nav-logo-img {
    height: 32px;
  }
}
