/* =========================================================
   RJ CARS · Hoja de estilos principal
   Autos seminuevos en Tehuacán, Puebla
   Metodología: mobile-first, variables CSS, BEM.
   ========================================================= */

/* ---------- Design tokens (identidad de marca) ---------- */
:root {
  --color-red: #ff3838; /* Vibrant sport red */
  --color-red-dark: #d61b1b;
  --color-yellow: #ffd60a; /* Cyber Yellow */
  --color-yellow-dark: #e0b400;
  --color-dark: #0b0d10; /* Obsidian Black */
  --color-dark-soft: #12151a; /* Slate Dark */
  --color-gray: #7a828e;
  --color-gray-light: #e2e8f0;
  --color-bg: #f8fafc; /* Clean slate light */
  --color-surface: #ffffff;
  --color-text: #0f172a; /* Slate 900 */
  --color-text-muted: #475569; /* Slate 600 */
  --color-whatsapp: #25d366;

  --font-base: "Plus Jakarta Sans", "Segoe UI", sans-serif;
  --font-title: "Outfit", sans-serif;

  --radius-sm: 8px;
  --radius: 16px; /* Sleeker rounded corners */
  --radius-lg: 24px;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, .04);
  --shadow: 0 10px 30px rgba(11, 13, 16, .08);
  --shadow-lg: 0 20px 50px rgba(11, 13, 16, .15);
  --shadow-glow-red: 0 8px 30px rgba(255, 56, 56, 0.25);
  --shadow-glow-yellow: 0 8px 30px rgba(255, 214, 10, 0.25);

  --container: 1200px;
  --header-h: 84px;

  --transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1); /* Ultra-smooth next-gen curve */
}

/* ---------- Reset moderno ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); }

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

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

a { color: inherit; text-decoration: none; }

h1, h2, h3 { font-family: var(--font-title); line-height: 1.2; margin: 0 0 .5em; font-weight: 700; }

:focus-visible {
  outline: 3px solid var(--color-yellow);
  outline-offset: 2px;
}

/* Accesibilidad: enlace para saltar al contenido */
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--color-dark);
  color: #fff;
  padding: 12px 18px;
  z-index: 1000;
  border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus { left: 0; }

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 20px;
}

/* ---------- Botones ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 14px 28px;
  border: 2px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  z-index: 1;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), 
              box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1), 
              background 0.4s cubic-bezier(0.16, 1, 0.3, 1), 
              border-color 0.4s cubic-bezier(0.16, 1, 0.3, 1), 
              color 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: center;
}
.btn:hover { transform: translateY(-3px); }
.btn:active { transform: translateY(-1px); }

.btn--primary {
  background: linear-gradient(135deg, var(--color-red) 0%, #ff5a36 100%);
  color: #fff;
  box-shadow: var(--shadow-glow-red);
}
.btn--primary:hover {
  background: linear-gradient(135deg, #ff5a36 0%, var(--color-red) 100%);
  box-shadow: 0 12px 35px rgba(255, 56, 56, 0.4);
}

.btn--whatsapp {
  background: linear-gradient(135deg, var(--color-whatsapp) 0%, #1ebe5b 100%);
  color: #fff;
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.25);
}
.btn--whatsapp:hover {
  background: linear-gradient(135deg, #1ebe5b 0%, var(--color-whatsapp) 100%);
  box-shadow: 0 12px 30px rgba(37, 211, 102, 0.4);
}

.btn--ghost {
  background: transparent;
  border-color: var(--color-gray-light);
  color: var(--color-text);
}
.btn--ghost:hover {
  border-color: var(--color-red);
  color: var(--color-red);
  background: rgba(255, 56, 56, 0.02);
}
:root[data-theme="dark"] .btn--ghost {
  border-color: rgba(255, 255, 255, 0.1);
  color: #fff;
}
:root[data-theme="dark"] .btn--ghost:hover {
  border-color: var(--color-yellow);
  color: var(--color-yellow);
  background: rgba(255, 214, 10, 0.05);
}

.btn--block { width: 100%; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-dark);
  box-shadow: var(--shadow-sm);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header-h);
  gap: 1rem;
}
.brand__logo {
  height: 56px;
  width: auto;
  border-radius: var(--radius-sm);
}

.main-nav__list {
  display: flex;
  gap: 1.6rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.main-nav a {
  color: #f2f2f2;
  font-weight: 600;
  padding: 6px 2px;
  border-bottom: 3px solid transparent;
  transition: color var(--transition), border-color var(--transition);
}
.main-nav a:hover { color: var(--color-yellow); border-bottom-color: var(--color-yellow); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 8px;
}
.nav-toggle span {
  width: 26px;
  height: 3px;
  background: var(--color-yellow);
  border-radius: 2px;
  transition: var(--transition);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  background: radial-gradient(circle at 80% 20%, rgba(255, 56, 56, 0.15), transparent 45%),
              radial-gradient(circle at 10% 80%, rgba(255, 214, 10, 0.1), transparent 45%),
              linear-gradient(135deg, #0b0d10 0%, #12151a 100%);
  color: #fff;
  overflow: hidden;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: 
    radial-gradient(rgba(255, 255, 255, 0.15) 1px, transparent 0),
    radial-gradient(rgba(255, 255, 255, 0.1) 1px, transparent 0);
  background-size: 40px 40px;
  background-position: 0 0, 20px 20px;
  opacity: 0.35;
  pointer-events: none;
}
.hero__inner {
  position: relative;
  z-index: 1;
  padding: clamp(3rem, 8vw, 6rem) 20px;
  max-width: 760px;
}
.hero__eyebrow {
  display: inline-block;
  background: var(--color-yellow);
  color: var(--color-dark);
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-size: .8rem;
  padding: 5px 14px;
  border-radius: 999px;
  margin: 0 0 1rem;
}
.hero__title {
  font-size: clamp(2.2rem, 6vw, 4rem);
  font-weight: 900;
  text-transform: uppercase;
  margin: 0 0 1rem;
}
.hero__title span { color: var(--color-yellow); }
.hero__subtitle {
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  max-width: 620px;
  margin: 0 0 2rem;
  color: #f0f0f0;
}
.hero__actions { display: flex; flex-wrap: wrap; gap: 1rem; }
.hero__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 1.4rem;
  list-style: none;
  padding: 0;
  margin: 2.2rem 0 0;
  font-weight: 600;
  color: var(--color-yellow);
}

/* ---------- Secciones ---------- */
.section { padding: clamp(3rem, 7vw, 5.5rem) 0; }
.section--alt { background: var(--color-surface); }
.section__head { text-align: center; margin-bottom: 2.5rem; }
.section__title {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 900;
  text-transform: uppercase;
  position: relative;
  display: inline-block;
}
.section__title::after {
  content: "";
  display: block;
  width: 60px;
  height: 4px;
  margin: .6rem auto 0;
  background: var(--color-red);
  border-radius: 2px;
}
.section__subtitle { color: var(--color-text-muted); margin: 0; }

