/* Comercial Motors — recriação do visual do site atual (Next.js/Tailwind)
   em CSS puro. Paleta e espaçamentos extraídos de tailwind.config.ts e
   globals.css do frontend antigo (ver PLANO-MIGRACAO.md). */

:root {
  --brand-black: #161616;
  --brand-accent: #e31e24;
  --brand-gray: #6e6e6e;
  --surface: #fafafa;
  --surface-alt: #f1f1f1;
  --surface-border: #dddddd;
  --whatsapp-green: #25d366;
  --max-content: 1200px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--surface);
  color: var(--brand-black);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
}

h1,
h2,
h3,
p,
dl,
dd,
ul,
ol {
  margin: 0;
  padding: 0;
}

ul,
ol {
  list-style: none;
}

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

/* --- Layout --- */

.container {
  width: 100%;
  max-width: var(--max-content);
  margin-inline: auto;
  padding-inline: 1rem;
}
@media (min-width: 640px) {
  .container {
    padding-inline: 1.5rem;
  }
}

main {
  padding-top: 80px;
}

.py-section {
  padding-block: 3.5rem;
}
@media (min-width: 640px) {
  .py-section {
    padding-block: 5rem;
  }
}

/* --- Botões --- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 44px;
  border-radius: 6px;
  padding: 0.75rem 1.25rem;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  background: none;
  transition: filter 0.15s, background-color 0.15s, color 0.15s, border-color 0.15s;
}
.btn svg {
  width: 1.1rem;
  height: 1.1rem;
  flex-shrink: 0;
}
.btn-primary {
  background: var(--brand-accent);
  color: #fff;
}
.btn-primary:hover {
  filter: brightness(0.9);
}
.btn-outline {
  border-color: var(--brand-black);
  color: var(--brand-black);
}
.btn-outline:hover {
  background: var(--brand-black);
  color: #fff;
}
.btn-outline-accent {
  border-color: var(--brand-accent);
  color: var(--brand-accent);
}
.btn-outline-accent:hover {
  background: var(--brand-accent);
  color: #fff;
}
.btn-full {
  width: 100%;
}

/* --- Campos de formulário --- */

.field label {
  display: block;
  text-align: left;
}
.field-label {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--brand-gray);
}
.field-input {
  height: 44px;
  width: 100%;
  border-radius: 6px;
  border: 1px solid var(--surface-border);
  background: #fff;
  padding: 0 12px;
  font-size: 15px;
  color: var(--brand-black);
  outline: none;
  font-family: inherit;
  transition: border-color 0.15s;
}
.field-input:focus {
  border-color: var(--brand-black);
}

