/* =========================================================================
   O TOPO do sistema (comum/_topo.html) — o mesmo nas telas do escritório e
   nas das lojas — e a marca da Oficina (comum/_logo.html, static/logo.svg).
   Só tokens de static/tema.css.
   ========================================================================= */
.topo {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--cor-superficie) 92%, transparent);
  backdrop-filter: saturate(1.5) blur(10px);
  border-bottom: 1px solid var(--cor-borda);
  font-family: var(--fonte);
}
.topo-dentro {
  max-width: var(--largura); margin: 0 auto; padding: 0 var(--esp-5);
  display: flex; align-items: center; gap: var(--esp-4); min-height: 60px;
}
.topo-dentro.largo { max-width: 1440px; }
/* .topo-dentro.estreito: o topo não encolhe — com o menu cheio, os módulos sumiam rolando pro lado */
.topo-marca { display: inline-flex; align-items: center; text-decoration: none; color: var(--cor-texto); flex: none;
  margin-right: var(--esp-3); border-radius: 10px; }
.topo-marca:focus-visible { outline: 2px solid var(--cor-acao); outline-offset: 3px; }

/* ---- a marca ---- */
.logo { display: inline-flex; align-items: center; gap: 10px; }
.logo-selo { width: 34px; height: 34px; flex: none; display: block; }
.logo-fundo { fill: var(--cor-acao); }
.logo-anel { stroke: var(--cor-superficie); }
.logo-ponto { fill: var(--cor-superficie); }
.logo-texto { display: flex; flex-direction: column; line-height: 1.05; }
.logo-nome { font-weight: 750; font-size: 17px; letter-spacing: -0.01em; color: var(--cor-texto); }
.logo-sub { font-size: 11px; font-weight: 550; color: var(--cor-texto-3); letter-spacing: .01em; margin-top: 2px; }
.logo.grande { gap: 14px; }
.logo.grande .logo-selo { width: 52px; height: 52px; }
.logo.grande .logo-nome { font-size: 26px; }
.logo.grande .logo-sub { font-size: 13px; }

/* ---- o menu ---- */
.topo-menu { display: flex; align-items: center; gap: 2px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none;
  /* rola só pro lado: sem isso o risquinho do item ativo (1px) fazia o menu balançar pra cima e pra baixo no dedo */
  overflow-y: hidden; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }
.topo-menu::-webkit-scrollbar { display: none; }
.topo-menu > a, .topo-mais > summary {
  position: relative; display: inline-flex; align-items: center; gap: 6px;
  height: 60px; padding: 0 12px; white-space: nowrap; cursor: pointer;
  color: var(--cor-texto-2); text-decoration: none; font-weight: 500; list-style: none; font-size: 15px;
}
.topo-mais > summary::-webkit-details-marker { display: none; }
.topo-mais > summary::after { content: ""; width: 7px; height: 7px; margin-left: 2px; border: solid currentColor;
  border-width: 0 1.6px 1.6px 0; transform: rotate(45deg) translateY(-2px); }
.topo-menu > a:hover, .topo-mais > summary:hover { color: var(--cor-texto); }
.topo-menu > a.ativo, .topo-mais.ativo > summary { color: var(--cor-texto); font-weight: 650; }
.topo-menu > a.ativo::after, .topo-mais.ativo > summary::before {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 0; height: 2px;
  background: var(--cor-acao); border-radius: 2px;
}
.topo-contador {
  display: inline-grid; place-items: center; min-width: 19px; height: 19px; padding: 0 5px;
  border-radius: 999px; background: var(--cor-erro); color: var(--cor-superficie); font-size: 11px; font-weight: 700;
}
.topo details { position: relative; }
.topo .topo-mais { position: static; }  /* presa no .topo, fora do menu que rola: senão a gaveta é cortada */
.topo-gaveta {
  position: absolute; top: calc(100% + 6px); z-index: 40; min-width: 220px; padding: 6px;
  background: var(--cor-superficie); border: 1px solid var(--cor-borda); border-radius: var(--raio-g);
  box-shadow: var(--sombra-3); display: flex; flex-direction: column;
}
.topo-mais .topo-gaveta { top: 56px; }
.topo-gaveta.direita { right: 0; }
.topo-gaveta a, .topo-gaveta button {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 8px;
  border: 0; background: none; color: var(--cor-texto); text-decoration: none; text-align: left;
  font: inherit; font-weight: 500; cursor: pointer; min-height: 40px;
}
.topo-gaveta a:hover, .topo-gaveta button:hover { background: var(--cor-superficie-3); color: var(--cor-texto); }
.topo-gaveta a.ativo { color: var(--cor-acao); }
.topo-gaveta svg { width: 18px; height: 18px; color: var(--cor-texto-3); flex: none; }
.topo-gaveta form { margin: 0; }
.topo-gaveta .quem { padding: 8px 10px 10px; margin-bottom: 4px; border-bottom: 1px solid var(--cor-borda); }
.topo-gaveta .quem strong { display: block; }
.topo-gaveta .quem small { color: var(--cor-texto-3); }
.topo-conta { flex: none; margin-left: auto; }
.topo-conta > summary {
  list-style: none; cursor: pointer; display: grid; place-items: center; width: 36px; height: 36px;
  border-radius: 50%; background: var(--cor-acao-suave); color: var(--cor-acao); font-weight: 700; font-size: 13px;
}
.topo-conta > summary::-webkit-details-marker { display: none; }