/* ---------- Barra de filtros ---------- */
.filter-bar {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  background: var(--color-surface);
  padding: 1.2rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
  align-items: end;
}
.filter-bar__field { display: flex; flex-direction: column; gap: .35rem; }
.filter-bar__field label { font-weight: 600; font-size: .85rem; color: var(--color-text-muted); }
.filter-bar input,
.filter-bar select,
.form-field input,
.form-field textarea {
  font: inherit;
  padding: 11px 13px;
  border: 1.5px solid var(--color-gray-light);
  border-radius: var(--radius-sm);
  background: #fff;
  transition: border-color var(--transition);
  width: 100%;
}
.filter-bar input:focus,
.filter-bar select:focus,
.form-field input:focus,
.form-field textarea:focus {
  border-color: var(--color-red);
  outline: none;
}
.results-count { color: var(--color-text-muted); font-size: .9rem; margin: 0 0 1.2rem; }

/* ---------- Grid de autos ---------- */
.car-grid {
  display: grid;
  /* Grid fluido: las tarjetas se reacomodan a cualquier ancho (sin saltos). */
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr));
  gap: clamp(1rem, 2.5vw, 1.6rem);
}
.car-card {
  background: var(--color-surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--color-gray-light);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.car-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(255, 56, 56, 0.2);
}
:root[data-theme="dark"] .car-card:hover {
  border-color: rgba(255, 214, 10, 0.3);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5), 0 0 20px rgba(255, 214, 10, 0.05);
}
.car-card__media { position: relative; aspect-ratio: 16 / 10; background: #e9ebee; overflow: hidden; }
.car-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1); }
.car-card:hover .car-card__media img { transform: scale(1.06); }
.car-card__badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: linear-gradient(135deg, var(--color-red), #ff5a36);
  color: #fff;
  font-size: .72rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 999px;
  box-shadow: 0 4px 12px rgba(255, 56, 56, 0.25);
  z-index: 2;
}
.car-card__body { padding: 1.1rem 1.2rem 1.3rem; display: flex; flex-direction: column; gap: .6rem; flex: 1; }
.car-card__title { font-size: 1.15rem; font-weight: 800; margin: 0; }
.car-card__ask {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: .35rem;
  margin: 0;
  font-size: .92rem;
  font-weight: 700;
  color: var(--color-red);
  background: rgba(225, 6, 0, .08);
  padding: 5px 12px;
  border-radius: 999px;
}
.car-card__specs {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem .9rem;
  list-style: none;
  padding: 0;
  margin: 0;
  color: var(--color-text-muted);
  font-size: .88rem;
}
.car-card__specs li { display: flex; align-items: center; gap: .3rem; }
.car-card__actions { margin-top: auto; display: flex; gap: .6rem; }
.car-card__actions .btn { flex: 1; padding: 10px 14px; font-size: .92rem; }

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem 1rem;
  color: var(--color-text-muted);
}

/* ---------- Servicios ---------- */
.services-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.4rem;
}
.service-card {
  background: var(--color-bg);
  border-radius: var(--radius);
  padding: 1.8rem 1.5rem;
  text-align: center;
  border-bottom: 4px solid var(--color-yellow);
  transition: transform var(--transition), box-shadow var(--transition);
}
.service-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.service-card__icon { font-size: 2.5rem; margin-bottom: .6rem; }
.service-card h3 { font-size: 1.15rem; }
.service-card p { color: var(--color-text-muted); margin: 0; }

/* ---------- Nosotros ---------- */
.about { display: grid; gap: 2rem; align-items: center; }
.about__media {
  background: var(--color-dark);
  border-radius: var(--radius);
  padding: 2rem;
  display: grid;
  place-items: center;
}
.about__list { padding-left: 1.2rem; color: var(--color-text-muted); }
.about__list li { margin-bottom: .4rem; }

/* ---------- Contacto ---------- */
.contact { display: grid; gap: 2.5rem; }
.contact__list { list-style: none; padding: 0; margin: 1.5rem 0 0; display: grid; gap: 1rem; }
.contact__list li { display: flex; flex-direction: column; }
.contact__label { font-weight: 700; color: var(--color-red); font-size: .85rem; text-transform: uppercase; }
.contact__list a { font-size: 1.2rem; font-weight: 800; }

.contact-form {
  background: var(--color-bg);
  padding: 1.8rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.contact-form__title { font-size: 1.3rem; margin-bottom: 1.2rem; }
.form-field { margin-bottom: 1.1rem; display: flex; flex-direction: column; gap: .35rem; }
.form-field label { font-weight: 600; font-size: .9rem; }
.form-error { color: var(--color-red); font-size: .82rem; min-height: 1em; }
.form-field input[aria-invalid="true"],
.form-field textarea[aria-invalid="true"] { border-color: var(--color-red); }
.contact-form__note { font-size: .8rem; color: var(--color-text-muted); margin: .8rem 0 0; text-align: center; }

/* ---------- Footer ---------- */
.site-footer { background: var(--color-dark); color: #d8d8d8; padding: 2.5rem 0; text-align: center; }
.site-footer__inner { display: grid; gap: .8rem; place-items: center; }
.site-footer__logo { border-radius: var(--radius-sm); }
.site-footer__text { margin: 0; max-width: 480px; }
.site-footer__copy { font-size: .82rem; color: #9aa0a6; margin: 0; }

/* ---------- Botón flotante WhatsApp ---------- */
.whatsapp-fab {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 56px;
  height: 56px;
  background: var(--color-whatsapp);
  color: #fff;
  border-radius: 50%;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow);
  z-index: 90;
  transition: transform var(--transition);
  animation: pulse 2.4s infinite;
}
.whatsapp-fab:hover { transform: scale(1.08); }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, .5); }
  70% { box-shadow: 0 0 0 16px rgba(37, 211, 102, 0); }
  100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}

/* ---------- Modal de detalle ---------- */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .65);
  display: none;
  place-items: center;
  z-index: 200;
  padding: 1rem;
}
.modal[aria-hidden="false"] { display: grid; }
.modal__dialog {
  position: relative;
  background: #fff;
  border-radius: var(--radius);
  max-width: 760px;
  width: 100%;
  max-height: 92vh;
  overflow: auto;
  box-shadow: var(--shadow-lg);
}
.modal__media { aspect-ratio: 16 / 9; background: #e9ebee; }
.modal__media img { width: 100%; height: 100%; object-fit: cover; }

/* Cuerpo del detalle */
.modal__body { padding: 1.5rem 1.6rem 1.7rem; display: flex; flex-direction: column; gap: 1rem; }
.modal__header { display: flex; flex-direction: column; gap: .5rem; }
.modal__badge {
  align-self: flex-start;
  background: var(--color-red);
  color: #fff;
  font-size: .7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: 4px 11px;
  border-radius: 999px;
}
.modal__title { font-size: 1.5rem; font-weight: 900; margin: 0; line-height: 1.2; }
.modal__ask {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: .4rem;
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-red);
  background: rgba(225, 6, 0, .08);
  padding: 8px 16px;
  border-radius: 999px;
}
.modal__desc { margin: 0; color: var(--color-text-muted); }
.modal__specs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 1.4rem;
  list-style: none;
  padding: 0;
  margin: .2rem 0 .4rem;
}
.modal__specs li {
  display: flex;
  justify-content: space-between;
  gap: .8rem;
  border-bottom: 1px solid var(--color-gray-light);
  padding: .55rem 0;
}
.modal__specs span:first-child { color: var(--color-text-muted); }
.modal__specs span:last-child { font-weight: 700; text-align: right; }

/* Botón de cerrar: círculo flotante sobre la imagen (estilo lightbox) */
.modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 5;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, .55);
  color: #fff;
  border: 0;
  border-radius: 50%;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(3px);
  transition: background .2s ease, transform .2s ease;
}
.modal__close:hover { background: rgba(0, 0, 0, .8); transform: scale(1.08); }

