:root {
  --ink: #101112;
  --muted: #64748b;
  --line: #e5e7eb;
  --paper: #f8fafc;
  --white: #ffffff;
  --black: #050505;
  --charcoal: #141719;
  --green: #009030;
  --green-dark: #007a2a;
  --red: #e01020;
  --accent: #009030;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; }
ul { margin: 0; padding: 0; list-style: none; }

/* ---------- topo ---------- */
.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px max(24px, 7vw);
  color: #dbeafe;
  background: var(--black);
  font-size: 13px;
}

.nav {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px max(24px, 7vw);
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--charcoal);
  font-size: 20px;
  font-weight: 800;
}

.logo img {
  width: 46px;
  height: 46px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--black);
}

.nav-links { display: flex; gap: 22px; color: #334155; font-size: 14px; }
.nav-toggle { display: none; border: 0; background: transparent; font-size: 26px; cursor: pointer; }

.admin-link {
  padding: 11px 18px;
  color: var(--white);
  background: var(--black);
  border-radius: 8px;
  font-weight: 700;
  white-space: nowrap;
}

/* ---------- hero ---------- */
.hero {
  position: relative;
  min-height: 620px;
  display: grid;
  align-items: end;
  padding: 120px max(24px, 7vw) 78px;
  color: var(--white);
  background-position: center;
  background-size: cover;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.3)),
    linear-gradient(0deg, rgba(0, 144, 48, 0.24), transparent 55%);
}

.hero-content { position: relative; max-width: 720px; }

.eyebrow {
  margin: 0 0 12px;
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 650px;
  margin: 0;
  font-size: clamp(38px, 7vw, 78px);
  line-height: 1;
  text-shadow: 0 16px 45px rgba(0, 0, 0, 0.45);
}

.hero-content p.lead {
  display: block;
  max-width: 520px;
  margin-top: 20px;
  color: #e2e8f0;
  font-size: 19px;
  line-height: 1.55;
}

.hero-actions, .card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 12px 20px;
  border: 0;
  border-radius: 8px;
  color: var(--white);
  background: var(--green);
  font-weight: 800;
  cursor: pointer;
}

.btn.btn-light { background: var(--white); color: var(--black); }
.btn.btn-outline { background: transparent; border: 1px solid var(--line); color: var(--ink); }
.btn.btn-block { width: 100%; }
.btn.btn-lg { min-height: 52px; font-size: 16px; }

/* ---------- seções ---------- */
.section { padding: 72px max(24px, 7vw); }

.section-heading { max-width: 720px; margin: 0 auto 32px; text-align: center; }
.section-heading.align-left { margin: 0 0 24px; text-align: left; }
.section-heading h2 { margin: 0; color: var(--charcoal); font-size: clamp(28px, 4vw, 44px); line-height: 1.08; }
.section-heading p { margin-top: 10px; color: var(--muted); line-height: 1.6; }

/* ---------- marcas ---------- */
.brand-strip {
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 6px;
}

.brand {
  flex: 0 0 auto;
  min-height: 42px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: #334155;
  font-weight: 700;
  cursor: pointer;
}

.brand.active { color: var(--white); border-color: var(--black); background: var(--black); }

/* ---------- filtros ---------- */
.filters {
  max-width: 1180px;
  margin: 22px auto 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.filters .filters-actions { display: flex; align-items: end; gap: 10px; }

label { display: grid; gap: 6px; color: #334155; font-size: 13px; font-weight: 700; }

input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  background: var(--white);
  color: var(--ink);
}

textarea { resize: vertical; }

/* ---------- grid de veículos ---------- */
.vehicle-grid {
  max-width: 1180px;
  margin: 26px auto 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.empty-state {
  max-width: 1180px;
  margin: 26px auto 0;
  padding: 40px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--white);
}

.vehicle-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.06);
  overflow: hidden;
}

