/*
 * Tema padrão do ToolboxOffice (site público). Sem JavaScript: o menu do celular usa um checkbox.
 * A cor (--brand) e as letras (--f-title, --f-text) vêm das configurações do site, num <style> do layout.php.
 * Base: o site.css do protótipo Sites. Pensado para celular primeiro: as regras de telas largas ficam no fim.
 */

:root {
  --ink: #1b1f24;      /* texto principal */
  --muted: #4b535c;    /* texto secundário (contraste 7:1 no branco) */
  --line: #e3e6ea;
  --bg-alt: #f5f6f8;
  --radius: 14px;
  --nav-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--nav-h) + 8px); }
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
body {
  margin: 0;
  font: 16px/1.65 var(--f-text), system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: #fff;
  overflow-wrap: break-word; /* links e palavras longas não estouram a largura da tela */
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand); text-underline-offset: .15em; }
a, summary, label { touch-action: manipulation; }
h1, h2, h3 {
  font-family: var(--f-title), var(--f-text), sans-serif;
  line-height: 1.15;
  margin: 0 0 .5em;
  color: var(--ink);
  text-wrap: balance;
}
h1 { font-size: clamp(2.125rem, 6vw, 3.75rem); }
h2 { font-size: clamp(1.75rem, 4vw, 2.375rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 4px; }

/* Texto só para leitor de tela (ex.: "abre em nova aba"). */
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
/* Seções de texto: linhas curtas para leitura, mas com a mesma margem esquerda das outras seções. */
.narrow > * { max-width: 760px; }

/* Pular para o conteúdo: invisível até receber o foco do teclado. */
.skip {
  position: absolute; left: 12px; top: -100px; z-index: 20;
  background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 8px; font-weight: 600;
}
.skip:focus { top: 12px; }

.draft-bar { margin: 0; background: #fef3c7; color: #713f12; text-align: center; padding: 10px 16px; font-size: .875rem; }

/* Cabeçalho e menu */
.nav { position: sticky; top: 0; z-index: 10; background: rgba(255, 255, 255, .96); border-bottom: 1px solid var(--line); }
.nav-in { position: relative; display: flex; align-items: center; justify-content: space-between; min-height: var(--nav-h); gap: 16px; }
.brand {
  display: inline-flex; align-items: center; min-height: 44px; min-width: 0; padding: 6px 0;
  font-family: var(--f-title), sans-serif; font-weight: 700; font-size: 1.125rem; line-height: 1.2;
  color: var(--ink); text-decoration: none;
}
/* Logo nunca encolhe por causa do menu: altura fixa, largura proporcional (com teto para logos muito largos). */
.brand:has(img) { flex-shrink: 0; }
.brand img { height: 44px; width: auto; max-width: min(240px, 55vw); object-fit: contain; object-position: left center; }
.menu a, .menu-bar a {
  display: flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 8px;
  color: #3b4148; text-decoration: none; font-weight: 500; font-size: .9375rem;
}
.menu a:hover, .menu-bar a:hover { background: var(--bg-alt); color: var(--brand); }
.menu a[aria-current="page"], .menu-bar a[aria-current="page"] { color: var(--brand); font-weight: 600; }

/* Barra em linha (telas largas, poucas páginas): escondida até o fim do arquivo liberar. */
.menu-bar { display: none; }

/* Botão "Menu" (<details>): abre uma lista que rola sozinha se houver muitas páginas. */
.menu-drop { flex-shrink: 0; }
.menu-btn {
  display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px; border-radius: 8px;
  font-weight: 600; font-size: .9375rem; cursor: pointer; list-style: none; user-select: none;
}
.menu-btn::-webkit-details-marker { display: none; }
.menu-btn:hover, .menu-drop[open] .menu-btn { background: var(--bg-alt); }
.bars { display: flex; flex-direction: column; gap: 4px; }
.bars span { width: 18px; height: 2px; background: var(--ink); border-radius: 2px; }
.menu {
  position: absolute; left: 0; right: 0; top: 100%;
  display: flex; flex-direction: column; padding: 8px 12px 16px; background: #fff;
  border-bottom: 1px solid var(--line); box-shadow: 0 12px 24px rgba(0, 0, 0, .08);
  max-height: calc(100vh - var(--nav-h));
  max-height: calc(100dvh - var(--nav-h)); /* nunca passa da tela: o resto rola dentro do menu */
  overflow-y: auto; overscroll-behavior: contain;
}

/* Botões */
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 26px;
  background: var(--brand); color: #fff; text-decoration: none; font-weight: 600; border-radius: 999px;
  transition: filter .15s;
}
.btn:hover { filter: brightness(1.12); }

/* Capa */
.hero {
  position: relative; overflow: hidden; color: #fff;
  background: var(--brand);
  background: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand) 60%, #000));
}
.hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* Véu sobre a foto: escuro o bastante para texto branco passar no AA (4,5:1) mesmo sobre foto quase branca. */
.hero.has-img::after { content: ""; position: absolute; inset: 0; background: linear-gradient(rgba(0, 0, 0, .58), rgba(0, 0, 0, .68)); }
.hero.has-img .hero-in { text-shadow: 0 1px 3px rgba(0, 0, 0, .35); }
.hero.has-img .btn { text-shadow: none; }
.hero-in { position: relative; z-index: 1; max-width: 880px; padding-top: clamp(64px, 12vw, 140px); padding-bottom: clamp(64px, 12vw, 140px); text-align: center; }
.hero h1, .hero h2 { color: #fff; font-size: clamp(2.125rem, 6vw, 3.75rem); }
.hero-sub { font-size: clamp(1.125rem, 2.2vw, 1.3125rem); max-width: 640px; margin: 0 auto 28px; }
.hero .btn { background: #fff; color: var(--brand); }
.hero :focus-visible { outline-color: #fff; }

/* Seções */
.sec { padding: clamp(56px, 8vw, 88px) 0; }
.sec.alt { background: var(--bg-alt); }
.page-title { padding-top: clamp(40px, 6vw, 64px); }
.page-title h1 { font-size: clamp(2rem, 5vw, 3rem); margin: 0; }
.page-title + .sec { padding-top: 32px; }
.prose { color: #3b4148; }
.empty { color: #6b7280; font-style: italic; border: 2px dashed #d4d9df; border-radius: 12px; padding: 18px; text-align: center; }
.split { display: grid; gap: 28px; align-items: center; }
.split-img, .map { width: 100%; aspect-ratio: 4 / 3; border-radius: var(--radius); }
.split-img { object-fit: cover; }

/* Serviços e depoimentos */
.cards { list-style: none; padding: 0; margin: 28px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 20px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.card p { color: var(--muted); }
.card .price { color: var(--brand); font-weight: 700; font-size: 1.125rem; font-variant-numeric: tabular-nums; }
.quote { margin: 0; }
.quote blockquote { margin: 0 0 14px; color: #2d3237; }
.quote blockquote::before { content: "“"; display: block; font: 700 48px/.6 Georgia, serif; color: var(--brand); margin: 10px 0 6px; }
.quote figcaption { font-weight: 600; }

/* Galeria */
.gallery { list-style: none; padding: 0; margin: 28px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 14px; }
.gallery figure { margin: 0; }
.gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; }
.gallery figcaption { font-size: .875rem; color: var(--muted); margin-top: 6px; }

/* Perguntas */
.faq { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; font-weight: 600; padding: 14px 0; min-height: 44px; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--brand); font-size: 1.5rem; line-height: 1; flex-shrink: 0; }
.faq[open] summary::after { content: "–"; }
.faq .prose { padding: 0 0 18px; }

/* Horários */
.hours { margin: 20px 0 0; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.hours div { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 16px; padding: 14px 20px; border-top: 1px solid #eef0f2; }
.hours div:first-child { border-top: 0; }
.hours dt { font-weight: 600; }
.hours dd { margin: 0; color: var(--muted); font-variant-numeric: tabular-nums; }
.note { color: var(--muted); font-size: .9375rem; margin-top: 14px; }

/* Vídeo */
.video { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: #000; margin: 20px 0; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Contato */
.contact { list-style: none; padding: 0; margin: 20px 0; }
.contact li { margin: 0 0 12px; }
.contact .label { display: block; font-size: .8125rem; color: var(--muted); font-weight: 600; }
.contact li > a:not(.btn) { display: inline-flex; align-items: center; min-height: 44px; font-weight: 500; }
.contact address { font-style: normal; }
.social { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.social a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border: 1px solid #cfd5db; border-radius: 999px; text-decoration: none; font-weight: 500; }
.social a:hover { border-color: var(--brand); }
.map { border: 0; }

/* Página não encontrada */
.not-found { text-align: center; }
.not-found .wrap { max-width: 760px; }
.not-found .code { font-family: var(--f-title), sans-serif; font-weight: 700; font-size: clamp(4.5rem, 16vw, 8rem); line-height: 1; color: var(--brand); margin: 0 0 12px; }
.not-found .prose { margin-bottom: 28px; }

/* Rodapé */
.foot { border-top: 1px solid var(--line); padding: 28px 0; font-size: .875rem; color: var(--muted); }
.foot-in { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; }
.made { color: #6b7280; }

/* Telas a partir de tablet deitado: menu em linha e colunas lado a lado. */
@media (min-width: 761px) {
  body { font-size: 17px; }
  .brand { font-size: 1.25rem; }
  /* Com muitas páginas, a lista aberta vira colunas. */
  .menu { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0 8px; padding: 12px 20px 20px; }
  .split { grid-template-columns: 1.1fr .9fr; gap: 48px; }
}

/* Computador: até 7 páginas cabem numa barra em linha (o layout.php decide quando há mais). */
@media (min-width: 1025px) {
  .menu-bar { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; }
  .menu-drop:not(.always) { display: none; }
}

/* Tela baixa (celular deitado): cabeçalho não fica preso no topo, para sobrar espaço para o conteúdo. */
@media (max-height: 500px) {
  .nav { position: static; }
  html { scroll-padding-top: 8px; }
}

/* Loja: link do carrinho no topo (fora do menu, visível também no celular) e faixa de modo de teste */
.brand { margin-right: auto; }
.cart-link {
  display: flex; align-items: center; gap: 6px; flex-shrink: 0; min-height: 44px; min-width: 44px; padding: 0 10px;
  justify-content: center; border-radius: 8px;
  color: var(--ink); font-weight: 600; font-size: .9375rem; text-decoration: none; white-space: nowrap;
}
.cart-link:hover { background: var(--bg-alt); color: var(--brand); }
.cart-icon { flex-shrink: 0; }
/* Com o carrinho no topo, o logo (mesmo largo) encolhe para "Menu" e "Carrinho" nunca saírem da tela. */
.nav-in:has(.cart-link) .brand { flex-shrink: 1; min-width: 0; }
.nav-in:has(.cart-link) .brand img { max-width: 100%; min-width: 0; }
@media (max-width: 600px) {
  .nav-in:has(.cart-link) { gap: 8px; }
  /* No celular, só o ícone e o número; o texto continua para o leitor de tela. */
  .cart-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .cart-count { margin-left: -4px; }
}
.test-bar { margin: 0; background: #e0f2fe; color: #0c4a6e; text-align: center; padding: 10px 16px; font-size: .875rem; }