/* =========================================================
   Media queries (mobile-first → desktop)
   ========================================================= */
@media (max-width: 820px) {
  .nav-toggle { display: flex; }
  .main-nav {
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: var(--color-dark);
    max-height: 0;
    overflow: hidden;
    transition: max-height .3s ease;
  }
  .main-nav.is-open { max-height: 340px; }
  .main-nav__list { flex-direction: column; gap: 0; padding: .5rem 20px 1rem; }
  .main-nav a { display: block; padding: 12px 0; border-bottom: 1px solid rgba(255,255,255,.08); }
}

@media (min-width: 560px) {
  .services-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 720px) {
  .filter-bar { grid-template-columns: 2fr 1fr 1fr auto; }
  .about { grid-template-columns: 1fr 1.2fr; }
  .contact { grid-template-columns: 1fr 1fr; align-items: start; }
}

@media (min-width: 960px) {
  .services-grid { grid-template-columns: repeat(4, 1fr); }
}

/* =========================================================
   ANIMACIONES MODERNAS
   ========================================================= */

/* ---- Entrada del hero (al cargar) ---- */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.hero__eyebrow,
.hero__title,
.hero__subtitle,
.hero__actions,
.hero__badges {
  opacity: 0;
  animation: fade-up .8s cubic-bezier(.22, 1, .36, 1) forwards;
}
.hero__eyebrow  { animation-delay: .05s; }
.hero__title    { animation-delay: .18s; }
.hero__subtitle { animation-delay: .32s; }
.hero__actions  { animation-delay: .46s; }
.hero__badges   { animation-delay: .60s; }

/* ---- Gradiente animado + resplandor flotante en el hero ---- */
.hero {
  background:
    linear-gradient(135deg, rgba(17,19,21,.94) 0%, rgba(17,19,21,.80) 50%, rgba(225,6,0,.88) 100%);
  background-size: 200% 200%;
  animation: hero-pan 14s ease-in-out infinite;
}
@keyframes hero-pan {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}
.hero::before {
  content: "";
  position: absolute;
  width: 480px;
  height: 480px;
  top: -160px;
  right: -120px;
  background: radial-gradient(circle, rgba(255,196,0,.35), transparent 70%);
  border-radius: 50%;
  filter: blur(20px);
  animation: float-glow 9s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}
@keyframes float-glow {
  0%, 100% { transform: translateY(0) scale(1); opacity: .85; }
  50%      { transform: translateY(40px) scale(1.12); opacity: 1; }
}

/* ---- Header: reduce su tamaño al hacer scroll ---- */
.site-header { transition: background .3s ease, box-shadow .3s ease; }
.site-header.is-scrolled {
  background: rgba(17, 19, 21, .92);
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow);
}
.site-header.is-scrolled .brand__logo { height: 46px; transition: height .3s ease; }
.brand__logo { transition: height .3s ease, transform .3s ease; }
.brand:hover .brand__logo { transform: scale(1.04); }

/* ---- Sistema de revelado al hacer scroll ----
   A PRUEBA DE FALLOS: el contenido es visible por defecto. Solo se oculta
   cuando el JS lo "arma" (.is-armed). Si el JS no corre, todo se ve igual. */
[data-reveal] {
  transition: opacity .7s ease, transform .7s cubic-bezier(.22, 1, .36, 1);
  transition-delay: calc(var(--reveal-index, 0) * 90ms);
}
[data-reveal].is-armed {
  opacity: 0;
  transform: translateY(34px);
  will-change: opacity, transform;
}
[data-reveal="left"].is-armed  { transform: translateX(-40px); }
[data-reveal="right"].is-armed { transform: translateX(40px); }
[data-reveal="zoom"].is-armed  { transform: scale(.9); }
[data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* ---- Banda de estadísticas (contadores) ---- */
.stats {
  background: var(--color-dark);
  color: #fff;
  padding: clamp(2.2rem, 5vw, 3.2rem) 0;
}
.stats__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  text-align: center;
}
.stat__number {
  font-size: clamp(2rem, 6vw, 3.2rem);
  font-weight: 900;
  color: var(--color-yellow);
  line-height: 1;
  display: block;
}
.stat__label { color: #c8ccd0; font-weight: 600; margin-top: .4rem; }

/* ---- Tarjetas de auto: zoom de imagen + brillo ---- */
.car-card__media img { transition: transform .5s ease; }
.car-card:hover .car-card__media img { transform: scale(1.07); }
.car-card__badge { box-shadow: 0 4px 12px rgba(225, 6, 0, .35); }

/* ---- Efecto de brillo en botones primarios/whatsapp ---- */
.btn--primary,
.btn--whatsapp { position: relative; overflow: hidden; }
.btn--primary::after,
.btn--whatsapp::after {
  content: "";
  position: absolute;
  top: 0;
  left: -120%;
  width: 60%;
  height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,.45), transparent);
  transform: skewX(-20deg);
  transition: left .6s ease;
}
.btn--primary:hover::after,
.btn--whatsapp:hover::after { left: 130%; }

/* ---- Tarjetas de servicio: icono con rebote al hover ---- */
.service-card__icon { transition: transform .35s cubic-bezier(.34, 1.56, .64, 1); display: inline-block; }
.service-card:hover .service-card__icon { transform: translateY(-6px) scale(1.15); }

