:root {
  --primary-color: #4b5563;
  --secondary-color: #1abc9c;
  --text-color: #111827;
  --background: #f5f5f5;
  --background-sidebar: #ffffff;
  --background-hover: #e5e7eb;
  --card-background: #ffffff;
  --border-color: #d1d5db;
}

/* Grundlayout */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background-color: var(--background);
  color: var(--text-color);
  overflow-x: hidden;
}

.container {
  display: flex;
  flex-direction: row;
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  /* fixiert */
  top: 0;
  left: 0;
  width: 22rem;
  height: 100vh;
  /* ganze Höhe */
  padding: 1rem;
  background-color: var(--background-sidebar);
  border-right: 1px solid var(--border-color);

  overflow-y: auto;
  /* Sidebar scrollt */
  overflow-x: hidden;
  z-index: 20;
}

/* Scrollbar ausblenden (optional) */
.sidebar::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.sidebar {
  scrollbar-width: none;
}

/* "Alle anzeigen"-Button */

/* "Überschrift"-Button (Alle anzeigen)*/
.all-button {
  position: sticky;
  top: 0;
  width: 100%;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.4rem 1.2rem;
  /* erhöht die Höhe deutlich */
  margin-bottom: 0.75rem;
  background-color: var(--secondary-color);
  color: #ffffff;
  border-radius: 0.5rem;
  font-weight: 300;
  font-size: 1.4rem;
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
}

.all-button:hover {
  filter: brightness(0.95);
}

/* Menü in der Sidebar */
.menu {
  margin-bottom: 0.75rem;
}

/* "sidebar"-Buttons */
.menu-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background-color: var(--background-sidebar);
  color: var(--text-color);
  font-size: 1.3rem;
  font-weight: 300;
  padding: 0.6rem 0.75rem;
  border-radius: 0.4rem;
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.menu-header:hover {
  background-color: var(--background-hover);
}

.menu-header i {
  min-width: 1rem;
}

.menu-items {
  margin-top: 0.35rem;
}

