/* ============================================================
   PREZO.PSI — DESIGN SYSTEM BASE
   Tokens, reset, typography, components.
   Clientes ajustam tokens em site.css (overrides), nao aqui.

   Fontes: self-hosted na pasta assets/fonts/ (ADR 039).
   Declarar @font-face no topo de site.css apos copiar fontes
   escolhidas do prezo-fonts.
   ============================================================ */

/* === Tokens === */
:root {
  /* Cores: valores de PARTIDA. Sobrescrever por cliente em site.css */
  --c-primary:        #C4694F;
  --c-primary-text:   #A8442E;
  --c-background:     #F5F0E8;
  --c-foreground:     #2C2C2C;
  --c-accent:         #7A9E7E;
  --c-subtle:         #E2D5C3;
  --c-background-80:  rgba(245,240,232,0.8);

  /* Aliases semanticos (usar esses em components) */
  --color-brand-primary:   var(--c-primary);
  --color-brand-secondary: var(--c-accent);
  --color-text-default:    var(--c-foreground);
  --color-text-muted:      rgba(44,44,44,0.55);
  --color-text-inverse:    var(--c-background);
  --color-bg-canvas:       var(--c-background);
  --color-bg-surface:      #ffffff;
  --color-bg-subtle:       var(--c-subtle);
  --color-border-default:  var(--c-subtle);
  --color-border-strong:   rgba(44,44,44,0.25);

  /* Tipografia: definir fontes em @font-face no site.css */
  --f-display: Georgia, serif;
  --f-body:    -apple-system, BlinkMacSystemFont, sans-serif;

  /* Escala tipografica */
  --t-display: clamp(2.5rem, 6vw, 4.5rem);
  --t-h1:      clamp(2rem,   4vw, 3rem);
  --t-h2:      clamp(1.6rem, 3vw, 2.25rem);
  --t-h3:      clamp(1.25rem,2vw, 1.5rem);
  --t-lg:      1.125rem;
  --t-base:    1rem;
  --t-sm:      0.875rem;
  --t-xs:      0.75rem;

  /* Line heights */
  --lh-tight:  1.15;
  --lh-snug:   1.3;
  --lh-base:   1.6;
  --lh-loose:  1.8;

  /* Espacamento */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.25rem;
  --sp-6: 1.5rem;
  --sp-7: 1.75rem;
  --sp-8: 2rem;
  --sp-10: 2.5rem;
  --sp-12: 3rem;
  --sp-16: 4rem;
  --sp-20: 5rem;
  --sp-24: 6rem;
  --sp-32: 8rem;

  /* Radius */
  --r-sm:   4px;
  --r-md:   8px;
  --r-lg:   16px;
  --r-xl:   24px;
  --r-full: 9999px;

  /* Shadows */
  --sh-sm:  0 1px 3px rgba(44,44,44,0.07);
  --sh-md:  0 4px 16px rgba(44,44,44,0.10);
  --sh-lg:  0 12px 40px rgba(44,44,44,0.14);
  --sh-xl:  0 24px 60px rgba(44,44,44,0.18);

  /* Transicoes */
  --tr-fast: 150ms ease-in-out;
  --tr-base: 300ms ease-in-out;
  --tr-slow: 500ms ease-in-out;

  /* Layout */
  --max-w: 1120px;
  --max-w-text: 680px;

  /* Mobile-first: thumb zone bottom safe area */
  --sticky-bar-h: 56px;
}

/* === Reset === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; scroll-padding-top: 80px; }
body { font-family: var(--f-body); font-size: 18px; color: var(--color-text-default); background: var(--color-bg-canvas); line-height: var(--lh-base); padding-bottom: 0; }
/* body padding reservado apenas para acessórios opcionais — sem sticky-bar mobile full-width */
img, picture, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { cursor: pointer; font-family: var(--f-body); border: none; background: none; font-size: inherit; color: inherit; }
input, textarea, select { font-family: inherit; font-size: inherit; }

/* Selection */
::selection { background: var(--c-primary); color: var(--color-text-inverse); }

/* Focus states */
:focus-visible {
  outline: 2.5px solid var(--c-primary);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}

/* === Container === */
.container { width: 100%; max-width: var(--max-w); margin-inline: auto; padding-inline: var(--sp-6); }
.container--text { max-width: var(--max-w-text); margin-inline: auto; padding-inline: var(--sp-6); }

/* === Tipografia helpers === */
.t-display { font-family: var(--f-display); font-size: var(--t-display); font-weight: 600; line-height: var(--lh-tight); letter-spacing: -0.02em; }
.t-h1      { font-family: var(--f-display); font-size: var(--t-h1);      font-weight: 600; line-height: var(--lh-tight); letter-spacing: -0.01em; }
.t-h2      { font-family: var(--f-display); font-size: var(--t-h2);      font-weight: 600; line-height: var(--lh-snug); }
.t-h3      { font-family: var(--f-body);    font-size: var(--t-h3);      font-weight: 500; line-height: var(--lh-snug); }
.t-lg      { font-size: var(--t-lg); line-height: var(--lh-loose); }
.t-base    { font-size: var(--t-base); line-height: var(--lh-base); }
.t-sm      { font-size: var(--t-sm); }
.t-xs      { font-size: var(--t-xs); letter-spacing: 0.06em; text-transform: uppercase; font-weight: 500; }
.text-center { text-align: center; }
.text-muted { color: var(--color-text-muted); }

