/* ========================================
   VARIABLES
   Azul marino y crema = del logo · Amarillo/dorado = acción principal · Verde = abre WhatsApp
   ======================================== */
:root {
  --ink: #101b33;
  --muted: #56627a;
  --azul: #163a63;
  --azul-oscuro: #0f233c;
  --azul-claro: #e9eef4;
  --crema: #ece2c6;
  --amarillo: #e7b53c;
  --amarillo-hover: #d4a02a;
  --wa: #128c4a;
  --wa-hover: #0e7a40;
  --fondo: #eef2f8;
  --papel: #ffffff;
  --linea: #d3dbea;

  --fuente-titulo: "Bricolage Grotesque", system-ui, -apple-system, "Segoe UI", sans-serif;
  --fuente: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ancho: 1200px;
}

/* ========================================
   BASE
   ======================================== */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  font-family: var(--fuente);
  font-size: 1rem;
  line-height: 1.55;
  background: var(--fondo);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: var(--azul); }
ul, ol { padding: 0; list-style: none; }

h1, h2, h3 { font-family: var(--fuente-titulo); line-height: 1.1; letter-spacing: -0.01em; }
h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); font-weight: 800; }
h3 { font-weight: 700; }

:focus-visible { outline: 3px solid var(--azul); outline-offset: 2px; }
.header :focus-visible,
.contacto :focus-visible { outline-color: #fff; }
.banda :focus-visible { outline-color: var(--ink); }
.hero .panel :focus-visible { outline-color: var(--azul); }
.hero :focus-visible { outline-color: #fff; }

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

.saltar {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  background: var(--amarillo); color: var(--ink); padding: .6rem 1rem; border-radius: 8px; font-weight: 600;
}
.saltar:focus { top: 1rem; }

/* Las secciones con ancla no quedan tapadas por el encabezado fijo */
[id] { scroll-margin-top: 1rem; }
@media (min-width: 900px) { [id] { scroll-margin-top: 5rem; } }

/* ========================================
   LAYOUT GENERAL
   ======================================== */
.contenedor {
  max-width: var(--ancho);
  margin-inline: auto;
  padding-inline: 1.25rem;
}
.seccion { padding-block: 3.5rem; }
.seccion h2 { margin-bottom: 1.5rem; }

/* ========================================
   BOTONES
   ======================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: .85rem 1.5rem;
  border: 0; border-radius: 8px;
  font: 600 1rem/1.2 var(--fuente);
  text-decoration: none; text-align: center;
  cursor: pointer;
  transition: background-color .15s;
}
.btn--bloque { width: 100%; padding-inline: 1rem; }
.btn--amarillo { background: var(--amarillo); color: var(--ink); }
.btn--amarillo:hover { background: var(--amarillo-hover); }
.btn--azul { background: var(--azul); color: #fff; }
.btn--azul:hover { background: var(--azul-oscuro); }
.btn--oscuro { background: var(--azul-oscuro); color: #fff; }
.btn--oscuro:hover { background: var(--ink); }
.btn--wa { background: var(--wa); color: #fff; }
.btn--wa:hover { background: var(--wa-hover); }

.btn-texto {
  background: none; border: 0; padding: .25rem 0;
  color: var(--azul); font: 600 .95rem var(--fuente);
  text-decoration: underline; cursor: pointer; justify-self: start;
}

/* ========================================
   ENCABEZADO
   ======================================== */
.header { background: var(--azul-oscuro); color: #fff; }

.header__inner {
  max-width: var(--ancho); margin-inline: auto;
  padding: .75rem 1.25rem;
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.5rem;
}

.logo {
  display: flex; align-items: center; gap: .6rem;
  color: #fff; text-decoration: none;
  margin-right: auto;
}

.logo__img {
  width: 72px; height: 72px; border-radius: 50%;
  object-fit: cover; flex-shrink: 0;
}

.logo__texto {
  font: 800 1.35rem/1 var(--fuente-titulo);
  letter-spacing: -0.02em;
}

.nav {
  order: 3; width: 100%;
  display: flex; gap: 1.25rem; overflow-x: auto; padding-block: .25rem;
}
.nav a {
  color: var(--crema); text-decoration: none; font-weight: 500; white-space: nowrap;
}
.nav a:hover { color: #fff; text-decoration: underline; text-underline-offset: 4px; }

.header__wa {
  background: var(--wa); color: #fff; text-decoration: none;
  padding: .5rem 1rem; border-radius: 8px; font-weight: 600; font-size: .95rem;
}
.header__wa:hover { background: var(--wa-hover); }

@media (min-width: 900px) {
  .header { position: sticky; top: 0; z-index: 50; }
  .header__inner { flex-wrap: nowrap; padding-block: .9rem; }
  .logo { margin-right: 0; }
  .nav { order: 0; width: auto; margin-left: auto; overflow: visible; }
}

/* ========================================
   BANDA DE MARCAS (deslizante)
   ======================================== */
.marcas-ticker {
  background: var(--papel); overflow: hidden; position: relative;
  padding: 1.5rem 0; border-block: 1px solid var(--linea);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}

.marcas-ticker__pista {
  display: flex; width: max-content; gap: 3.5rem; align-items: center;
  animation: desfile-marcas 32s linear infinite;
}

.marcas-ticker__pista:hover { animation-play-state: paused; }

.marcas-ticker__item {
  display: flex; align-items: center; justify-content: center;
  background: none; border: 0; padding: 0; cursor: pointer;
  opacity: .85; transition: opacity .15s, transform .15s;
}
.marcas-ticker__item:hover,
.marcas-ticker__item:focus-visible { opacity: 1; transform: scale(1.06); }

.marcas-ticker__logo {
  width: 80px; height: 80px; border-radius: 50%;
  background: var(--azul-claro); object-fit: contain; padding: 11px;
  flex-shrink: 0; border: 1px solid var(--linea);
}

@keyframes desfile-marcas {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  .marcas-ticker__pista { animation: none; overflow-x: auto; scrollbar-width: none; }
  .marcas-ticker__pista::-webkit-scrollbar { display: none; }
}

/* ========================================
   INICIO: COMPRAR O VENDER
   ======================================== */
.hero {
  background: var(--azul-oscuro);
  color: #fff;
  padding: 2.5rem 1.25rem 3.5rem;
  position: relative;
}

/* Línea de carril, el único adorno de la página */
.hero::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: 0; height: 6px;
  background: repeating-linear-gradient(90deg, var(--amarillo) 0 36px, transparent 36px 60px);
}

.hero__inner {
  max-width: calc(var(--ancho) - 2.5rem); margin-inline: auto;
  display: grid; gap: 2rem; align-items: center;
}

.hero h1 {
  font-size: clamp(2.2rem, 5.2vw, 3.6rem);
  font-weight: 800; letter-spacing: -0.025em;
  margin-bottom: 1rem;
}

.hero__sub { font-size: 1.1rem; color: var(--crema); max-width: 34rem; margin-bottom: 1.5rem; }

.hero__puntos { display: grid; gap: .55rem; }
.hero__puntos li { padding-left: 1.6rem; position: relative; font-weight: 500; }
.hero__puntos li::before {
  content: ""; position: absolute; left: 0; top: .35em;
  width: .9rem; height: .5rem;
  border-left: 3px solid var(--amarillo); border-bottom: 3px solid var(--amarillo);
  transform: rotate(-45deg);
}

@media (min-width: 900px) {
  .hero { padding: 4rem 1.25rem 5rem; }
  .hero__inner { grid-template-columns: 1.1fr .9fr; gap: 4rem; }
}

/* Panel con pestañas */
.panel {
  background: var(--papel); color: var(--ink);
  border-radius: 16px; padding: 1.25rem;
  box-shadow: 0 18px 40px rgba(4, 16, 48, .35);
}

.tabs {
  display: grid; grid-template-columns: 1fr 1fr; gap: .25rem;
  background: var(--azul-claro); padding: .25rem; border-radius: 10px;
  margin-bottom: 1.25rem;
}
.tab {
  padding: .75rem .5rem; border: 0; border-radius: 8px;
  background: transparent; color: var(--azul-oscuro);
  font: 600 1rem var(--fuente); cursor: pointer;
  transition: background-color .15s, color .15s;
}
.tab:hover { background: rgba(10, 46, 110, .08); }
.tab[aria-selected="true"] { background: var(--azul-oscuro); color: #fff; }

.panel__titulo { font-size: 1.35rem; font-weight: 700; }

/* ========================================
   FORMULARIOS
   ======================================== */
.form { display: grid; gap: 1rem; }

.form--vender { grid-template-columns: 1fr 1fr; gap: .9rem; }
.form--vender .campo--ancho,
.form--vender .btn,
.form--vender .form__ayuda { grid-column: 1 / -1; }

.campo label,
.grupo legend { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .3rem; }

.campo input,
.campo select {
  width: 100%; padding: .75rem .85rem;
  border: 1.5px solid var(--linea); border-radius: 8px;
  font: inherit; background: #fff; color: var(--ink);
}
.campo input:focus,
.campo select:focus { outline: none; border-color: var(--azul); box-shadow: 0 0 0 3px rgba(22, 58, 99, .2); }
.campo input::placeholder { color: #8a95ab; }

.form__ayuda { font-size: .9rem; color: var(--muted); }

/* ========================================
   CÓMO FUNCIONA
   ======================================== */
.caminos { display: grid; gap: 1.25rem; }

.camino {
  background: var(--papel); border: 1px solid var(--linea); border-radius: 12px;
  padding: 1.75rem;
  display: flex; flex-direction: column; gap: 1.25rem; align-items: flex-start;
}
.camino h3 { font-size: 1.4rem; }

.pasos { display: grid; gap: 1rem; counter-reset: paso; flex: 1; }
.pasos li {
  counter-increment: paso;
  display: grid; grid-template-columns: 2rem 1fr; column-gap: .9rem;
}
.pasos li::before {
  content: counter(paso);
  grid-row: span 2;
  width: 2rem; height: 2rem; border-radius: 50%;
  background: var(--azul-claro); color: var(--azul-oscuro);
  display: grid; place-items: center; font-weight: 700;
}
.pasos strong { line-height: 2rem; }
.pasos span { color: var(--muted); grid-column: 2; }

@media (min-width: 800px) {
  .caminos { grid-template-columns: 1fr 1fr; gap: 1.5rem; }
}

/* ========================================
   INVENTARIO
   ======================================== */
.seccion__cab {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between;
  gap: .25rem 1rem; margin-bottom: 1.5rem;
}
.seccion__cab h2 { margin-bottom: 0; }
.conteo { color: var(--muted); font-weight: 500; }

.catalogo { display: grid; gap: 1.25rem; align-items: start; }

.filtros {
  background: var(--papel); border: 1px solid var(--linea); border-radius: 12px;
}
.filtros summary {
  padding: .9rem 1.1rem; font-weight: 700; cursor: pointer; list-style: none;
  display: flex; justify-content: space-between; align-items: center;
}
.filtros summary::-webkit-details-marker { display: none; }
.filtros summary::after {
  content: ""; width: .6rem; height: .6rem;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(45deg); margin-top: -.2rem; transition: transform .15s;
}
.filtros[open] summary::after { transform: rotate(-135deg); margin-top: .2rem; }

.filtros__cuerpo { padding: 0 1.1rem 1.1rem; display: grid; gap: 1.1rem; }

.grupo { border: 0; padding: 0; min-width: 0; }

.marcas { display: grid; gap: .1rem; max-height: 320px; overflow-y: auto; }
.marca {
  display: flex; align-items: center; gap: .65rem;
  padding: .45rem .4rem; border-radius: 6px; cursor: pointer;
}
.marca:hover { background: var(--fondo); }
.marca input { width: 1.1rem; height: 1.1rem; accent-color: var(--azul); cursor: pointer; }
.marca span { margin-left: auto; color: var(--muted); font-size: .85rem; }

@media (min-width: 900px) {
  .catalogo { grid-template-columns: 260px 1fr; gap: 2rem; }
  .filtros { position: sticky; top: 5.5rem; }
  .filtros summary { display: none; }
  .filtros__cuerpo { padding-top: 1.1rem; }
}

/* Tarjetas */
.autos {
  display: grid; gap: 1.25rem; align-items: stretch;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}

.auto {
  background: var(--papel); border: 1px solid var(--linea); border-radius: 12px;
  overflow: hidden; display: flex; flex-direction: column;
  transition: border-color .15s;
}
.auto:hover { border-color: var(--azul); }

.auto__foto { position: relative; aspect-ratio: 4 / 3; background: var(--azul-claro); }
.auto__foto img { width: 100%; height: 100%; object-fit: cover; }

.auto__descuento {
  position: absolute; top: .6rem; left: .6rem;
  background: var(--amarillo); color: var(--ink);
  font-weight: 700; font-size: .85rem;
  padding: .25rem .55rem; border-radius: 6px;
}

.auto__cuerpo { padding: 1rem 1.1rem 1.1rem; display: flex; flex-direction: column; gap: .6rem; flex: 1; }
.auto__nombre { font-size: 1.25rem; }

.auto__datos { display: flex; flex-wrap: wrap; gap: .4rem; }
.auto__datos li {
  background: var(--azul-claro); color: var(--azul-oscuro);
  padding: .2rem .6rem; border-radius: 6px; font-size: .85rem; font-weight: 500;
}

.auto__precio {
  font: 800 1.55rem/1.1 var(--fuente-titulo); letter-spacing: -0.01em;
  color: var(--azul); margin-top: .2rem;
}
.auto__precio s { display: block; margin-top: .25rem; font: 500 .9rem var(--fuente); color: var(--muted); }

.auto .btn { margin-top: auto; }

.vacio {
  grid-column: 1 / -1;
  padding: 2.5rem 1.5rem; text-align: center;
  border: 1.5px dashed var(--linea); border-radius: 12px; background: var(--papel);
  display: grid; gap: .5rem; justify-items: center;
}
.vacio p { max-width: 32rem; color: var(--muted); }
.vacio strong { color: var(--ink); font-size: 1.15rem; }
.vacio__acciones { display: flex; flex-wrap: wrap; gap: .75rem; justify-content: center; margin-top: .75rem; }

/* ========================================
   BANDA: VENDER
   ======================================== */
.banda { background: var(--amarillo); color: var(--ink); padding: 2.5rem 1.25rem; }
.banda__inner {
  max-width: calc(var(--ancho) - 2.5rem); margin-inline: auto;
  display: grid; gap: 1.25rem; align-items: center;
}
.banda h2 { margin-bottom: .4rem; }
.banda p { max-width: 38rem; }

@media (min-width: 800px) {
  .banda__inner { grid-template-columns: 1fr auto; gap: 2rem; }
}

/* ========================================
   SERVICIOS Y NOSOTROS
   ======================================== */
.dos-col { display: grid; gap: 3rem; }

.servicios li {
  display: grid; gap: .1rem;
  padding: 1rem 0; border-top: 1px solid var(--linea);
}
.servicios li:last-child { border-bottom: 1px solid var(--linea); }
.servicios span { color: var(--muted); }

.texto { max-width: 34rem; }
.texto + .texto { margin-top: .75rem; }

@media (min-width: 900px) {
  .dos-col { grid-template-columns: 1.3fr 1fr; gap: 5rem; }
}

/* ========================================
   CONTACTO Y PIE
   ======================================== */
.contacto { background: var(--azul-oscuro); color: #fff; padding: 3rem 1.25rem; }
.contacto__inner {
  max-width: calc(var(--ancho) - 2.5rem); margin-inline: auto;
  display: grid; gap: 1.5rem; align-items: center;
}
.contacto h2 { margin-bottom: .5rem; }
.contacto p { color: var(--crema); }
.contacto__datos { margin-top: 1rem; display: grid; gap: .25rem; }
.contacto a:not(.btn) { color: #fff; }

@media (min-width: 800px) {
  .contacto__inner { grid-template-columns: 1fr auto; gap: 2rem; }
}

.footer {
  background: var(--ink); color: #b9c4dc;
  text-align: center; padding: 1.25rem; font-size: .9rem;
}

/* ========================================
   AJUSTES PARA CELULAR
   ======================================== */
@media (max-width: 899px) {
  /* El panel de comprar/vender es lo primero que se debe ver */
  .hero { padding-top: 1.75rem; }
  .hero h1 { font-size: clamp(1.9rem, 8vw, 2.4rem); margin-bottom: .75rem; }
  .hero__sub { font-size: 1rem; margin-bottom: 0; }
  .hero__puntos { display: none; }
}

@media (max-width: 520px) {
  .nav { gap: 1rem; }
  .nav a { font-size: .95rem; }
  .tab { font-size: .95rem; padding-inline: .25rem; }
  .form--vender { grid-template-columns: 1fr; }
  .panel { padding: 1rem; }
  .camino { padding: 1.25rem; }
  .btn:not(.btn--bloque) { width: 100%; }
}
