/* =========================================================================
   Orca App — folha de estilo do site
   Estrutura:
   1. Base e tipografia
   2. Acessibilidade (skip link, foco)
   3. Cabeçalho e navegação (responsivo)
   4. Botões e links utilitários
   5. Slots de imagem
   6. Ajustes responsivos gerais
   7. Impressão (gerador de orçamento)
   ========================================================================= */

/* --- 1. Base -------------------------------------------------------------- */
:root {
  --azul: #2E7CF6;
  --azul-escuro: #1B5FCC;
  --azul-claro: #EDF3FD;
  --verde: #4FC79A;
  --verde-escuro: #3FB489;
  --grafite: #1F2933;
  --texto: #4A5568;
  --texto-suave: #8A94A6;
  --borda: #E2E8F0;
  --fundo-suave: #F7F9FC;
  --fonte: 'Plus Jakarta Sans', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: #FFFFFF;
  color: var(--texto);
  font-family: var(--fonte);
  -webkit-font-smoothing: antialiased;
}

body.bg-suave { background: var(--fundo-suave); }

a { color: var(--azul); text-decoration: none; }
a:hover { color: var(--azul-escuro); text-decoration: underline; }

img { max-width: 100%; }

input, textarea, select, button { font-family: inherit; }

/* deixa campos e fieldsets encolherem dentro de grades estreitas */
input, textarea, select { max-width: 100%; min-width: 0; }
fieldset { min-inline-size: 0; }

summary::-webkit-details-marker { display: none; }

table { border-collapse: collapse; }

/* --- 2. Acessibilidade ---------------------------------------------------- */
:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(46, 124, 246, .4);
  border-radius: 8px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: #FFFFFF;
  color: var(--grafite);
  font-weight: 600;
  padding: 12px 20px;
  border: 1px solid var(--borda);
  border-radius: 0 0 8px 0;
}
.skip-link:focus {
  left: 0;
  text-decoration: none;
}

/* --- 3. Cabeçalho --------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: #FFFFFF;
  border-bottom: 1px solid var(--borda);
}

.site-header__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.site-header__brand { display: flex; align-items: center; flex-shrink: 0; }
.site-header__brand img { display: block; height: 48px; width: auto; }

.site-header__menu {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex: 1;
}

.site-nav {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  font-size: 15px;
  min-width: 0;
}
.site-nav a {
  color: var(--texto);
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  white-space: nowrap;
  text-decoration: none;
}
.site-nav a:hover { color: var(--azul); text-decoration: none; }
.site-nav a.is-active { color: var(--grafite); font-weight: 600; }

.site-header__actions {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-shrink: 0;
}
.site-header__login {
  color: var(--texto);
  font-size: 15px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  text-decoration: none;
  white-space: nowrap;
}
.site-header__login:hover { color: var(--azul); text-decoration: none; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  padding: 0 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  border: none;
  transition: background .2s cubic-bezier(.16, 1, .3, 1);
}
.btn--verde { background: var(--verde); color: #FFFFFF; }
.btn--verde:hover { background: var(--verde-escuro); color: #FFFFFF; text-decoration: none; }

.site-header__burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0 11px;
  border: 1px solid var(--borda);
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
}
.site-header__burger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--grafite);
  transition: transform .2s cubic-bezier(.16, 1, .3, 1), opacity .2s;
}
.site-header__burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.site-header__burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.site-header__burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 959px) {
  .site-header__inner { flex-wrap: wrap; gap: 12px; }
  .site-header__burger { display: flex; }
  .site-header__menu {
    display: none;
    flex-basis: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 4px 0 16px;
    border-top: 1px solid var(--borda);
    max-height: calc(100vh - 70px);
    overflow-y: auto;
  }
  .site-header__menu.is-open { display: flex; }
  .site-nav { flex-direction: column; gap: 0; }
  .site-nav a {
    min-height: 48px;
    font-size: 16px;
    border-bottom: 1px solid var(--borda);
  }
  .site-header__actions {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    margin-top: 14px;
  }
  .site-header__login { min-height: 48px; font-size: 16px; }
  .site-header__actions .btn { height: 46px; font-size: 15px; }
}

/* --- 4. Slots de imagem --------------------------------------------------- */
.slot-img {
  display: block;
  width: 100%;
  height: 100%;
}

.slot-ph {
  width: 100%;
  height: 100%;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 18px;
  background: var(--azul-claro);
  border: 1px dashed #C3D6F5;
  color: #6B7A99;
  font-size: 14px;
  line-height: 1.5;
}
.slot-ph span { max-width: 34ch; }

.slot-selo {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  text-align: center;
  background: #FFFFFF;
  border-radius: 8px;
  color: var(--grafite);
  line-height: 1.2;
}
.slot-selo strong { font-size: 17px; font-weight: 800; color: var(--azul); }
.slot-selo span { font-size: 12px; color: var(--texto-suave); }

/* --- 4b. Chips de filtro e de ciclo ---------------------------------------- */
.chip-ativo {
  border-color: var(--azul) !important;
  background: var(--azul-claro) !important;
  color: var(--azul) !important;
}
.chip-inativo {
  border-color: var(--borda) !important;
  background: transparent !important;
  color: var(--texto) !important;
}

/* --- 5. Ajustes responsivos gerais ---------------------------------------- */
@media (max-width: 720px) {
  h1 { font-size: 32px !important; line-height: 1.2 !important; }
  h2 { font-size: 25px !important; line-height: 1.25 !important; }
  h3 { font-size: 19px !important; }
  section { padding-left: 18px !important; padding-right: 18px !important; }
}

/* tabelas largas rolam dentro do próprio bloco em vez de esticar a página */
.tabela-rolavel {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
  min-width: 0;
}
.tabela-rolavel > table { min-width: 640px; }

@media (max-width: 700px) {
  /* grades de coluna automática viram coluna única em vez de estourar a tela */
  [style*="repeat(auto-fit"] { grid-template-columns: 1fr !important; }

  /* faixas de botões (ciclo de cobrança, temas, categorias) quebram em linhas */
  div:has(> [data-loop="ciclos"]),
  div:has(> [data-loop="temas"]),
  div:has(> [data-loop="categorias"]),
  div:has(> [data-action^="ver"]) {
    flex-wrap: wrap;
    max-width: 100%;
  }

  /* gerador: a descrição do item ocupa a linha inteira */
  [data-loop="itens"] { grid-template-columns: 1fr 1fr 1fr auto !important; }
  [data-loop="itens"] > :first-child { grid-column: 1 / -1; }
  [style*="64px 68px 96px 36px"][style*="uppercase"] { display: none !important; }
}

/* --- 6. Impressão --------------------------------------------------------- */
@media print {
  .site-header,
  .skip-link,
  footer,
  .nao-imprimir,
  .gerador-form,
  a[href^="https://wa.me"] { display: none !important; }

  body { background: #FFFFFF !important; }

  .gerador-preview,
  .gerador-preview * { visibility: visible; }

  .gerador-preview {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    border: none !important;
    box-shadow: none !important;
  }
}
