:root {
  /* Paleta da marca Ponkan Criativa */
  --brand-orange: #f5831f;
  --brand-graphite: #2e302d;
  --brand-brown: #4c3d2c;

  --bg: #fdf8f3;
  --surface: #ffffff;
  --text: #2e302d;
  --muted: #5f625d;
  --primary: #f5831f;
  --primary-dark: #b3550a;
  --accent: #4c3d2c;
  --border: #eadfd2;
  --ok: #2f7d32;
  --warn: #8a5a00;
  --shadow: 0 6px 22px rgba(46, 48, 45, 0.09);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Ubuntu, Cantarell, 'Helvetica Neue', Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

a { color: var(--primary-dark); text-decoration: none; }
a:hover, a:focus { text-decoration: underline; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--brand-orange);
  border-bottom: 3px solid #d96e10;
}

.wrap {
  width: min(1120px, 92vw);
  margin: 0 auto;
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.75rem 0;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 700;
  color: #fff;
}
.logo svg { width: 28px; height: 28px; flex: 0 0 auto; }
.logo span { white-space: nowrap; }

.nav-burger {
  display: none;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 10px;
  background: transparent;
  color: #fff;
  cursor: pointer;
}
.nav-burger svg { width: 24px; height: 24px; }
.nav-burger:hover,
.nav-burger:focus-visible { background: rgba(0, 0, 0, 0.15); border-color: rgba(255,255,255,0.7); }
.nav-burger[aria-expanded='true'] { background: rgba(0, 0, 0, 0.2); border-color: #fff; }

.nav {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  flex-wrap: wrap;
}

.nav-link,
.nav-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  width: auto;
  margin: 0;
  padding: 0.45rem 0.7rem;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #fff;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
}
.nav-link:hover,
.nav-link:focus-visible,
.nav-toggle:hover,
.nav-toggle:focus-visible,
.nav-group.is-open .nav-toggle {
  background: rgba(0, 0, 0, 0.15);
  text-decoration: none;
  color: #fff;
}
.nav-link.is-current {
  background: rgba(0, 0, 0, 0.2);
  color: #fff;
}
.nav-toggle.is-current { color: #fff; }

.chev {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  transition: transform 0.18s ease;
}
.nav-group.is-open .chev { transform: rotate(180deg); }

.nav-group { position: relative; }

.nav-menu {
  position: absolute;
  /* 2 px de overlap: o menu começa 2px ACIMA do bottom do botão,
     eliminando qualquer gap físico entre os dois elementos */
  top: calc(100% - 2px);
  left: 0;
  z-index: 120;
  display: none;
  min-width: 288px;
  margin: 0;
  /* padding-top cria o espaçamento visual sem criar gap de DOM */
  padding: 10px 0.4rem 0.4rem;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 14px 34px rgba(46, 48, 45, 0.16);
}
.nav-group.is-open .nav-menu { display: block; }

.nav-menu a {
  display: block;
  padding: 0.5rem 0.6rem;
  border-radius: 9px;
  color: var(--text);
  line-height: 1.3;
}
.nav-menu a:hover,
.nav-menu a:focus-visible {
  background: #fdf3e9;
  text-decoration: none;
}
.nav-menu a[aria-current='page'] {
  background: #fdeee0;
  text-decoration: none;
}
.mi-name {
  display: block;
  font-size: 0.93rem;
  font-weight: 700;
}
.mi-desc {
  display: block;
  font-size: 0.79rem;
  font-weight: 400;
  color: var(--muted);
}

/* Último menu alinhado à direita para não vazar da tela */
@media (min-width: 900px) {
  .nav-group:last-of-type .nav-menu { left: auto; right: 0; }
}

/* Desktop com mouse: hover controlado APENAS via JS (evita descompasso visual).
   O JS adiciona/remove .is-open com delay de fechamento para o mouse atravessar o padding. */

main { padding: 1.2rem 0 2rem; }

.hero {
  background: linear-gradient(160deg, #fff1e2 0%, #fffaf4 100%);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 1.2rem;
}
.hero h1 { margin: 0 0 0.5rem; line-height: 1.25; font-size: clamp(1.4rem, 3.2vw, 2.2rem); }
.hero p { margin: 0.3rem 0 0; color: var(--muted); }

.search-box {
  margin-top: 1rem;
  display: grid;
  gap: 0.45rem;
}
.search-box input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.75rem;
  font-size: 1rem;
}

.section-title {
  margin: 1.4rem 0 0.6rem;
  font-size: 1.2rem;
  padding-left: 0.6rem;
  border-left: 4px solid var(--brand-orange);
  line-height: 1.2;
}

.cards {
  display: grid;
  gap: 0.85rem;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.95rem;
  box-shadow: var(--shadow);
}
.card h3 { margin: 0 0 0.4rem; font-size: 1.05rem; }
.card { transition: border-color 0.15s ease, transform 0.15s ease; }
.card:hover { border-color: var(--brand-orange); transform: translateY(-2px); }
.card p { margin: 0 0 0.7rem; color: var(--muted); }
.card .btn-inline {
  display: inline-block;
  background: #fdeee0;
  color: var(--primary-dark);
  border-radius: 8px;
  padding: 0.45rem 0.7rem;
  font-weight: 600;
}

.grid-2 {
  display: grid;
  gap: 1rem;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 1rem;
}

.form-grid {
  display: grid;
  gap: 0.75rem;
}

label {
  font-weight: 600;
  font-size: 0.94rem;
}

input,
select,
button,
textarea {
  width: 100%;
  margin-top: 0.3rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.68rem;
  font-size: 1rem;
  font-family: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: var(--primary);
  color: var(--brand-graphite);
  font-weight: 700;
  letter-spacing: 0.01em;
}

button:hover,
button:focus {
  background: #e0740f;
}

.note {
  margin: 0.5rem 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.result {
  margin-top: 1rem;
  background: #fff4e8;
  border: 1px solid #f6d8b6;
  border-radius: 12px;
  padding: 0.85rem;
}
.result h2,
.result h3 { margin: 0 0 0.4rem; font-size: 1.1rem; }
.result p { margin: 0.2rem 0; }

.warning {
  margin-top: 0.8rem;
  background: #fff8eb;
  border: 1px solid #f0d9a8;
  border-radius: 10px;
  padding: 0.7rem;
  color: #6b4a06;
  font-size: 0.92rem;
}

.table-wrap {
  overflow-x: auto;
  margin-top: 0.8rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.94rem;
}
th, td {
  border: 1px solid var(--border);
  padding: 0.55rem;
  text-align: left;
}
th { background: #fdf0e3; }

/* ---- Seção editorial (conteúdo de apoio das calculadoras) ---- */
.editorial { margin-top: 1rem; }
.editorial h2 { margin: 0 0 0.7rem; font-size: 1.28rem; }
.editorial h3 {
  margin: 1.5rem 0 0.5rem;
  font-size: 1.04rem;
  color: var(--primary-dark);
}
.editorial h2 + p { margin-top: 0; }
.editorial p {
  margin: 0 0 0.85rem;
  line-height: 1.68;
  color: #3a3d39;
}
.editorial ul,
.editorial ol {
  margin: 0 0 0.9rem;
  padding-left: 1.35rem;
  line-height: 1.68;
  color: #3a3d39;
}
.editorial li { margin-bottom: 0.4rem; }
.editorial strong { color: var(--brand-graphite); }
.editorial sup { font-size: 0.72em; }
.editorial .table-wrap { margin: 0.9rem 0 1rem; }

.faq details {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 10px;
  padding: 0.65rem;
  margin-bottom: 0.6rem;
}
.faq summary {
  cursor: pointer;
  font-weight: 700;
}

.breadcrumb {
  margin-bottom: 0.7rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.site-footer {
  border-top: 1px solid var(--border);
  background: #fff;
  padding: 1.2rem 0 1.4rem;
  margin-top: 1rem;
}
.site-footer p {
  margin: 0.2rem 0;
  font-size: 0.9rem;
  color: var(--muted);
}
.footer-links {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
}


/* Página de contato */
.contact-list {
  display: grid;
  gap: 0.6rem;
  margin-top: 1rem;
}
.contact-item {
  display: grid;
  grid-template-columns: 26px 1fr;
  grid-template-areas: "icon label" "icon value";
  align-items: center;
  column-gap: 0.7rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fffdfa;
  color: var(--text);
}
.contact-item:hover,
.contact-item:focus-visible {
  border-color: var(--primary);
  background: #fff6ec;
  text-decoration: none;
}
.contact-item svg {
  grid-area: icon;
  width: 24px;
  height: 24px;
  color: var(--primary-dark);
}
.ci-label {
  grid-area: label;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-weight: 700;
}
.ci-value {
  grid-area: value;
  font-weight: 600;
  word-break: break-word;
}


/* Aviso de consentimento (LGPD / AdSense) */
.consent-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 200;
  display: none;
  gap: 0.8rem;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  padding: 0.85rem 4vw;
  background: var(--brand-graphite);
  color: #f7f3ee;
  font-size: 0.9rem;
  line-height: 1.45;
  box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.18);
}
.consent-bar.is-visible { display: flex; }
.consent-bar p { margin: 0; max-width: 62ch; }
.consent-bar a { color: #ffc48a; text-decoration: underline; }
.consent-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.consent-actions button {
  width: auto;
  margin: 0;
  padding: 0.55rem 1rem;
  border-radius: 9px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
}
.consent-accept { background: var(--brand-orange); color: var(--brand-graphite); border: 1px solid var(--brand-orange); }
.consent-accept:hover { background: #e0740f; }
.consent-reject { background: transparent; color: #f7f3ee; border: 1px solid #6b6f68; }
.consent-reject:hover { background: #3b3e3a; }

canvas {
  width: 100%;
  min-height: 260px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
}

@media (max-width: 899px) {
  .nav-burger { display: inline-flex; }

  /* Menu vira um painel que desce do cabeçalho */
  .nav {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    z-index: 130;
    flex-direction: column;
    align-items: stretch;
    gap: 0.1rem;
    padding: 0.7rem 4vw 1rem;
    background: var(--brand-graphite);
    border-bottom: 3px solid #d96e10;
    box-shadow: 0 16px 30px rgba(46, 48, 45, 0.25);
    max-height: calc(100vh - 64px);
    overflow-y: auto;
  }
  .nav.is-open { display: flex; }

  .nav-link,
  .nav-toggle {
    width: 100%;
    justify-content: space-between;
    padding: 0.7rem 0.6rem;
    font-size: 1rem;
    border-radius: 9px;
    color: #fff;
  }
  .nav-link + .nav-link,
  .nav-group + .nav-link { border-top: 1px solid rgba(255,255,255,0.1); }

  .nav-group { position: static; }
  .chev { display: none; }

  /* Submenu sempre visível dentro do painel: um toque a menos */
  .nav-menu {
    position: static;
    display: block;
    min-width: 0;
    width: auto;
    margin: 0 0 0.3rem;
    padding: 0 0 0 0.55rem;
    border: 0;
    border-left: 2px solid rgba(255,255,255,0.25);
    border-radius: 0;
    box-shadow: none;
    background: transparent;
  }
  .nav-menu a { padding: 0.5rem 0.55rem; color: rgba(255,255,255,0.9); }
  .nav-menu a:hover, .nav-menu a:focus-visible { background: rgba(255,255,255,0.1); }
  .mi-name { font-size: 0.95rem; }
  .mi-desc { font-size: 0.8rem; color: rgba(255,255,255,0.6); }
}

@media (min-width: 640px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2 { grid-template-columns: 1.2fr 1fr; }
}

@media (min-width: 1024px) {
  .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hero { padding: 1.6rem; }
}