.menu-item {
  padding: 0.6rem 0.8rem;
  /* vorher 0.4rem */
  margin-bottom: 0.2rem;
  border-radius: 0.35rem;
  border: 1px solid transparent;
  font-size: 1.1rem;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.menu-item:hover {
  background-color: var(--background-hover);
  border-color: var(--border-color);
}

/* Hauptinhalt */
.main-content {
  margin-left: 23rem;
  padding: 0.75rem 1rem 1rem;
  display: flex;
  flex-direction: column;

  /* NEU */
  width: calc(100vw - 27rem);
  max-width: calc(100vw - 27rem);
}

/* Auswahlzeile */
.auswahl-container {
  position: sticky;
  top: 0;
  font-size: 1.4rem;
  z-index: 5;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem;
  padding: 0.5rem 0;
  background-color: var(--background);
}

.auswahl-label {
  font-weight: 600;
  margin-right: 0.4rem;
}

/* Filter-Buttons (Chips) */
.filter-button {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin: 0.15rem;
  padding: 0.3rem 0.6rem;
  background-color: var(--secondary-color);
  color: #ffffff;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  font-size: 1.0rem;
  line-height: 2;
}

.filter-button:hover {
  filter: brightness(0.95);
}

.filter-button .remove-btn {
  display: inline-block;
  font-weight: 700;
  cursor: pointer;
}

/* Fahrzeug-Grid-Container */
.vehicle-grid-container {
  width: 100%;
  margin-top: 0.5rem;
  display: block;
}


/* Fahrzeug-Grid: echtes Auto-Layout für 1/2/3+ Spalten */
.vehicle-grid {
  width: 100%;
  display: grid;
  grid-auto-flow: dense;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  row-gap: 2.5rem;
  /* vertikal */
  column-gap: 2rem;
  /* horizontal */
}

/* Fahrzeugkarte */
.vehicle-card {
  padding: 0.6rem;
  max-width: 380px;
  /* verhindert „Auseinanderziehen“ bei 1 Fahrzeug */
  margin: 0 auto;
  /* zentriert die Karte */
  display: flex;
  flex-direction: column;
  height: 100%;
  cursor: pointer;

  transform-origin: top left;
  /* Verhindert Verschieben nach unten */
}


.vehicle-card:hover {

  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

/* Fahrzeugbild */
.vehicle-image-wrapper {
  width: 100%;
  display: flex;
  justify-content: center;
}

.vehicle-image {
  width: 100%;
  max-width: 260px;
  border-radius: 0.4rem;
  display: block;
}

/* Fahrzeugdetails */
.vehicle-details {
  margin-top: 0.4rem;
  margin-left: 28px;
  font-size: 0.9rem;
}

.vehicle-title {
  font-weight: 700;
  margin-bottom: 0.2rem;
}

.vehicle-text {
  margin: 0.05rem 0;
  line-height: 1.3;
}

.vehicle-card a,
.vehicle-card {
  color: black;
  /* Setzt die Textfarbe auf Schwarz */
  text-decoration: none;
  /* Entfernt die Unterstreichung */
}

/* Hinweis bei keine Fahrzeuge */
.no-vehicles {
  grid-column: 1 / -1;
  text-align: center;
  padding: 1rem;
  font-size: 0.95rem;
  color: #6b7280;
}

.legal-container {
  max-width: 800px;
  margin: 30px auto;
  padding: 15px;
}

.sidebar-legal {
  margin-top: 40px;
  font-size: 0.85rem;
  color: #666;
}

.sidebar-legal a {
  color: #1a73e8;
  text-decoration: none;
}

.boxtext {
  font-size: 1.0rem;
  line-height: 1.0;
  overflow: auto;
}

.footer {
  width: 100%;
  padding: 15px;
  text-align: center;
  font-size: 0.9rem;
  color: #555;
}

.footer a {
  color: #1a73e8;
  text-decoration: none;
  margin: 0 8px;
}

.footer a:hover {
  text-decoration: underline;
}



/* ---------------------------------------
   LEGAL / IMPRESSUM / DATENSCHUTZ MODAL
---------------------------------------- */

#legal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 999;
}

.legal-content {
  width: 70%;
  max-width: 1100px;
  height: 75%;
  background: #ffffff;
  padding: 30px;
  border-radius: 14px;

  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.legal-content h2 {
  margin-top: 0;
  font-size: 1.8rem;
  margin-bottom: 20px;
}

.legal-text {
  flex: 1;
  overflow-y: auto;
  font-size: 1.8rem;
  line-height: 1.5;
}

.legal-close {
  align-self: center;
  margin-top: 20px;

  width: clamp(130px, 14vw, 200px);
  height: clamp(40px, 4vw, 60px);
  font-size: clamp(1rem, 1.4vw, 1.4rem);

  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(0, 0, 0, 0.3);
  color: #222;
  border-radius: 12px;
  cursor: pointer;
}

/* ================================================
   STILE FÜR DAS IMPRESSUM/DATENSCHUTZ MODAL
================================================ */

.modal-overlay {
  position: fixed;
  /* Bleibt an Ort und Stelle, auch beim Scrollen */
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  /* Halbtransparenter schwarzer Hintergrund */

  display: none;
  /* Standardmäßig unsichtbar */
  justify-content: center;
  /* Zentriert den Inhalt horizontal */
  align-items: center;
  /* Zentriert den Inhalt vertikal */
  z-index: 1000;
  /* Stellt sicher, dass es über allem anderen liegt */
}

.modal-content {
  background-color: white;
  padding: 30px;
  border-radius: 8px;
  width: 80%;
  max-width: 900px;
  /* Maximale Breite für große Bildschirme */
  height: 80%;
  max-height: 80vh;
  /* Maximale Höhe */

  display: flex;
  flex-direction: column;
  /* Ordnet Titel, Text und Button untereinander an */
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.modal-content h2 {
  margin-top: 0;
  border-bottom: 1px solid #eee;
  padding-bottom: 15px;
}

.modal-text-content {
  flex-grow: 1;
  /* Sorgt dafür, dass der Textbereich den verfügbaren Platz ausfüllt */
  overflow-y: auto;
  /* Fügt eine Scrollbar hinzu, wenn der Text zu lang ist */
  font-size: 1.8rem;
  line-height: 1.6;
}

.modal-close-button {
  margin-top: 20px;
  padding: 10px 20px;
  border: 1px solid #ccc;
  background-color: #f0f0f0;
  border-radius: 5px;
  cursor: pointer;
  align-self: center;
  /* Zentriert den Button horizontal */
}

.modal-close-button:hover {
  background-color: #e0e0e0;
}

/* Optional: Ein kleiner Stil für die Links in der Sidebar */
.sidebar-legal {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid #eee;
}

.sidebar-legal a {
  cursor: pointer;
  color: #337ab7;
  text-decoration: none;
}

.sidebar-legal a:hover {
  text-decoration: underline;
}


/* ================================================
   HAMBURGER BUTTON (DESKTOP = unsichtbar)
================================================ */
#mobile-menu-button {
  display: none;
  /* Standard: nicht sichtbar */
}

/* Standard: Hamburger = grün */
#mobile-menu-button {
  background-color: green;
  color: white;
  border: none;
  padding: 10px;
  border-radius: 6px;
}

/* Wenn Sidebar geöffnet → roter Hintergrund */
#mobile-menu-button.active {
  background-color: red;
}



