/* ==========================================================================
   Componentes compartilhados: botões, header, menu, footer, breadcrumb...
   ========================================================================== */

/* ---------- Ícones (sprite em views/partials/icons.php) ---------- */
.icon { width: 1.25em; height: 1.25em; flex: none; fill: currentColor; }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: 44px; padding: 0.625rem 1.25rem;
  border: 2px solid transparent; border-radius: var(--radius-pill);
  font-weight: 700; font-size: var(--text-sm); letter-spacing: 0.02em; line-height: 1.1;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color var(--duration) var(--ease), color var(--duration) var(--ease),
              border-color var(--duration) var(--ease), transform var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn:active { transform: none; box-shadow: none; }
.btn--red { background: var(--red-600); color: var(--white); }
.btn--red:hover { background: var(--red-800); color: var(--white); }
.btn--green { background: var(--green-700); color: var(--white); }
.btn--green:hover { background: var(--green-900); color: var(--white); }
.btn--orange { background: var(--orange-600); color: var(--white); }
.btn--orange:hover { background: var(--orange-700); color: var(--white); }
.btn--outline { border-color: currentColor; color: var(--green-700); background: transparent; }
.btn--outline:hover { background: var(--green-700); border-color: var(--green-700); color: var(--white); }
.btn--light { background: var(--white); color: var(--green-700); }
.btn--light:hover { background: var(--green-100); color: var(--green-900); }
.btn--lg { min-height: 52px; padding: 0.875rem 1.75rem; font-size: var(--text-base); }

/* ---------- Redes sociais ---------- */
.social { display: flex; align-items: center; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.social a {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  color: var(--green-700); transition: background-color var(--duration), color var(--duration);
}
.social a:hover { background: var(--green-700); color: var(--white); }
.social .icon { width: 18px; height: 18px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--white); /* branco sólido (sem transparência) */
  transition: box-shadow var(--duration) var(--ease), background-color var(--duration) var(--ease);
}
.site-header.is-scrolled { box-shadow: 0 1px 0 var(--color-border), var(--shadow); }
.site-header__inner { display: flex; align-items: center; gap: var(--space-5); min-height: var(--header-h); }

.site-logo { flex: none; display: block; line-height: 0; }
.site-logo img { width: 76px; height: auto; transition: width var(--duration) var(--ease); }

.site-header__main { display: none; flex: 1; align-items: center; justify-content: space-between; gap: var(--space-5); }
.site-header__actions { display: flex; flex: none; gap: var(--space-2); }

.main-nav ul { display: flex; gap: clamp(0.75rem, 0.2rem + 1.2vw, 1.75rem); margin: 0; padding: 0; list-style: none; }
.main-nav a {
  position: relative; display: block; padding: var(--space-2) 0;
  font-size: var(--text-sm); font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase;
  color: var(--gray-800); text-decoration: none; white-space: nowrap;
}
.main-nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 2px; height: 3px; border-radius: 3px;
  background: var(--orange-500); transform: scaleX(0); transform-origin: left;
  transition: transform var(--duration) var(--ease);
}
.main-nav a:hover { color: var(--green-700); }
.main-nav a:hover::after, .main-nav a[aria-current="page"]::after { transform: scaleX(1); }
.main-nav a[aria-current="page"] { color: var(--green-700); }

.menu-toggle {
  margin-left: auto; display: grid; place-items: center; width: 48px; height: 48px;
  border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--green-700); cursor: pointer;
}
.menu-toggle .icon { width: 30px; height: 30px; }

@media (min-width: 1024px) {
  .site-logo img { width: 112px; }
  .site-header.is-scrolled .site-logo img { width: 84px; }
  /* logo | menu centralizado | ações: colunas laterais iguais mantêm o menu no centro da página */
  .site-header__inner { display: grid; grid-template-columns: 1fr auto 1fr; }
  .site-header__main { display: contents; }
  .site-header__actions { justify-self: end; }
  .menu-toggle { display: none; }
}
@media (min-width: 1280px) {
  .site-logo img { width: 128px; }
}