/* --- Cabeçalho --- */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  border-bottom: 1px solid var(--surface-border);
  background: rgba(250, 250, 250, 0.95);
  backdrop-filter: blur(6px);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 80px;
}
.site-header .logo-text {
  font-size: 1.875rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-decoration: none;
}
.site-header .logo-text .parte-1 {
  color: var(--brand-black);
}
.site-header .logo-text .parte-2 {
  color: var(--brand-accent);
}
.site-header .logo-img {
  height: 64px;
  width: auto;
}
.site-header nav {
  display: none;
  align-items: center;
  gap: 2rem;
}
.site-header .acoes-desktop {
  display: none;
  align-items: center;
  gap: 0.75rem;
}
@media (min-width: 1280px) {
  .site-header nav,
  .site-header .acoes-desktop {
    display: flex;
  }
  .site-header .menu-toggle {
    display: none;
  }
}
.site-header nav a {
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  color: var(--brand-black);
  transition: color 0.15s;
}
.site-header nav a:hover {
  color: var(--brand-accent);
}
.menu-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  width: 44px;
  border-radius: 6px;
  border: none;
  background: none;
  color: var(--brand-black);
  cursor: pointer;
}
.menu-toggle svg {
  width: 24px;
  height: 24px;
}
.mobile-menu {
  display: none;
  border-top: 1px solid var(--surface-border);
  background: var(--surface);
}
.mobile-menu.aberto {
  display: block;
}
@media (min-width: 1280px) {
  .mobile-menu {
    display: none !important;
  }
}
.mobile-menu .container {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding-block: 1rem;
}
.mobile-menu a {
  border-radius: 6px;
  padding: 0.75rem 0.5rem;
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--brand-black);
}
.mobile-menu a:hover {
  background: var(--surface-alt);
}
.mobile-menu .acoes-mobile {
  margin-top: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* --- Rodapé --- */

.site-footer {
  background: var(--brand-black);
  color: #fff;
}
.site-footer .container {
  padding-block: 3rem;
}
.footer-grid {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2rem;
}
@media (min-width: 768px) {
  .footer-grid {
    flex-direction: row;
    justify-content: space-between;
  }
}
.footer-logo-box {
  display: inline-block;
  border-radius: 8px;
  background: #fff;
  padding: 0.75rem;
}
.footer-logo-box img {
  height: 40px;
  width: auto;
}
.footer-desc {
  margin-top: 0.75rem;
  max-width: 20rem;
  font-size: 0.875rem;
  color: #d1d5db;
}
.footer-col {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  font-size: 0.875rem;
}
.footer-col-title {
  font-weight: 600;
  color: #fff;
}
.footer-col a {
  color: #d1d5db;
  text-decoration: none;
}
.footer-col a:hover {
  color: #fff;
}
.footer-social {
  display: flex;
  gap: 1rem;
  padding-top: 0.25rem;
}
.footer-social a {
  color: #d1d5db;
}
.footer-social a:hover {
  color: #fff;
}
.footer-social svg {
  width: 20px;
  height: 20px;
}
.footer-bottom {
  margin-top: 2.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 1.5rem;
  font-size: 0.75rem;
  color: #9ca3af;
}

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

.whatsapp-flutuante {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 56px;
  width: 56px;
  border-radius: 999px;
  background: var(--whatsapp-green);
  color: #fff;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  transition: transform 0.15s;
}
.whatsapp-flutuante:hover {
  transform: scale(1.05);
}
.whatsapp-flutuante svg {
  width: 28px;
  height: 28px;
}
@media (min-width: 640px) {
  .whatsapp-flutuante {
    bottom: 1.5rem;
    right: 1.5rem;
  }
}

/* --- Hero --- */

.hero {
  background: var(--surface-alt);
  padding-block: 7rem 3.5rem;
}
@media (min-width: 640px) {
  .hero {
    padding-block: 8rem 5rem;
  }
}
.hero-intro {
  margin-inline: auto;
  max-width: 42rem;
  text-align: center;
}
.hero-intro h1 {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--brand-black);
}
@media (min-width: 640px) {
  .hero-intro h1 {
    font-size: 2.25rem;
  }
}
.hero-intro p {
  margin-top: 0.75rem;
  font-size: 1rem;
  color: var(--brand-gray);
}
@media (min-width: 640px) {
  .hero-intro p {
    font-size: 1.125rem;
  }
}
.hero-form {
  margin: 2rem auto 0;
  max-width: 48rem;
  border-radius: 12px;
  border: 1px solid var(--surface-border);
  background: #fff;
  padding: 1rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}
@media (min-width: 640px) {
  .hero-form {
    padding: 1.5rem;
  }
}
.hero-form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}
@media (min-width: 640px) {
  .hero-form-grid {
    grid-template-columns: 1fr 1fr;
  }
}
@media (min-width: 1024px) {
  .hero-form-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}
.hero-form .btn {
  margin-top: 1rem;
}

/* --- Seções gerais --- */

.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--brand-black);
}
@media (min-width: 640px) {
  .section-title {
    font-size: 1.875rem;
  }
}
.section-title-center {
  text-align: center;
}
.section-alt {
  background: var(--surface-alt);
}

/* --- Grid de veículos --- */

.grid-veiculos {
  margin-top: 2rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}
@media (min-width: 640px) {
  .grid-veiculos {
    grid-template-columns: 1fr 1fr;
  }
}
@media (min-width: 1024px) {
  .grid-veiculos {
    grid-template-columns: repeat(4, 1fr);
  }
}

