/* =============================================================
   Animações ("blast"). As que dependem de JS só existem com a
   classe .js, que o movimento.js põe quando o movimento é permitido.
   ============================================================= */
.progresso { position: fixed; left: 0; top: 0; width: 100%; height: 3px; z-index: 40; background: var(--oliva-escuro); transform-origin: 0 50%; transform: scaleX(0); pointer-events: none; }

.cabecalho { transition: transform 0.5s var(--ease); }
.cabecalho.escondido { transform: translateY(-100%); }

/* Bolhas: o elemento de fora anda, o de dentro desenha e estoira */
.bolhas-ambiente { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.bolhas-click { position: fixed; inset: 0; z-index: 60; overflow: hidden; pointer-events: none; }
.bolha { position: absolute; display: block; will-change: transform, opacity; }
.bolhas-ambiente .bolha { pointer-events: auto; cursor: pointer; }
.bolha i {
  position: absolute; inset: 0; display: block; border: 2px solid var(--oliva); border-radius: 50%;
  transition: scale 0.28s var(--ease), opacity 0.28s;
}
.bolha i::after {
  content: ""; position: absolute; left: 16%; top: 14%; width: 38%; height: 38%;
  border: 2px solid transparent; border-top-color: var(--oliva); border-left-color: var(--oliva);
  border-radius: 50%; rotate: -12deg;
}
.bolha i.estoura { scale: 1.7; opacity: 0; }
.rodape .bolha i { border-color: rgba(241, 236, 228, 0.6); }
.rodape .bolha i::after { border-top-color: rgba(241, 236, 228, 0.6); border-left-color: rgba(241, 236, 228, 0.6); }
.heroi .contentor, .rodape .contentor { position: relative; z-index: 1; }
/* No ecrã largo as bolhas do topo andam por cima do título e do logo, para se poderem estoirar com o rato (a camada deixa passar o rato; só as bolhas o apanham) */
@media (min-width: 860px) { .heroi .bolhas-ambiente { z-index: 2; overflow: visible; } }

/* Rasto de patas */
.trilho { display: flex; justify-content: space-between; align-items: center; margin-top: 80px; padding: 0 4px; }
.trilho i { display: block; width: 44px; height: 44px; background: url("../assets/pata.svg") center / contain no-repeat; rotate: 90deg; opacity: 0.9; }
.trilho i:nth-child(odd) { translate: 0 14px; }
.trilho i:nth-child(even) { translate: 0 -14px; }
@media (max-width: 700px) { .trilho i:nth-child(n+7) { display: none; } }

/* Preços, fotografias, rodapé */
.linhas-preco li { transition: opacity 0.6s var(--ease), translate 0.7s var(--ease), background 0.25s, padding 0.25s; }
.linhas-preco li:hover { background: rgba(102, 100, 59, 0.1); padding-left: 10px; padding-right: 10px; }
.foto img { scale: 1.14; transition: scale 0.9s var(--ease); }
.foto:hover img { scale: 1.22; }
.marca-grande { overflow: hidden; padding-bottom: 0.08em; }
.cortina { display: none; }

/* Letras e palavras que sobem */
/* a folga em cima e em baixo é para a máscara não cortar acentos (PREÇÁRIO) nem cedilhas */
.pal { display: inline-block; overflow: hidden; vertical-align: top; padding: 0.2em 0 0.16em; margin: -0.2em 0 -0.16em; }
.titulo-misto > span.pal, .titulo-misto > em.pal { display: block; }
.titulo-misto > em.pal { padding-right: 0.14em; }
.pal-in { display: inline-block; }
.heroi h1 > span { overflow: hidden; padding: 0.08em 0 0.14em; margin: -0.08em 0 -0.14em; }
.letra { display: inline-block; }

.js .pal-in { transform: translateY(115%); transition: transform 0.95s var(--ease); transition-delay: calc(var(--d, 0) * 80ms + 120ms); }
.js .visto .pal-in { transform: none; }

.js .heroi h1 .letra { transform: translateY(115%) rotate(9deg); transition: transform 1.05s cubic-bezier(0.34, 1.4, 0.64, 1); transition-delay: calc(var(--l) * 45ms + 150ms); }
.js .heroi .visto h1 .letra { transform: none; }
.js .heroi h1.livre .letra { transition: transform 0.35s var(--ease); transition-delay: 0s; }
.js .heroi h1.livre .letra:hover { transform: translateY(-8px) rotate(-5deg) scale(1.08); }

.js .marca-grande .letra { transform: translateY(105%); transition: transform 1.1s cubic-bezier(0.34, 1.3, 0.64, 1); transition-delay: calc(var(--l) * 70ms); }
.js .marca-grande.visto .letra { transform: none; }

/* O recorte vai na imagem e não na figura: um elemento totalmente cortado nunca conta como visível para o observador. */
.js .foto.revelar { opacity: 1; transform: none; }
.js .foto.revelar img { clip-path: inset(0 0 100% 0); transition: clip-path 1.3s var(--ease), scale 1.8s var(--ease); transition-delay: calc(var(--i, 0) * 80ms), 0s; }
.js .foto.revelar.visto img { clip-path: inset(0 0 0 0); }
.js .foto img { scale: 1.32; transition: scale 1.8s var(--ease); }
.js .visto .foto img, .js .foto.visto img { scale: 1.14; }
.js .foto:hover img { scale: 1.22; transition-duration: 0.9s; }

.js .selo.revelar { transform: scale(0.55) rotate(-10deg); transition: opacity 0.6s, transform 1.4s cubic-bezier(0.34, 1.56, 0.64, 1); transition-delay: 0.35s; }
.js .selo.revelar.visto { transform: none; }
.inclina { transition: transform 0.25s var(--ease); }

.js .linhas-preco li { opacity: 0; translate: -22px 0; }
.js .visto .linhas-preco li { opacity: 1; translate: 0 0; transition-delay: calc(var(--r, 0) * 70ms + 250ms), calc(var(--r, 0) * 70ms + 250ms), 0s, 0s; }

.js .icone { scale: 0.55; opacity: 0; transition: scale 0.9s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s, background 0.2s, color 0.2s, transform 0.3s var(--ease); transition-delay: calc(var(--k, 0) * 110ms + 200ms), calc(var(--k, 0) * 110ms + 200ms), 0s, 0s, 0s; }
.js .visto .icone { scale: 1; opacity: 1; }
.js .icone svg * { stroke-dasharray: 1; stroke-dashoffset: 1; }
.js .visto .icone svg * { stroke-dashoffset: 0; transition: stroke-dashoffset 1.3s var(--ease) calc(var(--k, 0) * 110ms + 450ms); }


.js .trilho i { opacity: 0; scale: 0.2; }
.js .trilho.visto i { opacity: 0.9; scale: 1; transition: opacity 0.4s, scale 0.6s cubic-bezier(0.34, 1.56, 0.64, 1); }
.js .trilho.visto i:nth-child(1) { transition-delay: 0.1s; }
.js .trilho.visto i:nth-child(2) { transition-delay: 0.3s; }
.js .trilho.visto i:nth-child(3) { transition-delay: 0.5s; }
.js .trilho.visto i:nth-child(4) { transition-delay: 0.7s; }
.js .trilho.visto i:nth-child(5) { transition-delay: 0.9s; }
.js .trilho.visto i:nth-child(6) { transition-delay: 1.1s; }
.js .trilho.visto i:nth-child(7) { transition-delay: 1.3s; }
.js .trilho.visto i:nth-child(8) { transition-delay: 1.5s; }
.js .trilho.visto i:nth-child(9) { transition-delay: 1.7s; }

@media (prefers-reduced-motion: no-preference) {
  .selo img { animation: flutuar 7s ease-in-out infinite; }
  @keyframes flutuar { 50% { transform: translateY(-14px) rotate(1.4deg); } }

  .calculadora .total { transform-origin: left center; }
  .calculadora .total.pulsa { animation: pulsa 0.5s var(--ease); }
  @keyframes pulsa { 40% { transform: scale(1.08); } }

  .pastilha input:checked + label, .opcao input:checked + label { animation: estala 0.45s cubic-bezier(0.34, 1.56, 0.64, 1); }
  @keyframes estala { from { scale: 0.9; } to { scale: 1; } }

  .botao::after {
    content: ""; position: absolute; top: 0; bottom: 0; left: -70%; width: 40%;
    background: rgba(255, 255, 255, 0.28); transform: skewX(-22deg); pointer-events: none;
  }
  .botao:hover::after { left: 130%; transition: left 0.75s var(--ease); }

  .cortina {
    display: grid; place-items: center; position: fixed; inset: 0; z-index: 100; pointer-events: none;
    background: var(--oliva-fundo); border-radius: 0 0 50% 50% / 0 0 12vh 12vh;
    animation: abrir 1.2s cubic-bezier(0.7, 0, 0.2, 1) forwards;
  }
  .cortina .disco {
    width: min(58vw, 240px); aspect-ratio: 1; border-radius: 50%; background: var(--fundo);
    display: grid; place-items: center; animation: entra 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  }
  .cortina .disco img { width: 68%; height: auto; display: block; }
  @keyframes abrir { 0%, 40% { transform: none; } 100% { transform: translateY(-105%); visibility: hidden; } }
  @keyframes entra { from { scale: 0.3; rotate: -14deg; opacity: 0; } to { scale: 1; rotate: 0deg; opacity: 1; } }
}

@media (prefers-reduced-motion: reduce) {
  .cabecalho { transition: none; }
  .foto img { transition: none; }
}

/* ---------- Barra fixa em baixo, sempre visível: preços e "Marcar" ---------- */
.barra-marcar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: var(--oliva-fundo); color: var(--sobre-oliva);
  box-shadow: 0 2px 0 0 var(--oliva-fundo); /* tapa qualquer fio de sub-píxel por baixo */
  transform: translateY(110%); visibility: hidden;
  transition: transform 0.6s var(--ease), visibility 0s 0.6s;
}
.barra-marcar.visivel { transform: none; visibility: visible; transition: transform 0.6s var(--ease); }
/* Cobre qualquer fresta por baixo da barra (arredondamentos do ecrã, barra do browser que sobe e desce) */
.barra-marcar::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 120px; background: var(--oliva-fundo); }
.barra-texto { font-family: var(--fonte-texto); font-weight: 600; font-size: 1.3rem; line-height: 1.2; min-width: 0; }
.barra-precos { display: none; }
.barra-marcar .botao { background: var(--sobre-oliva); color: var(--oliva-fundo); border-color: var(--sobre-oliva); flex-shrink: 0; min-height: 44px; }
.tem-barra .rodape { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }

@media (min-width: 1480px) {
  .barra-marcar { justify-content: center; padding-inline: 24px; gap: 24px; }
  .barra-texto { display: none; }
  .barra-precos { display: flex; flex: 0 1 auto; flex-wrap: wrap; justify-content: center; gap: 16px; list-style: none; margin: 0; padding: 0; }
  .barra-marcar .botao { box-sizing: border-box; height: 48px; min-height: 0; padding-block: 0; margin: 0; line-height: 1; display: inline-flex; align-items: center; justify-content: center; }
  .barra-precos a {
    /* Rótulo e preço pela mesma linha de base; o conjunto fica centrado na pill de 48px */
    display: inline-flex; flex-wrap: wrap; align-items: baseline; align-content: center; justify-content: center;
    box-sizing: border-box; height: 48px; gap: 0 14px; padding: 0 22px; white-space: nowrap;
    color: inherit; text-decoration: none; cursor: pointer;
    border: 1px solid rgba(244, 239, 228, 0.6); border-radius: 999px;
    transition: background 0.2s, color 0.2s, border-color 0.2s, translate 0.3s var(--ease);
  }
  .barra-precos a:hover { background: var(--sobre-oliva); color: var(--oliva-fundo); border-color: var(--sobre-oliva); translate: 0 -3px; }
  .barra-precos a:active { translate: 0 0; }
  .barra-precos a:focus-visible { outline: 2px solid var(--sobre-oliva); outline-offset: 4px; }
  .bp-nome { font-size: var(--t-mini); letter-spacing: 0.14em; text-transform: uppercase; }
  .bp-preco { font-family: var(--fonte-texto); font-weight: 700; font-size: 1.35rem; line-height: 1; font-variant-numeric: lining-nums tabular-nums; }
}

