/* ============================================================
   JB13 AUTOMÓVEIS — Design System
   Preto profundo + dourado + vermelho (do logótipo)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@400;500;600;700&family=Work+Sans:wght@400;500;600;700&display=swap');

:root {
  --black: #0d0d0d;
  --black-soft: #161513;
  --black-card: #1b1a17;
  --line: #2b2924;
  --gold: #c9a04b;
  --gold-light: #e0c079;
  --red: #b8242c;
  --white: #f7f5f0;
  --gray: #9a9689;
  --gray-dim: #6b6860;

  --font-display: 'Oswald', sans-serif;
  --font-body: 'Work Sans', sans-serif;

  --radius: 4px;
  --container: 1180px;
}

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

body {
  margin: 0;
  background: var(--black);
  color: var(--white);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin: 0 0 0.5em;
  color: var(--white);
}

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

/* Linha assinatura — inspirada no traço do logótipo */
.pinline {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold) 20%, var(--gold-light) 50%, var(--gold) 80%, transparent);
  border: none;
  margin: 0;
  opacity: 0.6;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(13, 13, 13, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand img { height: 44px; width: auto; }
.brand-name {
  font-family: var(--font-display);
  font-size: 1.1rem;
  letter-spacing: 0.05em;
  color: var(--white);
}
.brand-name b { color: var(--gold); }

nav.main-nav { display: flex; gap: 32px; }
nav.main-nav a {
  font-family: var(--font-display);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gray);
  padding: 6px 0;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
nav.main-nav a:hover,
nav.main-nav a.active {
  color: var(--gold);
  border-color: var(--gold);
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line);
  color: var(--white);
  font-size: 1.4rem;
  padding: 6px 12px;
  border-radius: var(--radius);
  cursor: pointer;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.88rem;
  padding: 13px 28px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-gold {
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  color: #16130a;
}
.btn-gold:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn-outline {
  border-color: var(--gold);
  color: var(--gold);
  background: transparent;
}
.btn-outline:hover { background: var(--gold); color: #16130a; }
.btn-red { background: var(--red); color: var(--white); }
.btn-red:hover { filter: brightness(1.1); }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 78vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 70% 30%, rgba(201,160,75,0.10), transparent 55%),
    linear-gradient(180deg, #0d0d0d 0%, #121110 100%);
}
.hero-silhouette {
  position: absolute;
  right: -5%;
  bottom: -8%;
  width: 62%;
  max-width: 780px;
  opacity: 0.07;
  filter: grayscale(1) brightness(3);
  pointer-events: none;
}
.hero-content { position: relative; z-index: 2; max-width: 620px; }
.eyebrow {
  font-family: var(--font-display);
  color: var(--red);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-size: 0.82rem;
  margin-bottom: 14px;
  display: block;
}
.hero h1 {
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  line-height: 1.08;
  margin-bottom: 20px;
}
.hero h1 em {
  font-style: normal;
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p {
  color: var(--gray);
  font-size: 1.08rem;
  margin-bottom: 32px;
  max-width: 480px;
}
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; }

.hero-stats {
  position: relative;
  z-index: 2;
  display: flex;
  gap: 48px;
  margin-top: 64px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
  max-width: 620px;
}
.hero-stats .stat-num {
  font-family: var(--font-display);
  font-size: 1.8rem;
  color: var(--gold);
}
.hero-stats .stat-label {
  color: var(--gray-dim);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ---------- Section ---------- */
.section { padding: 88px 0; }
.section-tight { padding: 56px 0; }
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 40px;
  gap: 24px;
  flex-wrap: wrap;
}
.section-head .eyebrow { margin-bottom: 8px; }
.section-head h2 { font-size: 2rem; margin: 0; }
.section-head p { color: var(--gray); margin: 8px 0 0; max-width: 480px; }

/* ---------- Car grid & cards ---------- */
.car-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 28px;
}
.car-card {
  background: var(--black-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.25s ease, border-color 0.25s ease;
}
.car-card:hover { transform: translateY(-4px); border-color: var(--gold); }
.car-card-img {
  position: relative;
  aspect-ratio: 4/3;
  background: #0a0a0a;
  overflow: hidden;
}
.car-card-img img { width: 100%; height: 100%; object-fit: cover; }
.car-card-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--red);
  color: var(--white);
  font-family: var(--font-display);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: var(--radius);
}
.car-card-badge.reservado { background: var(--gold); color: #16130a; }
.car-card-body { padding: 20px; }
.car-card-body h3 {
  font-size: 1.15rem;
  margin-bottom: 4px;
}
.car-card-price {
  font-family: var(--font-display);
  color: var(--gold);
  font-size: 1.3rem;
  margin-bottom: 14px;
}
.car-specs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.car-specs span {
  font-size: 0.78rem;
  color: var(--gray);
  border: 1px solid var(--line);
  padding: 4px 10px;
  border-radius: var(--radius);
  white-space: nowrap;
}

.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--gray);
}
.empty-state h3 { color: var(--white); margin-bottom: 10px; }

