/* ==========================================================================
   Componentes reutilizáveis: botão, logo e botão flutuante do WhatsApp
   ========================================================================== */

/* ---------- Botão ---------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  font-weight: 560;
  line-height: 1.2;
  letter-spacing: -0.005em;
  text-align: center;
  transition:
    background-color var(--dur-fast) ease,
    border-color var(--dur-fast) ease,
    color var(--dur-fast) ease,
    box-shadow var(--dur) var(--ease-out),
    transform var(--dur-fast) ease;
}

.button svg {
  flex: none;
}

/* Tamanhos */
.button--sm {
  min-height: 2.5rem;
  padding: 0.5rem 1.125rem;
  font-size: 0.875rem;
}

.button--md {
  min-height: 3rem;
  padding: 0.75rem 1.375rem;
  font-size: var(--fs-sm);
}

.button--lg {
  min-height: 3.5rem;
  padding: 0.875rem clamp(1.25rem, 0.9rem + 1vw, 1.5rem);
  font-size: 1rem;
}

.button--block {
  width: 100%;
}

/* Variantes */
.button--primary {
  background: var(--c-white);
  color: var(--c-ink);
}

.button--primary:hover {
  box-shadow:
    0 0 0 5px rgb(var(--c-violet) / 0.16),
    0 14px 34px -14px rgb(var(--c-violet) / 0.7);
}

.button--secondary {
  border-color: var(--c-line-strong);
  color: var(--c-paper);
}

.button--secondary:hover {
  border-color: var(--c-pencil);
  background: var(--c-graphite-2);
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .button:hover {
    transform: translateY(-1px);
  }
}

/* Depois do :hover para ter prioridade ao clicar */
.button:active {
  transform: translateY(0) scale(0.98);
}

@media (width < 24em) {
  .button--lg {
    gap: 0.5rem;
    padding-inline: 1rem;
    font-size: 0.9375rem;
  }
}

/* ---------- Logo ---------- */

.logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: var(--c-ink);
}

/* ---------- Botão flutuante do WhatsApp ---------- */

.whatsapp-fab {
  position: fixed;
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(1rem, env(safe-area-inset-bottom));
  z-index: 40;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: var(--r-pill);
  background: var(--c-white);
  color: var(--c-ink);
  font-size: var(--fs-sm);
  font-weight: 580;
  box-shadow:
    0 0 0 1px rgb(255 255 255 / 0.08),
    0 16px 36px -10px rgb(0 0 0 / 0.9);
  transition:
    opacity var(--dur) ease,
    transform var(--dur) var(--ease-out),
    translate var(--dur) var(--ease-out),
    box-shadow var(--dur) var(--ease-out),
    visibility 0s;
}

/* Escondido enquanto o hero está na tela (controlado pelo JS) */
.whatsapp-fab[data-visible="false"] {
  visibility: hidden;
  opacity: 0;
  transform: translateY(1rem) scale(0.96);
  transition:
    opacity var(--dur) ease,
    transform var(--dur) ease,
    visibility 0s linear var(--dur);
}

.whatsapp-fab__label {
  display: none;
}

@media (hover: hover) {
  .whatsapp-fab:hover {
    box-shadow:
      0 0 0 5px rgb(var(--c-violet) / 0.18),
      0 16px 36px -10px rgb(var(--c-violet) / 0.6);
  }
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .whatsapp-fab:hover {
    translate: 0 -2px;
  }
}

@media (width >= 48em) {
  .whatsapp-fab {
    width: auto;
    padding: 0 1.375rem 0 1.125rem;
  }

  .whatsapp-fab__label {
    display: inline;
  }
}
