/*
 * Diretriz visual: Fidelidade Fluida.
 * Esta camada preserva a identidade JB Marcas e Patentes e apenas ajusta
 * dimensões, ritmo e área de toque em telas menores. Não altera cores,
 * fontes, textos, imagens ou a composição desktop original.
 */

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  overflow-x: hidden;
}

img,
svg,
video,
canvas {
  max-width: 100%;
}

button,
input,
select,
textarea {
  max-width: 100%;
}

input,
select,
textarea {
  font-size: max(16px, 1em);
}

@media (max-width: 1023px) {
  .container {
    padding-inline: clamp(1rem, 3vw, 1.5rem);
  }

  nav .h-20 {
    height: 4.5rem;
  }

  nav img[alt="JB Marcas e Patentes"] {
    height: 3rem;
  }

  .whatsapp-float {
    right: 1.25rem;
    bottom: 1.25rem;
  }

  .reveal {
    transform: translateY(16px);
  }
}

@media (min-width: 640px) and (max-width: 1023px) {
  .container {
    padding-inline: 1.5rem;
  }

  .service-card,
  .testimonial-card,
  .gold-border-card {
    padding: 1.5rem;
  }

  .process-step:after {
    width: calc(100% - 3rem);
    left: calc(50% + 1.5rem);
  }
}

@media (max-width: 639px) {
  body {
    line-height: 1.55;
  }

  .container {
    padding-inline: 1rem;
  }

  nav .h-20 {
    height: 4.25rem;
  }

  nav .gap-4 {
    gap: 0.5rem;
  }

  nav img[alt="JB Marcas e Patentes"] {
    height: 2.7rem;
  }

  .btn-gold,
  .btn-black {
    width: 100%;
    min-height: 3rem;
    padding: 0.8rem 1.1rem;
    line-height: 1.25;
    white-space: normal;
  }

  .service-card,
  .testimonial-card,
  .gold-border-card {
    padding: 1.25rem;
  }

  .stat-number {
    font-size: clamp(2.5rem, 12vw, 3.25rem);
  }

  .process-step:after {
    display: none;
  }

  .whatsapp-float {
    width: 3.4rem;
    height: 3.4rem;
    right: 1rem;
    bottom: max(1rem, env(safe-area-inset-bottom));
  }

  #root .py-24 {
    padding-top: 3.75rem;
    padding-bottom: 3.75rem;
  }

  #root .pt-28 {
    padding-top: 6.5rem;
  }

  #root .gap-12 {
    gap: 2rem;
  }

  #root .gap-8 {
    gap: 1.5rem;
  }

  #root .gap-6 {
    gap: 1.25rem;
  }

  #root .text-4xl {
    font-size: clamp(2rem, 10vw, 2.75rem);
  }

  /* Sobre nós: empilha imagem e conteúdo como as demais seções no celular.
     O seletor alcança apenas o grid externo e preserva o grid interno das métricas. */
  #sobre > .container > .grid.grid-cols-2 {
    grid-template-columns: minmax(0, 1fr);
    gap: 2rem;
  }

  /* Rodapé: organiza as cidades em uma grade regular, evitando linhas
     desalinhadas causadas pela lista inline em telas estreitas. */
  #root footer .footer-states-list {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    row-gap: 0.35rem;
    margin-top: 1rem;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
  }

  #root footer .footer-states-list > span {
    display: flex;
    align-items: baseline;
    min-width: 0;
    width: 100%;
    max-width: 100%;
    margin-right: 0 !important;
    line-height: 1.5 !important;
    white-space: normal !important;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  #root footer .footer-states-list > span > span {
    flex: 0 0 2.35rem;
    margin-right: 0.35rem !important;
  }
}

@media (max-width: 639px) {
  html,
  body,
  #root {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  #root > *,
  #root main,
  #root section,
  #root footer,
  #root nav {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  #root .container {
    width: 100%;
    max-width: none;
    margin-inline: 0;
  }

  #root [class*="grid"],
  #root [class*="flex"] {
    min-width: 0;
    max-width: 100%;
  }

  #root .w-96,
  #root .w-72,
  #root .w-64,
  #root .w-48,
  #root .w-\[400px\],
  #root .w-\[280px\] {
    width: 100%;
    max-width: 100%;
  }

  #root .max-w-7xl,
  #root .max-w-6xl,
  #root .max-w-3xl,
  #root .max-w-2xl,
  #root .max-w-lg,
  #root .max-w-md,
  #root .max-w-sm,
  #root .max-w-xs {
    width: 100%;
    max-width: 100%;
  }
}

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