.vehicle-photo {
  position: relative;
  display: block;
  min-height: 220px;
  background-color: var(--charcoal);
  background-position: center;
  background-size: cover;
}

.vehicle-badges { position: absolute; top: 12px; left: 12px; display: flex; flex-wrap: wrap; gap: 6px; max-width: calc(100% - 24px); }

.tag-pill {
  padding: 7px 10px;
  border-radius: 8px;
  color: var(--white);
  background: var(--red);
  font-size: 11px;
  font-weight: 800;
}

.status-pill {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 7px 10px;
  border-radius: 8px;
  color: var(--white);
  font-size: 11px;
  font-weight: 800;
}

.badge-disponivel { background: var(--green); }
.badge-reservado { background: #b45309; }
.badge-vendido { background: #475569; }

.vehicle-photo .km-pill {
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 7px 9px;
  border-radius: 8px;
  color: var(--white);
  background: rgba(0, 0, 0, 0.62);
  font-size: 12px;
  font-weight: 900;
}

.vehicle-content { padding: 18px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.vehicle-content .marca { margin: 0; color: var(--muted); font-weight: 700; font-size: 13px; }
.vehicle-content h3 { margin: 0 0 10px; color: var(--charcoal); font-size: 21px; }

dl.specs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0 0 14px; }
dl.specs dt { color: var(--muted); font-size: 11px; }
dl.specs dd { margin: 0; color: #1f2937; font-weight: 800; font-size: 13px; }

.price { display: block; margin: 4px 0 14px; color: var(--accent); font-size: 24px; font-weight: 900; }

.card-actions { margin-top: auto; }
.card-actions .btn { flex: 1; }

/* ---------- sobre / confiança ---------- */
.trust { background: #eef8f1; }
.trust-grid { max-width: 1180px; margin: 0 auto; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.trust article { padding: 24px; border: 1px solid var(--line); border-radius: 10px; background: var(--white); box-shadow: 0 18px 50px rgba(15, 23, 42, 0.05); }
.trust article .dot { display: block; width: 42px; height: 42px; margin-bottom: 14px; border-radius: 8px; background: var(--green); }
.trust article h3 { margin: 0 0 8px; font-size: 18px; }
.trust article p { margin: 0; color: var(--muted); line-height: 1.5; }

/* ---------- localização ---------- */
.location {
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 28px;
  align-items: center;
}

.location p { color: var(--muted); margin: 6px 0; }
.location iframe { width: 100%; min-height: 380px; border: 0; border-radius: 10px; }

/* ---------- whatsapp flutuante ---------- */
.floating-whatsapp {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 40;
  padding: 14px 20px;
  border-radius: 999px;
  color: var(--white);
  background: var(--green-dark);
  font-weight: 900;
  box-shadow: 0 18px 40px rgba(22, 163, 74, 0.32);
}

/* ---------- rodapé ---------- */
.footer {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
  padding: 40px max(24px, 7vw) 90px;
  color: #cbd5e1;
  background: var(--black);
}

.footer p { margin: 6px 0; color: #94a3b8; font-size: 14px; }
.footer-logo { display: inline-flex; align-items: center; gap: 10px; color: var(--white); font-size: 20px; margin-bottom: 8px; }
.footer-logo img { width: 42px; height: 42px; border-radius: 8px; object-fit: cover; }

/* ---------- página de detalhes ---------- */
.details-hero {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 24px;
  max-width: 1180px;
  margin: 30px auto;
  padding: 0 max(24px, 4vw);
}

.details-gallery {
  position: relative;
  min-height: 480px;
  border-radius: 10px;
  overflow: hidden;
  background-color: var(--charcoal);
}

.details-gallery img { width: 100%; height: 480px; object-fit: cover; }

.gallery-counter {
  position: absolute; right: 16px; top: 16px;
  padding: 8px 10px; border-radius: 8px;
  color: var(--white); background: rgba(0, 0, 0, 0.64);
  font-size: 12px; font-weight: 900;
}

.gallery-controls { position: absolute; inset: 0; display: flex; align-items: center; justify-content: space-between; padding: 0 14px; }
.gallery-controls button { width: 44px; height: 44px; border: 0; border-radius: 8px; color: var(--white); background: rgba(0, 0, 0, 0.58); font-size: 26px; cursor: pointer; }
.gallery-controls button:hover { background: var(--green); }

.photo-strip { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.photo-strip button { padding: 0; aspect-ratio: 1.3; border: 2px solid transparent; border-radius: 8px; background-color: var(--charcoal); background-position: center; background-size: cover; cursor: pointer; }
.photo-strip button.active { border-color: var(--green); }

.details-summary { align-self: start; padding: 28px; border-radius: 10px; background: var(--white); box-shadow: 0 18px 50px rgba(15, 23, 42, 0.06); }
.details-summary h1 { margin: 0 0 6px; font-size: clamp(26px, 3vw, 34px); color: var(--charcoal); }
.details-summary .price { font-size: 30px; }
.details-summary dl.specs { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 20px; }

.details-body {
  max-width: 1180px;
  margin: 10px auto 40px;
  padding: 0 max(24px, 4vw);
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 18px;
}

.details-card { padding: 26px; border: 1px solid var(--line); border-radius: 10px; background: var(--white); box-shadow: 0 18px 50px rgba(15, 23, 42, 0.05); }
.details-card h2 { margin: 0 0 14px; font-size: 20px; }
.details-card p { margin: 0; color: #334155; line-height: 1.7; }

.feature-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 6px; }
.feature-list li { display: flex; align-items: center; gap: 8px; color: #1f2937; font-weight: 600; font-size: 14px; }

.related-section { max-width: 1180px; margin: 0 auto 60px; padding: 0 max(24px, 4vw); }
.related-section h2 { font-size: 22px; margin: 0 0 16px; }
.related-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }

/* ---------- páginas de autenticação (admin) ---------- */
.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 34px 20px;
  background: linear-gradient(rgba(11, 18, 32, 0.82), rgba(11, 18, 32, 0.82)), url("../../fotos/fachada-lema-car.webp") center / cover;
}

.auth-panel { width: min(100%, 440px); padding: 32px; border-radius: 10px; background: var(--white); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35); }
.auth-panel h1 { margin: 0 0 6px; font-size: 26px; }
.auth-panel p.lead { color: var(--muted); margin: 0 0 20px; }
.auth-form { display: grid; gap: 16px; }
.auth-logo { display: flex; align-items: center; gap: 10px; justify-content: center; margin-bottom: 22px; color: var(--white); font-weight: 800; font-size: 18px; }
.auth-logo img { width: 44px; height: 44px; border-radius: 8px; }

.form-error { margin-top: 16px; padding: 12px; border-radius: 8px; color: #991b1b; background: #fee2e2; font-size: 14px; }
.form-success { margin-top: 16px; padding: 12px; border-radius: 8px; color: #166534; background: #dcfce7; font-size: 14px; }

/* ---------- painel admin ---------- */
.admin-app { min-height: 100vh; background: #f1f5f9; display: flex; }

.admin-sidebar {
  width: 240px;
  flex-shrink: 0;
  padding: 24px 16px;
  background: var(--black);
  color: #cbd5e1;
}

.admin-sidebar .logo { color: var(--white); margin-bottom: 26px; }
.admin-sidebar nav { display: grid; gap: 4px; }
.admin-sidebar a { padding: 10px 12px; border-radius: 8px; color: #cbd5e1; font-weight: 600; font-size: 14px; }
.admin-sidebar a:hover, .admin-sidebar a.active { background: rgba(255, 255, 255, 0.1); color: var(--white); }
.admin-sidebar .sidebar-foot { margin-top: 24px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,0.12); }
.admin-sidebar button { width: 100%; padding: 10px; border: 0; border-radius: 8px; background: rgba(255,255,255,0.08); color: var(--white); font-weight: 700; cursor: pointer; }

.admin-main { flex: 1; min-width: 0; padding: 30px max(24px, 3vw); }

.admin-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; max-width: 1180px; margin: 0 auto 26px; flex-wrap: wrap; }
.admin-header h1 { margin: 0; font-size: 28px; color: var(--charcoal); }
.admin-header p { margin: 6px 0 0; color: var(--muted); }

.admin-stats { max-width: 1180px; margin: 0 auto; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.admin-stats article { padding: 22px; border: 1px solid var(--line); border-radius: 10px; background: var(--white); }
.admin-stats span.value { display: block; color: var(--charcoal); font-size: 34px; font-weight: 900; }
.admin-stats span.label { color: var(--muted); font-size: 13px; font-weight: 700; }

.admin-panel { max-width: 1180px; margin: 22px auto 0; padding: 24px; border: 1px solid var(--line); border-radius: 10px; background: var(--white); }
.admin-panel h2 { margin: 0 0 18px; font-size: 20px; }

table.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
table.admin-table th, table.admin-table td { padding: 12px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
table.admin-table th { color: var(--muted); font-size: 12px; text-transform: uppercase; }
table.admin-table img.thumb { width: 56px; height: 42px; object-fit: cover; border-radius: 6px; background: var(--charcoal); }
table.admin-table .row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
table.admin-table .row-actions a, table.admin-table .row-actions button { padding: 6px 10px; border-radius: 6px; font-size: 12px; font-weight: 700; border: 1px solid var(--line); background: var(--white); cursor: pointer; }
table.admin-table .row-actions .danger { color: #b91c1c; border-color: #fecaca; }
table.admin-table .row-actions .primary { background: var(--green); border-color: var(--green); color: var(--white); }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-section { margin-top: 22px; }
.form-section h3 { margin: 0 0 12px; font-size: 15px; color: var(--charcoal); }

.checklist { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.checklist label { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13px; }
.checklist input { width: auto; }

.photo-manager { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.photo-manager figure { position: relative; margin: 0; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); }
.photo-manager img { width: 100%; height: 90px; object-fit: cover; }
.photo-manager figcaption { display: flex; justify-content: space-between; padding: 4px 6px; font-size: 11px; background: var(--white); }
.photo-manager figcaption button { border: 0; background: transparent; color: #b91c1c; cursor: pointer; font-weight: 800; }

.alert-banner { max-width: 1180px; margin: 0 auto 18px; padding: 14px 16px; border-radius: 8px; font-size: 14px; font-weight: 600; }
.alert-banner.success { color: #166534; background: #dcfce7; }
.alert-banner.error { color: #991b1b; background: #fee2e2; }

/* ---------- responsivo ---------- */
@media (max-width: 980px) {
  .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .vehicle-grid, .related-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .trust-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .details-hero, .details-body { grid-template-columns: 1fr; }
  .location { grid-template-columns: 1fr; }
  .admin-grid { grid-template-columns: 1fr; }
  .form-grid, .form-grid.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .topbar { font-size: 11px; padding: 8px 16px; }
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--white);
    border-bottom: 1px solid var(--line);
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 14px 24px; border-top: 1px solid var(--line); }
  .footer { grid-template-columns: 1fr; padding-bottom: 100px; }
  .vehicle-grid, .related-grid, .trust-grid { grid-template-columns: 1fr; }
  .filters { grid-template-columns: 1fr; }
  .form-grid, .form-grid.cols-3, .checklist, .photo-manager { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-app { flex-direction: column; }
  .admin-sidebar { width: 100%; display: flex; align-items: center; justify-content: space-between; }
  .admin-sidebar nav { display: none; }
  .hero { min-height: 520px; padding: 90px 20px 56px; }
}