/* ---- Aparición del modal ---- */
@keyframes modal-pop {
  from { opacity: 0; transform: translateY(20px) scale(.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.modal[aria-hidden="false"] { animation: fade-in .25s ease; }
.modal[aria-hidden="false"] .modal__dialog { animation: modal-pop .35s cubic-bezier(.22, 1, .36, 1); }

@media (min-width: 720px) {
  .stats__grid { grid-template-columns: repeat(4, 1fr); }
}

/* =========================================================
   Respeta a quien prefiere menos movimiento
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
  [data-reveal] { opacity: 1 !important; transform: none !important; }
  .hero__eyebrow, .hero__title, .hero__subtitle,
  .hero__actions, .hero__badges { opacity: 1 !important; }
}

/* =========================================================
   REDISEÑO CORPORATIVO (estilo concesionario)
   ========================================================= */

/* ---- Barra superior ---- */
.topbar { background: #000; color: #cfd3d7; font-size: .82rem; }
.topbar__inner {
  display: flex;
  align-items: center;
  gap: 1.4rem;
  min-height: 38px;
  flex-wrap: wrap;
}
.topbar__phone { margin-left: auto; color: var(--color-yellow); font-weight: 700; }
.topbar__phone:hover { color: #fff; }
@media (max-width: 560px) { .topbar__item--sep { display: none; } }

/* ---- Enlace CTA del menú ---- */
.main-nav__cta {
  background: var(--color-red);
  color: #fff !important;
  padding: 9px 20px !important;
  border-radius: 999px;
  border-bottom: 0 !important;
  transition: background var(--transition);
}
.main-nav__cta:hover { background: var(--color-red-dark); }

/* ---- Contenedor angosto y antetítulos ---- */
.container--narrow { max-width: 840px; }
.section__eyebrow {
  text-transform: uppercase;
  letter-spacing: .14em;
  font-weight: 800;
  font-size: .76rem;
  color: var(--color-red);
  margin: 0 0 .5rem;
}
.btn--lg { padding: 16px 34px; font-size: 1.05rem; }

/* ---- HERO a pantalla completa con imagen ---- */
.hero {
  min-height: clamp(560px, 86vh, 820px);
  display: flex;
  align-items: center;
  background: #0c0e11;
  animation: none;
}
.hero::before, .hero::after { display: none; }
.hero__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  transform: scale(1.05);
  animation: hero-zoom 18s ease-in-out infinite alternate;
}
@keyframes hero-zoom { from { transform: scale(1.05); } to { transform: scale(1.14); } }
.hero__overlay {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(90deg, rgba(8,9,11,.92) 0%, rgba(8,9,11,.6) 45%, rgba(8,9,11,.1) 100%);
}
.hero__inner { position: relative; z-index: 1; max-width: 720px; padding-block: 3rem; }
.hero__scroll {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  width: 26px;
  height: 42px;
  border: 2px solid rgba(255,255,255,.55);
  border-radius: 14px;
  z-index: 1;
}
.hero__scroll span {
  display: block;
  width: 4px;
  height: 8px;
  margin: 7px auto 0;
  background: #fff;
  border-radius: 2px;
  animation: hero-scroll 1.6s infinite;
}
@keyframes hero-scroll {
  0% { opacity: 0; transform: translateY(0); }
  30% { opacity: 1; }
  100% { opacity: 0; transform: translateY(14px); }
}

/* ---- Banda de valores ---- */
.values { background: var(--color-surface); padding: clamp(2.4rem, 6vw, 3.6rem) 0; }
.values__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.4rem;
  text-align: center;
}
.value { padding: 1.2rem .8rem; }
.value__icon {
  font-size: 2.4rem;
  display: inline-block;
  transition: transform .35s cubic-bezier(.34, 1.56, .64, 1);
}
.value:hover .value__icon { transform: translateY(-6px) scale(1.12); }
.value h3 { font-size: 1.1rem; margin: .4rem 0 .3rem; }
.value p { color: var(--color-text-muted); margin: 0; font-size: .95rem; }
@media (min-width: 680px) { .values__grid { grid-template-columns: repeat(4, 1fr); } }

/* ---- Banner CTA de ancho completo ---- */
.cta-banner {
  position: relative;
  overflow: hidden;
  color: #fff;
  text-align: center;
  padding: clamp(3rem, 8vw, 5.5rem) 0;
}
.cta-banner__bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
.cta-banner__overlay { position: absolute; inset: 0; z-index: 0; background: rgba(10,11,13,.55); }
.cta-banner__inner { position: relative; z-index: 1; max-width: 700px; margin-inline: auto; }
.cta-banner__title {
  font-size: clamp(1.6rem, 4.5vw, 2.7rem);
  font-weight: 900;
  text-transform: uppercase;
}
.cta-banner__text { font-size: 1.12rem; margin: 0 0 1.7rem; color: #e8e8e8; }

/* ---- FAQ acordeón ---- */
.faq { display: grid; gap: .8rem; }
.faq__item {
  background: var(--color-surface);
  border: 1px solid var(--color-gray-light);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow var(--transition);
}
.faq__item.is-open { box-shadow: var(--shadow-sm); }
.faq__question {
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  font: inherit;
  font-weight: 700;
  font-size: 1.04rem;
  color: var(--color-text);
  padding: 1.15rem 1.3rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.faq__icon { position: relative; width: 18px; height: 18px; flex-shrink: 0; }
.faq__icon::before, .faq__icon::after {
  content: "";
  position: absolute;
  background: var(--color-red);
  border-radius: 2px;
  transition: transform .3s ease;
}
.faq__icon::before { top: 8px; left: 0; width: 18px; height: 2px; }
.faq__icon::after { left: 8px; top: 0; width: 2px; height: 18px; }
.faq__item.is-open .faq__icon::after { transform: scaleY(0); }
.faq__answer { max-height: 0; overflow: hidden; transition: max-height .35s ease; }
.faq__item.is-open .faq__answer { max-height: 320px; }
.faq__answer p { padding: 0 1.3rem 1.2rem; margin: 0; color: var(--color-text-muted); }

/* ---- Footer corporativo (multicolumna) ---- */
.site-footer { text-align: left; padding-bottom: 1.6rem; }
.site-footer__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  padding-bottom: 2rem;
}
.site-footer__col h4 { color: #fff; font-size: 1rem; margin: 0 0 .9rem; }
.site-footer__col ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .55rem; }
.site-footer__col a, .site-footer__col li { color: #b9bec3; }
.site-footer__col a:hover { color: var(--color-yellow); }
.site-footer__logo { margin-bottom: .8rem; }
.site-footer__bottom {
  border-top: 1px solid rgba(255,255,255,.1);
  padding-top: 1.2rem;
  text-align: center;
  font-size: .82rem;
  color: #9aa0a6;
}
.site-footer__bottom p { margin: 0; }
@media (min-width: 720px) { .site-footer__grid { grid-template-columns: 2fr 1fr 1fr; } }

/* =========================================================
   ÚLTIMA GENERACIÓN · Modo oscuro, glassmorphism y microinteracciones
   ========================================================= */

/* ---- Tokens del tema oscuro ---- */
:root[data-theme="dark"] {
  --color-bg: #0f1115;
  --color-surface: #181b20;
  --color-text: #eceef1;
  --color-text-muted: #9aa2ab;
  --color-gray-light: #2a2f37;
  --color-dark: #0b0d10;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, .5);
  --shadow: 0 8px 24px rgba(0, 0, 0, .55);
  --shadow-lg: 0 18px 46px rgba(0, 0, 0, .65);
}

/* Transición suave al cambiar de tema */
body, .topbar, .site-header, .section, .section--alt, .values, .stats,
.car-card, .service-card, .value, .faq__item, .contact-form, .filter-bar,
.filter-bar input, .filter-bar select, .form-field input, .form-field textarea,
.modal__dialog, .admin-card, .admin-table-wrap, .admin-modal__dialog,
.admin-btn-icon {
  transition: background-color .35s ease, color .35s ease, border-color .35s ease,
    box-shadow .35s ease;
}

/* Ajustes específicos en oscuro (donde había colores fijos) */
:root[data-theme="dark"] .filter-bar input,
:root[data-theme="dark"] .filter-bar select,
:root[data-theme="dark"] .form-field input,
:root[data-theme="dark"] .form-field textarea,
:root[data-theme="dark"] .admin-btn-icon {
  background: #1f242b;
  color: var(--color-text);
}
:root[data-theme="dark"] .modal__dialog,
:root[data-theme="dark"] .admin-modal__dialog { background: var(--color-surface); color: var(--color-text); }
:root[data-theme="dark"] .service-card,
:root[data-theme="dark"] .contact-form { background: #12151a; }
:root[data-theme="dark"] .car-card__media,
:root[data-theme="dark"] .modal__media,
:root[data-theme="dark"] .admin-table__thumb,
:root[data-theme="dark"] .admin-photo__preview { background: #0f1318; }
:root[data-theme="dark"] .admin-table tbody tr:hover { background: #1d2128; }
:root[data-theme="dark"] .car-card,
:root[data-theme="dark"] .faq__item { border: 1px solid rgba(255, 255, 255, .06); }

/* ---- Header premium con leve glassmorphism (ambos temas) ---- */
.site-header {
  background: rgba(12, 14, 17, .94);
  backdrop-filter: blur(10px) saturate(130%);
  -webkit-backdrop-filter: blur(10px) saturate(130%);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  box-shadow: 0 2px 16px rgba(0, 0, 0, .25);
}
.brand { margin-right: auto; }

/* ---- Interruptor de tema (iconos SVG sol/luna) ---- */
.theme-toggle {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .18);
  background: rgba(255, 255, 255, .06);
  color: #fff;
  border-radius: 50%;
  cursor: pointer;
  display: inline-grid;
  place-items: center;
  transition: background .25s ease, color .25s ease, border-color .25s ease, transform .35s ease;
}
.theme-toggle:hover {
  background: rgba(255, 255, 255, .14);
  color: var(--color-yellow);
  border-color: rgba(255, 196, 0, .5);
  transform: rotate(25deg);
}
.theme-toggle:active { transform: scale(.9); }
.theme-toggle__icon { width: 20px; height: 20px; display: block; }
.theme-toggle__icon--sun { display: none; }
:root[data-theme="dark"] .theme-toggle__icon--moon { display: none; }
:root[data-theme="dark"] .theme-toggle__icon--sun { display: block; }

/* ---- Definición de tarjetas en modo oscuro (look premium) ---- */
:root[data-theme="dark"] .service-card,
:root[data-theme="dark"] .contact-form,
:root[data-theme="dark"] .filter-bar,
:root[data-theme="dark"] .admin-stat,
:root[data-theme="dark"] .admin-table-wrap {
  border: 1px solid rgba(255, 255, 255, .07);
}

/* ---- Ajustes finos en móvil ---- */
@media (max-width: 560px) {
  .site-header__inner { gap: .55rem; }
  .brand__logo { height: 42px; }
  .site-header.is-scrolled .brand__logo { height: 38px; }
  .theme-toggle { width: 38px; height: 38px; }
  .theme-toggle__icon { width: 18px; height: 18px; }
  .hero__inner { padding-block: 2.4rem; }
}

/* ---- Microinteracciones / brillo ---- */
.btn--primary { box-shadow: 0 6px 18px rgba(225, 6, 0, .28); }
.btn--primary:hover { box-shadow: 0 10px 26px rgba(225, 6, 0, .42); }
.btn--whatsapp { box-shadow: 0 6px 18px rgba(37, 211, 102, .28); }

/* La banda de estadísticas siempre es oscura: degradado amarillo para contraste. */
.stat__number {
  background: linear-gradient(90deg, var(--color-yellow), #ffe17a);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Realce del enlace activo del menú al pasar el cursor en móvil */
.value, .service-card, .car-card { will-change: transform; }

@media (prefers-reduced-motion: reduce) {
  .theme-toggle:hover { transform: none; }
}

/* =========================================================
   CATÁLOGO ESTILO MARKETPLACE + RESPONSIVIDAD FLUIDA
   ========================================================= */

/* Objetivos táctiles cómodos en todos los botones */
.btn { min-height: 46px; }

/* Barra de filtros fija bajo el header en pantallas medianas y grandes */
@media (min-width: 720px) {
  .filter-bar {
    position: sticky;
    top: 78px;
    z-index: 40;
    border: 1px solid var(--color-gray-light);
  }
}
:root[data-theme="dark"] .filter-bar { border-color: rgba(255, 255, 255, .07); }

/* Ajustes móviles para que el catálogo "respire" y sea cómodo al tacto */
@media (max-width: 560px) {
  .section { padding: clamp(2.2rem, 7vw, 3rem) 0; }
  .car-card__actions { flex-direction: column; }
  .car-card__media { aspect-ratio: 16 / 11; }
  .results-count { margin-bottom: 1rem; }
}

/* =========================================================
   HERO: buscador + pastillas (estilo marketplace)
   ========================================================= */
.hero-search {
  display: flex;
  align-items: center;
  gap: .5rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 999px;
  padding: 6px 6px 6px 18px;
  max-width: 540px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  margin-bottom: 1.5rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.hero-search:focus-within {
  border-color: var(--color-yellow);
  box-shadow: 0 0 25px rgba(255, 214, 10, 0.2);
}
.hero-search__icon { width: 22px; height: 22px; color: var(--color-yellow); flex-shrink: 0; }
.hero-search input {
  flex: 1;
  border: 0;
  outline: none;
  font: inherit;
  font-size: 1rem;
  padding: 10px 6px;
  background: transparent;
  color: #fff;
  min-width: 0;
}
.hero-search input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}
.hero-search .btn { min-height: 44px; border-radius: 999px; padding-inline: 22px; white-space: nowrap; }

.hero-pills { display: flex; flex-wrap: wrap; gap: .6rem; }
.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .1);
  color: #fff;
  font-weight: 600;
  font-size: .88rem;
  padding: 8px 18px;
  border-radius: 999px;
  backdrop-filter: blur(4px);
  transition: all var(--transition);
}
.hero-pill:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: var(--color-yellow);
  transform: translateY(-2px);
}
.hero-pill--wa {
  background: rgba(37, 211, 102, 0.1);
  border-color: rgba(37, 211, 102, 0.3);
}
.hero-pill--wa:hover {
  background: var(--color-whatsapp);
  border-color: var(--color-whatsapp);
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
}

/* =========================================================
   CARRUSEL HORIZONTAL DE DESTACADOS (scroll-snap)
   ========================================================= */
.section__head--row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  text-align: left;
  gap: 1rem;
}
.section__head--row .section__title::after { margin-left: 0; }
.section__link { color: var(--color-red); font-weight: 800; white-space: nowrap; }
.section__link:hover { text-decoration: underline; }

.carousel {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  /* Alinea la primera tarjeta con el contenido y permite "asomar" la siguiente. */
  padding: .5rem max(20px, calc((100vw - var(--container)) / 2)) 1.4rem;
  scrollbar-width: thin;
}
.carousel > .car-card {
  flex: 0 0 clamp(240px, 78vw, 300px);
  scroll-snap-align: start;
}
.carousel::-webkit-scrollbar { height: 8px; }
.carousel::-webkit-scrollbar-thumb { background: var(--color-gray-light); border-radius: 8px; }
:root[data-theme="dark"] .carousel::-webkit-scrollbar-thumb { background: #2a2f37; }

@media (max-width: 560px) {
  .hero-search { padding-left: 12px; }
  .hero-search .btn { padding-inline: 16px; }
}

/* =========================================================
   GALERÍA DE FOTOS (modal de detalle, estilo marketplace)
   ========================================================= */
.gallery__main { position: relative; aspect-ratio: 16 / 9; background: #e9ebee; overflow: hidden; }
.gallery__main img { width: 100%; height: 100%; object-fit: cover; }
.gallery__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, .5);
  color: #fff;
  font-size: 1.7rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.gallery__nav--prev { left: 10px; }
.gallery__nav--next { right: 10px; }
.gallery__nav:hover { background: rgba(0, 0, 0, .78); }
.gallery__counter {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(0, 0, 0, .6);
  color: #fff;
  font-size: .78rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
}
.gallery__thumbs { display: flex; gap: .5rem; overflow-x: auto; padding: .7rem; scrollbar-width: thin; }
.gallery__thumb {
  flex: 0 0 66px;
  height: 50px;
  border: 2px solid transparent;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  padding: 0;
  background: none;
}
.gallery__thumb img { width: 100%; height: 100%; object-fit: cover; }
.gallery__thumb.is-active { border-color: var(--color-red); }
:root[data-theme="dark"] .gallery__main { background: #0f1318; }

/* ---- Galería de detalle mejorada (proporcionada y clara) ---- */
.gallery__main {
  aspect-ratio: 16 / 10;
  max-height: 44vh;
  touch-action: pan-y; /* permite el swipe horizontal sin bloquear el scroll */
  user-select: none;
}
@media (min-width: 720px) { .gallery__main { aspect-ratio: 16 / 9; max-height: 52vh; } }
.gallery__main img { transition: opacity .2s ease; }
.gallery__nav {
  width: 46px;
  height: 46px;
  background: rgba(0, 0, 0, .42);
  backdrop-filter: blur(2px);
  transition: background .2s ease, transform .2s ease;
}
.gallery__nav:hover { background: rgba(0, 0, 0, .72); transform: translateY(-50%) scale(1.06); }
.gallery__thumbs {
  gap: .55rem;
  padding: .8rem;
  scroll-behavior: smooth;
}
.gallery__thumb {
  flex: 0 0 76px;
  height: 56px;
  border-width: 2.5px;
  border-radius: 10px;
  transition: border-color .2s ease, transform .2s ease, opacity .2s ease;
  opacity: .7;
}
.gallery__thumb:hover { opacity: 1; transform: translateY(-2px); }
.gallery__thumb.is-active { opacity: 1; box-shadow: 0 0 0 1px var(--color-red); }
.gallery__counter { font-size: .82rem; padding: 4px 12px; }
@media (max-width: 560px) {
  /* En móvil la foto NO debe dominar la pantalla: deja ver precio y datos. */
  .gallery__main { aspect-ratio: 16 / 11; max-height: 34vh; }
  .gallery__thumb { flex-basis: 58px; height: 44px; }
  .gallery__thumbs { padding: .6rem; gap: .45rem; }
  .gallery__nav { width: 40px; height: 40px; font-size: 1.5rem; }

  /* Cuerpo del modal más compacto y ordenado en móvil. */
  .modal { padding: .6rem; }
  .modal__dialog { max-height: 94vh; }
  .modal__body { padding: 1.1rem 1.1rem 1.4rem; gap: .8rem; }
  .modal__title { font-size: 1.2rem; }
  .modal__ask { font-size: .92rem; }
  .modal__specs { grid-template-columns: 1fr; gap: 0; }
}

/* ---- Detalle a 2 columnas en escritorio (estilo marketplace) ----
   Galería pegada a la izquierda; la ficha de datos se desplaza a la
   derecha. Aprovecha el ancho y evita una columna larga y angosta. */
@media (min-width: 760px) {
  .modal__dialog { max-width: 940px; }
  .modal__content {
    display: grid;
    grid-template-columns: 1.05fr .95fr;
    align-items: start;
  }
  .modal__content > .gallery {
    position: sticky;
    top: 0;
    background: #0f1318;
  }
  .modal__content > .gallery .gallery__main {
    aspect-ratio: 4 / 3;
    max-height: 70vh;
  }
  .modal__body {
    padding: 1.9rem 1.9rem 1.9rem 1.7rem;
    gap: 1.05rem;
  }
  .modal__header { padding-right: 2.6rem; } /* deja sitio al botón de cerrar */
  .modal__specs { grid-template-columns: 1fr; gap: 0; }
}

/* Indicador de número de fotos en la tarjeta */
.car-card__photos {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(0, 0, 0, .6);
  color: #fff;
  font-size: .72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
}

/* =========================================================
   REFINAMIENTO MÓVIL v2 (logo limpio + hero más corto)
   ========================================================= */

/* Logo completo (banner de la marca), siempre visible y proporcional. */
.brand__logo {
  height: 48px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
  border-radius: var(--radius-sm);
}
.site-header.is-scrolled .brand__logo { height: 42px; }

@media (max-width: 560px) {
  /* Header más compacto */
  .brand__logo { height: 40px; max-width: 135px; }
  .site-header.is-scrolled .brand__logo { height: 36px; }

  /* Hero: que NO ocupe toda la pantalla; deja ver el contenido antes */
  .hero { min-height: auto; }
  .hero__inner { padding-block: 2.2rem 2.6rem; }
  .hero__eyebrow { font-size: .7rem; padding: 4px 12px; }
  .hero__title { font-size: clamp(1.9rem, 8.5vw, 2.5rem); margin-bottom: .8rem; }
  .hero__subtitle { font-size: .98rem; margin-bottom: 1.3rem; }
  .hero__scroll { display: none; }

  /* Buscador del hero a ancho completo y cómodo */
  .hero-search { max-width: 100%; }
  .hero-pills { gap: .5rem; }
  .hero-pill { padding: 8px 14px; font-size: .9rem; }

  /* Secciones con encabezado un poco más compacto */
  .section__head { margin-bottom: 1.6rem; }
}

/* =========================================================
   MEJORAS UX/UI · estados de carga, scroll-spy, back-to-top
   ========================================================= */

/* ---- Esqueletos de carga (perceived performance) ----
   Se muestran mientras el inventario llega desde la API; evitan
   el "salto" de una cuadrícula vacía a una llena. */
@keyframes skeleton-shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.skeleton {
  position: relative;
  background: linear-gradient(
    100deg,
    var(--color-gray-light) 30%,
    rgba(255, 255, 255, .55) 50%,
    var(--color-gray-light) 70%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s ease-in-out infinite;
  border-radius: var(--radius-sm);
}
:root[data-theme="dark"] .skeleton {
  background: linear-gradient(
    100deg,
    #20252c 30%,
    #2c333c 50%,
    #20252c 70%
  );
  background-size: 200% 100%;
}
.car-card--skeleton { pointer-events: none; }
.car-card--skeleton .car-card__media { aspect-ratio: 16 / 10; }
.skeleton-line { height: 14px; border-radius: var(--radius-sm); }
.skeleton-line--title { height: 20px; width: 75%; }
.skeleton-line--price { height: 26px; width: 45%; }
.skeleton-line--specs { width: 90%; }
.skeleton-actions { height: 46px; border-radius: var(--radius); margin-top: .4rem; }
@media (prefers-reduced-motion: reduce) {
  .skeleton { animation: none; }
}

/* ---- Estado vacío con acción para limpiar filtros ---- */
.empty-state__icon { font-size: 2.6rem; display: block; margin-bottom: .6rem; }
.empty-state__title { font-weight: 800; color: var(--color-text); margin: 0 0 .3rem; }
.empty-state .btn { margin-top: 1.2rem; }

/* ---- Enlace de navegación activo (scroll-spy) ---- */
.main-nav a.is-active {
  color: var(--color-yellow);
  border-bottom-color: var(--color-yellow);
}
.main-nav .main-nav__cta.is-active { color: #fff; border-bottom-color: transparent; }
@media (max-width: 820px) {
  .main-nav a.is-active { color: var(--color-yellow); }
}

/* ---- Botón "Volver arriba" ---- */
.to-top {
  position: fixed;
  right: 18px;
  bottom: 84px; /* justo encima del botón flotante de WhatsApp */
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  background: var(--color-dark);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 50%;
  box-shadow: var(--shadow);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity .3s ease, transform .3s ease, visibility .3s ease, background .25s ease;
  z-index: 90;
}
.to-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { background: var(--color-red); transform: translateY(-2px); }
.to-top svg { width: 22px; height: 22px; }
@media (max-width: 560px) {
  .to-top { width: 42px; height: 42px; bottom: 80px; }
}
@media (prefers-reduced-motion: reduce) {
  .to-top { transition: opacity .2s ease, visibility .2s ease; transform: none; }
  .to-top.is-visible { transform: none; }
  .to-top:hover { transform: none; }
}

/* =========================================================
   AUDITORÍA UX · pulido de tarjetas del catálogo y home
   ========================================================= */

/* ---- Tarjeta de auto: foto clickeable y mayor definición ---- */
.car-card { border: 1px solid var(--color-gray-light); }
.car-card__media { cursor: pointer; }
/* Pista visual al pasar el cursor sobre la foto (abre el detalle). */
.car-card__media::after {
  content: "Ver detalle";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(10, 11, 13, .42);
  color: #fff;
  font-weight: 800;
  letter-spacing: .02em;
  opacity: 0;
  transition: opacity .25s ease;
}
.car-card__media:hover::after { opacity: 1; }
/* Título a máximo 2 líneas para que las tarjetas queden parejas. */
.car-card__title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
:root[data-theme="dark"] .car-card { border-color: rgba(255, 255, 255, .08); }

@media (prefers-reduced-motion: reduce) {
  .car-card__media::after { transition: none; }
}

/* ---- Home: encabezados de sección con mejor jerarquía y aire ---- */
.section__eyebrow { display: inline-block; }
.hero-search { width: 100%; }
/* Mejora el contraste del subtítulo del hero sobre la imagen. */
.hero__subtitle { text-shadow: 0 1px 12px rgba(0, 0, 0, .35); }
.hero__title { text-shadow: 0 2px 18px rgba(0, 0, 0, .35); }

/* Banda de valores: tarjetas con leve fondo para definirlas mejor. */
.value {
  background: var(--color-bg);
  border-radius: var(--radius);
  border: 1px solid var(--color-gray-light);
}
:root[data-theme="dark"] .value { border-color: rgba(255, 255, 255, .07); }

/* Carrusel de destacados: deja respirar la primera tarjeta y el scrollbar. */
@media (min-width: 720px) {
  .carousel > .car-card { flex-basis: clamp(280px, 30%, 320px); }
}

/* =========================================================
   CTA: VENDE O CAMBIA TU AUTO
   ========================================================= */
.sell-cta {
  padding: clamp(3rem, 8vw, 5rem) 0;
}

.sell-cta__card {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  align-items: stretch;
  gap: 0;
  max-width: 980px;
  margin: 0 auto;
  background: var(--color-bg);
  border: 1px solid var(--color-gray-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.sell-cta__content {
  padding: clamp(2rem, 5vw, 3.5rem);
}

.sell-cta__eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--color-red);
  margin-bottom: 0.6rem;
  text-transform: uppercase;
}

.sell-cta__title {
  font-size: clamp(1.7rem, 4vw, 2.3rem);
  font-weight: 900;
  line-height: 1.15;
  color: var(--color-text);
  margin: 0 0 0.8rem;
}

.sell-cta__text {
  font-size: 1rem;
  color: var(--color-text-muted);
  margin: 0 0 1.4rem;
  max-width: 46ch;
}

.sell-cta__list {
  list-style: none;
  padding: 0;
  margin: 0 0 1.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  font-weight: 600;
  color: var(--color-text);
}

.sell-cta__media {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: linear-gradient(135deg, var(--color-red), #ff5a36);
}

.sell-cta__badge {
  font-size: clamp(1.1rem, 2.6vw, 1.5rem);
  font-weight: 900;
  text-align: center;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.3;
  text-shadow: 0 2px 14px rgba(0, 0, 0, .25);
}

@media (max-width: 720px) {
  .sell-cta__card { grid-template-columns: 1fr; }
  .sell-cta__media { order: -1; min-height: 120px; padding: 1.5rem; }
}

:root[data-theme="dark"] .sell-cta__card {
  background: var(--color-dark-soft);
  border-color: rgba(255, 255, 255, 0.08);
}

/* =========================================================
   ÚLTIMA GENERACIÓN 2026 · Aurora, glass refinado y
   micro-detalles (selección, scrollbar, progreso de lectura)
   ========================================================= */

/* ---- Tokens refinados ---- */
:root {
  --grad-brand: linear-gradient(100deg, var(--color-yellow) 0%, #ffb340 45%, var(--color-red) 100%);
  --ring: 0 0 0 3px rgba(255, 56, 56, .18);
  --radius-xl: 28px;
}
:root[data-theme="dark"] {
  --ring: 0 0 0 3px rgba(255, 214, 10, .22);
}

/* ---- Micro-detalles globales ---- */
::selection { background: var(--color-yellow); color: var(--color-dark); }

html { scrollbar-color: #3a4149 transparent; }
body::-webkit-scrollbar { width: 10px; }
body::-webkit-scrollbar-thumb {
  background: #3a4149;
  border-radius: 8px;
  border: 2px solid transparent;
  background-clip: content-box;
}

/* Titulares mejor repartidos y párrafos sin viudas incómodas */
h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }

/* ---- Barra de progreso de lectura (scroll-driven, sin JS) ---- */
.scroll-progress {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 300;
  background: var(--grad-brand);
  transform-origin: 0 50%;
  transform: scaleX(0);
  pointer-events: none;
}
@supports (animation-timeline: scroll()) {
  .scroll-progress {
    display: block;
    animation: scroll-progress-grow linear both;
    animation-timeline: scroll(root);
  }
}
@keyframes scroll-progress-grow {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}

/* =========================================================
   HERO · Aurora dinámica + grano cinematográfico
   ========================================================= */

/* Color grading sobre la imagen: tinte cálido de marca */
.hero__overlay {
  background:
    radial-gradient(60% 90% at 85% 10%, rgba(255, 56, 56, .18), transparent 60%),
    radial-gradient(50% 80% at 8% 90%, rgba(255, 214, 10, .12), transparent 55%),
    linear-gradient(90deg, rgba(8, 9, 11, .94) 0%, rgba(8, 9, 11, .62) 45%, rgba(8, 9, 11, .18) 100%);
}

/* Aurora: dos manchas de luz que respiran lentamente */
.hero__overlay::before,
.hero__overlay::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  pointer-events: none;
  mix-blend-mode: screen;
}
.hero__overlay::before {
  width: 520px;
  height: 520px;
  top: -180px;
  right: -100px;
  background: radial-gradient(circle, rgba(255, 214, 10, .30), transparent 65%);
  animation: aurora-a 12s ease-in-out infinite;
}
.hero__overlay::after {
  width: 460px;
  height: 460px;
  bottom: -200px;
  left: 12%;
  background: radial-gradient(circle, rgba(255, 56, 56, .26), transparent 65%);
  animation: aurora-b 16s ease-in-out infinite;
}
@keyframes aurora-a {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); opacity: .8; }
  50%      { transform: translate3d(-50px, 46px, 0) scale(1.15); opacity: 1; }
}
@keyframes aurora-b {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); opacity: .7; }
  50%      { transform: translate3d(60px, -34px, 0) scale(1.12); opacity: 1; }
}

/* Grano sutil (SVG inline) para textura cinematográfica */
.hero::after {
  content: "";
  display: block;
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
  background-size: 160px 160px;
  opacity: .55;
  pointer-events: none;
}

/* Eyebrow: chip de cristal con punto "en vivo" */
.hero__eyebrow {
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .16);
  color: #f4f5f7;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  font-weight: 700;
  letter-spacing: .1em;
  padding: 7px 16px;
}
.hero__eyebrow::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-yellow);
  box-shadow: 0 0 0 0 rgba(255, 214, 10, .6);
  animation: live-dot 2.2s ease-out infinite;
}
@keyframes live-dot {
  0%   { box-shadow: 0 0 0 0 rgba(255, 214, 10, .55); }
  70%  { box-shadow: 0 0 0 9px rgba(255, 214, 10, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 214, 10, 0); }
}

/* Título: acento con degradado de marca (texto recortado) */
.hero__title span {
  background: linear-gradient(95deg, var(--color-yellow) 10%, #ffb340 55%, #ff7a45 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* =========================================================
   SECCIONES · jerarquía y acentos degradados
   ========================================================= */
.section__title::after {
  width: 72px;
  height: 5px;
  border-radius: 999px;
  background: var(--grad-brand);
}
.section__link {
  background: var(--grad-brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.section__link:hover { text-decoration: none; filter: brightness(1.12); }

/* ---- Valores: tarjetas glass con chip de icono degradado ---- */
.value {
  background: var(--color-bg);
  border-radius: var(--radius-lg);
  padding: 1.6rem 1.1rem 1.4rem;
  transition: transform .45s cubic-bezier(.16, 1, .3, 1),
              box-shadow .45s cubic-bezier(.16, 1, .3, 1),
              border-color .45s cubic-bezier(.16, 1, .3, 1);
}
.value:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow);
  border-color: rgba(255, 56, 56, .25);
}
:root[data-theme="dark"] .value:hover { border-color: rgba(255, 214, 10, .28); }
.value__icon {
  width: 62px;
  height: 62px;
  display: inline-grid;
  place-items: center;
  font-size: 1.9rem;
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(255, 214, 10, .14), rgba(255, 56, 56, .12));
  border: 1px solid rgba(255, 56, 56, .14);
  margin-bottom: .5rem;
}

/* ---- Banda de estadísticas: hairlines degradadas + brillo radial ---- */
.stats {
  position: relative;
  background:
    radial-gradient(70% 120% at 50% 0%, rgba(255, 56, 56, .10), transparent 60%),
    var(--color-dark);
}
.stats::before,
.stats::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 214, 10, .5), rgba(255, 56, 56, .5), transparent);
}
.stats::before { top: 0; }
.stats::after { bottom: 0; }

/* =========================================================
   TARJETAS DE AUTO · borde luminoso y profundidad
   ========================================================= */
.car-card { border-radius: var(--radius-lg); }
.car-card:hover {
  box-shadow:
    0 24px 50px rgba(11, 13, 16, .16),
    0 0 0 1px rgba(255, 56, 56, .22);
}
:root[data-theme="dark"] .car-card:hover {
  box-shadow:
    0 24px 50px rgba(0, 0, 0, .55),
    0 0 0 1px rgba(255, 214, 10, .26);
}
.car-card__badge { letter-spacing: .05em; }

/* =========================================================
   FORMULARIOS · anillos de enfoque modernos
   ========================================================= */
.filter-bar input:focus,
.filter-bar select:focus,
.form-field input:focus,
.form-field textarea:focus {
  box-shadow: var(--ring);
}
.filter-bar { border-radius: var(--radius-lg); }
.contact-form { border-radius: var(--radius-lg); }

/* =========================================================
   FAQ · superficie suave con acento al abrir
   ========================================================= */
.faq__item { border-radius: var(--radius-lg); }
.faq__item:hover { border-color: rgba(255, 56, 56, .28); }
.faq__item.is-open { border-color: rgba(255, 56, 56, .35); }
:root[data-theme="dark"] .faq__item:hover,
:root[data-theme="dark"] .faq__item.is-open { border-color: rgba(255, 214, 10, .3); }

/* =========================================================
   HEADER Y FOOTER · hairlines degradadas
   ========================================================= */
.site-header { border-bottom: 0; }
.site-header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 2%, rgba(255, 214, 10, .35), rgba(255, 56, 56, .35), transparent 98%);
  pointer-events: none;
}
.site-header { position: sticky; }