/* ================================================
   MOBILE VERSION (unter 768px)
================================================ */
@media (max-width: 768px) {

  /* Container komplett untereinander */
  .container {
    display: block !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  /* --------------------------
       HAMBURGER BUTTON
    --------------------------- */
  #mobile-menu-button {
    display: flex !important;
    position: fixed;
    top: 10px;
    right: 12px;
    z-index: 9999;

    width: 46px;
    height: 46px;
    background: #1abc9c;
    color: #fff;
    border-radius: 10px;

    align-items: center;
    justify-content: center;

    font-size: 1.8rem;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
  }


  /* --------------------------
       SIDEBAR Standard: VERSTECKT
    --------------------------- */
  .sidebar {
    display: none !important;
    position: absolute !important;
    top: 0;
    left: 0;

    width: 85% !important;
    max-width: 300px !important;

    height: 70vh !important;
    background: #ffffff;
    overflow-y: auto;
    border-radius: 14px;

    padding: 1rem;
    box-shadow: 0 0 25px rgba(0, 0, 0, 0.3);
    z-index: 9999 !important;
  }

  /* --------------------------
       SIDEBAR geöffnet
    --------------------------- */
  .sidebar.open {
    display: block !important;
  }


  /* --------------------------
       HAUPTBEREICH
    --------------------------- */
  .main-content {
    margin: 0 !important;
    padding: 0.75rem !important;
    width: 100% !important;
    max-width: 100% !important;
  }


  /* --------------------------
       GRID: 1 Fahrzeug pro Zeile
    --------------------------- */
  .vehicle-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    width: 100% !important;
    gap: 1rem !important;
  }


  /* --------------------------
       KARTEN: volle Breite
    --------------------------- */
  .vehicle-card {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 auto !important;
  }

  .vehicle-card .vehicle-image-wrapper {
    text-align: left !important;
  }

  .vehicle-card img.vehicle-image {
    width: 100% !important;
    margin: 0 !important;
  }

  .vehicle-details {
    margin: 0 !important;
    padding-top: 0.5rem !important;
    width: 100% !important;
    text-align: center !important;
    margin-bottom: 10px !important;
  }
}