.car-card {
  width: 100%;
  /* Se adapta al ancho del contenedor */
  max-width: 100%;
  /* Máximo de 252px en pantallas grandes */
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  font-family: "Roboto", sans-serif;
  background: white;
  transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
  margin: 15px auto;
  /* Centrado */
}

.car-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15), 0 3px 6px rgba(0, 0, 0, 0.1);
}

.car-image-container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  width: 100%;
  min-height: 140px;
  aspect-ratio: 16/9; /* Mantiene una relación de aspecto */
}

.car-image {
  flex-grow: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.promo-banner {
  position: absolute;
  top: 12px;
  left: 30px;
  background: #c51e28;
  color: white;
  padding: 2px 35px;
  font-size: 10px;
  font-weight: bold;
  text-transform: uppercase;
  transform: translateX(-50%) rotate(-40deg);
  /* Ajuste la inclinación */
  z-index: 3;
  box-shadow: 2px 2px 10px rgba(0.5, 0.5, 0.5, 0.5);
  white-space: nowrap;
}

.car-details {
  padding: 16px;
}

.car-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
  /* Espacio entre el título y la info del coche */
}

.car-title {
  font-weight: bold;
  font-size: 18px;
  color: #333;
  margin-bottom: 8px;
}

.car-info {
  font-size: 12px;
  color: #666;
  display: flex;
  justify-content: space-between;
  /* Distribuye uniformemente */
  align-items: center;
  gap: 10px;
  /* Espaciado entre elementos */
  margin-bottom: 8px;
  /* Espacio entre el título y la info del coche */
}

.car-info span {
  display: flex;
  align-items: center;
  white-space: nowrap;
  /* Evita que el texto se rompa en móviles */
}

.car-info i {
  margin-right: 5px;
  color: #666;
}

.car-price-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 50px;
  margin-bottom: 1px;
  /* Espacio entre los precios y la ubicación */
}

.car-price {
  font-size: 18px;
  font-weight: bold;
  color: #2c3e50;
  margin: 0;
}

.car-promo-price {
  font-size: 14px;
  color: #e74c3c;
  text-decoration: line-through;
  margin: 0;
  display: block;
}

.car-monthly {
  background-color: #c51e28;
  color: white;
  padding: 8px 12px;
  border-radius: 18px;
  font-size: 12px;
  font-weight: bold;
  margin: 0;
  cursor: pointer;
  text-align: center;
  display: inline-block;
  text-decoration: none;
  border: none;
  outline: none;
  transition: background 0.3s ease, color 0.3s ease;
}

.car-monthly:hover {
  background-color: white;
  color: #c51e28;
  border: 2px solid #c51e28;
}

.car-location {
  background-color: #ecf0f1;
  text-align: center;
  font-size: 12px;
  color: #34495e;
  font-weight: 500;
  padding: 10px;
  margin-top: 2px;
  /* Separa la ubicación del resto del contenido */
}

.car-condition {
  font-size: 12px;
  font-weight: bold;
  text-transform: uppercase;
}

.demo {
  color: #2980b9;
}

.seminuevo {
  color: #27ae60;
}


/* Overlay para mostrar galeria de la unidad */
.car-image-container {
  position: relative;
  width: 100%;
  height: 140px;
  overflow: hidden;
}

.car-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4); /* Oscurecer la imagen */
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
  cursor: pointer;
}

.car-overlay a {
  color: white;
  font-size: 24px;
  text-decoration: none;
}

.car-image-container:hover .car-overlay {
  opacity: 1;
}

/* Ajustes Responsivos para móviles */
@media screen and (max-width: 400px) {
  .car-card {
    width: 95%;
    /* Se expande hasta el 95% del ancho de la pantalla */
    max-width: 100%;
    /* Evita que tenga un tamaño fijo */
  }

  .car-info span {
    width: 100%;
    /* Los ítems se apilan uno debajo del otro */
  }

  .car-price-container {
    flex-direction: column;
    /* Pone el precio y el botón en columnas */
    align-items: flex-start;
  }

  .car-monthly {
    width: 100%;
    /* Hace el botón más ancho */
    text-align: center;
    margin-top: 8px;
  }
}
