/* Partes comuns a todas as páginas: topo (submenu Produtos e menu do celular), "Outros produtos" e rodapé.
   Carregado por último em cada página. Todas as classes novas usam o prefixo gn- para não colidir
   com estilo.css, isps.css, cfs.css e os CSS de cada produto. */

/* ---------- Fontes reserva com métricas ajustadas ----------
   Enquanto as fontes do Google carregam, o texto usa Arial/Courier New escaladas para a mesma largura
   (size-adjust medido no Chromium). Quando a fonte chega, as linhas quebram no mesmo lugar: sem CLS.
   Só muda o quadro anterior ao carregamento; com a fonte carregada o visual é o mesmo. */
@font-face { font-family: "Archivo fb"; src: local("Arial"), local("ArialMT"); font-weight: 100 550; size-adjust: 98.8%; }
@font-face { font-family: "Archivo fb"; src: local("Arial Bold"), local("Arial-BoldMT"); font-weight: 551 900; size-adjust: 95.85%; }
@font-face { font-family: "Rajdhani fb"; src: local("Arial"), local("ArialMT"); font-weight: 100 550; size-adjust: 85.9%; }
@font-face { font-family: "Rajdhani fb"; src: local("Arial Bold"), local("Arial-BoldMT"); font-weight: 551 900; size-adjust: 86.75%; }
@font-face { font-family: "Martian fb"; src: local("Courier New"), local("CourierNewPSMT"); size-adjust: 116.65%; }
@font-face { font-family: "JetBrains fb"; src: local("Courier New"), local("CourierNewPSMT"); size-adjust: 100%; }
:root {
  --fonte: "Archivo", "Archivo fb", system-ui, sans-serif;
  --mono: "Martian Mono", "Martian fb", ui-monospace, monospace;
  --titulo: "Rajdhani", "Rajdhani fb", "Archivo", sans-serif;
  --tec: "JetBrains Mono", "JetBrains fb", ui-monospace, monospace;
}

/* ---------- Rajdhani servida pelo próprio site ----------
   N2: os títulos em Rajdhani trocavam de fonte depois da primeira pintura e quebravam em outra linha
   (CLS na abertura). O arquivo é local (o mesmo do Smart Vision, sem segundo download), vem pré-carregado
   no <head> e usa font-display: block: o título aparece já na fonte certa. Vale sobre a Rajdhani do Google
   porque este CSS é carregado depois. */