.card-veiculo {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid var(--surface-border);
  background: #fff;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.2s;
}
.card-veiculo:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}
.card-veiculo .foto-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--surface-alt);
}
.card-veiculo .foto-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}
.card-veiculo:hover .foto-wrap img {
  transform: scale(1.05);
}
.card-veiculo .corpo {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 1rem;
}
.card-veiculo .preco {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--brand-black);
}
.card-veiculo .titulo {
  margin-top: 0.25rem;
  font-size: 15px;
  font-weight: 600;
  color: var(--brand-black);
}
.card-veiculo .specs {
  margin-top: 0.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0 0.75rem;
  font-size: 13px;
  color: var(--brand-gray);
}
.card-veiculo .btn {
  margin-top: 1rem;
}

.estado-vazio {
  margin-top: 2.5rem;
  border-radius: 12px;
  border: 1px solid var(--surface-border);
  background: var(--surface-alt);
  padding: 2.5rem;
  text-align: center;
}
.estado-vazio p:first-child {
  color: var(--brand-black);
}
.estado-vazio p + p {
  margin-top: 0.25rem;
  font-size: 0.875rem;
  color: var(--brand-gray);
}

/* --- Pills de categoria --- */

.filtro-categorias {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.pill {
  display: inline-flex;
  align-items: center;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--surface-border);
  padding: 0 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--brand-gray);
  text-decoration: none;
  transition: border-color 0.15s, color 0.15s, background-color 0.15s;
}
.pill:hover {
  border-color: var(--brand-black);
  color: var(--brand-black);
}
.pill.ativo {
  border-color: var(--brand-accent);
  background: var(--brand-accent);
  color: #fff;
}
.pill.ativo:hover {
  color: #fff;
}

/* --- Como funciona --- */

.passos {
  margin-top: 2.5rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}
@media (min-width: 640px) {
  .passos {
    grid-template-columns: repeat(3, 1fr);
  }
}
.passo {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}
@media (min-width: 640px) {
  .passo {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
}
.passo .numero {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  height: 44px;
  width: 44px;
  border-radius: 999px;
  background: var(--brand-black);
  color: #fff;
  font-size: 1.125rem;
  font-weight: 700;
}
.passo h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--brand-black);
}
.passo p {
  margin-top: 0.25rem;
  font-size: 14px;
  color: var(--brand-gray);
}

/* --- Atendimento personalizado --- */

.atendimento-card {
  margin-inline: auto;
  display: flex;
  max-width: 48rem;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  border-radius: 16px;
  border: 1px solid var(--surface-border);
  background: #fff;
  padding: 1.5rem;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}
@media (min-width: 640px) {
  .atendimento-card {
    padding: 2.5rem;
  }
}
.atendimento-icone {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 6rem;
  width: 6rem;
  border-radius: 999px;
  background: var(--surface-alt);
  color: var(--brand-gray);
}
.atendimento-icone svg {
  width: 2.5rem;
  height: 2.5rem;
}
.atendimento-card h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--brand-black);
}
@media (min-width: 640px) {
  .atendimento-card h2 {
    font-size: 1.875rem;
  }
}
.atendimento-card p {
  margin: 0.75rem auto 0;
  max-width: 36rem;
  font-size: 15px;
  line-height: 1.6;
  color: var(--brand-gray);
}

/* --- Lead ("Não achou o veículo ideal?") --- */

