/* ============================================================
   ANIMAÇÕES E MICROINTERAÇÕES — Sistema Premium
   Movimentos sutis e naturais que dão vida ao site
   ============================================================ */

/* ---- Configuração de preferência de movimento reduzido ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* ---- Fade-in e entrada suave geral ---- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* ---- Entrada de seções ao scroll ---- */
.reveal {
  animation: fadeInUp .8s cubic-bezier(.22, .61, .36, 1) forwards;
  opacity: 0;
}

.reveal.in {
  opacity: 1;
}

/* Delay progressivo para múltiplos elementos */
.reveal:nth-child(1) { animation-delay: 0ms; }
.reveal:nth-child(2) { animation-delay: 80ms; }
.reveal:nth-child(3) { animation-delay: 160ms; }
.reveal:nth-child(n+4) { animation-delay: 240ms; }

/* ---- Entrada de página (fade do branco para o conteúdo) ---- */
main#main-content {
  animation: fadeIn .5s cubic-bezier(.22, .61, .36, 1);
}

/* ---- Seções e blocos ---- */
.section {
  animation: fadeInUp .9s cubic-bezier(.22, .61, .36, 1) .1s both;
}

.section:nth-of-type(2) { animation-delay: .2s; }
.section:nth-of-type(3) { animation-delay: .3s; }
.section:nth-of-type(n+4) { animation-delay: .4s; }

/* ---- Títulos com entrada sofisticada ---- */
.h-display,
.h-sec {
  animation: fadeInUp .7s cubic-bezier(.22, .61, .36, 1) .15s both;
}

/* ---- Parágrafos com entrada progressiva ---- */
.lede,
p {
  animation: fadeInUp .7s cubic-bezier(.22, .61, .36, 1) .25s both;
}

/* ---- Imagens com fade suave ---- */
.section img {
  animation: fadeIn .6s cubic-bezier(.22, .61, .36, 1) .2s both;
  transition: transform .5s cubic-bezier(.22, .61, .36, 1), filter .5s cubic-bezier(.22, .61, .36, 1);
}

/* ---- Botões aparecem com leve deslocamento ---- */
.btn {
  animation: fadeInUp .6s cubic-bezier(.22, .61, .36, 1) .35s both;
  transition: all .4s cubic-bezier(.22, .61, .36, 1);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(206, 178, 130, .15);
}

.btn--ghost:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(206, 178, 130, .08);
}

/* ---- Microinteração: Links e elementos navigationais ---- */
a, .btn {
  transition: color .3s cubic-bezier(.22, .61, .36, 1), border-color .3s cubic-bezier(.22, .61, .36, 1), background .3s cubic-bezier(.22, .61, .36, 1);
}

/* ---- Cards com slide suave ---- */
.card-v,
.unit,
.svc__item {
  animation: fadeInUp .7s cubic-bezier(.22, .61, .36, 1) .2s both;
  transition: transform .4s cubic-bezier(.22, .61, .36, 1), box-shadow .4s cubic-bezier(.22, .61, .36, 1), border-color .4s cubic-bezier(.22, .61, .36, 1);
}

.card-v:hover,
.unit:hover,
.svc__item:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 32px rgba(0, 0, 0, .24);
}

/* ---- Delay progressivo em cards de grid ---- */
.card-v:nth-child(1),
.unit:nth-child(1),
.svc__item:nth-child(1) { animation-delay: .2s; }

.card-v:nth-child(2),
.unit:nth-child(2),
.svc__item:nth-child(2) { animation-delay: .28s; }

.card-v:nth-child(3),
.unit:nth-child(3),
.svc__item:nth-child(3) { animation-delay: .36s; }

.card-v:nth-child(4),
.unit:nth-child(4),
.svc__item:nth-child(4) { animation-delay: .44s; }

.card-v:nth-child(n+5) { animation-delay: .52s; }

/* ---- Imagens dentro de cards com zoom subtil ---- */
.card-v .ph img,
.unit .ph img {
  transition: transform .6s cubic-bezier(.22, .61, .36, 1);
}

.card-v:hover .ph img,
.unit:hover .ph img {
  transform: scale(1.03);
}

/* ---- Hero conteúdo com entrada stagered ---- */
.hero__title {
  animation: fadeInDown .8s cubic-bezier(.22, .61, .36, 1) .3s both;
}

.hero__support {
  animation: fadeInUp .7s cubic-bezier(.22, .61, .36, 1) .45s both;
}

/* ---- Header com entrada suave ---- */
.header {
  animation: fadeInDown .6s cubic-bezier(.22, .61, .36, 1) .1s both;
}

/* ---- Footer com fade-in ---- */
.footer {
  animation: fadeIn .7s cubic-bezier(.22, .61, .36, 1) .3s both;
}

/* ---- Select e inputs com foco elegante ---- */
select, input, textarea {
  transition: border-color .3s cubic-bezier(.22, .61, .36, 1), background .3s cubic-bezier(.22, .61, .36, 1), box-shadow .3s cubic-bezier(.22, .61, .36, 1);
}

select:focus, input:focus, textarea:focus {
  border-color: var(--gold) !important;
  box-shadow: 0 0 0 2px rgba(206, 178, 130, .1) !important;
}

/* ---- Smooth scroll behavior ---- */
html {
  scroll-behavior: smooth;
}

/* ---- Microinteração: Tab switch buttons ---- */
.tab-btn {
  transition: all .3s cubic-bezier(.22, .61, .36, 1);
}

.tab-btn:hover {
  transform: translateY(-1px);
}

/* ---- Filterbox/select com efeito de foco ---- */
#priceSort {
  transition: border-color .3s cubic-bezier(.22, .61, .36, 1), box-shadow .3s cubic-bezier(.22, .61, .36, 1), background .3s cubic-bezier(.22, .61, .36, 1);
}

#priceSort:focus {
  border-color: var(--gold);
  box-shadow: 0 0 8px rgba(206, 178, 130, .2);
}

/* ---- Floating WhatsApp com pulse subtil ---- */
.floating-wa {
  animation: fadeIn .5s cubic-bezier(.22, .61, .36, 1) .8s both;
  transition: transform .3s cubic-bezier(.22, .61, .36, 1), box-shadow .3s cubic-bezier(.22, .61, .36, 1);
}

.floating-wa:hover {
  transform: scale(1.08);
  box-shadow: 0 8px 24px rgba(37, 211, 102, .3);
}

/* ---- Drawer (menu mobile) com entrada suave ---- */
@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.is-open .drawer nav a {
  animation: slideInRight .4s cubic-bezier(.22, .61, .36, 1) both;
}

.is-open .drawer nav a:nth-child(1) { animation-delay: .05s; }
.is-open .drawer nav a:nth-child(2) { animation-delay: .1s; }
.is-open .drawer nav a:nth-child(3) { animation-delay: .15s; }
.is-open .drawer nav a:nth-child(4) { animation-delay: .2s; }

/* ============================================================
   FIM — ANIMAÇÕES E MICROINTERAÇÕES
   ============================================================ */
