/* Componentes compartilhados (modal de lead, cookies, flutuantes, marquee, carrossel, preloader).
   Cada modelo define as variáveis abaixo no :root. */
:root {
  --bg: #fff; --ink: #14181f; --ink-2: #4a5160; --line: rgba(20, 24, 31, .14);
  --brand: #243261; --accent: #4b8606; --on-brand: #fff;
  --font-body: system-ui, sans-serif; --font-display: var(--font-body);
  --r: 10px; --ease: cubic-bezier(.22, 1, .36, 1);
  --whats: #14803f; --fab: 56px; --fab-x: 20px; --fab-y: 20px;
}
html[data-nomotion] *, html[data-nomotion] *::before, html[data-nomotion] *::after { animation: none !important; transition: none !important; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: fixed; left: 12px; top: -60px; z-index: 500; background: var(--brand); color: var(--on-brand); padding: 10px 16px; border-radius: 8px; transition: top .2s; }
.skip:focus { top: 12px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.ic { width: 1.25em; height: 1.25em; flex: none; }

/* preloader (a hero só anima depois de body.is-loaded) */
.preloader { position: fixed; inset: 0; z-index: 400; background: var(--pre-bg, var(--brand)); display: grid; place-items: center; transition: opacity .55s ease, visibility .55s; }
.preloader.is-done { opacity: 0; visibility: hidden; pointer-events: none; }
.preloader img { width: min(260px, 60vw); height: auto; opacity: 0; transform: translateY(8px) scale(.96); animation: pre-in .7s var(--ease) .1s forwards; }
.preloader::after { content: ""; position: absolute; left: 50%; top: calc(50% + 70px); width: 120px; height: 3px; margin-left: -60px; background: rgba(255, 255, 255, .22); border-radius: 3px; }
.preloader::before { content: ""; position: absolute; z-index: 1; left: 50%; top: calc(50% + 70px); width: 120px; height: 3px; margin-left: -60px; background: var(--pre-bar, #8ccb3a); border-radius: 3px; transform-origin: left; transform: scaleX(0); animation: pre-bar 1.1s var(--ease) .25s forwards; }
@keyframes pre-in { to { opacity: 1; transform: none; } }
@keyframes pre-bar { to { transform: scaleX(1); } }

/* reveal on scroll */
@media (prefers-reduced-motion: no-preference) {
  .js [data-reveal] { opacity: 0; transform: translateY(22px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
  .js [data-reveal].is-inview { opacity: 1; transform: none; }
}

/* marquee */
.marquee { position: relative; overflow: hidden; padding: 8px 0; }
.marquee::before, .marquee::after { content: ""; position: absolute; top: 0; bottom: 0; width: 12%; z-index: 2; pointer-events: none; }
.marquee::before { left: 0; background: linear-gradient(90deg, var(--marquee-bg, #fff), transparent); }
.marquee::after { right: 0; background: linear-gradient(270deg, var(--marquee-bg, #fff), transparent); }
.marquee-track { display: flex; align-items: center; gap: 72px; width: max-content; padding-right: 72px; list-style: none; margin: 0; animation: marquee var(--marquee-dur, 40s) linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-track img { height: 64px; width: auto; display: block; }
@keyframes marquee { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .marquee-track { animation: none; flex-wrap: wrap; width: auto; justify-content: center; } }

/* carrossel de avaliações (scroll-snap) */
.car-track { display: flex; gap: 18px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding-block: 4px; overscroll-behavior-x: contain; }
.car-track::-webkit-scrollbar { display: none; }
.car-track > * { scroll-snap-align: start; flex: 0 0 min(86%, 400px); }
.car-nav { display: flex; gap: 10px; }
.car-btn { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line); background: transparent; color: inherit; cursor: pointer; transition: background .2s, color .2s, border-color .2s; }
.car-btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

/* botões flutuantes */
.whats-float { position: fixed; right: var(--fab-x); bottom: var(--fab-y); z-index: 90; width: var(--fab); height: var(--fab); border-radius: 50%; background: var(--whats); color: #fff; display: grid; place-items: center; box-shadow: 0 14px 30px -10px rgba(0, 0, 0, .45); transition: opacity .3s, transform .3s var(--ease), visibility .3s; }
.whats-float .ic { width: 30px; height: 30px; }
.whats-float::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--whats); opacity: 0; }
@media (prefers-reduced-motion: no-preference) { .whats-float::after { animation: pulse 2.6s ease-out infinite; } }
@keyframes pulse { 0% { transform: scale(1); opacity: .7; } 100% { transform: scale(1.7); opacity: 0; } }
.cookie-float { position: fixed; left: var(--fab-x); bottom: var(--fab-y); z-index: 90; width: var(--fab); height: var(--fab); border-radius: 50%; display: grid; place-items: center; background: var(--brand); color: var(--on-brand); border: 0; cursor: pointer; box-shadow: 0 12px 26px -12px rgba(0, 0, 0, .5); transition: opacity .3s, transform .3s var(--ease), visibility .3s; }
.cookie-float[hidden] { display: none; }
.to-top { position: fixed; right: calc(var(--fab-x) + (var(--fab) - 44px) / 2); bottom: calc(var(--fab-y) + var(--fab) + 14px); z-index: 89; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--bg); color: var(--ink); display: grid; place-items: center; cursor: pointer; opacity: 0; transform: translateY(12px); pointer-events: none; box-shadow: 0 12px 26px -14px rgba(0, 0, 0, .5); transition: opacity .3s, transform .3s var(--ease), background-color .2s; }
.to-top[hidden] { display: grid; }
.to-top.is-visible { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { background: var(--accent); color: #fff; }
.is-hidden { opacity: 0 !important; visibility: hidden !important; pointer-events: none !important; transform: translateY(12px) !important; }
@media (max-width: 640px) { :root { --fab-x: 16px; } }

/* banner de cookies */
.cookie { position: fixed; z-index: 300; left: 16px; right: 16px; bottom: 16px; max-width: 760px; margin-inline: auto; background: var(--brand); color: var(--on-brand); border-radius: 14px; padding: 18px 20px; box-shadow: 0 24px 60px -20px rgba(0, 0, 0, .6); font-size: .92rem; line-height: 1.5; }
.cookie[hidden] { display: none; }
.cookie a { color: inherit; text-decoration: underline; }
.cookie-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.cookie-actions button, .cookie-prefs button { font: inherit; font-weight: 600; padding: 10px 16px; border-radius: 8px; border: 1.5px solid rgba(255, 255, 255, .5); background: transparent; color: inherit; cursor: pointer; }
.cookie-actions button[data-cookie="accept"], .cookie-actions button[data-cookie="reject"] { background: #fff; color: var(--brand); border-color: #fff; }
.cookie-prefs { margin-top: 14px; display: grid; gap: 10px; }
.cookie-prefs[hidden] { display: none; }
.cookie-prefs label { display: flex; gap: 10px; align-items: flex-start; }

/* modal de orçamento (só WhatsApp) */
.lead { position: fixed; inset: 0; z-index: 350; display: grid; place-items: center; padding: 16px; }
.lead[hidden] { display: none; }
.lead-backdrop { position: absolute; inset: 0; background: rgba(8, 12, 28, .66); backdrop-filter: blur(3px); }
.lead-box { position: relative; width: min(460px, 100%); max-height: calc(100dvh - 32px); overflow: auto; background: var(--bg); color: var(--ink); border-radius: 18px; box-shadow: 0 40px 90px -30px rgba(0, 0, 0, .7); animation: lead-in .35s var(--ease); }
@keyframes lead-in { from { opacity: 0; transform: translateY(14px) scale(.98); } }
.lead-head { display: flex; align-items: center; gap: 12px; padding: 16px 18px; background: var(--brand); color: var(--on-brand); }
.lead-head img { width: 38px; height: 38px; object-fit: contain; background: #fff; border-radius: 10px; padding: 4px; }
.lead-head strong { display: block; font-family: var(--font-display); font-size: 1.05rem; }
.lead-head span { font-size: .82rem; opacity: .85; }
.lead-close { margin-left: auto; width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .14); color: inherit; display: grid; place-items: center; cursor: pointer; }
.lead-body { padding: 20px 18px 22px; display: grid; gap: 14px; }
.lead-body p { margin: 0; color: var(--ink-2); font-size: .95rem; line-height: 1.5; }
.lf { display: grid; gap: 6px; }
.lf label { font-weight: 600; font-size: .88rem; }
.lf input, .lf select { font: inherit; padding: 13px 14px; border-radius: 10px; border: 1.5px solid var(--line); background: #fff; color: var(--ink); min-height: 48px; }
.lf.is-invalid input, .lf.is-invalid select { border-color: #c0392b; }
.lf-consent { display: flex; gap: 10px; font-size: .85rem; color: var(--ink-2); line-height: 1.45; }
.lf-consent input { margin-top: 3px; flex: none; width: 18px; height: 18px; accent-color: var(--accent); }
.lf-consent a { text-decoration: underline; }
.lf-error { color: #c0392b; font-size: .88rem; margin: 0; }
.lead-submit { font: inherit; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; border: 0; border-radius: 12px; background: var(--whats); color: #fff; cursor: pointer; text-decoration: none; transition: filter .2s; }
.lead-submit:hover { filter: brightness(1.08); }
.lead-foot { padding: 0 18px 18px; font-size: .88rem; color: var(--ink-2); }
.lead-foot a { font-weight: 700; color: var(--brand); }
.hp { position: absolute; left: -9999px; }