.lead-card {
  margin-top: 2.5rem;
  border-radius: 16px;
  border: 1px solid var(--surface-border);
  background: var(--surface-alt);
  padding: 2rem;
  text-align: center;
}
@media (min-width: 640px) {
  .lead-card {
    padding: 2.5rem;
  }
}
.lead-card h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--brand-black);
}
@media (min-width: 640px) {
  .lead-card h2 {
    font-size: 1.5rem;
  }
}
.lead-card > p {
  margin-top: 0.5rem;
  font-size: 1.125rem;
  color: var(--brand-gray);
}
.lead-btn-abrir {
  margin-top: 1.5rem;
  height: 64px;
  width: 100%;
  border: none;
  border-radius: 12px;
  background: var(--brand-accent);
  padding-inline: 1.5rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  transition: background-color 0.15s;
}
.lead-btn-abrir:hover {
  background: #b91c1c;
}
@media (min-width: 640px) {
  .lead-btn-abrir {
    width: auto;
    padding-inline: 3rem;
  }
}
.lead-form {
  margin: 1.5rem auto 0;
  max-width: 28rem;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.lead-form label span {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--brand-black);
}
.lead-form label span .opcional {
  font-size: 1rem;
  font-weight: 400;
  color: var(--brand-gray);
}
.lead-form input {
  height: 56px;
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--surface-border);
  background: #fff;
  padding: 0 1rem;
  font-size: 1.125rem;
  color: var(--brand-black);
  outline: none;
  font-family: inherit;
}
.lead-form input:focus {
  border-color: var(--brand-black);
}
.lead-erro {
  border-radius: 6px;
  background: #fef2f2;
  padding: 0.5rem 0.75rem;
  font-size: 1rem;
  color: var(--brand-accent);
}
.lead-submit {
  height: 64px;
  width: 100%;
  border: none;
  border-radius: 12px;
  background: var(--brand-accent);
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  transition: background-color 0.15s, opacity 0.15s;
}
.lead-submit:hover {
  background: #b91c1c;
}
.lead-submit:disabled {
  opacity: 0.6;
  cursor: default;
}
.lead-sucesso p:first-child {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--brand-black);
}
.lead-sucesso p + p {
  margin-top: 0.5rem;
  font-size: 1.125rem;
  color: var(--brand-gray);
}

/* --- Página de veículo (detalhe) --- */

.veiculo-detalhe {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}
@media (min-width: 1024px) {
  .veiculo-detalhe {
    grid-template-columns: 2fr 1fr;
  }
}
.galeria-principal {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 12px;
  background: var(--surface-alt);
}
.galeria-principal img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.galeria-miniaturas {
  margin-top: 0.75rem;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
}
@media (min-width: 640px) {
  .galeria-miniaturas {
    grid-template-columns: repeat(6, 1fr);
  }
}
.galeria-miniaturas button {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 8px;
  background: var(--surface-alt);
  border: none;
  padding: 0;
  cursor: pointer;
  opacity: 0.8;
}
.galeria-miniaturas button:hover {
  opacity: 1;
}
.galeria-miniaturas button.ativa {
  opacity: 1;
  outline: 2px solid var(--brand-accent);
  outline-offset: 1px;
}
.galeria-miniaturas img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.veiculo-titulo h1 {
  margin-top: 2rem;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--brand-black);
}
@media (min-width: 640px) {
  .veiculo-titulo h1 {
    font-size: 1.875rem;
  }
}
.veiculo-titulo p {
  margin-top: 0.25rem;
  color: var(--brand-gray);
}
.specs-grid {
  margin-top: 1.5rem;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  border-radius: 12px;
  border: 1px solid var(--surface-border);
  padding: 1rem;
}
@media (min-width: 640px) {
  .specs-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
.specs-grid dt {
  font-size: 0.75rem;
  color: var(--brand-gray);
}
.specs-grid dd {
  margin-top: 0.125rem;
  font-size: 15px;
  font-weight: 600;
  color: var(--brand-black);
}
.veiculo-descricao {
  margin-top: 1.5rem;
}
.veiculo-descricao h2 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--brand-black);
}
.veiculo-descricao p {
  margin-top: 0.5rem;
  font-size: 15px;
  color: var(--brand-gray);
  white-space: pre-line;
}
.card-contato {
  border-radius: 12px;
  border: 1px solid var(--surface-border);
  background: #fff;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}
@media (min-width: 1024px) {
  .card-contato {
    position: sticky;
    top: 96px;
  }
}
.card-contato .preco {
  font-size: 1.875rem;
  font-weight: 700;
  color: var(--brand-black);
}
.card-contato .subtitulo {
  margin-top: 0.25rem;
  font-size: 0.875rem;
  color: var(--brand-gray);
}
.card-contato .btn {
  margin-top: 1.5rem;
}

/* --- Contato / política --- */

.pagina-simples {
  padding-block: 4rem;
  text-align: center;
}
.pagina-simples h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--brand-black);
}
.pagina-simples p {
  margin-top: 0.75rem;
  color: var(--brand-gray);
}
.pagina-simples .btn {
  margin-top: 1.5rem;
  display: inline-flex;
}
