/* =========================================================
   Casa em Ordem
   Mobile first. Tokens de marca em :root.
   ========================================================= */

:root {
  /* Cores da marca: as dos quatro azulejos do logótipo */
  --azul: #2346D8;
  --azul-700: #1A35AE;
  --azul-50: #EEF2FF;
  --telha: #EE6A3C;
  --telha-50: #FFF0E8;
  --sol: #FFC83D;
  --sol-50: #FFF7DD;
  --tinta: #171A2E;
  --cinza: #5D6178;
  --linha: #E9E5DD;
  --papel: #F7F4EE;
  --branco: #FFFFFF;
  --wa: #25D366;

  --f-display: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --f-body: "Figtree", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;

  --wrap: 1200px;
  --gutter: 18px;
  --header-h: 68px;
  --r: 20px;
  --r-lg: 28px;
  --section-pad: clamp(72px, 11vw, 128px);
  --ease: cubic-bezier(.2, .8, .2, 1);

  color-scheme: light;
}
@media (min-width: 600px) { :root { --gutter: 28px; } }
@media (min-width: 1024px) { :root { --gutter: 40px; --header-h: 80px; } }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 8px);
}
body {
  margin: 0;
  background: var(--branco);
  color: var(--tinta);
  font-family: var(--f-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
html.nav-open { overflow: hidden; }

img, svg { display: block; max-width: 100%; }
img { height: auto; }
h1, h2, h3, h4, p, ul, ol, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }

:focus-visible { outline: 3px solid var(--azul); outline-offset: 3px; border-radius: 6px; }
.section--sol :focus-visible { outline-color: var(--tinta); }
.cta :focus-visible, .site-footer :focus-visible { outline-color: var(--sol); }

.sr-only {
  position: absolute !important;
  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; left: 12px; top: -60px; z-index: 100;
  padding: 10px 16px; border-radius: 12px;
  background: var(--tinta); color: var(--branco);
  font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 12px; }

.wrap {
  width: 100%;
  max-width: calc(var(--wrap) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------- Tipografia ---------- */
.hero__title, .section-title, .cta__title {
  font-family: var(--f-display);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: .98;
  text-wrap: balance;
}
.section-title { margin-top: 14px; font-size: clamp(2.3rem, 1.4rem + 3.9vw, 4.1rem); }
.section-lead {
  margin-top: 16px;
  max-width: 56ch;
  color: var(--cinza);
  font-size: 1.1rem;
  text-wrap: pretty;
}
.section-lead strong { color: var(--tinta); font-weight: 700; }

/* Etiqueta de secção: um azulejo pequeno + texto */
.label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.label::before { content: ""; width: 14px; height: 14px; border-radius: 3px; background: var(--azul); }
.label--telha::before { background: var(--telha); }
.label--tinta::before { background: var(--tinta); }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 50px;
  padding: 12px 22px;
  border: 0;
  border-radius: 999px;
  font-family: var(--f-body);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.1;
  text-decoration: none;
  transition: background-color .2s, color .2s, box-shadow .2s, transform .2s var(--ease);
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn .icon { width: 20px; height: 20px; flex: none; }
.btn--lg { min-height: 58px; padding: 14px 28px; font-size: 1.06rem; }

.btn--azul { background: var(--azul); color: var(--branco); box-shadow: 0 10px 24px -12px rgb(35 70 216 / .7); }
.btn--azul:hover { background: var(--azul-700); }
.btn--ghost { background: var(--branco); color: var(--tinta); box-shadow: inset 0 0 0 2px var(--linha); }
.btn--ghost:hover { box-shadow: inset 0 0 0 2px var(--tinta); }
.btn--branco { background: var(--branco); color: var(--tinta); }
.btn--branco .icon { color: #1DA851; }
.btn--branco:hover { background: var(--sol); }

/* ---------- Cabeçalho ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgb(255 255 255 / .9);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
  backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s;
}
.site-header.is-scrolled { border-bottom-color: var(--linha); }
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: var(--header-h);
}
.brand { flex: none; border-radius: 6px; }
.brand img { height: 28px; width: auto; }

.menu-toggle {
  display: grid; place-items: center;
  width: 48px; height: 48px;
  margin-right: -6px;
  border: 0; border-radius: 14px;
  background: var(--azul-50);
}
.menu-toggle__bars, .menu-toggle__bars::before, .menu-toggle__bars::after {
  display: block;
  width: 20px; height: 2.5px;
  border-radius: 2px;
  background: var(--tinta);
  transition: transform .3s var(--ease), background-color .2s;
}
.menu-toggle__bars { position: relative; }
.menu-toggle__bars::before, .menu-toggle__bars::after { content: ""; position: absolute; left: 0; }
.menu-toggle__bars::before { top: -6.5px; }
.menu-toggle__bars::after { top: 6.5px; }
.menu-toggle[aria-expanded="true"] .menu-toggle__bars { background: transparent; }
.menu-toggle[aria-expanded="true"] .menu-toggle__bars::before { transform: translateY(6.5px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-toggle__bars::after { transform: translateY(-6.5px) rotate(-45deg); }

.nav {
  position: fixed;
  inset: var(--header-h) 0 0 0;
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 20px var(--gutter) calc(28px + env(safe-area-inset-bottom));
  background: var(--branco);
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity .25s, transform .3s var(--ease), visibility 0s .3s;
}
.nav.is-open { opacity: 1; visibility: visible; transform: none; transition: opacity .25s, transform .3s var(--ease), visibility 0s; }
.nav__list { display: grid; }
.nav__list a {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--linha);
  font-family: var(--f-display);
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  text-decoration: none;
}
.nav__list a::before { content: ""; width: 14px; height: 14px; border-radius: 3px; flex: none; background: var(--azul); }
.nav__list li:nth-child(3n + 2) a::before { background: var(--telha); }
.nav__list li:nth-child(3n) a::before { background: var(--sol); }
.nav__cta { min-height: 58px; }

@media (min-width: 1120px) {
  .menu-toggle { display: none; }
  .brand img { height: 32px; }
  .nav {
    position: static;
    flex-direction: row;
    align-items: center;
    gap: 20px;
    padding: 0;
    background: none;
    overflow: visible;
    opacity: 1; visibility: visible; transform: none; transition: none;
  }
  .nav__list { display: flex; gap: 2px; }
  .nav__list a {
    white-space: nowrap;
    padding: 8px 14px;
    border: 0;
    border-radius: 999px;
    font-family: var(--f-body);
    font-size: .98rem;
    font-weight: 600;
    letter-spacing: 0;
    transition: background-color .2s;
  }
  .nav__list a::before { display: none; }
  .nav__list a:hover { background: var(--azul-50); }
  .nav__cta { min-height: 46px; padding: 10px 20px; white-space: nowrap; }
}

/* ---------- Hero ---------- */
.hero { padding: clamp(20px, 5vw, 64px) 0 clamp(56px, 8vw, 96px); overflow: hidden; }
.hero__grid { display: grid; gap: 44px; }
@media (min-width: 980px) {
  .hero__grid { grid-template-columns: 1.08fr 1fr; align-items: center; gap: 64px; }
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px 7px 10px;
  border-radius: 999px;
  background: var(--azul-50);
  color: var(--azul-700);
  font-size: .88rem;
  font-weight: 700;
}
.chip__dot { width: 12px; height: 12px; border-radius: 3px; background: var(--telha); }

.hero__title { margin-top: 20px; font-size: clamp(3rem, 1.5rem + 6.6vw, 6rem); line-height: .94; }
.hl { position: relative; z-index: 0; white-space: nowrap; }
.hl::after {
  content: "";
  position: absolute;
  z-index: -1;
  left: -.06em; right: -.06em;
  bottom: .04em;
  height: .38em;
  border-radius: .08em;
  background: var(--sol);
  transform: skewX(-8deg);
}
.hero__lead { margin-top: 22px; max-width: 46ch; font-size: clamp(1.1rem, 1rem + .45vw, 1.28rem); color: var(--cinza); text-wrap: pretty; }
.hero__actions { display: grid; gap: 12px; margin-top: 30px; }
@media (min-width: 520px) { .hero__actions { display: flex; flex-wrap: wrap; } }
.hero__note { margin-top: 18px; font-size: .92rem; font-weight: 600; color: var(--cinza); }

/* A casa de azulejos */
.house {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
  max-width: 560px;
  margin-inline: auto;
}
@media (min-width: 600px) { .house { gap: 14px; } }
.house__tile { position: relative; aspect-ratio: 1; overflow: hidden; }
.house__tile img { width: 100%; height: 100%; object-fit: cover; }
.house__tile--roof-l {
  clip-path: polygon(0 100%, 100% 0, 100% 100%);
  background:
    radial-gradient(circle at 100% 100%, transparent 34%, rgb(255 255 255 / .22) 35% 39%, transparent 40%) 0 0 / 50% 50%,
    var(--telha);
}
.house__tile--roof-r { clip-path: polygon(0 0, 100% 100%, 0 100%); }
.house__tile--wall-l, .house__tile--wall-r { border-radius: 4px; }

.badge {
  position: absolute;
  right: -6px;
  top: 2%;
  width: clamp(104px, 26vw, 140px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--branco);
  box-shadow: 0 14px 30px -14px rgb(23 26 46 / .45);
}
.badge svg { position: absolute; inset: 0; width: 100%; height: 100%; animation: spin 22s linear infinite; }
.badge text {
  font-family: var(--f-display);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
  fill: var(--tinta);
}
.badge__mark { width: 38%; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Os azulejos assentam do chão para o telhado */
.js .house__tile { animation: tile-in .8s var(--ease) both; }
.js .house__tile--wall-l { animation-delay: .1s; }
.js .house__tile--wall-r { animation-delay: .22s; }
.js .house__tile--roof-l { animation-delay: .4s; }
.js .house__tile--roof-r { animation-delay: .52s; }
.js .badge { animation: pop .6s .8s var(--ease) both; }
.js .hero__text > * { animation: rise .7s var(--ease) both; }
.js .hero__text > :nth-child(2) { animation-delay: .06s; }
.js .hero__text > :nth-child(3) { animation-delay: .12s; }
.js .hero__text > :nth-child(4) { animation-delay: .18s; }
.js .hero__text > :nth-child(5) { animation-delay: .24s; }
@keyframes tile-in { from { opacity: 0; transform: translateY(28px) scale(.94); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: scale(.6) rotate(-20deg); } to { opacity: 1; transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* ---------- Faixa em movimento ---------- */
.ticker {
  overflow: hidden;
  background: var(--azul);
  color: var(--branco);
  padding: 18px 0;
}
.ticker__track {
  display: flex;
  align-items: center;
  gap: 26px;
  width: max-content;
  animation: ticker 48s linear infinite;
}
.ticker span {
  font-family: var(--f-display);
  font-size: clamp(1.35rem, 1rem + 1.2vw, 1.9rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.ticker i { width: 16px; height: 16px; border-radius: 3px; background: var(--sol); flex: none; }
.ticker i:nth-of-type(3n + 2) { background: var(--telha); }
.ticker i:nth-of-type(3n) { background: var(--branco); }
@keyframes ticker { to { transform: translateX(-50%); } }

/* ---------- Secções ---------- */
.section { padding-block: var(--section-pad); }
.section--sol { background: var(--sol); }
.section--telha-claro { background: var(--telha-50); }
.section--azul-claro { background: var(--azul-50); }
.section-head { margin-bottom: clamp(32px, 5vw, 56px); }
.section-head--row { display: grid; gap: 24px; }
@media (min-width: 760px) {
  .section-head--row { grid-template-columns: 1fr auto; align-items: end; }
}

/* ---------- Serviços ---------- */
.services {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: min(84%, 340px);
  gap: 14px;
  margin-inline: calc(var(--gutter) * -1);
  padding: 4px var(--gutter) 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--gutter);
  scrollbar-width: none;
}
.services::-webkit-scrollbar { display: none; }
.services:focus-visible { outline-offset: -3px; }
@media (min-width: 760px) {
  .services { grid-auto-flow: row; grid-template-columns: 1fr 1fr; margin-inline: 0; padding: 0; overflow: visible; gap: 18px; }
}
@media (min-width: 1140px) { .services { grid-template-columns: repeat(4, 1fr); } }

.service {
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--azul);
  color: var(--branco);
}
.service__img { aspect-ratio: 4 / 3; overflow: hidden; }
.service__img img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.service:hover .service__img img { transform: scale(1.05); }
.service__body { flex: 1; display: flex; flex-direction: column; gap: 10px; padding: 22px 22px 24px; }
.service__tag { font-size: .82rem; font-weight: 700; opacity: .8; }
.service__title { font-family: var(--f-display); font-size: 1.75rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
.service__body > p:not(.service__tag) { font-size: .98rem; opacity: .9; margin-bottom: 8px; }
.service__link {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding: 11px 18px;
  border: 0;
  border-radius: 999px;
  background: var(--branco);
  color: var(--tinta);
  font-weight: 700;
  font-size: .95rem;
}
.service__link span { transition: transform .2s var(--ease); }
.service__link:hover span { transform: translateX(4px); }

.service--telha { background: var(--telha); color: var(--tinta); }
.service--telha .service__link { background: var(--tinta); color: var(--branco); }
.service--sol { background: var(--sol); color: var(--tinta); }
.service--sol .service__link { background: var(--tinta); color: var(--branco); }
.service--tinta { background: var(--tinta); }
.service--tinta .service__link { background: var(--sol); }

/* Especialidades */
.subhead {
  margin: clamp(48px, 7vw, 80px) 0 18px;
  font-family: var(--f-display);
  font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.025em;
}
.specs { display: grid; gap: 10px; }
@media (min-width: 760px) { .specs { grid-template-columns: 1fr 1fr; gap: 14px; } }
.spec {
  display: grid;
  grid-template-columns: 52px 1fr 44px;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border-radius: var(--r);
  background: var(--papel);
  transition: background-color .2s;
}
.spec:hover { background: var(--azul-50); }
.spec__icon {
  display: grid; place-items: center;
  width: 52px; height: 52px;
  border-radius: 12px;
  background: var(--azul);
  color: var(--branco);
}
.spec__icon svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.spec__icon--telha { background: var(--telha); color: var(--tinta); }
.spec__icon--sol { background: var(--sol); color: var(--tinta); }
.spec h4 { font-size: 1.05rem; font-weight: 700; line-height: 1.25; }
.spec p { margin-top: 3px; font-size: .92rem; line-height: 1.45; color: var(--cinza); }
.spec__go {
  display: grid; place-items: center;
  width: 44px; height: 44px;
  border: 0; border-radius: 50%;
  background: var(--branco);
  color: var(--tinta);
  transition: background-color .2s, color .2s;
}
.spec__go svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.spec__go:hover { background: var(--azul); color: var(--branco); }

/* ---------- Como trabalhamos ---------- */
.steps { display: grid; gap: 12px; }
@media (min-width: 700px) { .steps { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .steps { grid-template-columns: repeat(5, 1fr); gap: 14px; } }
.step {
  padding: 24px 22px 26px;
  border-radius: var(--r);
  background: var(--branco);
}
.step__n {
  display: grid; place-items: center;
  width: 46px; height: 46px;
  margin-bottom: 18px;
  border-radius: 12px;
  background: var(--tinta);
  color: var(--sol);
  font-family: var(--f-display);
  font-size: 1.4rem;
  font-weight: 800;
}
.step:nth-child(2n) .step__n { background: var(--azul); color: var(--branco); }
.step:nth-child(3) .step__n, .step:nth-child(5) .step__n { background: var(--telha); color: var(--tinta); }
.step h3 { font-family: var(--f-display); font-size: 1.35rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.step p { margin-top: 8px; color: var(--cinza); font-size: .98rem; }

/* ---------- Antes e depois ---------- */
.tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 5px;
  border-radius: 999px;
  background: var(--papel);
}
.tab {
  min-height: 46px;
  padding: 10px 8px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  font-size: .92rem;
  font-weight: 700;
  white-space: nowrap;
  color: var(--cinza);
  transition: background-color .2s, color .2s;
}
@media (min-width: 760px) {
  .tabs { display: inline-flex; justify-self: start; }
  .tab { padding: 10px 22px; font-size: 1rem; }
}
.tab[aria-selected="true"] { background: var(--telha); color: var(--tinta); }

.ba {
  --pos: 50%;
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--papel);
  touch-action: pan-y;
  cursor: ew-resize;
  -webkit-user-select: none;
  user-select: none;
  isolation: isolate;
}
@media (min-width: 760px) { .ba { aspect-ratio: 3 / 2; } }
.ba__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; -webkit-user-drag: none; }
.ba__img--antes { clip-path: inset(0 calc(100% - var(--pos)) 0 0); }
.ba__label {
  position: absolute;
  top: 14px;
  z-index: 2;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: .82rem;
  font-weight: 700;
  pointer-events: none;
}
.ba__label--antes { left: 14px; background: var(--tinta); color: var(--branco); }
.ba__label--depois { right: 14px; background: var(--sol); color: var(--tinta); }
.ba__range { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; pointer-events: none; }
.ba__handle {
  position: absolute;
  top: 0; bottom: 0;
  left: var(--pos);
  z-index: 3;
  width: 4px;
  margin-left: -2px;
  background: var(--branco);
  pointer-events: none;
}
.ba__handle::after {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  width: 56px; height: 56px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23171A2E' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 7 4 12l5 5M15 7l5 5-5 5'/%3E%3C/svg%3E") center / 26px no-repeat,
    var(--sol);
  box-shadow: 0 0 0 4px var(--branco), 0 10px 24px -8px rgb(23 26 46 / .5);
  transition: transform .2s var(--ease);
}
.ba:hover .ba__handle::after, .ba.is-dragging .ba__handle::after { transform: translate(-50%, -50%) scale(1.08); }
.ba__range:focus-visible + .ba__handle::after { outline: 3px solid var(--azul); outline-offset: 6px; }
.obra__caption { margin-top: 16px; max-width: 70ch; color: var(--cinza); }
.obra__caption strong { color: var(--tinta); }

/* ---------- Testemunhos ---------- */
.quotes {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: min(86%, 380px);
  gap: 14px;
  margin-inline: calc(var(--gutter) * -1);
  padding: 4px var(--gutter) 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--gutter);
  scrollbar-width: none;
}
.quotes::-webkit-scrollbar { display: none; }
.quotes:focus-visible { outline-offset: -3px; }
@media (min-width: 960px) {
  .quotes { grid-auto-flow: row; grid-template-columns: repeat(3, 1fr); margin-inline: 0; padding: 0; overflow: visible; gap: 18px; }
}
.quote {
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 28px 26px 26px;
  border-radius: var(--r-lg);
  background: var(--branco);
}
.quote::before { content: ""; width: 34px; height: 34px; border-radius: 6px; background: var(--azul); }
.quote--sol::before { background: var(--sol); }
.quote--telha::before { background: var(--telha); }
.quote blockquote { flex: 1; }
.quote blockquote p { font-family: var(--f-display); font-size: 1.32rem; font-weight: 600; letter-spacing: -0.015em; line-height: 1.3; text-wrap: pretty; }
.quote figcaption { display: grid; gap: 2px; }
.quote figcaption strong { font-weight: 700; }
.quote figcaption span { font-size: .9rem; color: var(--cinza); }

/* ---------- Zonas ---------- */
/* Telemóvel: mapa à esquerda, distritos (a legenda) à direita, convite por baixo */
.zonas {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr);
  grid-template-areas: "head head" "map list" "cta cta";
  gap: 0 20px;
  align-items: center;
}
.zonas__head { grid-area: head; margin-bottom: 28px; }
.zonas__map { grid-area: map; margin: 0; }
.zonas__list { grid-area: list; display: grid; gap: 8px; }
.zonas__cta { grid-area: cta; margin-top: 24px; }

/* Mapa */
.pt-map { display: block; width: 100%; height: auto; overflow: visible; }
.pt-map .d {
  fill: #D3DBF4;
  stroke: var(--azul-50);
  stroke-width: 1.2;
  stroke-linejoin: round;
  transition: fill .25s, opacity .25s;
}
.pt-map .d--azul { fill: var(--azul); }
.pt-map .d--telha { fill: var(--telha); }
.pt-map .d--sol { fill: var(--sol); }
.pt-map .d--tinta { fill: var(--tinta); }
.pt-map .d.is-on { cursor: pointer; }
.zonas.is-pointing .pt-map .d.is-on:not(.is-hot) { opacity: .3; }

/* Distritos: cartões cuja cor corresponde à do mapa */
.zona {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--branco);
  transition: transform .25s var(--ease), box-shadow .25s, opacity .25s;
}
.zona__tile { grid-row: 1 / 3; width: 28px; height: 28px; border-radius: 5px; background: var(--azul); }
.zona--telha .zona__tile { background: var(--telha); }
.zona--sol .zona__tile { background: var(--sol); }
.zona--tinta .zona__tile { background: var(--tinta); }
.zona__name { font-family: var(--f-display); font-size: 1.12rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.zona__sub { font-size: .78rem; font-weight: 600; color: var(--cinza); }
.zona.is-hot { transform: translateX(4px); box-shadow: 0 10px 24px -14px rgb(23 26 46 / .45); }
.zonas.is-pointing .zona:not(.is-hot) { opacity: .55; }

/* Convite para outras zonas */
.zonas__cta { padding: 22px; border-radius: 20px; background: var(--branco); }
.zonas__cta-title { font-family: var(--f-display); font-size: 1.3rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; }
.zonas__cta-text { margin-top: 6px; font-size: .97rem; color: var(--cinza); }
.zonas__cta .btn { margin-top: 16px; width: 100%; }

@media (min-width: 600px) {
  .zonas { grid-template-columns: 200px minmax(0, 1fr); grid-template-areas: "head head" "map list" "map cta"; gap: 0 40px; }
  .zonas__list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-self: end; }
  .zona { padding: 16px; }
  .zona__tile { width: 36px; height: 36px; }
  .zona__name { font-size: 1.25rem; }
  .zonas__cta { align-self: start; margin-top: 12px; }
  .zonas__cta .btn { width: auto; }
}

@media (min-width: 1100px) {
  .zonas {
    grid-template-columns: minmax(0, 1fr) 300px;
    grid-template-areas: "head map" "list map" "cta map";
    gap: 0 96px;
  }
  .zonas__map { padding-right: 20px; }
  .zonas__list { align-self: auto; }
  .zonas__cta {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 28px;
    align-items: center;
    margin-top: 12px;
    padding: 24px 26px;
  }
  .zonas__cta-text { grid-column: 1; }
  .zonas__cta .btn { grid-column: 2; grid-row: 1 / 3; margin: 0; }
}

/* ---------- Contacto final ---------- */
.cta { padding-bottom: var(--section-pad); }
.cta__box {
  position: relative;
  overflow: hidden;
  padding: clamp(40px, 7vw, 88px) clamp(24px, 6vw, 80px);
  border-radius: clamp(24px, 4vw, 40px);
  background: var(--azul);
  color: var(--branco);
}
.cta__tiles {
  position: absolute;
  top: clamp(22px, 4vw, 48px);
  right: clamp(22px, 4vw, 56px);
  display: grid;
  grid-template-columns: repeat(2, clamp(24px, 5vw, 64px));
  gap: clamp(4px, .8vw, 10px);
}
.cta__tiles i { aspect-ratio: 1; border-radius: 3px; background: var(--sol); }
.cta__tiles i:nth-child(1) { background: var(--telha); clip-path: polygon(0 100%, 100% 0, 100% 100%); border-radius: 0; }
.cta__tiles i:nth-child(2) { background: var(--telha); clip-path: polygon(0 0, 100% 100%, 0 100%); border-radius: 0; }
.cta__tiles i:nth-child(3) { background: var(--branco); }
.cta__title { max-width: 13ch; padding-right: 64px; font-size: clamp(2.4rem, 1.4rem + 4.6vw, 5rem); }
.cta__lead { margin: 20px 0 30px; max-width: 48ch; font-size: 1.12rem; color: rgb(255 255 255 / .88); }
.cta__info {
  display: grid;
  gap: 18px;
  margin-top: 40px;
  padding-top: 28px;
  border-top: 1px solid rgb(255 255 255 / .25);
  font-weight: 600;
}
@media (min-width: 800px) { .cta__info { grid-template-columns: repeat(3, auto); justify-content: start; column-gap: 56px; } }
.cta__info li { display: grid; gap: 2px; }
.cta__info span { font-size: .78rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--sol); }
.cta__info a { text-decoration: none; font-size: 1.1rem; }
.cta__info a:hover { text-decoration: underline; }
.cta__info small { font-size: .78rem; font-weight: 500; color: rgb(255 255 255 / .75); }

/* ---------- Rodapé ---------- */
.site-footer {
  background: var(--tinta);
  color: rgb(255 255 255 / .7);
  font-size: .96rem;
  padding-bottom: calc(92px + env(safe-area-inset-bottom));
}
/* fiada de azulejos no topo */
.site-footer__tiles {
  height: 12px;
  background: repeating-linear-gradient(90deg,
    var(--telha) 0 56px, transparent 56px 62px,
    var(--azul) 62px 118px, transparent 118px 124px,
    var(--sol) 124px 180px, transparent 180px 186px);
}
.site-footer a { color: inherit; text-decoration: none; transition: color .2s; }
.site-footer a:hover { color: var(--branco); }

.site-footer__top {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 44px 24px;
  padding: clamp(48px, 7vw, 80px) 0 clamp(40px, 5vw, 64px);
}
.f-brand, .f-col:last-child { grid-column: 1 / -1; }
@media (min-width: 980px) {
  .site-footer__top { grid-template-columns: 1.5fr 1fr 1fr 1.3fr; gap: 48px; }
  .f-brand, .f-col:last-child { grid-column: auto; }
}

.f-brand img { height: 34px; width: auto; }
.f-brand p { margin: 20px 0 24px; max-width: 38ch; line-height: 1.6; }
.btn--contorno {
  min-height: 48px;
  background: transparent;
  color: var(--branco);
  box-shadow: inset 0 0 0 2px rgb(255 255 255 / .22);
}
.btn--contorno .icon { color: var(--wa); }
.btn--contorno:hover { background: rgb(255 255 255 / .08); box-shadow: inset 0 0 0 2px rgb(255 255 255 / .5); }

.f-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  font-family: var(--f-body);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--branco);
}
.f-title::before { content: ""; width: 12px; height: 12px; border-radius: 3px; background: var(--azul); }
.f-title--telha::before { background: var(--telha); }
.f-title--sol::before { background: var(--sol); }
.f-col ul { display: grid; gap: 12px; }
.f-col a:hover { text-decoration: underline; text-underline-offset: 4px; }

.f-contacts li { display: grid; grid-template-columns: 20px 1fr; gap: 12px; align-items: start; }
.f-contacts svg { width: 20px; height: 20px; margin-top: 2px; color: var(--sol); }
.f-contacts a { color: var(--branco); font-weight: 600; }
.f-contacts small { display: block; margin-top: 2px; font-size: .78rem; color: rgb(255 255 255 / .5); }

.site-footer__bottom {
  display: grid;
  gap: 10px;
  padding: 24px 0 8px;
  border-top: 1px solid rgb(255 255 255 / .12);
  font-size: .85rem;
  color: rgb(255 255 255 / .55);
}
.f-legal span { margin-inline: 6px; }
.f-links { display: flex; flex-wrap: wrap; gap: 8px 22px; }
@media (min-width: 980px) {
  .site-footer { padding-bottom: 8px; }
  .site-footer__bottom { grid-template-columns: auto 1fr auto; align-items: center; gap: 32px; padding-right: 88px; }
  .f-legal { justify-self: center; }
}

/* ---------- Widget WhatsApp ---------- */
.chat {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 60;
}
html.nav-open .chat { display: none; }
.chat__fab {
  display: grid; place-items: center;
  width: 62px; height: 62px;
  border: 0; border-radius: 50%;
  background: var(--wa);
  color: var(--branco);
  box-shadow: 0 14px 30px -10px rgb(23 26 46 / .5);
  transition: transform .3s var(--ease), opacity .25s;
}
.chat__fab svg { width: 32px; height: 32px; }
.chat__fab:hover { transform: scale(1.06); }
.chat.is-tucked .chat__fab { opacity: 0; transform: translateY(24px) scale(.8); pointer-events: none; }

.chat__panel {
  position: fixed;
  left: 10px; right: 10px;
  bottom: calc(max(16px, env(safe-area-inset-bottom)) + 76px);
  max-height: calc(100dvh - 120px);
  display: flex;
  flex-direction: column;
  border-radius: 24px;
  background: var(--branco);
  box-shadow: 0 30px 70px -20px rgb(23 26 46 / .5), 0 0 0 1px rgb(23 26 46 / .06);
  overflow: hidden;
  transform-origin: calc(100% - 30px) 100%;
  animation: chat-in .28s var(--ease);
}
@media (min-width: 520px) { .chat__panel { position: absolute; left: auto; right: 0; bottom: 78px; width: 370px; } }
@keyframes chat-in { from { opacity: 0; transform: translateY(10px) scale(.96); } to { opacity: 1; transform: none; } }

.chat__head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 10px 14px 14px;
  background: var(--azul);
  color: var(--branco);
}
.chat__avatar { display: grid; place-items: center; width: 44px; height: 44px; flex: none; border-radius: 50%; background: var(--branco); }
.chat__avatar img { width: 26px; }
.chat__name { font-family: var(--f-display); font-size: 1.1rem; font-weight: 800; line-height: 1.1; }
.chat__sub { font-size: .82rem; color: rgb(255 255 255 / .82); }
.chat__close {
  margin-left: auto;
  display: grid; place-items: center;
  width: 44px; height: 44px;
  border: 0; border-radius: 12px;
  background: none;
  color: var(--branco);
}
.chat__close:hover { background: rgb(255 255 255 / .14); }
.chat__close svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }

.chat__body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  overflow-y: auto;
  background: var(--papel);
}
.msg {
  align-self: flex-start;
  max-width: 88%;
  padding: 10px 14px;
  border-radius: 6px 18px 18px 18px;
  background: var(--branco);
  font-size: .96rem;
  line-height: 1.45;
  box-shadow: 0 1px 1px rgb(0 0 0 / .05);
}
.js .chat__panel:not([hidden]) .msg { animation: rise .35s var(--ease) both; }
.js .chat__panel:not([hidden]) .msg:nth-child(2) { animation-delay: .12s; }
.chat__options { display: grid; gap: 8px; margin-top: 8px; }
.js .chat__panel:not([hidden]) .chat__options { animation: rise .35s .24s var(--ease) both; }
.chat__opt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 50px;
  padding: 12px 16px;
  border-radius: 16px;
  background: var(--branco);
  box-shadow: inset 0 0 0 2px var(--linha);
  font-weight: 700;
  text-decoration: none;
  transition: box-shadow .2s, background-color .2s;
}
.chat__opt::after { content: "→"; color: var(--azul); }
.chat__opt:hover { box-shadow: inset 0 0 0 2px var(--azul); }
.chat__opt--main { background: var(--wa); color: var(--tinta); box-shadow: none; }
.chat__opt--main::after { color: var(--tinta); }
.chat__opt--main:hover { box-shadow: inset 0 0 0 2px var(--tinta); }

/* ---------- Revelação ao fazer scroll ---------- */
.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.js .reveal.is-in { opacity: 1; transform: none; }

/* ---------- Movimento reduzido ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .ticker__track { animation: none; }
  .js .reveal { opacity: 1; transform: none; }
}