/* === Secoes === */
.section { padding-block: var(--sp-20); }
.section--lg { padding-block: var(--sp-24); }
.section--sm { padding-block: var(--sp-12); }

/* === Logo tipografico (ADR 067) === */
.logo {
  font-family: var(--f-display);
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.01em;
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  color: var(--color-text-default);
}
.logo em { font-style: italic; font-weight: 500; }
.logo--light { color: var(--color-text-inverse); }
.logo--lg { font-size: 2rem; }
.logo--sm { font-size: 1.125rem; }

/* === Botoes === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  min-height: 48px;
  padding: 0 var(--sp-6);
  border-radius: var(--r-full);
  font-family: var(--f-body);
  font-size: var(--t-base);
  font-weight: 500;
  line-height: 1;
  transition: transform var(--tr-base), box-shadow var(--tr-base), background var(--tr-base), color var(--tr-base);
  white-space: nowrap;
  cursor: pointer;
}
.btn--primary { background: var(--c-primary); color: var(--color-text-inverse); }
.btn--primary:hover { background: var(--c-primary-text); transform: translateY(-1px); box-shadow: var(--sh-md); }
.btn--secondary { background: transparent; color: var(--color-text-default); border: 1.5px solid var(--color-text-default); }
.btn--secondary:hover { background: var(--color-text-default); color: var(--color-bg-canvas); }
.btn--ghost { background: transparent; color: var(--color-text-inverse); border: 1.5px solid rgba(245,240,232,0.4); }
.btn--ghost:hover { border-color: var(--color-text-inverse); background: rgba(245,240,232,0.1); }
.btn--lg { min-height: 56px; padding: 0 var(--sp-8); font-size: var(--t-lg); }
.btn--sm { min-height: 40px; padding: 0 var(--sp-4); font-size: var(--t-sm); }

/* === Cards === */
.card { background: var(--color-bg-surface); border-radius: var(--r-xl); padding: var(--sp-8); box-shadow: var(--sh-sm); transition: box-shadow var(--tr-base), transform var(--tr-base); }
.card:hover { box-shadow: var(--sh-md); transform: translateY(-2px); }
.card--bg { background: var(--color-bg-canvas); }
.card--subtle { background: var(--color-bg-subtle); }
.card--dark { background: var(--color-text-default); color: var(--color-text-inverse); }
.card--bordered { background: transparent; border: 1.5px solid var(--color-border-default); box-shadow: none; }

/* === Divider === */
.divider { height: 1px; background: var(--color-border-default); border: none; margin-block: var(--sp-6); }
.divider--sm { width: 60px; height: 2px; background: var(--c-primary); border: none; margin-block: var(--sp-6); }

/* === Badge === */
.badge { display: inline-flex; align-items: center; padding: var(--sp-1) var(--sp-3); border-radius: var(--r-full); font-size: var(--t-xs); font-weight: 500; letter-spacing: 0.04em; }
.badge--primary { background: rgba(196,105,79,0.12); color: var(--c-primary-text); }
.badge--accent  { background: rgba(122,158,126,0.15); color: #4a7a50; }
.badge--neutral { background: rgba(44,44,44,0.08); color: var(--color-text-default); }

/* === Form === */
.input, .textarea, .select {
  width: 100%;
  min-height: 48px;
  padding: var(--sp-3) var(--sp-4);
  border: 1.5px solid var(--color-border-default);
  border-radius: var(--r-md);
  font-family: var(--f-body);
  font-size: var(--t-base);
  background: var(--color-bg-surface);
  color: var(--color-text-default);
  transition: border-color var(--tr-fast), box-shadow var(--tr-fast);
  outline: none;
}
.input:focus, .textarea:focus, .select:focus { border-color: var(--c-primary); box-shadow: 0 0 0 3px rgba(196,105,79,0.15); }
.input::placeholder, .textarea::placeholder { color: rgba(44,44,44,0.35); }
.textarea { resize: vertical; min-height: 120px; line-height: var(--lh-base); }
.label { display: block; font-size: var(--t-sm); font-weight: 500; margin-bottom: var(--sp-2); }
.form-group { display: flex; flex-direction: column; gap: var(--sp-2); }
.helper-text { font-size: var(--t-xs); color: var(--color-text-muted); }

/* === Navegacao === */
.nav { position: sticky; top: 0; z-index: 30; padding: var(--sp-4) 0; background: var(--c-background-80); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid transparent; transition: border-color var(--tr-base), background var(--tr-base); }
.nav.scrolled { border-bottom-color: var(--color-border-default); }
.nav__inner { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); }
.nav__links { display: flex; align-items: center; gap: var(--sp-6); }
.nav__link { font-size: var(--t-sm); font-weight: 500; color: var(--color-text-default); transition: color var(--tr-fast); }
.nav__link:hover { color: var(--c-primary-text); }
@media (max-width: 720px) {
  .nav__links { display: none; }
}