/* ---------- Menu mobile (painel lateral) ---------- */
.mobile-menu {
  position: fixed; inset: 0; z-index: 200; visibility: hidden;
  transition: visibility 0s linear var(--duration);
}
.mobile-menu.is-open { visibility: visible; transition-delay: 0s; }
.mobile-menu__backdrop {
  position: absolute; inset: 0; background: rgb(0 30 20 / 0.5); opacity: 0;
  transition: opacity var(--duration) var(--ease);
}
.mobile-menu__panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(88vw, 360px);
  display: flex; flex-direction: column; gap: var(--space-5);
  padding: var(--space-4) var(--space-5) var(--space-6); overflow-y: auto;
  background: var(--white); box-shadow: var(--shadow-lg);
  transform: translateX(100%); transition: transform var(--duration) var(--ease);
}
.mobile-menu.is-open .mobile-menu__backdrop { opacity: 1; }
.mobile-menu.is-open .mobile-menu__panel { transform: none; }
.mobile-menu__close { align-self: flex-end; }
.mobile-menu nav ul { margin: 0; padding: 0; list-style: none; }
.mobile-menu nav a {
  display: block; padding: var(--space-3) 0; border-bottom: 1px solid var(--color-border);
  font-weight: 700; font-size: var(--text-base); letter-spacing: 0.03em; text-transform: uppercase;
  color: var(--gray-800); text-decoration: none;
}
.mobile-menu nav a[aria-current="page"] { color: var(--green-700); border-bottom-color: var(--orange-500); }
.mobile-menu__actions { display: grid; gap: var(--space-2); }
.mobile-menu__actions .btn { width: 100%; }
body.menu-open { overflow: hidden; }

/* ---------- Breadcrumb ---------- */
.breadcrumb { padding-block: var(--space-4); font-size: var(--text-sm); }
.breadcrumb ol { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.breadcrumb li + li::before { content: "›"; margin-right: var(--space-2); color: var(--gray-400); }
.breadcrumb a { color: var(--color-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--green-700); text-decoration: underline; }
.breadcrumb [aria-current="page"] { color: var(--green-700); font-weight: 700; }

/* ---------- Cabeçalho de página ---------- */
.page-title { padding-block: var(--space-4) var(--space-6); }
.page-title h1 { margin: 0; }
.eyebrow {
  display: inline-block; margin-bottom: var(--space-3);
  font-size: var(--text-sm); font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--orange-text);
}

/* ---------- Introdução de página (eyebrow + h1 + texto) ---------- */
.page-intro { padding-block: var(--space-4) var(--space-6); }
.page-intro h1 { margin-bottom: var(--space-5); }
.page-intro .lead { font-size: var(--text-md); line-height: 1.7; }
.page-intro .lead p { margin: 0 0 0.75em; }
.page-intro .lead p:last-child { margin: 0; }

/* ---------- Texto corrido vindo do editor ---------- */
.prose p, .prose ul, .prose ol { margin: 0 0 1em; }
.prose > :last-child { margin-bottom: 0; }
.prose h2 { margin-bottom: var(--space-5); }

/* ---------- Footer ---------- */
.site-footer { background: var(--green-700); color: var(--white); }
.site-footer a { color: var(--white); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; color: var(--white); }
.site-footer__grid {
  display: grid; gap: var(--space-6); padding-block: var(--space-7);
  grid-template-columns: 1fr;
}
.site-footer__brand img { width: 120px; }
.site-footer h2 {
  margin: 0 0 var(--space-4); font-family: var(--font-body); font-size: var(--text-base); font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--white);
}
.site-footer ul:not(.social) { margin: 0; padding: 0; list-style: none; display: grid; gap: var(--space-2); font-size: var(--text-sm); }
.site-footer li { display: flex; align-items: flex-start; gap: var(--space-2); }
.site-footer li .icon { margin-top: 0.1em; opacity: 0.85; }
.site-footer .social a { color: var(--white); background: rgb(255 255 255 / 0.12); }
.site-footer .social a:hover { background: var(--white); color: var(--green-700); }
.site-footer__bottom {
  padding-block: var(--space-4); border-top: 1px solid rgb(255 255 255 / 0.18);
  font-size: var(--text-xs); line-height: 1.6; text-align: center; color: rgb(255 255 255 / 0.85);
}
.site-footer__bottom p { margin: 0; }

@media (min-width: 640px) {
  .site-footer__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
  .site-footer__grid { grid-template-columns: 0.8fr 1fr 1fr 0.9fr 1.3fr; }
}