@media (max-width: 760px) {
  .topo-dentro { flex-wrap: wrap; padding: 0 var(--esp-4); gap: 0 var(--esp-3); }
  .topo-marca { height: 56px; }
  .logo-sub { display: none; }
  .topo-menu { order: 3; flex-basis: 100%; margin: 0 calc(-1 * var(--esp-4)); padding: 0 var(--esp-2);
    border-top: 1px solid var(--cor-borda); }
  .topo-menu:empty { display: none; }
  .topo-menu > a, .topo-mais > summary { height: 46px; padding: 0 10px; }
  .topo-mais .topo-gaveta { top: auto; right: var(--esp-4); }
}

/* ---- a faixa da loja (telas das lojas, logo abaixo do topo) ---- */
.loja-faixa { background: var(--cor-superficie); border-bottom: 1px solid var(--cor-borda); }
.loja-faixa-dentro { max-width: 760px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 12px; min-height: 58px; }
.loja-faixa-dentro.largo { max-width: var(--largura); padding: 10px var(--esp-5); }
.loja-faixa .loja-sel { flex: 1; }
.loja-trocar {
  flex: none; display: inline-flex; align-items: center; padding: 7px 12px; border-radius: 999px;
  border: 1px solid var(--cor-borda-forte); color: var(--cor-texto); text-decoration: none; font-size: 14px; font-weight: 600;
}
.loja-trocar:hover { background: var(--cor-superficie-3); }
@media (max-width: 760px) {
  .loja-faixa-dentro.largo { padding: 10px var(--esp-4); }
}

/* ---- login ---- */
.logo-entrar { display: flex; justify-content: center; margin-bottom: var(--esp-5); }
.titulo-entrar { text-align: center; font-size: 1.3rem; margin: 0; }
.sub-entrar { text-align: center; color: var(--cor-texto-3); margin: 4px 0 var(--esp-4); }

.caixa-entrar .logo-entrar .logo { flex-direction: row; }
.caixa-entrar .logo-entrar .logo-nome { color: var(--cor-texto); }
.caixa-entrar .logo-entrar .logo-sub { color: var(--cor-texto-3); }
.caixa-entrar .logo-entrar .logo-texto { text-align: left; }

/* Cópia de teste (OFICINA_ENSAIO=1) */
.faixa-ensaio { background: var(--cor-atencao-suave); color: var(--cor-atencao); font-weight: 600;
  padding: 6px 16px; font-size: 13px; text-align: center; }

/* ---- o sino de notificações (v1.01; preenchido pelo static/novidades.js) ---- */
.topo-sino { flex: none; margin-left: auto; }
.topo-sino + .topo-conta { margin-left: 0; }
.topo-sino > summary {
  list-style: none; cursor: pointer; position: relative; display: grid; place-items: center;
  width: 38px; height: 38px; border-radius: 50%; color: var(--cor-texto-2);
}
.topo-sino > summary::-webkit-details-marker { display: none; }
.topo-sino > summary:hover, .topo-sino[open] > summary { background: var(--cor-superficie-3); color: var(--cor-texto); }
.topo-sino > summary:focus-visible { outline: 2px solid var(--cor-acao); outline-offset: 2px; }
.topo-sino > summary svg { width: 21px; height: 21px; }
.topo-sino .topo-contador { position: absolute; top: 1px; right: -3px; border: 2px solid var(--cor-superficie); }
.topo-sino.toca > summary svg { animation: sino-balanca .9s ease-in-out; transform-origin: 50% 10%; }
@keyframes sino-balanca { 0%,100% { transform: rotate(0) } 20% { transform: rotate(14deg) } 40% { transform: rotate(-11deg) }
  60% { transform: rotate(7deg) } 80% { transform: rotate(-4deg) } }