/* === Mobile nav toggle === */
.nav__hamburger { display: none; flex-direction: column; gap: 5px; padding: var(--sp-2); cursor: pointer; background: none; border: none; }
.nav__hamburger span { display: block; width: 22px; height: 2px; background: var(--color-text-default); border-radius: 2px; transition: transform var(--tr-base), opacity var(--tr-base); }
.nav__hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__hamburger.open span:nth-child(2) { opacity: 0; }
.nav__hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.nav__mobile { display: none; position: fixed; inset: 0; background: var(--color-bg-canvas); z-index: 29; padding-top: 80px; flex-direction: column; align-items: center; justify-content: center; gap: var(--sp-8); }
.nav__mobile.open { display: flex; }
.nav__mobile .nav__link { font-size: var(--t-h3); }
@media (max-width: 720px) {
  .nav__hamburger { display: flex; }
}

/* === Grid helpers === */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-8); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-6); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-6); }
@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}
@media (max-width: 1024px) and (min-width: 769px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

/* === Flex helpers === */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--sp-2); }
.gap-4 { gap: var(--sp-4); }
.gap-6 { gap: var(--sp-6); }
.gap-8 { gap: var(--sp-8); }

/* === Spacing helpers === */
.mt-2 { margin-top: var(--sp-2); }
.mt-4 { margin-top: var(--sp-4); }
.mt-6 { margin-top: var(--sp-6); }
.mt-8 { margin-top: var(--sp-8); }
.mt-12 { margin-top: var(--sp-12); }
.mt-16 { margin-top: var(--sp-16); }
.mb-2 { margin-bottom: var(--sp-2); }
.mb-4 { margin-bottom: var(--sp-4); }
.mb-6 { margin-bottom: var(--sp-6); }
.mb-8 { margin-bottom: var(--sp-8); }
.mb-12 { margin-bottom: var(--sp-12); }

/* === FAQ (usa <details>) === */
.faq {
  border-top: 1px solid var(--color-border-default);
  max-width: 780px;
}
.faq details {
  border-bottom: 1px solid var(--color-border-default);
}
.faq summary {
  padding: var(--sp-4) 0;
  font-size: var(--t-base);
  font-weight: 500;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--sp-4);
  min-height: 48px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--color-bg-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  transition: transform var(--tr-base), background var(--tr-base);
}
.faq details[open] summary::after {
  content: "\2212";
  background: var(--c-primary);
  color: var(--color-text-inverse);
}
.faq details p {
  padding-bottom: var(--sp-4);
  font-size: var(--t-sm);
  color: var(--color-text-muted);
  line-height: var(--lh-loose);
  max-width: 620px;
}

/* === WhatsApp floating button — canto inferior direito, todos os dispositivos === */
@keyframes wa-pulse {
  0%   { transform: scale(1);   opacity: 0.55; }
  100% { transform: scale(1.75); opacity: 0; }
}
.sticky-bar {
  position: fixed;
  bottom: var(--sp-6);
  right: var(--sp-6);
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #25D366;
  box-shadow: 0 4px 16px rgba(37,211,102,0.45);
  text-decoration: none;
  transition: transform 0.2s ease;
}
.sticky-bar::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(37,211,102,0.5);
  animation: wa-pulse 2s ease-out infinite;
  z-index: -1;
}
.sticky-bar:hover,
.sticky-bar:focus-visible {
  transform: scale(1.08);
  outline: none;
}
.sticky-bar img { width: 36px; height: 36px; display: block; }

/* Variação: dois anéis finos expandindo (mais sutil) */
.sticky-bar--rings::before {
  background: transparent;
  border: 2px solid rgba(37,211,102,0.7);
}
.sticky-bar--rings::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: transparent;
  border: 2px solid rgba(37,211,102,0.7);
  animation: wa-pulse 2s ease-out infinite;
  animation-delay: 0.75s;
  z-index: -1;
}

/* === Reveal (fade in on scroll) === */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* === Section heading pattern === */
.section-heading { max-width: 600px; margin-bottom: var(--sp-8); }
.section-heading .eyebrow {
  font-size: var(--t-xs);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--c-primary-text);
  margin-bottom: var(--sp-3);
}
.section-heading--center { text-align: center; margin-inline: auto; }

/* === Accessibility helpers === */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--c-primary);
  color: var(--color-text-inverse);
  padding: var(--sp-2) var(--sp-4);
  z-index: 100;
  transition: top var(--tr-fast);
}
.skip-link:focus { top: 0; }

/* === Print === */
@media print {
  .nav, .btn, .sticky-bar, .faq summary::after { display: none; }
  .section { padding-block: var(--sp-8); }
  .faq details { border: none; }
  .faq summary { padding: 0; }
  .faq details p { padding: 0 0 var(--sp-4) 0; }
}