/* ---------- Página provisória / erro ---------- */
.placeholder { padding-block: var(--space-8); text-align: center; }
.placeholder p { color: var(--color-muted); }
.error-page { padding-block: var(--space-9); text-align: center; }
.error-page__code { font-family: var(--font-display); font-size: 4rem; line-height: 1; color: var(--green-100); -webkit-text-stroke: 2px var(--green-600); }

/* ---------- Avisos (flash) ---------- */
.alert { padding: var(--space-3) var(--space-4); border-radius: var(--radius-sm); border-left: 4px solid; font-size: var(--text-sm); }
.alert--success { background: var(--green-100); border-color: var(--green-700); color: var(--green-900); }
.alert--error { background: #fdecec; border-color: var(--red-600); color: var(--red-800); }

/* ---------- Formulários do site (comentários, visita, contato) ---------- */
.form-field { display: grid; gap: var(--space-1); }
.form-field label { font-weight: 600; font-size: var(--text-sm); color: var(--gray-800); }
.form-field label small { font-weight: 400; color: var(--color-muted); }
.form-field input, .form-field textarea, .form-field select {
  width: 100%; min-height: 48px; padding: 0.7rem 0.9rem; border: 2px solid var(--gray-200); border-radius: var(--radius);
  background: var(--white); font-size: var(--text-base); transition: border-color var(--duration), box-shadow var(--duration);
}
.form-field textarea { resize: vertical; min-height: 120px; }
.form-field input:focus, .form-field textarea:focus, .form-field select:focus { outline: none; border-color: var(--green-700); box-shadow: 0 0 0 4px rgb(0 99 67 / 0.15); }
.form-field.has-error input, .form-field.has-error textarea, .form-field.has-error select { border-color: var(--red-600); }
.field-error { color: var(--red-600); font-size: var(--text-sm); font-weight: 600; }

/* ---------- Texto rico (conteúdo dos posts) ----------
 * Usado no site E dentro do editor do admin (Quill): o que se vê ao editar é o que aparece no site.
 * Fonte e tamanho são fixos: o editor não permite alterá-los.
 */
.rich-text { font-family: var(--font-body); font-size: var(--text-base); line-height: 1.7; color: var(--gray-800); }
.rich-text p, .rich-text ul, .rich-text ol, .rich-text blockquote { margin: 0 0 1em; }
.rich-text > :last-child { margin-bottom: 0; }
.rich-text ul, .rich-text ol { padding-left: 1.5em; }
.rich-text li + li { margin-top: 0.25em; }
.rich-text a { color: var(--color-link); }
.rich-text strong, .rich-text b { font-weight: 700; }
.rich-text blockquote { padding: 0.75em 1.25em; border-left: 4px solid var(--orange-500); background: var(--cream); font-style: italic; }
.rich-text img { display: block; max-width: 100%; height: auto; margin: 1.5em auto; border-radius: var(--radius); }

/* Links discretos: "Compre com o seu CNPJ" (cabeçalho/menu) e Política de Privacidade (rodapé) */
.site-footer__bottom a { margin-left: var(--space-3); color: inherit; text-decoration: underline; }

/* "Próximo passo": faixa fina de CTA contextual no fim de algumas páginas */
.next-step { background: var(--green-100); border-top: 1px solid var(--color-border); }
.next-step__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3) var(--space-5); padding-block: var(--space-5); }
.next-step__title { margin: 0; font-weight: 700; font-size: var(--text-lg); color: var(--green-900); }
.next-step__sub { margin: var(--space-1) 0 0; color: var(--gray-800); }

/* Aviso de cookies (LGPD) — criado por consent.js; só aparece se houver pixels configurados */
.link-button { background: none; border: 0; padding: 0; font: inherit; color: var(--color-link); text-decoration: underline; cursor: pointer; }
.cookie-banner { position: fixed; inset: auto var(--space-4) var(--space-4) var(--space-4); z-index: 60; max-width: 40rem; margin-inline: auto; background: var(--white); color: var(--color-text); border: 1px solid var(--color-border); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: var(--space-4) var(--space-5); }
.cookie-banner p { margin: 0 0 var(--space-3); font-size: var(--text-sm); }
.cookie-banner__actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