.site-footer { position: relative; }
.site-footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 2%, rgba(255, 214, 10, .3), rgba(255, 56, 56, .3), transparent 98%);
}

/* =========================================================
   MODAL · cristal y radios amplios
   ========================================================= */
.modal {
  background: rgba(5, 6, 8, .6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.modal__dialog { border-radius: var(--radius-xl); }

/* =========================================================
   CTA VENDE · panel oscuro premium con aurora propia
   ========================================================= */
.sell-cta__media {
  background:
    radial-gradient(80% 110% at 80% 15%, rgba(255, 214, 10, .35), transparent 60%),
    linear-gradient(150deg, var(--color-red) 0%, #b81111 100%);
}

/* =========================================================
   ACCESIBILIDAD · menos movimiento
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  .hero__overlay::before,
  .hero__overlay::after { animation: none; }
  .hero__eyebrow::before { animation: none; }
  .scroll-progress { display: none; }
}

/* =========================================================
   REVELADO ESCALONADO · sin estilos inline (CSP estricta)
   El retardo se deriva de la posición del elemento; el JS puede
   sobreescribirlo con style.setProperty (tarjetas del catálogo).
   ========================================================= */
[data-reveal]:nth-child(2) { --reveal-index: 1; }
[data-reveal]:nth-child(3) { --reveal-index: 2; }
[data-reveal]:nth-child(4) { --reveal-index: 3; }
[data-reveal]:nth-child(5) { --reveal-index: 4; }
[data-reveal]:nth-child(6) { --reveal-index: 5; }

/* El antetítulo va en su propia línea (el título es inline-block) */
.section__head .section__eyebrow { display: block; }

/* =========================================================
   AUTOS VENDIDOS · listón, foto atenuada y estado en detalle
   ========================================================= */

/* Foto en escala de grises suave: se nota vendido sin ocultar el auto. */
.car-card--sold .car-card__media img {
  filter: grayscale(.85) contrast(.96);
  opacity: .9;
}
.car-card--sold:hover .car-card__media img { transform: none; }

/* Listón diagonal "VENDIDO" sobre la esquina de la foto. */
.car-card--sold .car-card__media::before {
  content: "VENDIDO";
  position: absolute;
  top: 22px;
  right: -44px;
  transform: rotate(35deg);
  background: linear-gradient(135deg, #1f2937, #0b0d10);
  color: #fff;
  font-family: var(--font-title);
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: .14em;
  padding: 7px 52px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .35);
  z-index: 3;
  pointer-events: none;
}

/* Chip de estado en tarjeta y detalle. */
.car-card__ask--sold,
.modal__ask--sold {
  color: #4b5563;
  background: rgba(107, 114, 128, .14);
}
:root[data-theme="dark"] .car-card__ask--sold,
:root[data-theme="dark"] .modal__ask--sold {
  color: #cbd5e1;
  background: rgba(148, 163, 184, .14);
}
.modal__badge--sold { background: linear-gradient(135deg, #1f2937, #0b0d10); }

/* La tarjeta vendida baja un poco su presencia frente a las disponibles. */
.car-card--sold { border-style: dashed; }
.car-card--sold:hover {
  box-shadow: var(--shadow);
  border-color: var(--color-gray-light);
}
