/* vehiculos.css - Catálogo de vehículos */

/* ========================================================= */
/* TEMA: un toque menos dark que la portada                  */
/* ========================================================= */
body.page-catalogo {
  --bg: #181a1f;
  --bg-texture: radial-gradient(ellipse at 50% 0%, rgba(212, 175, 55, 0.04) 0%, transparent 60%);
  --card: #23262e;
  --glass: rgba(255, 255, 255, 0.04);
  --muted: #b9bcc4;
  --shadow-1: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-2: 0 4px 12px rgba(0, 0, 0, 0.32);
  background: var(--bg);
  background-image: var(--bg-texture);
}

/* ========================================================= */
/* FONDO DE SECCIÓN (imagen abstracta B/N)                   */
/* ========================================================= */
.catalogo-section {
  scroll-margin-top: var(--nav-height);
  background-color: var(--bg);
  background-image: var(--bg-texture), linear-gradient(rgba(24, 26, 31, 0.55), rgba(24, 26, 31, 0.55)), url("../assets/fondo-catalogo.jpg");
  background-size: auto, auto, cover;
  background-position: center, center, center;
  background-repeat: no-repeat, no-repeat, no-repeat;
  position: relative;
}
.catalogo-section::before,
.catalogo-section::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 80px;
  pointer-events: none;
}
.catalogo-section::before {
  top: 0;
  background: linear-gradient(to bottom, var(--bg), transparent);
}
.catalogo-section::after {
  bottom: 0;
  background: linear-gradient(to top, var(--bg), transparent);
}
.catalogo-section .container {
  position: relative;
  z-index: 1;
  padding-top: 1.25rem;
}
.catalogo-filtros {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.5rem;
  padding: 1rem;
  background: var(--glass);
  border: 1px solid rgba(212, 175, 55, 0.12);
  border-radius: var(--radius);
}
.filtro-input,
.filtro-select {
  flex: 1 1 150px;
  min-width: 130px;
  padding: 0.55rem 0.7rem;
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
}
.filtro-input:focus,
.filtro-select:focus {
  border-color: var(--accent);
}
.filtro-input::placeholder {
  color: var(--muted);
}
.catalogo-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 1rem;
}
.catalogo-toolbar label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
}
.catalogo-toolbar .filtro-select {
  flex: 0 0 auto;
  min-width: auto;
  padding: 0.3rem 0.5rem;
}
.catalogo-mas {
  text-align: center;
  margin-top: 2rem;
}
#ver-mas {
  padding: 0.7rem 2rem;
}

body.page-catalogo footer {
  margin-top: 0;
  position: relative;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}
body.page-catalogo.loading footer {
  opacity: 0;
  visibility: hidden;
}
body.page-catalogo.loading #vehiculos-container {
  min-height: 55vh;
}
body.page-catalogo #vehiculos-container {
  position: relative;
}
/* Skeleton como overlay: crossfade suave hacia las tarjetas reales */
body.page-catalogo #skeleton-container {
  position: absolute;
  inset: 0;
  z-index: 2;
  margin-top: 0;
  pointer-events: none;
  background: var(--bg);
}
body.page-catalogo .card.fade-in {
  transition: opacity 0.6s cubic-bezier(0.2, 0.8, 0.2, 1),
              transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Skeleton profesional: fiel a la tarjeta real + shimmer dorado sutil */
body.page-catalogo .skeleton-card {
  display: flex;
  flex-direction: column;
}
body.page-catalogo .skeleton-img {
  height: 240px;
  background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(212,175,55,0.16) 50%, rgba(255,255,255,0.04) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.6s ease-in-out infinite;
}
body.page-catalogo .skeleton-body {
  gap: 0.55rem;
  flex: 1;
}
body.page-catalogo .skeleton-line {
  height: 12px;
  border-radius: 999px;
  margin: 0 auto;
  background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(212,175,55,0.16) 50%, rgba(255,255,255,0.04) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.6s ease-in-out infinite;
}
body.page-catalogo .skeleton-line.w-90 { width: 90%; }
body.page-catalogo .skeleton-line.w-80 { width: 80%; }
body.page-catalogo .skeleton-line.w-45 { width: 45%; }
body.page-catalogo .skeleton-price {
  height: 16px;
  width: 42%;
  margin: 0.5rem auto 0;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(212,175,55,0.22) 50%, rgba(255,255,255,0.04) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.6s ease-in-out infinite;
}
body.page-catalogo .skeleton-actions {
  display: flex;
  justify-content: center;
  gap: 0.6rem;
  margin-top: 0.45rem;
  padding-top: 0.9rem;
  border-top: 1px solid rgba(255,255,255,0.05);
}
/* Fade superior del footer hacia el fondo de la sección */
body.page-catalogo footer::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 90px;
  background: linear-gradient(to bottom, var(--bg), transparent);
  pointer-events: none;
}
body.page-catalogo footer p {
  position: relative;
  z-index: 1;
}

/* ========================================================= */
/* RESPONSIVE                                                 */
/* ========================================================= */
@media (min-width: 901px) {
  #result-count {
    display: none;
  }
}
@media (max-width: 900px) {
  .filtro-input,
  .filtro-select {
    flex: 1 1 45%;
    min-width: 0;
    padding: 0.45rem 0.55rem;
    font-size: 0.85rem;
  }
  .catalogo-toolbar {
    display: none;
  }
}
@media (max-width: 480px) {
  .catalogo-filtros {
    flex-direction: column;
  }
  .filtro-input,
  .filtro-select {
    width: 100%;
    min-width: 0;
  }
}
