/* Base: reset, tipografia, botões, layout comum. */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-space);
}

body {
  margin: 0;
  background: var(--c-warm-white);
  color: var(--c-black);
  font-family: var(--f-body);
  font-size: var(--t-body);
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
h1, h2, h3, p, figure, blockquote, ul { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; }

h1, h2 {
  font-family: var(--f-display);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
h1 { font-size: var(--t-h1); }
h2 { font-size: var(--t-h2); }
h3 {
  font-family: var(--f-body);
  font-size: var(--t-h3);
  font-weight: 600;
  line-height: 1.3;
}
p { max-width: var(--measure); text-wrap: pretty; }

:focus-visible {
  outline: 2px solid var(--c-gold);
  outline-offset: 3px;
}

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

/* Grid de colunas. Filhos ocupam a largura toda por padrão; cada seção posiciona os seus.
   Listas internas de 2 colunas usam column-gap: var(--grid-gap) para cair em 6 + 6 (ou 4 + 4). */
.grid {
  display: grid;
  grid-template-columns: repeat(var(--grid-cols), minmax(0, 1fr));
  column-gap: var(--grid-gap);
}
.grid > * { grid-column: 1 / -1; }
.grid > p { max-width: none; } /* no grid, a coluna define a largura da linha */

/* Bloco centralizado: 6 de 8 colunas no tablet, 8 de 12 no desktop. */
@media (min-width: 37.5rem) {
  .grid > .col-center { grid-column: 2 / span 6; }
}
@media (min-width: 64rem) {
  .grid > .col-center { grid-column: 3 / span 8; }
}

/* Seções: o tom define cor de fundo e de texto. */
.section { padding-block: var(--section-y); position: relative; }
.section--dark { background: var(--c-black); color: var(--c-on-dark); }
.section--light { background: var(--c-cream); color: var(--c-black); }
.section--dark .muted { color: var(--c-on-dark-muted); }
.section--light .muted { color: var(--c-ink-muted); }

/* Rótulo curto em caixa alta espaçada, eco do "P I S O S" do logo. Usar com parcimônia. */
.label {
  font-family: var(--f-body);
  font-size: var(--t-small);
  font-weight: 600;
  letter-spacing: 0.32em;
  text-transform: uppercase;
}

/* Botões */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6em;
  min-height: 3rem;
  padding: 0.85em 1.6em;
  border: 0;
  border-radius: var(--radius);
  font-family: var(--f-body);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.btn svg { width: 1.15em; height: 1.15em; flex: none; }
.btn--gold { background: var(--c-gold); color: var(--c-black); }
.btn--gold:hover { background: var(--c-gold-light); }
.btn--gold:active { transform: translateY(1px); }
/* Pílula (hero): cantos totalmente arredondados, mais alta. */
.btn--pill { min-height: 3.5rem; padding: 0.85em 1.9em; border-radius: 999px; }
.btn--gold { box-shadow: 0 10px 30px rgb(201 144 74 / 0.32); }
/* Vidro escuro: secundário sobre fundo escuro. */
.btn--glass {
  background: rgb(255 255 255 / 0.06);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.24);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.btn--glass:hover { background: rgb(255 255 255 / 0.12); }
.btn .btn__arrow { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.2s var(--ease); }
.btn:hover .btn__arrow { transform: translateX(3px); }
@media (max-width: 37.4375rem) {
  /* celular: pílulas mais leves */
  .btn--pill { min-height: 3rem; padding: 0.7em 1.4em; font-size: 0.875rem; }
  .btn--gold { box-shadow: 0 6px 18px rgb(201 144 74 / 0.22); }
}
.btn--ghost {
  background: transparent;
  color: inherit;
  box-shadow: inset 0 0 0 1px currentColor;
}

/* Cabeçalho: barra flutuante encaixada nas bordas do grid (fundo claro por causa do logo). */
.site-header {
  position: fixed;
  top: var(--header-top);
  left: 0;
  right: 0;
  z-index: 50;
  pointer-events: none;
}
.site-header__bar {
  position: relative; /* referência para o filete do menu (.site-nav__rail) */
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--header-h);
  padding: 0.5rem 0.5rem 0.5rem 0.75rem;
  background: rgb(251 246 239 / 0.96);
  border: 1px solid rgb(201 144 74 / 0.35);
  border-radius: 6px;
  box-shadow: 0 8px 28px rgb(0 0 0 / 0.18);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  pointer-events: auto;
}
.site-header__logo { width: 3.25rem; flex: none; text-decoration: none; }
.site-header .btn { min-height: 2.75rem; padding: 0.6em 1.3em; font-size: 0.875rem; box-shadow: none; }

/* Menu de atalhos no cabeçalho: só no desktop (no celular não cabe; lá a barra é logo + botão). */
.site-nav { display: none; }
@media (min-width: 64rem) {
  .site-nav { display: block; }
  .site-nav ul {
    display: flex;
    gap: clamp(1rem, 2.2vw, 2rem);
    margin: 0;
    padding: 0;
    list-style: none;
  }
  /* Jost, a fonte dos títulos: as letras geométricas conversam com as do logo. */
  .site-nav a {
    display: inline-block;
    padding: 0.5rem 0; /* área de clique maior que o texto */
    font-family: var(--f-display);
    font-size: 1rem;
    font-weight: 400;
    letter-spacing: 0.01em;
    color: var(--c-black);
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.2s var(--ease);
  }
  .site-nav a:hover,
  .site-nav a[aria-current] { color: var(--c-gold-dark); } /* sem negrito: o texto não muda de largura nem empurra os vizinhos */
  .site-nav a:focus-visible { outline: 2px solid var(--c-gold); outline-offset: 4px; border-radius: 2px; }

  /* O "rodapé" da barra: filete dourado na borda de baixo, embaixo da seção atual.
     Posição (--x) e largura (--w) vêm do nav.js; ele desliza quando a seção muda. */
  .site-nav__rail {
    position: absolute;
    left: 0;
    bottom: -1px; /* em cima da borda da barra */
    width: var(--w, 0);
    height: 2px;
    background: var(--g-gold);
    transform: translateX(var(--x, 0));
    opacity: 0;
    transition: transform 0.45s var(--ease), width 0.45s var(--ease), opacity 0.2s var(--ease);
    pointer-events: none;
  }
  .site-nav__rail.is-on { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .site-nav__rail { transition: none; }
}

/* Mídia: imagem real ou espaço reservado rotulado (prévia). */
.media { position: relative; overflow: hidden; width: 100%; }
.media > img { width: 100%; height: 100%; object-fit: cover; }
/* Proporções no CSS (não só no JS): o espaço fica reservado desde o primeiro desenho, sem pulo de layout. */
.media[data-ratio="1/1"] { aspect-ratio: 1 / 1; }
.media[data-ratio="4/3"] { aspect-ratio: 4 / 3; }
.media[data-ratio="16/9"] { aspect-ratio: 16 / 9; }
.media[data-ratio="9/16"] { aspect-ratio: 9 / 16; }
.media--placeholder {
  display: grid;
  place-items: center;
  padding: 1rem;
  background:
    repeating-linear-gradient(135deg, transparent 0 14px, rgb(201 144 74 / 0.07) 14px 15px),
    rgb(201 144 74 / 0.1);
  box-shadow: inset 0 0 0 1px rgb(201 144 74 / 0.45);
  color: var(--c-gold-dark);
  text-align: center;
}
.section--dark .media--placeholder,
.hero .media--placeholder { background-color: rgb(255 255 255 / 0.04); color: var(--c-gold-light); }
.media__label {
  max-width: 22ch;
  font-size: var(--t-small);
  font-weight: 500;
  line-height: 1.4;
}
.site-header__logo .media__label,
.site-footer__logo .media__label { font-size: 0.625rem; }
.is-pending { color: var(--c-gold-dark); }
.section--dark .is-pending { color: var(--c-gold-light); }

/* Botão com aparência de link (ex.: "Preferências de cookies"). */
.link-button {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

/* Botão flutuante do WhatsApp — dourado da marca, ícone reconhecível. */
.wa-float {
  position: fixed;
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(1rem, env(safe-area-inset-bottom));
  z-index: 40;
  display: grid;
  place-items: center;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  background: var(--c-gold);
  color: var(--c-black);
  box-shadow: 0 6px 20px rgb(0 0 0 / 0.28);
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease), background-color 0.2s var(--ease), bottom 0.25s var(--ease);
}
.wa-float svg { width: 1.75rem; height: 1.75rem; }
.has-consent .wa-float { bottom: calc(var(--consent-h, 0px) + 1rem); }

/* Aviso de cookies */
.consent {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.75rem 1.5rem;
  padding: 1rem var(--gutter) max(1rem, env(safe-area-inset-bottom));
  background: var(--c-black);
  color: var(--c-on-dark);
  font-size: 0.875rem;
  border-top: 2px solid var(--c-gold);
  box-shadow: 0 -4px 20px rgb(0 0 0 / 0.2);
}
.consent[hidden] { display: none; }
.consent p { max-width: 40rem; }
.consent a { color: var(--c-gold-light); }
.consent__actions { display: flex; gap: 0.75rem; }
.consent .btn { min-height: 2.6rem; padding: 0.55em 1.3em; font-size: 0.875rem; }
.wa-float:hover { background: var(--c-gold-light); transform: scale(1.05); }
.wa-float.is-hidden {
  opacity: 0;
  visibility: hidden;
  transform: scale(0.85);
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease), visibility 0s linear 0.2s;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