@media (prefers-reduced-motion: reduce) { .topo-sino.toca > summary svg { animation: none; } }
.sino-gaveta { width: min(360px, calc(100vw - 24px)); padding: 0; }
.sino-cabeca { display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding: 12px 14px 10px; border-bottom: 1px solid var(--cor-borda); }
.topo-gaveta .sino-cabeca a.sino-config { width: auto; min-height: 0; padding: 0; font-size: 13px; color: var(--cor-acao); }
.topo-gaveta .sino-cabeca a.sino-config:hover { background: none; text-decoration: underline; }
.sino-lista { max-height: min(420px, 60vh); overflow-y: auto; padding: 6px; }
.topo-gaveta .sino-lista a { align-items: flex-start; flex-direction: column; gap: 1px; padding: 9px 10px; }
.sino-lista a strong { font-weight: 600; }
.sino-lista a small { color: var(--cor-texto-3); font-size: 12.5px; }
.sino-lista a.sino-novo strong::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--cor-atencao); margin-right: 7px; vertical-align: 1px; }
.sino-vazio { margin: 0; padding: 18px 10px; color: var(--cor-texto-3); text-align: center; font-size: 14px; }
.topo-gaveta a.topo-versao small { margin-left: auto; color: var(--cor-texto-3); font-size: 12px; }
@media (max-width: 760px) {
  .topo-sino { height: 56px; display: flex; align-items: center; }
  .topo-sino .sino-gaveta { position: fixed; top: 60px; right: 12px; }
}

/* ---- Minha conta › Avisos e Novidades da versão ---- */
.avisos-grupo { border: 0; padding: 0; margin: 0 0 var(--esp-4); }
.avisos-grupo legend { font-weight: 650; margin-bottom: 8px; padding: 0; }
.aviso-opcao { align-items: flex-start !important; margin-bottom: 10px; }
.aviso-opcao input { margin-top: 2px !important; }
.aviso-opcao span { display: flex; flex-direction: column; gap: 1px; }
.aviso-opcao small { font-weight: 400; color: var(--cor-texto-3); }
.aviso-bloqueado { color: var(--cor-erro); }
.versao-bloco { margin-bottom: var(--esp-4); }
.versao-bloco h2 small { font-weight: 500; font-size: .85rem; color: var(--cor-texto-3); margin-left: 6px; }
.versao-itens { margin: 8px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; line-height: 1.5; }
.versao-atual { border-color: var(--cor-acao); }

/* =========================================================================
   v1.01 — LAYOUT B ("jeito de app", escolhido pelo usuário em 11/11/2026)
   computador (>= 1000px): coluna do menu à esquerda, o topo fica só com sino e conta;
   celular/tablet: barra embaixo + o menu inteiro abre do lado (botão "Menu").
   Tudo só pra quem tem a coluna (body:has(> .lateral)); as telas da loja seguem iguais.
   ========================================================================= */