@font-face { font-family: "Rajdhani"; font-style: normal; font-weight: 500; font-display: block; src: url("smart-vision/assets/fonts/rajdhani-500-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Rajdhani"; font-style: normal; font-weight: 500; font-display: block; src: url("smart-vision/assets/fonts/rajdhani-500-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Rajdhani"; font-style: normal; font-weight: 600; font-display: block; src: url("smart-vision/assets/fonts/rajdhani-600-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Rajdhani"; font-style: normal; font-weight: 600; font-display: block; src: url("smart-vision/assets/fonts/rajdhani-600-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Rajdhani"; font-style: normal; font-weight: 700; font-display: block; src: url("smart-vision/assets/fonts/rajdhani-700-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Rajdhani"; font-style: normal; font-weight: 700; font-display: block; src: url("smart-vision/assets/fonts/rajdhani-700-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* ---------- Imagens com width/height declarados ----------
   As dimensões dão a proporção e reservam o espaço (sem CLS). :where() zera a especificidade: as regras
   de classe que já definem largura ou altura continuam valendo; o que não estava definido volta a "auto",
   como antes dos atributos. Assim o tamanho exibido não muda. */
:where(img[data-dim]) { width: auto; height: auto; }

/* ---------- Topo ---------- */
.topo { --gn-topo: 68px; }
.topo .topo__nav { align-items: center; }
.topo__nav > a, .gn-sub__botao { min-height: 44px; display: inline-flex; align-items: center; }
.gn-sub { position: relative; display: flex; align-items: center; align-self: stretch; }
.gn-sub__rotulo { display: none; }
.gn-sub__botao {
  gap: 6px; padding: 6px 0; margin: 0; border: 0; background: none; color: inherit;
  font: inherit; cursor: pointer; transition: color 160ms var(--ease-out);
}
.gn-sub__botao svg { width: 12px; height: 12px; transition: transform 200ms var(--ease-out); }
.gn-sub__botao[aria-expanded="true"] svg { transform: rotate(180deg); }
.gn-sub__botao[aria-expanded="true"], .gn-sub__botao--atual { color: #fff; }
.gn-sub__botao--atual { box-shadow: inset 0 -1px 0 var(--ciano); }
.gn-sub__lista {
  position: absolute; top: 100%; left: -18px; z-index: 2; display: none;
  width: 340px; margin: 0; padding: 8px; list-style: none;
  background: rgba(3, 8, 23, 0.98); border: 1px solid var(--linha-forte); border-radius: var(--raio);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}
.gn-sub__botao[aria-expanded="true"] ~ .gn-sub__lista { display: grid; }
@media (hover: hover) and (min-width: 1101px) {
  /* N7: o painel abre só pelo estado aria-expanded; o passar do mouse é tratado no comum.js */
  .gn-sub__lista a:hover { background: rgba(25, 204, 250, 0.08); color: #fff; }
}
.topo__nav .gn-sub__lista a {
  display: grid; gap: 2px; min-height: 44px; padding: 8px 12px; color: var(--ink);
  border-radius: var(--raio); border-left: 2px solid transparent; box-shadow: none;
}
.gn-sub__lista small { font-family: var(--mono); font-size: 0.6875rem; color: var(--ink-2); }
.topo__nav .gn-sub__lista a[aria-current="page"] { border-left-color: var(--ciano); color: #fff; box-shadow: none; background: rgba(25, 204, 250, 0.06); }
/* submenu Empresa: Quem somos, Parceiros, Ética e Compliance */
.gn-sub--empresa .gn-sub__lista { width: 300px; }

/* botão do menu (só abaixo de 1100 px) */
.gn-menu {
  display: none; flex: none; width: 46px; height: 46px; padding: 0; margin-left: 10px;
  place-items: center; cursor: pointer; color: var(--ink);
  background: rgba(3, 8, 23, 0.35); border: 1px solid var(--linha-forte); border-radius: var(--raio);
}
.gn-menu svg { width: 22px; height: 22px; }
.gn-menu .gn-x { display: none; }
.gn-menu[aria-expanded="true"] .gn-tres { display: none; }
.gn-menu[aria-expanded="true"] .gn-x { display: block; }
/* N9: com a gaveta aberta o fundo não rola. A trava fica no html (a rolagem da janela): travar também
   o body faria dele um contêiner de rolagem e soltaria as barras "sticky" do Smart Vision. */
html.gn-trava { overflow: hidden; }

/* N14: "Pular para o conteúdo", primeiro foco de todas as páginas */
.gn-pular {
  position: fixed; left: 16px; top: -80px; z-index: 100; padding: 10px 18px;
  background: var(--ciano); color: #03080d; font-weight: 700; border-radius: var(--raio);
  text-decoration: none; transition: top 120ms var(--ease-out);
}
.gn-pular:focus { top: 12px; }

@media (max-width: 1100px) {
  .topo { gap: 16px; }
  .gn-menu { display: grid; }
  .topo .topo__nav.gn-nav {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    height: calc(100vh - var(--gn-topo)); height: calc(100dvh - var(--gn-topo));
    flex-direction: column; align-items: stretch; gap: 0; overflow-y: auto; overscroll-behavior: contain;
    padding: 12px var(--gutter) 40px; font-size: 1.0625rem; color: var(--ink);
    background: #030817; border-top: 1px solid var(--linha);
  }
  .topo.gn-aberto { background: #030817; border-bottom-color: var(--linha); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .topo.gn-aberto .topo__nav.gn-nav { display: flex; }
  .gn-sub { display: block; align-self: auto; }
  .gn-sub__botao { display: none; }
  .gn-sub__rotulo { display: block; margin: 12px 0 6px; font-family: var(--mono); font-size: 0.75rem; color: var(--ink-2); }
  .gn-sub__lista, .gn-sub__botao[aria-expanded="true"] ~ .gn-sub__lista {
    position: static; display: grid; width: auto; padding: 0; border: 0; background: none; box-shadow: none;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 2px;
  }
  .topo__nav .gn-sub__lista a { min-height: 52px; padding: 8px 12px; background: rgba(163, 174, 198, 0.05); }
  .topo__nav.gn-nav > a { min-height: 52px; margin-top: 12px; padding: 0 12px; border-top: 1px solid var(--linha); font-weight: 600; }
}
@media (max-width: 760px) {
  .topo { --gn-topo: 60px; gap: 10px; }
  .topo__cta { padding: 0 14px; }
  .gn-menu { margin-left: 0; }
}
@media (max-width: 359px) {
  .topo__marca img { width: 120px; }
}

/* ---------- Outros produtos (fim das páginas de produto) ---------- */
.gn-outros { padding: 72px var(--gutter) 80px; border-top: 1px solid var(--linha); }
.gn-outros__tit {
  margin: 0 0 22px; font-family: var(--mono); font-size: 0.75rem; font-weight: 500;
  letter-spacing: 0.02em; line-height: 1.5; color: var(--ink-2); font-variation-settings: normal;
}
.gn-outros__lista { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.gn-outros__lista a {
  display: grid; grid-template-columns: 1fr auto; align-items: center; column-gap: 12px; min-height: 64px;
  padding: 12px 16px; border: 1px solid var(--linha); border-radius: var(--raio);
  background: rgba(163, 174, 198, 0.04);
  transition: border-color 160ms var(--ease-out), background-color 160ms var(--ease-out);
}
.gn-outros__lista b { font-weight: 600; font-size: 1rem; color: var(--ink); }
.gn-outros__lista small { grid-column: 1; font-family: var(--mono); font-size: 0.6875rem; color: var(--ink-2); }
.gn-outros__lista span { grid-column: 2; grid-row: 1 / 3; color: var(--ciano); }
@media (hover: hover) { .gn-outros__lista a:hover { border-color: var(--ciano); background: rgba(25, 204, 250, 0.06); } }

/* ---------- Rodapé ---------- */
.gn-rodape {
  position: relative; z-index: 1; padding: 64px var(--gutter) 28px; color: var(--ink-2);
  font-size: 0.9375rem; line-height: 1.6; background: #020612; border-top: 1px solid var(--linha);
}
.gn-rodape__grade { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 40px 56px; }
.gn-rodape__marca img { display: block; width: 190px; height: auto; }
.gn-rodape__marca p { margin-top: 18px; max-width: 30em; }
.gn-rodape__tit {
  margin: 0 0 14px; font-family: var(--mono); font-size: 0.75rem; font-weight: 500; letter-spacing: 0.02em;
  line-height: 1.5; color: var(--ciano); font-variation-settings: normal;
}
.gn-rodape ul { list-style: none; margin: 0; padding: 0; display: grid; }
.gn-rodape li a { display: inline-flex; align-items: center; min-height: 32px; color: var(--ink); transition: color 160ms var(--ease-out); }
.gn-rodape address { margin-top: 14px; font-style: normal; }
.gn-rodape__base {
  margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--linha);
  font-family: var(--mono); font-size: 0.75rem; color: var(--ink-2);
}
@media (hover: hover) { .gn-rodape li a:hover { color: var(--ciano); } }
@media (max-width: 1100px) {
  .gn-rodape__grade { gap: 40px 36px; }
}
@media (max-width: 900px) {
  .gn-rodape__grade { grid-template-columns: 1fr 1fr; }
  .gn-rodape__marca { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .gn-rodape__grade { grid-template-columns: 1fr; }
  .gn-rodape li a { min-height: 44px; }
}

/* ---------- Índice de seções que rola de lado (CFS, Smart Ports, VisionAI) ----------
   D23: um degradê na borda mostra que há mais itens; o JS liga as classes e traz o item ativo para a vista. */
nav.indice::before, nav.indice::after {
  content: ""; position: sticky; z-index: 1; flex: none; width: 44px; pointer-events: none;
  opacity: 0; transition: opacity 160ms var(--ease-out);
}
nav.indice::before { left: 0; margin-right: -44px; background: linear-gradient(90deg, var(--bg), transparent); }
nav.indice::after { right: 0; margin-left: -44px; background: linear-gradient(270deg, var(--bg), transparent); }
nav.indice.gn-rola-esq::before, nav.indice.gn-rola-dir::after { opacity: 1; }

/* ---------- N19: alvos de toque com pelo menos 24 px, sem mexer no desenho ----------
   O logo do topo ganha altura de clique; os links da migalha e os sliders ganham área por padding
   e margem negativa, então a linha e o espaço ocupado continuam iguais. */
.topo__marca { display: flex; align-items: center; min-height: 44px; }
.trilha a { padding-block: 4px; margin-block: -4px; }
input[type="range"] { height: 24px; margin-block: -2px; }
.gn-rodape__marca > a { display: inline-flex; align-items: center; min-height: 44px; }


/* ---------- Seletor de idioma: bandeiras separadas por barra, último item do menu ---------- */
.topo .topo__nav .gn-idioma { display: inline-flex; align-items: center; margin-left: 4px; padding-left: 12px; border-left: 1px solid var(--linha); }
.topo .topo__nav .gn-idioma a { display: inline-flex; align-items: center; gap: 10px; min-height: 32px; padding: 4px 9px; color: var(--ink); text-decoration: none; box-shadow: none; opacity: 0.5; transition: opacity 160ms var(--ease-out); }
.topo .topo__nav .gn-idioma a + a { border-left: 1px solid rgba(163, 174, 198, 0.35); }
.topo .topo__nav .gn-idioma a[aria-current="true"] { opacity: 1; }
.topo .topo__nav .gn-idioma a:focus-visible { opacity: 1; outline: 2px solid var(--ciano); outline-offset: 2px; }
@media (hover: hover) { .topo .topo__nav .gn-idioma a:hover { opacity: 1; } }
.topo .gn-bandeira { display: block; width: 20px; height: 14px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2); }
.topo .gn-idioma__nome { display: none; }
@media (max-width: 1100px) {
  .topo .topo__nav .gn-idioma { margin: 16px 0 0; padding: 12px 0 0; border-left: 0; border-top: 1px solid var(--linha); }
  .topo .topo__nav .gn-idioma a { min-height: 48px; padding: 0 16px; opacity: 0.6; }
  .topo .topo__nav .gn-idioma a:first-child { padding-left: 4px; }
  .topo .topo__nav .gn-idioma a[aria-current="true"] { opacity: 1; }
  .topo .gn-idioma__nome { display: inline; font-size: 0.9375rem; }
  .topo .gn-bandeira { width: 24px; height: 17px; }
}
