/* Fahrzeubestand */
.fahrzeugbestand {
  background-color: #f9fbfc;
  padding: 4rem 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Innen-Wrapper begrenzt auf max Breite & zentriert */
.fahrzeugbestand-inner {
  width: 100%;
  max-width: 1020px; /* 3 Karten à 300px + Abstand */
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 0 2rem;
}

.fahrzeugbestand-inner h2 {
  font-size: 2rem;
  margin-bottom: 2rem;
  color: #1a1a1a;
}

/* Fahrzeugbestand Überschrift/Header */
.fahrzeugbestand-header {
  text-align: center;
  justify-content: center;
  margin: 0 auto 2.5rem auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.fahrzeugbestand-header h2 {
  font-size: 2.4rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: #1a1a1a;
  margin: 0;
}

.fahrzeugbestand-subline {
  font-size: 1rem;
  color: #666;
  margin-top: 0.6rem;
  max-width: 600px;
}

.fahrzeugbestand-divider {
  width: 60px;
  height: 3px;
  background-color: #3d64ff;
  border-radius: 2px;
  margin-top: 1rem;
}

/* Wrapper für horizontale Fahrzeugkarten */
.car-slider-wrapper {
  width: 100%;
  overflow: visible;
  position: relative;
  z-index: 0;
}

.car-slider {
  display: flex;
  gap: 2rem;
  width: 100%;
  max-width: 100%;
}

.car-slider::-webkit-scrollbar {
  display: none;
}

.car-card {
  flex: 0 0 300px;
  background-color: #ffffff;
  border-radius: 16px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  position: relative;
  z-index: 2;
  will-change: transform;
}

.car-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
  z-index: 10;
}

.car-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  object-position: center 65%;
  display: block;
}

.car-card-body {
  padding: 1.5rem 1.2rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem; /* vorher 0.4rem */
}

/* Überschrift */
.car-card h3 {
  font-size: 1.15rem;
  font-weight: 600;
  color: #1a1a1a;
  margin: 0;
}

/* Infozeile (Kilometerstand, EZ, etc.) */
.car-info {
  font-size: 0.95rem;
  color: #5f5e5e;
  margin: 0;
}


/* Preis */
.price {
  font-size: 1.35rem;
  font-weight: bold;
  color: #1a1a1a;
  margin-top: 0.5rem;
}

/* Link „View Details“ */
.details-link {
  font-size: 0.95rem;
  color: #3d64ff;
  font-weight: 500;
  text-decoration: none;
  margin-top: 0.4rem;
}

.details-link:hover {
  text-decoration: none;
  color: #1a308a;
}

/* Tag oben links */
.car-tag {
  position: absolute;
  top: 12px;
  left: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 9999px;
  color: #1a1a1a;
  background-color: #26c281; /* oder .blue */
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.car-tag.green {
  background-color: #26c281;
}

.car-tag.blue {
  background-color: #3d64ff;
}

/* Pfeile + Mehr unterhalb, Start links */
.car-nav-buttons {
  display: flex;
  justify-content: flex-start;
  gap: 1rem;
  margin-top: 2rem;
  width: 100%;
}

.nav-btn {
  width: 36px;
  height: 36px;
  background-color: #f5f5f5;
  border: 1px solid #dfdada;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-btn:hover {
  background-color: #e0e0e0;
}

.material-icons {
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #1a1a1a;
}

.car-mehr-button {
  display: flex;
  justify-content: center;
  width: 100%;
  margin-top: 1.5rem;
}

.mehr-button {
  background-color: #f5f5f5;
  color: #1a1a1a;
  border: 1px solid #dfdada;
  text-decoration: none;
  padding: 0.7rem 1.4rem;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.95rem;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.mehr-button:hover {
  background-color: #e0e0e0;
  transform: translateY(-2px);
  text-decoration: none;
}

/* Bearbeiten / Löschen Buttons */
.edit-button,
.delete-button {
  display: inline-block;
  width: auto; /* <– wichtig! */
  min-width: 100px;
  max-width: 50%;
  padding: 0.5rem 1.2rem;
  font-size: 0.85rem;
  border-radius: 8px;
  text-align: center;
}

.edit-button {
  background-color: #007bff;
  color: white;
}

.delete-button {
  background-color: #dc3545;
  color: white;
}

/* Car Slide Animation */
.car-slide-transition {
  display: flex;
  gap: 2rem;
  transition: transform 0.3s ease;
}

.car-slide-transition.slide-left {
  animation: slideLeft 0.6s ease forwards;
}

.car-slide-transition.slide-right {
  animation: slideRight 0.6s ease forwards;
}

@keyframes slideLeft {
  from {
    transform: translateX(-20px);
    opacity: 0.8;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideRight {
  from {
    transform: translateX(20px);
    opacity: 0.8;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Button gedrückt Zustand */
.nav-btn.active {
  background-color: #d0d0d0;
  transform: scale(0.95);
}

/* ===== Responsive Breakpoints ===== */

/* === Smartphone: max-width: 767px === */
@media (max-width: 767px) {
  .fahrzeugbestand {
    background-color: #f1f3f6; /* etwas dunklerer Hintergrund für Kontrast */
  }

  .fahrzeugbestand-inner {
    padding: 0 1rem;
    align-items: center;
  }

  .car-slider-wrapper {
    overflow: hidden;
    display: flex;
    justify-content: center;
  }

  .car-slider {
    flex-wrap: nowrap;
    justify-content: center;
  }

  .car-slide-transition {
    flex-direction: row;
    justify-content: center;
    gap: 0;
  }

  .car-card {
    flex: 0 0 100%;
    max-width: 100%;
    margin: 1.2rem 0; /* oben/unten mehr Luft */
    border-radius: 12px;
    /* weicher, gleichmäßiger Schatten */
  }

  .car-card-body {
    padding: 1.2rem 1rem 1.5rem;
  }

  .car-nav-buttons {
    justify-content: center;
    margin-top: 1.2rem;
  }

  .car-slider {
    display: flex;
    transition: transform 0.4s ease-in-out;
    will-change: transform;
  }

  .edit-button,
  .delete-button {
    width: 100%;
    max-width: 100%;
    margin-top: 0.5rem;
  }
}

/* === Tablet: 768px–1023px === */
@media (min-width: 768px) and (max-width: 1023px) {
  .fahrzeugbestand-inner {
    padding: 0 1.5rem;
    align-items: center;
  }

  .car-card {
    flex: 0 0 45%;
    max-width: 45%;
  }

  .car-slide-transition {
    flex-wrap: wrap;
    gap: 2rem;
    justify-content: center;
  }

  .car-slider {
    justify-content: center;
  }

  .car-nav-buttons {
    justify-content: center;
  }
}

/* === Desktop: min-width: 1024px === */
@media (min-width: 1024px) {
  .car-card {
    flex: 0 0 300px;
  }

  .car-slide-transition {
    flex-direction: row;
    gap: 2rem;
  }

  .fahrzeugbestand-inner {
    align-items: flex-start;
  }
}
