:root {
  --bg: #0e1116;
  --surface: #161b23;
  --surface-2: #1d242f;
  --text: #e8ebf0;
  --muted: #9aa4b2;
  --accent: #e0392f;
  --accent-hover: #c72e25;
  --ok: #2f9e5f;
  --radius: 12px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  line-height: 1.55;
}

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

.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

/* Header */
.site-header {
  background: rgba(14, 17, 22, 0.95);
  border-bottom: 1px solid #232b37;
  position: sticky; top: 0; z-index: 10;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { font-size: 1.25rem; font-weight: 800; letter-spacing: 0.06em; }
.brand-mark { color: var(--accent); }
.header-phone { color: var(--muted); font-weight: 600; }
.header-phone:hover { color: var(--text); }

/* Hero */
.hero {
  padding: 56px 0 40px;
  background: linear-gradient(180deg, #131820 0%, var(--bg) 100%);
  text-align: center;
}
.hero h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); margin-bottom: 8px; }
.hero p { color: var(--muted); }

/* Grid de autos */
.car-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  padding: 32px 0 56px;
}
.car-card {
  background: var(--surface);
  border: 1px solid #232b37;
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.car-card:hover { transform: translateY(-3px); border-color: #354050; }
.car-photo { position: relative; aspect-ratio: 4 / 3; background: var(--surface-2); overflow: hidden; }
.car-photo img { width: 100%; height: 100%; object-fit: cover; }
.no-photo {
  display: flex; align-items: center; justify-content: center;
  height: 100%; color: var(--muted); font-size: 0.9rem;
}
.car-card.is-sold .car-photo img { filter: grayscale(0.7); opacity: 0.75; }
.badge-sold {
  position: absolute; top: 12px; left: 12px;
  background: var(--accent); color: #fff;
  font-size: 0.75rem; font-weight: 800; letter-spacing: 0.08em;
  padding: 4px 10px; border-radius: 6px;
}
.badge-sold.big { font-size: 1rem; top: 16px; left: 16px; }
.car-info { padding: 16px; }
.car-info h3 { font-size: 1.05rem; }
.year { color: var(--muted); font-weight: 500; }
.specs { color: var(--muted); font-size: 0.88rem; margin-top: 2px; }
.price { color: var(--accent); font-weight: 800; font-size: 1.2rem; margin-top: 8px; }
.price.big { font-size: 1.7rem; margin: 6px 0 18px; }

/* Detalle de vehículo */
.vehicle-page { padding: 24px 0 56px; }
.breadcrumb { margin-bottom: 16px; color: var(--muted); }
.breadcrumb a:hover { color: var(--text); }
.vehicle-layout { display: grid; grid-template-columns: 1.2fr 1fr; gap: 32px; }
@media (max-width: 860px) { .vehicle-layout { grid-template-columns: 1fr; } }

.gallery-main {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-2);
  aspect-ratio: 4 / 3;
}
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.no-photo-big { display: flex; align-items: center; justify-content: center; color: var(--muted); }
.gallery-thumbs { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.thumb {
  width: 84px; height: 64px; padding: 0; border: 2px solid transparent;
  border-radius: 8px; overflow: hidden; cursor: pointer; background: none;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb.active { border-color: var(--accent); }

.vehicle-detail h1 { font-size: clamp(1.4rem, 3vw, 1.9rem); }
.spec-list { list-style: none; margin-bottom: 18px; }
.spec-list li {
  display: flex; justify-content: space-between;
  padding: 9px 0; border-bottom: 1px solid #232b37;
}
.spec-list span { color: var(--muted); }
.description { color: #c6cdd7; white-space: pre-line; margin-bottom: 24px; }

/* Formulario de contacto */
.contact-box {
  background: var(--surface);
  border: 1px solid #232b37;
  border-radius: var(--radius);
  padding: 22px;
}
.contact-box h2 { font-size: 1.15rem; margin-bottom: 14px; }
.contact-box label { display: block; margin-bottom: 12px; font-size: 0.9rem; color: var(--muted); }
.contact-box input, .contact-box textarea {
  width: 100%; margin-top: 5px; padding: 10px 12px;
  background: var(--surface-2); border: 1px solid #2c3542;
  border-radius: 8px; color: var(--text); font: inherit;
}
.contact-box input:focus, .contact-box textarea:focus { outline: 2px solid var(--accent); border-color: transparent; }
.hp { position: absolute !important; left: -9999px !important; height: 0; opacity: 0; }

.btn-primary {
  display: inline-block;
  background: var(--accent); color: #fff;
  border: none; border-radius: 8px;
  padding: 11px 22px; font-size: 1rem; font-weight: 700;
  cursor: pointer;
}
.btn-primary:hover { background: var(--accent-hover); }

.alert-ok {
  background: rgba(47, 158, 95, 0.15); border: 1px solid var(--ok);
  color: #7ed6a5; border-radius: 8px; padding: 10px 14px; margin-bottom: 14px;
}

.empty-state { text-align: center; padding: 80px 20px; color: var(--muted); }
.empty-state h2 { color: var(--text); margin-bottom: 8px; }
.empty-state a { color: var(--accent); font-weight: 600; }

.site-footer {
  border-top: 1px solid #232b37;
  padding: 24px 0; color: var(--muted); font-size: 0.85rem; text-align: center;
}

/* Protección básica de imágenes */
.protected img {
  -webkit-user-select: none; user-select: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
  pointer-events: none;
}