/* ---------- Filters (catálogo) ---------- */
.catalog-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 40px;
  align-items: start;
}
.filters {
  background: var(--black-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  position: sticky;
  top: 100px;
}
.filters h4 {
  font-size: 0.95rem;
  color: var(--gold);
  margin-bottom: 16px;
}
.filter-group { margin-bottom: 22px; }
.filter-group label {
  display: block;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray-dim);
  margin-bottom: 8px;
}
.filter-group select,
.filter-group input {
  width: 100%;
  background: var(--black);
  border: 1px solid var(--line);
  color: var(--white);
  padding: 10px 12px;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.9rem;
}
.filter-group select:focus,
.filter-group input:focus { outline: 1px solid var(--gold); border-color: var(--gold); }

.results-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  color: var(--gray);
  font-size: 0.9rem;
}

/* ---------- Car detail ---------- */
.detail-layout {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 48px;
  align-items: start;
}
.gallery-main {
  aspect-ratio: 4/3;
  background: var(--black-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 12px;
}
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumbs {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}
.gallery-thumbs img {
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  cursor: pointer;
  opacity: 0.65;
  transition: opacity 0.2s, border-color 0.2s;
}
.gallery-thumbs img:hover,
.gallery-thumbs img.active { opacity: 1; border-color: var(--gold); }

.detail-panel h1 { font-size: 2rem; margin-bottom: 6px; }
.detail-price {
  font-family: var(--font-display);
  color: var(--gold);
  font-size: 2rem;
  margin: 12px 0 24px;
}
.spec-table {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 28px;
}
.spec-item {
  background: var(--black-card);
  padding: 14px 16px;
}
.spec-item .label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray-dim);
  margin-bottom: 4px;
}
.spec-item .value { font-family: var(--font-display); font-size: 1rem; }
.detail-desc { color: var(--gray); margin-bottom: 28px; white-space: pre-line; }
.detail-actions { display: flex; gap: 14px; flex-wrap: wrap; }

/* ---------- Caixa de pedido de informações (lead) ---------- */
.lead-box {
  max-width: 620px;
  margin: 56px auto 0;
  background: var(--black-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
}
.lead-box h3 { font-size: 1.2rem; margin-bottom: 8px; }
.lead-box p { color: var(--gray); margin-bottom: 22px; }
.lead-form { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; text-align: left; }
.lead-form .form-field { flex: 1; min-width: 180px; margin-bottom: 0; }
.lead-form button { flex-shrink: 0; align-self: flex-end; }
.lead-success { color: var(--gold-light); font-family: var(--font-display); text-transform: uppercase; letter-spacing: 0.04em; font-size: 0.95rem; }

/* ---------- Contactos ---------- */
.contact-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}
.contact-list { list-style: none; padding: 0; margin: 0 0 32px; }
.contact-list li {
  display: flex;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.contact-list .icon {
  width: 40px; height: 40px;
  border: 1px solid var(--gold);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--gold);
  flex-shrink: 0;
  font-size: 1.1rem;
}
.contact-list .label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray-dim);
}
.contact-list .value { font-size: 1.02rem; }
.map-frame {
  width: 100%;
  height: 100%;
  min-height: 380px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.map-frame iframe { width: 100%; height: 100%; min-height: 380px; border: 0; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 40px 0;
  margin-top: 60px;
}
.site-footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}
.site-footer .foot-brand {
  display: flex; align-items: center; gap: 10px;
  color: var(--gray);
  font-size: 0.85rem;
}
.site-footer .foot-brand img { height: 28px; }
.site-footer .credit {
  color: var(--gray-dim);
  font-size: 0.8rem;
}
.site-footer .credit a { color: var(--gold); }

