
/* =============================
   🎯 Estilos exclusivos para buscar.php y sidebar-busqueda.php
   ============================= */

/* Contenedor principal */
.busqueda-contenedor {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 2rem;
  padding: 2rem;
}

/* Filtro lateral (escritorio) */
#sidebar-wrapper {
  width: 300px;
  flex-shrink: 0;
  font-size: 0.95rem;
  background: #fdfdfd;
  border: 1px solid #ddd;
  padding: 1.5rem;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

#sidebar-wrapper h3 {
  margin-bottom: 1.2rem;
  font-size: 1.3rem;
  font-weight: bold;
  color: #000;
  text-align: center;
}

#sidebar-wrapper label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: #333;
  margin-top: 1rem;
}

#sidebar-wrapper select,
#sidebar-wrapper input[type="range"],
#sidebar-wrapper button {
  width: 100%;
  padding: 0.6rem 0.8rem;
  margin-bottom: 1rem;
  font-size: 1rem;
  border-radius: 6px;
  border: 1px solid #ccc;
  transition: border 0.2s ease;
}

#sidebar-wrapper button {
  background: #ffc107;
  color: white;
  border: none;
  cursor: pointer;
  font-weight: bold;
  transition: background 0.3s ease;
}

#sidebar-wrapper button:hover {
  background: #8a0000;
}

.btn-cerrar {
  background: none;
  border: none;
  font-size: 1rem;
  color: #ffc107;
  font-weight: bold;
  float: right;
  margin-bottom: 1rem;
  cursor: pointer;
}

/* Resultados */
.resultados-vehiculos {
  flex: 1;
  max-width: 100%;
  padding: 2rem;
  background-color: #fdfdfd;
  border-radius: 16px;
  border: 1px solid #ddd;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.titulo-busqueda {
  font-size: 1.6rem;
  margin-bottom: 1rem;
  text-align: center;
  font-weight: 700;
  color: #111;
  font-family: 'Poppins', sans-serif;
}

.resultado-header {
  background: #ffffff;
  border: 1px solid #ddd;
  padding: 1.2rem 2rem;
  margin: 0 auto 2rem;
  border-radius: 10px;
  max-width: 100%;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

.resultado-header h2 {
  font-size: 1.4rem;
  margin: 0;
  color: #222;
  font-weight: 500;
}

.resultado-header .resaltado {
  color: #ffc107;
  font-weight: bold;
}

.resultado-box {
  max-width: 100%;
  margin: 0 auto;
}

.tarjetas-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  justify-content: center;
}

.tarjeta-vehiculo {
  width: 250px;
  background-color: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s ease;
  opacity: 0;
  transform: translateY(10px);
  animation: fadeInCard 1s ease forwards;
}

.tarjeta-vehiculo:hover {
  transform: translateY(-4px);
}

.tarjeta-vehiculo img {
  width: 100%;
  height: 160px;
  object-fit: cover;
}

.tarjeta-info {
  padding: 0.8rem 1rem;
}

.tarjeta-titulo {
  font-size: 1rem;
  margin: 0 0 0.3rem 0;
  font-weight: 600;
  color: #111;
  min-height: 2.5em;
}

.tarjeta-precio {
  color: #b10000;
  font-weight: bold;
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.tarjeta-detalles {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: #444;
  gap: 10px;
}

.tarjeta-anio {
  background-color: #FFD700;
  color: #111;
  padding: 4px 10px;
  border-radius: 4px;
  font-weight: bold;
  font-size: 0.8rem;
  white-space: nowrap;
}

@keyframes fadeInCard {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* =============================
   📱 Estilos para móvil
   ============================= */
@media (max-width: 768px) {
  .busqueda-contenedor {
    flex-direction: column;
    padding: 1rem;
  }

  .resultados-vehiculos {
    padding: 1rem;
    width: 100%;
  }

  .tarjeta-vehiculo {
    width: calc(50% - 1rem);
    max-width: 170px;
  }

  .tarjetas-grid {
    gap: 1rem;
  }

  .tarjeta-titulo,
  .tarjeta-precio {
    font-size: 0.95rem;
  }

  .tarjeta-detalles {
    font-size: 0.8rem;
    flex-wrap: wrap;
  }

  #sidebar-wrapper {
    display: none;
  }

  #sidebar-wrapper.movil-active {
    display: block;
    position: fixed;
    top: 0;
    left: 50%;
    transform: translate(-50%, -100%);
    width: 95%;
    max-width: 400px;
    background: #fff;
    z-index: 1000;
    padding: 2rem 1.5rem;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
    transition: transform 0.4s ease;
    overflow-y: auto;
    max-height: 90vh;
  }

  #sidebar-wrapper.movil-active.active {
    transform: translate(-50%, 0);
  }

  .btn-filtro-movil {
    display: block;
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #ffc107;
    color: #fff;
    padding: 0.8rem 1.2rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    z-index: 1001;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
  }

  .overlay-filtro {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 900;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
  }

  .overlay-filtro.active {
    display: block;
    opacity: 1;
  }
}

@media (min-width: 769px) {
  .btn-filtro-movil,
  .overlay-filtro {
    display: none !important;
  }

  #sidebar-wrapper {
    display: block;
  }
}