:root { --lateral-largura: 236px; --lateral-fundo: #0b3550; --lateral-texto: #c9dbe8; --abas-altura: 62px; }
@media (prefers-color-scheme: dark) { :root:not([data-tema="claro"]) { --lateral-fundo: #0a1117; --lateral-texto: #9fb2c0; } }
:root[data-tema="escuro"] { --lateral-fundo: #0a1117; --lateral-texto: #9fb2c0; }

.lateral {
  position: fixed; inset: 0 auto 0 0; z-index: 50; width: var(--lateral-largura);
  background: var(--lateral-fundo); color: var(--lateral-texto); font-family: var(--fonte);
  display: flex; flex-direction: column; gap: 1px; padding: 12px 10px 18px;
  overflow-y: auto; overscroll-behavior: contain;
  scrollbar-width: none;                      /* sem barra de rolagem (pedido do usuário) */
}
.lateral::-webkit-scrollbar { display: none; }
.lateral-cabeca { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px 14px; }
.lateral-marca { text-decoration: none; border-radius: 10px; }
.lateral .logo-nome { color: #fff; }
.lateral .logo-sub { color: var(--lateral-texto); opacity: .8; }
.lateral .logo-fundo { fill: #fff; }
.lateral .logo-anel { stroke: var(--lateral-fundo); }
.lateral .logo-ponto { fill: var(--lateral-fundo); }
.lateral-fechar { display: none; border: 0; background: none; color: #fff; cursor: pointer; width: 40px; height: 40px;
  border-radius: 50%; place-items: center; }
.lateral-fechar svg { width: 22px; height: 22px; }
.lateral-item {
  display: flex; align-items: center; gap: 12px; padding: 0 12px; min-height: 40px; border-radius: 10px;
  color: inherit; text-decoration: none; font-weight: 500; font-size: 15px; cursor: pointer; list-style: none;
}
.lateral-item::-webkit-details-marker { display: none; }
.lateral-item svg { width: 19px; height: 19px; flex: none; opacity: .85; }
.lateral-item:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.lateral-item.ativo { background: rgba(255, 255, 255, .13); color: #fff; font-weight: 650; }
.lateral-item:focus-visible { outline: 2px solid #fff; outline-offset: -2px; }
.lateral-mais { margin-top: 6px; padding-top: 6px; border-top: 1px solid rgba(255, 255, 255, .1); }
.lateral-mais > summary::after { content: ""; margin-left: auto; width: 7px; height: 7px; border: solid currentColor;
  border-width: 0 1.6px 1.6px 0; transform: rotate(45deg) translateY(-2px); opacity: .7; transition: transform .15s; }
.lateral-mais[open] > summary::after { transform: rotate(-135deg) translateY(-2px); }
.lateral-item.sub { min-height: 36px; font-size: 14px; padding-left: 16px; }
.lateral-fundo { display: none; }
.barra-abas { display: none; }

/* a página abre espaço pra coluna; o menu de cima e a marca saem (estão na coluna) */
body:has(> .lateral) { padding-left: var(--lateral-largura); }
body:has(> .lateral) .topo-menu, body:has(> .lateral) .topo-marca { display: none; }
body:has(> .lateral) .topo-dentro { justify-content: flex-end; }

/* barra de rolagem da página: fina e na cor do tema */
html { scrollbar-width: thin; scrollbar-color: var(--cor-borda-forte) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--cor-borda-forte); border-radius: 10px; border: 3px solid var(--cor-fundo); }
::-webkit-scrollbar-track { background: transparent; }

@media (max-width: 999px) {
  body:has(> .lateral) { padding-left: 0; padding-bottom: calc(var(--abas-altura) + env(safe-area-inset-bottom)); }
  body:has(> .lateral) .topo-marca { display: inline-flex; }
  body:has(> .lateral) .topo-dentro { justify-content: flex-start; flex-wrap: nowrap; }
  /* sem o vidro (backdrop-filter): ele prende as caixas "fixed" dentro do topo e a dos avisos sumia lá em cima */
  body:has(> .lateral) .topo { backdrop-filter: none; background: var(--cor-superficie); }
  body:has(> .lateral) .topo-sino > summary { display: none; }        /* o sino é o "Avisos" da barra de baixo */
  body:has(> .lateral) .topo-sino { margin-left: auto; width: 0; }
  body:has(> .lateral) .topo-sino .sino-gaveta { position: fixed; top: auto; right: 10px; left: 10px; width: auto;
    bottom: calc(var(--abas-altura) + env(safe-area-inset-bottom) + 8px); }
  body:has(> .lateral) .topo-sino + .topo-conta { margin-left: 0; }

  /* o menu inteiro: abre do lado, por cima, com fundo escurecido */
  .lateral { width: min(300px, 84vw); transform: translateX(-102%); transition: transform .22s ease; box-shadow: 0 0 40px rgba(0, 0, 0, .35); z-index: 60; }
  .menu-aberto .lateral { transform: none; }
  .lateral-fechar { display: grid; }
  .lateral-fundo { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(5, 15, 25, .45);
    opacity: 0; pointer-events: none; transition: opacity .22s; }
  .menu-aberto .lateral-fundo { opacity: 1; pointer-events: auto; }
  .menu-aberto, .menu-aberto body { overflow: hidden; }

  .barra-abas {
    display: flex; position: fixed; inset: auto 0 0 0; z-index: 45; font-family: var(--fonte);
    background: var(--cor-superficie); border-top: 1px solid var(--cor-borda);
    padding: 5px 4px calc(5px + env(safe-area-inset-bottom));
  }
  .barra-abas > a, .barra-abas > button {
    flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    min-height: 52px; border: 0; background: none; border-radius: 12px; position: relative;
    color: var(--cor-texto-3); text-decoration: none; font: inherit; font-size: 11.5px; font-weight: 500; cursor: pointer;
  }
  .barra-abas span:not(.topo-contador) { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .barra-abas svg { width: 23px; height: 23px; }
  .barra-abas .ativo { color: var(--cor-acao); font-weight: 650; }
  .barra-abas .topo-contador { position: absolute; top: 2px; left: calc(50% + 4px); border: 2px solid var(--cor-superficie); }

  /* o que gruda embaixo sobe pra cima da barra */
  html body:has(> .lateral) .rodape-fixo { bottom: calc(var(--abas-altura) + env(safe-area-inset-bottom)); }
  html body:has(> .lateral) .chat-doca:not(.aberto) { bottom: calc(var(--abas-altura) + env(safe-area-inset-bottom) + 12px); }
}
@media (prefers-reduced-motion: reduce) { .lateral, .lateral-fundo { transition: none; } }
/* com os avisos abertos, o botão redondo do assistente sai da frente */
body:has([data-sino][open]) .chat-doca:not(.aberto) { visibility: hidden; }

/* ---- layout B: a barra de cima = título da tela + lua + sino + conta, na cor do fundo ---- */
.topo-titulo { display: none; }
.topo-lua { display: none; }
body:has(> .lateral) .topo {
  background: var(--cor-fundo); border-bottom: 0;   /* sólido: o conteúdo não aparece por trás ao rolar */
}
body:has(> .lateral) .topo-dentro { gap: 10px; min-height: 76px; }
body:has(> .lateral) .topo-titulo { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.2; }
body:has(> .lateral) .topo-titulo strong { font-size: 22px; font-weight: 700; color: var(--cor-texto);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -.01em; }
body:has(> .lateral) .topo-titulo small { font-size: 13px; color: var(--cor-texto-3); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body:has(> .lateral) .topo-lua, body:has(> .lateral) .topo-sino > summary, body:has(> .lateral) .topo-conta > summary {
  width: 40px; height: 40px; border-radius: 50%; }
body:has(> .lateral) .topo-lua, body:has(> .lateral) .topo-sino > summary {
  display: grid; place-items: center; flex: none; cursor: pointer; color: var(--cor-texto-2);
  background: var(--cor-superficie); border: 1px solid var(--cor-borda); }
body:has(> .lateral) .topo-lua:hover, body:has(> .lateral) .topo-sino > summary:hover { color: var(--cor-texto); border-color: var(--cor-borda-forte); }
body:has(> .lateral) .topo-lua svg { width: 19px; height: 19px; }
body:has(> .lateral) .topo-conta > summary { background: var(--cor-acao); color: var(--cor-acao-texto, #fff); }
body:has(> .lateral) .topo-sino { margin-left: 0; }
body:has(> .lateral) .topo-sino + .topo-conta { margin-left: 0; }
/* o título já está em cima: na página fica só pro leitor de tela (o "? Como funciona" e os botões continuam) */
body:has(.topo-titulo) .tela-cabecalho h1, body:has(.topo-titulo) .tela-cabecalho .tela-sub {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
body:has(.topo-titulo) .tela-cabecalho { padding-top: 4px; }
body:has(.topo-titulo) .tela-cabecalho:not(:has(.tela-acoes)):not(:has(.titulo-com-ajuda > :not(h1))) { display: none; }
@media (max-width: 999px) {
  body:has(.topo-titulo) .topo-marca { display: none; }
  body:has(> .lateral) .topo-dentro { min-height: 64px; }
  body:has(> .lateral) .topo-titulo strong { font-size: 19px; }
  body:has(> .lateral) .topo-sino { width: auto; height: auto; }
}
body:has(> .lateral) .barra-acoes { top: 80px; }
@media (max-width: 999px) { body:has(> .lateral) .barra-acoes { top: 68px; } }
.aviso-teste { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 4px 0 8px; }
.aviso-teste .sub { flex: 1 1 260px; margin: 0; }