/* ---------- Forms (admin) ---------- */
.admin-shell { min-height: 100vh; display: flex; }
.admin-sidebar {
  width: 240px;
  background: var(--black-soft);
  border-right: 1px solid var(--line);
  padding: 28px 20px;
  flex-shrink: 0;
}
.admin-sidebar .brand { margin-bottom: 40px; }
.admin-sidebar nav a {
  display: block;
  padding: 12px 14px;
  border-radius: var(--radius);
  color: var(--gray);
  font-size: 0.92rem;
  margin-bottom: 4px;
}
.admin-sidebar nav a:hover,
.admin-sidebar nav a.active { background: var(--black-card); color: var(--gold); }
.admin-main { flex: 1; padding: 40px; max-width: 1000px; }
.admin-topbar {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 32px;
}

.login-shell {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.login-card {
  width: 100%; max-width: 380px;
  background: var(--black-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 40px 32px;
  text-align: center;
}
.login-card img { height: 48px; margin: 0 auto 24px; }

.form-field { margin-bottom: 18px; text-align: left; }
.form-field label {
  display: block;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray-dim);
  margin-bottom: 8px;
}
.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  background: var(--black);
  border: 1px solid var(--line);
  color: var(--white);
  padding: 12px 14px;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.95rem;
}
.form-field textarea { resize: vertical; min-height: 100px; }
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus { outline: 1px solid var(--gold); border-color: var(--gold); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 0.88rem;
  margin-bottom: 18px;
}
.alert-error { background: rgba(184,36,44,0.15); border: 1px solid var(--red); color: #ff8b8f; }
.alert-ok { background: rgba(201,160,75,0.12); border: 1px solid var(--gold); color: var(--gold-light); }

/* Admin table */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td {
  text-align: left;
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 0.9rem;
}
.data-table th {
  color: var(--gray-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.72rem;
  font-weight: 500;
}
.data-table img.thumb {
  width: 56px; height: 42px; object-fit: cover; border-radius: 3px;
}
.tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.tag-disponivel { background: rgba(201,160,75,0.15); color: var(--gold-light); }
.tag-reservado { background: rgba(184,36,44,0.15); color: #ff8b8f; }
.tag-vendido { background: rgba(255,255,255,0.08); color: var(--gray); }
.row-actions { display: flex; gap: 10px; }
.row-actions button, .row-actions a {
  background: none; border: 1px solid var(--line); color: var(--gray);
  padding: 6px 12px; border-radius: var(--radius); font-size: 0.8rem; cursor: pointer;
}
.row-actions button:hover, .row-actions a:hover { border-color: var(--gold); color: var(--gold); }

.photo-upload-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.photo-upload-grid .thumb-wrap {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
}
.photo-upload-grid img { width: 100%; height: 100%; object-fit: cover; }
.photo-upload-grid .remove-photo {
  position: absolute; top: 4px; right: 4px;
  background: var(--red); color: #fff;
  width: 22px; height: 22px; border-radius: 50%;
  border: none; cursor: pointer; font-size: 0.8rem; line-height: 1;
}
.dropzone {
  border: 1.5px dashed var(--line);
  border-radius: var(--radius);
  padding: 28px;
  text-align: center;
  color: var(--gray);
  cursor: pointer;
  font-size: 0.88rem;
}
.dropzone:hover { border-color: var(--gold); color: var(--gold); }

.loading-spinner {
  width: 22px; height: 22px;
  border: 2px solid var(--line);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  nav.main-nav { display: none; }
  .nav-toggle { display: block; }
  .catalog-layout { grid-template-columns: 1fr; }
  .filters { position: static; }
  .detail-layout { grid-template-columns: 1fr; }
  .contact-layout { grid-template-columns: 1fr; }
  .admin-shell { flex-direction: column; }
  .admin-sidebar { width: 100%; }
  .form-row { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .hero-stats { gap: 28px; }
  .section { padding: 56px 0; }
}
