:root {
  --ink: #000000;
  --ink-soft: #0a0a0a;
  --surface: #0a0a0a;
  --paper: #FFFFFF;
  --magenta: #e8175d;
  --magenta-dark: #a30d40;
  --ochre: #e0891e;
  --ochre-dark: #a3620f;
  --line: rgba(255,255,255,0.08);
}

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

html { scroll-behavior: smooth; }

#buscador {
  font-family: "Helvetica Neue", Arial, sans-serif;
  background: #000000 !important;
  color: #FFFFFF !important;
  overflow-wrap: break-word;
  overflow-x: hidden;
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  background: #000000;
}

/* Composición geométrica plana inspirada en el muralismo y la
   arquitectura de Barragán: bloques de color sólidos, sin fotos ni
   ilustraciones figurativas. */
.hero-motif {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.motif-disc {
  position: absolute;
  top: -12vw;
  right: -10vw;
  width: 46vw;
  height: 46vw;
  max-width: 620px;
  max-height: 620px;
  border-radius: 50%;
  background: var(--magenta);
  opacity: 0.9;
}

.motif-ring {
  position: absolute;
  top: 6vh;
  right: 4vw;
  width: 34vw;
  height: 34vw;
  max-width: 440px;
  max-height: 440px;
  border-radius: 50%;
  border: 2px solid rgba(245,241,232,0.25);
}

.motif-block {
  position: absolute;
  bottom: -8vw;
  left: -6vw;
  width: 30vw;
  height: 30vw;
  max-width: 380px;
  max-height: 380px;
  background: var(--ochre);
  transform: rotate(18deg);
  opacity: 0.85;
}

/* ---------- Navbar / Hero content ---------- */

.navbar {
  position: relative;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
}

.brand {
  display: flex;
  align-items: center;
}

.brand-logo {
  height: 2rem;
  width: auto;
}

.nav-cta {
  color: var(--ink);
  background: var(--paper);
  padding: 0.6rem 1.2rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.85rem;
  transition: transform 0.2s ease, background 0.2s ease;
}
.nav-cta:hover { transform: scale(1.06); background: var(--magenta); color: var(--paper); }

.hero-content {
  position: relative;
  z-index: 3;
  min-width: 0;
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
  padding: 6rem 1.5rem 3rem;
  --eyebrow-size: clamp(0.7rem, 2.6vw, 1.05rem);
}

.eyebrow {
  color: var(--ochre);
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-size: var(--eyebrow-size);
  margin-bottom: 1rem;
}

/* El título mide exactamente 1.618x (proporción áurea) el texto de
   arriba, en todos los tamaños de pantalla. */
.hero-content h1 {
  font-size: calc(var(--eyebrow-size) * 1.618);
  line-height: 1.15;
  font-weight: 900;
}

/* Cada línea del título nunca se envuelve: el texto siempre queda en
   exactamente 2 líneas, el tamaño se ajusta proporcionalmente al ancho. */
.h1-line {
  display: block;
  white-space: nowrap;
}

.hero-sub {
  margin-top: 1.2rem;
  color: rgba(245,241,232,0.75);
  font-size: 1.05rem;
}

/* ---------- Cuenta regresiva ---------- */

.countdown {
  margin-top: 2rem;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  text-align: center;
}

.countdown-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: rgba(245,241,232,0.6);
  text-transform: uppercase;
}

.countdown-grid {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.7rem;
}

.countdown-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 4rem;
}

.countdown-value {
  font-size: 2.6rem;
  font-weight: 900;
  color: var(--paper);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.countdown-unit {
  margin-top: 0.2rem;
  font-size: 0.7rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: rgba(245,241,232,0.55);
}

.countdown-sep {
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--magenta);
  transform: translateY(-0.6rem);
}

.btn-primary {
  display: inline-block;
  margin-top: 2rem;
  padding: 0.9rem 2rem;
  background: var(--magenta);
  color: var(--paper);
  font-weight: 800;
  text-decoration: none;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(232,23,93,0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(232,23,93,0.5); }

.scroll-hint {
  position: relative;
  z-index: 3;
  text-align: center;
  padding-bottom: 1.5rem;
  color: rgba(245,241,232,0.5);
  animation: bounce 2s infinite;
}
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(8px); }
}

/* Ícono de auto compartido (fallback de fotos en tarjetas + modal) */
.car-icon {
  width: 64px;
  height: 64px;
}

/* ---------- Finder section ---------- */

.finder {
  position: relative;
  z-index: 3;
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  padding: 3rem 3rem 5rem 3rem;
  background: #000000 !important;
}

.filters-panel {
  position: relative;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 1.8rem 0;
  box-shadow: none;
}

.filters-panel h2 {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-size: 1.3rem;
  margin-bottom: 1.5rem;
  color: var(--paper);
  font-weight: 700;
}

.panel-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--magenta);
  flex-shrink: 0;
}

.filters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.6rem;
  margin-bottom: 1.5rem;
}

.filter-block label {
  display: block;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: rgba(245,241,232,0.6);
  margin-bottom: 0.5rem;
}