/* Barra da página de marcação: preço escolhido e "Marcar", alinhados com a coluna do formulário */
.barra-marcar.barra-reserva { padding-inline: 0; }
.barra-reserva-dentro { display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; }
.barra-marcar.barra-reserva .barra-texto { display: flex; flex-direction: column; gap: 2px; }
.barra-etiqueta { font-size: var(--t-mini); letter-spacing: 0.14em; text-transform: uppercase; line-height: 1.2; color: rgba(244, 239, 228, 0.82); }
.barra-valor { font-family: var(--fonte-texto); font-weight: 600; font-size: 1.3rem; line-height: 1.1; white-space: nowrap; }
.barra-valor.barra-vazio { font-size: var(--t-corpo); white-space: normal; text-wrap: balance; }
.barra-reserva .botao { min-height: 48px; white-space: nowrap; }
@media (min-width: 1480px) {
  .barra-marcar.barra-reserva { padding-inline: 0; }
}

/* Menos movimento no telemóvel: o topo tem de mostrar o botão e o preço */
@media (max-width: 859px) {
  .selo img { animation: none; }
  .cortina .disco { width: min(46vw, 190px); }
}
@media (prefers-reduced-motion: reduce) {
  .barra-marcar, .barra-marcar.visivel { transition: none; }
  .barra-precos a { transition: none; }
}
.selo { position: relative; }