.range-values {
  font-weight: 700;
  color: var(--paper);
  margin-bottom: 0.4rem;
  font-size: 0.95rem;
}

.filter-hint {
  margin-top: 0.6rem;
  font-size: 0.72rem;
  line-height: 1.4;
  color: rgba(245,241,232,0.5);
}

.contado-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.5rem 0 0.7rem;
  font-size: 0.82rem;
  color: rgba(245,241,232,0.8);
  cursor: pointer;
}

.contado-toggle input {
  width: 16px;
  height: 16px;
  accent-color: var(--magenta);
}

.single-slider {
  position: relative;
  height: 32px;
}
.single-slider input[type="range"] {
  position: absolute;
  width: 100%;
  top: 12px;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
}
.single-slider input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  background: rgba(245,241,232,0.15);
  border-radius: 3px;
}
.single-slider input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  margin-top: -9px;
  border-radius: 50%;
  background: var(--magenta);
  border: 3px solid var(--paper);
  cursor: pointer;
  box-shadow: 0 0 0 2px rgba(232,23,93,0.4);
}
.single-slider input[type="range"]::-moz-range-track {
  height: 6px;
  background: rgba(245,241,232,0.15);
  border-radius: 3px;
}
.single-slider input[type="range"]::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--magenta);
  border: 3px solid var(--paper);
  cursor: pointer;
  box-shadow: 0 0 0 2px rgba(232,23,93,0.4);
}

select {
  width: 100%;
  padding: 0.6rem 0.8rem;
  background: #111111;
  color: var(--paper);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  font-size: 0.95rem;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.chip-label {
  font-size: 0.8rem;
  color: rgba(245,241,232,0.6);
  margin-right: 0.4rem;
}
.chip {
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--paper);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.15s ease;
}
.chip:hover { border-color: var(--magenta); }
.chip.active {
  background: var(--magenta);
  border-color: var(--magenta);
  font-weight: 700;
}

.results-count {
  font-size: 0.85rem;
  color: rgba(245,241,232,0.55);
  margin-top: 0.5rem;
}

.match-highlight {
  margin-top: 1.1rem;
  padding: 1rem 1.2rem;
  border-radius: 12px;
  background: rgba(232,23,93,0.1);
  border: 1px solid rgba(232,23,93,0.35);
}

.match-title {
  font-weight: 800;
  color: var(--paper);
  font-size: 0.95rem;
}

.match-detail {
  margin-top: 0.3rem;
  font-size: 0.9rem;
  color: rgba(245,241,232,0.8);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.match-percent {
  display: inline-block;
  background: var(--magenta);
  color: var(--paper);
  font-weight: 800;
  font-size: 0.78rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
}

/* ---------- Results ---------- */

.results-grid {
  margin-top: 2rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem;
}

@media (min-width: 1024px) {
  .results-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  }
}

@media (min-width: 1400px) {
  .results-grid {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  }
}

.car-card {
  position: relative;
  cursor: pointer;
  background: var(--surface);
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.1);
  display: flex;
  flex-direction: column;
  transition: all 0.3s ease;
  overflow: hidden;
}

.car-card:hover {
  transform: translateY(-3px);
  border-color: var(--magenta);
  box-shadow: 0 12px 28px rgba(232,23,93,0.25);
}

.car-photo {
  background: var(--ink-soft);
  position: relative;
  overflow: hidden;
  border-radius: 14px 14px 0 0;
}

/* Sin alto fijo: cada tarjeta toma la altura natural de su foto a lo ancho
   completo de la tarjeta, sin recortar ni dejar barras vacías. */
.car-img {
  display: block;
  width: 100%;
  height: auto;
  filter: contrast(1.15) brightness(1.05);
}

.car-fallback {
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 160px;
}
.car-fallback .car-icon {
  width: 56px;
  height: 56px;
  opacity: 0.4;
}

.car-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--magenta);
  color: var(--paper);
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
}

.car-body {
  padding: 1rem 1.1rem 1.3rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  border-radius: 0 0 14px 14px;
}

.car-title {
  font-weight: 800;
  font-size: 1.05rem;
}

.car-year {
  color: rgba(245,241,232,0.55);
  font-size: 0.85rem;
}

.car-price {
  font-size: 1.25rem;
  font-weight: 900;
  color: var(--ochre);
  margin-top: 0.2rem;
}

.car-specs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.4rem;
}
.spec-chip {
  font-size: 0.7rem;
  background: rgba(245,241,232,0.07);
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  color: rgba(245,241,232,0.75);
}

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: rgba(245,241,232,0.5);
}

.site-footer {
  position: relative;
  z-index: 3;
  text-align: center;
  padding: 1.5rem;
  font-size: 0.75rem;
  color: rgba(245,241,232,0.4);
}

/* ---------- Modal de detalle del auto ---------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(11,11,13,0.85);
  opacity: 0;
  transition: opacity 0.2s ease;
}
.modal-overlay.open { opacity: 1; }
.modal-overlay[hidden] { display: none; }

.modal {
  position: relative;
  width: 100%;
  max-width: 760px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 18px;
  box-shadow: 0 30px 60px rgba(0,0,0,0.8);
  transform: translateY(12px) scale(0.98);
  transition: transform 0.2s ease;
}
.modal-overlay.open .modal { transform: translateY(0) scale(1); }

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(11,11,13,0.6);
  color: var(--paper);
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.15s ease;
}
.modal-close:hover { background: var(--magenta); }

.modal-gallery {
  position: relative;
  height: 340px;
  background: var(--ink-soft);
  border-radius: 18px 18px 0 0;
  overflow: hidden;
}

.modal-photo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: contrast(1.15) brightness(1.05);
}

.modal-fallback {
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}
.modal-fallback .car-icon {
  width: 100px;
  height: 100px;
  opacity: 0.4;
}

.modal-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(11,11,13,0.55);
  color: var(--paper);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease;
}
.modal-nav:hover { background: var(--magenta); }
.modal-prev { left: 14px; }
.modal-next { right: 14px; }

.modal-photo-count {
  position: absolute;
  bottom: 12px;
  right: 14px;
  background: rgba(11,11,13,0.65);
  color: var(--paper);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
}

.modal-thumbs {
  display: flex;
  gap: 0.5rem;
  padding: 0.9rem 1.5rem;
  overflow-x: auto;
}
.modal-thumb {
  width: 64px;
  height: 48px;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
  opacity: 0.55;
  border: 2px solid transparent;
  transition: opacity 0.15s ease, border-color 0.15s ease;
  flex-shrink: 0;
}
.modal-thumb:hover { opacity: 0.85; }
.modal-thumb.active {
  opacity: 1;
  border-color: var(--magenta);
}

.modal-body {
  padding: 0.4rem 1.5rem 1.8rem;
}

.modal-badge {
  display: inline-block;
  background: var(--magenta);
  color: var(--paper);
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  margin-bottom: 0.6rem;
}

.modal-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--paper);
}

.modal-version {
  color: rgba(245,241,232,0.6);
  font-size: 0.9rem;
  margin-top: 0.2rem;
}

.modal-price {
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--ochre);
  margin-top: 0.6rem;
}

.modal-specs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.9rem;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.modal-spec-label {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: rgba(245,241,232,0.5);
  margin-bottom: 0.2rem;
}

.modal-spec-value {
  font-weight: 700;
  color: var(--paper);
  font-size: 0.95rem;
}

.modal-description {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  color: rgba(245,241,232,0.75);
  line-height: 1.5;
}

.whatsapp-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  margin-top: 1.5rem;
  padding: 0.9rem 1.2rem;
  border-radius: 12px;
  background: var(--magenta);
  color: var(--paper);
  font-weight: 800;
  font-size: 0.95rem;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.whatsapp-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(232,23,93,0.4);
}

.whatsapp-cta .whatsapp-icon {
  width: 22px;
  height: 22px;
  fill: var(--paper);
  flex-shrink: 0;
}

.whatsapp-float {
  position: fixed;
  right: 1.3rem;
  bottom: 1.3rem;
  z-index: 60;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--magenta);
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-shadow: 0 8px 24px rgba(0,0,0,0.45);
  animation: whatsappPulse 2.6s ease-in-out infinite;
}

.whatsapp-float .whatsapp-icon {
  width: 30px;
  height: 30px;
  fill: var(--paper);
}

@keyframes whatsappPulse {
  0%, 100% { box-shadow: 0 8px 24px rgba(0,0,0,0.45), 0 0 0 0 rgba(232,23,93,0.5); }
  50% { box-shadow: 0 8px 24px rgba(0,0,0,0.45), 0 0 0 10px rgba(232,23,93,0); }
}

/* ---------- Paginación ---------- */

.pagination-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2rem;
  margin-top: 3rem;
  padding: 2rem;
  flex-wrap: wrap;
}

.pagination-btn {
  padding: 0.8rem 1.5rem;
  background: var(--magenta);
  color: var(--paper);
  border: none;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.pagination-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(232,23,93,0.4);
}

.pagination-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pagination-info {
  font-size: 0.95rem;
  color: rgba(245,241,232,0.8);
  font-weight: 700;
  min-width: 120px;
  text-align: center;
}

@media (max-width: 600px) {
  .countdown-value { font-size: 2rem; }
  .countdown-item { min-width: 3rem; }
  .countdown-sep { font-size: 1.8rem; }

  .whatsapp-float {
    right: 1rem;
    bottom: 1rem;
    width: 52px;
    height: 52px;
  }
  .whatsapp-float .whatsapp-icon { width: 26px; height: 26px; }

  .modal-gallery { height: 240px; }
  .modal-title { font-size: 1.25rem; }
  .modal-price { font-size: 1.4rem; }

  .pagination-container {
    gap: 1rem;
    margin-top: 2rem;
    padding: 1.5rem;
  }

  .pagination-btn {
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
  }

  .pagination-info {
    font-size: 0.9rem;
  }
}
