/* ========================
   style.css (aktualisierte Version)
   ======================== */

/* === Grundlayout === */
body {
  max-width: none;
  background-color: #000;
  color: #fff;
  margin: 0;
  padding: 0;
  font-family: Arial, sans-serif;
}

/* === Hauptcontainer (dreispaltiges Layout) === */
.flex-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin: 0 auto;
  max-width: 1300px;
  padding: 20px 10px;
  flex-wrap: nowrap; /* verhindert, dass Spalten umbrechen */
  box-sizing: border-box;
}

/* Bildbereich */
.image-section {
  border: none !important;
  padding: 0;            /* Rücksetzen, falls Padding für Border-Puffer genutzt wurde */
  overflow: visible;     /* damit der Container nichts abschneidet */
}

/* Passe Breite des Wrappers an, damit alles umschlossen wird */
.image-section .main-image-container,
.image-section #thumbnails {
  width: 100%;            /* beide Elemente füllen den Container */
}
/* Preisbox */
.preisbox {
  flex: 1 1 0;
  font-size: 0.9rem;
  border: 2px solid #fff;
  box-sizing: border-box;
  margin: 0;
  padding: 16px;
}

/* Kontaktformular */
.contact-form {
  flex: 1 1 0;
  background: #101820;
  color: #fff;
  font-family: sans-serif;
  font-size: 0.85rem;
  padding: 20px;
  max-width: none;
  width: 100%;
  box-sizing: border-box;
  border-radius: 6px;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.4);
}

/* Responsive: einspaltig unterhalb 900px */
@media (max-width: 900px) {
  .flex-row {
    flex-wrap: wrap;
  }
  .image-section,
  .preisbox,
  .contact-form {
    flex: 1 1 100%;
    margin-bottom: 20px;
  }
}

/* === Bildkarussell & Overlay === */
.main-image-container {
  border: 2px solid #fff !important; /* weißer Border um Main Image */
  box-sizing: border-box;
  display: inline-block;             /* passt die Breite genau an das Bild an */
  position: relative;
  z-index: 2;                        /* hebt den Rahmen über benachbarte Elemente */
}

.main-image-container img {
  display: block;
  width: 100%;
  height: auto;
}

.main-nav {
  color: white;
  cursor: pointer;
  font-size: 2rem;
  opacity: 0;
  position: absolute;
  top: 50%;
  transition: opacity 0.3s ease;
  user-select: none;
  z-index: 5;
}
.main-nav.left { left: 10px; }
.main-nav.right { right: 10px; }
.main-image-container:hover .main-nav { opacity: 1; }
#mainImage:hover { cursor: zoom-in; }

.foto-counter {
  display: flex;
  align-items: center;
  background: rgba(0,0,0,0.6);
  border-radius: 4px;
  color: white;
  font-size: 0.75rem;
  gap: 6px;
  padding: 4px 8px;
  position: absolute;
  right: 10px;
  top: 10px;
}
.foto-counter img { width:16px; height:16px; }

#thumbnails {
  display: flex;
  overflow: hidden;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  gap: 8px;
  height: 100px;
  padding: 0 4px;
}
#thumbnails img.thumbnail {
  flex: 1 0 calc(20% - 8px);
  max-width: calc(20% - 8px);
  height: 100px;
  object-fit: cover;
  scroll-snap-align: start;
  border: 2px solid transparent;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.4s ease;
  box-sizing: border-box;
}
#thumbnails img.thumbnail.loaded {
  opacity: 1;
  transform: translateY(0);
  border-color: #fff;
  border-radius: 4px;
  margin-bottom: 10px;
}
#thumbnails img.thumbnail.active {
  border-color: red !important;
}

/* === Overlay-Modus === */
#imageOverlay {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(0,0,0,0.9);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s;
  z-index: 1000;
}
#imageOverlay.show {
  opacity: 1;
  visibility: visible;
}
#overlayImage {
  max-width: 95vw;
  max-height: 90vh;
  object-fit: contain;
  cursor: zoom-out;
  transition: transform 0.3s ease-in-out;
}
.closeOverlay {
  position: absolute;
  top: 15px; right: 20px;
  width: 40px; height: 40px;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(0,0,0,0.6);
  border-radius: 50%;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
  z-index: 1100;
}
.overlay-nav {
  position: absolute;
  top: 50%; left: 0; right: 0;
  display: flex;
  justify-content: space-between;
  padding: 0 1rem;
  transform: translateY(-50%);
  z-index: 1050;
}
.overlay-nav span {
  color: #fff;
  font-size: 3rem;
  cursor: pointer;
  user-select: none;
}

/* === Banner === */
.banner {
  display: inline-block;
  font-weight: bold;
  font-size: 1.4rem;
  padding: 10px 20px;
  margin-top: 10px;
  margin-left: -20px;
  clip-path: polygon(0 0,100% 0,90% 100%,0% 100%);
  background: #c82323;
  color: #fff;
}
.banner span {
  font-size: 2.6rem;
}

/* === Steuerhinweis & Finanzierung === */
#steuerhinweis.steuer,
.finanzierung h1 {
  color: #fff;
  font-weight: bold;
}
.finanzierung h1 { font-size: 1.1rem; margin-bottom: 10px; padding: 6px 8px; }
#financeBox {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px;
  align-items: baseline;
  font-size: 0.85rem;
  padding: 6px 8px;
  box-sizing: border-box;
}
#rate { color: #c82323; font-size: 1.2rem; font-weight: bold; }

/* === Navigation im Header (aktiver Zustand) === */
.navbar ul {
  list-style: none;
  display: flex;
  gap: 1rem;
  margin: 0;
  padding: 0;
}
.navbar a {
  color: #fff;
  text-decoration: none;
  padding: 0.5rem 1rem;
  font-weight: 500;
  transition: background 0.2s;
}
.navbar a:hover { background: rgba(200,35,35,0.2); }
.navbar li.active a {
  background: #c82323;
  color: #fff;
  border-radius: 4px;
}

/* === Kontaktformular: Felder & Button === */
.contact-form label { display: block; margin-bottom: 0.3rem; font-weight: 500; }
.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form input[type="tel"],
.contact-form select,
.contact-form textarea {
  width: 100%; padding: 8px; margin-bottom: 1rem;
  border: 1px solid #ccc; border-radius: 4px;
  font-size: 0.85rem; box-sizing: border-box;
  background: #fff; color: #000;
}
.contact-form .checkbox-group {
  display: flex; align-items: flex-start;
  margin-bottom: 1rem;
}
.contact-form .checkbox-group input[type="checkbox"] {
  margin-right: 8px; margin-top: 3px; flex-shrink: 0;
}
.contact-form .checkbox-group span,
.contact-form .checkbox-group a { line-height: 1.4; }
.contact-form .checkbox-group a { color: #c82323; text-decoration: underline; }
.contact-form button[type="submit"] {
  width: 100%; padding: 12px;
  background: #00a877; color: #fff;
  border: none; border-radius: 4px;
  font-size: 1rem; cursor: pointer;
  transition: background 0.3s ease;
}
.contact-form button[type="submit"]:hover { background: #008f6a; }

/* === Technische Daten Tabelle === */
.tech-data {
  max-width: 1500px; width: 90%; margin: 30px auto;
  padding: 20px 5vw; background: #0d0d0d;
  color: #fff; border: 2px solid #fff; box-sizing: border-box;
}
.tech-data h2 { font-size: 1.3rem; margin-bottom: 1rem; }
.tech-data table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.tech-data td { padding: 6px 10px; border-bottom: 1px solid #333; vertical-align: top; }
.tech-data tr td:first-child,
.tech-data tr td:nth-child(3) { font-weight: bold; color: #aaa; width: 18%; }
.tech-data tr td:nth-child(2),
.tech-data tr td:nth-child(4) { color: #fff; width: 32%; }

/* Ende der aktualisierten style.css */
/* Spaltenbreiten korrigieren: Bild 60%, Preis & Kontakt je 20% */
.image-section {
  flex: 0 0 60%;
}

.preisbox,
.contact-form {
  flex: 0 0 20%;
}

/* Media-Query bleibt unverändert, damit unter 900px alles 100% Breite nimmt */
@media (max-width: 900px) {
  .image-section,
  .preisbox,
  .contact-form {
    flex: 1 1 100%;
  }
}

#thumbnails img.thumbnail {
  border: 1px solid transparent;  /* dünner Rand für nicht geladene Thumbnails */
}

#thumbnails img.thumbnail.loaded {
  border: 1px solid #fff;          /* dünner weißer Rand nach Laden */
}

#thumbnails img.thumbnail.active {
  border: 2px solid #c82323 !important;  /* dünner roter Rand für das aktive Thumbnail */
}
/* === Thumbnail Border Override: Dünnerer Weißer Rahmen === */

/* Stelle sicher, dass diese Regeln nach allen anderen Thumbnail-Styles kommen */
#thumbnails img.thumbnail.loaded {
  border: 1px solid #fff !important;  /* zwingend 1px weißer Rahmen */
  padding: 0 !important;              /* kein zusätzliches Padding */
}

#thumbnails img.thumbnail.active {
  border: 2px solid #c82323 !important; /* zwingend 1px roter Rahmen */
}

/* Transparente Thumbnails weiterhin ohne sichtbaren Rahmen */
#thumbnails img.thumbnail {
  border-width: 2px !important;       /* Basis-Randbreite 1px */
  border-style: solid !important;
  border-color: transparent !important;
  padding: 0 !important;
}
/* === Thumbnail Navigation: Pfeile links und rechts positionieren === */

/* Container für Thumbnails und Nav-Buttons */
.thumb-nav {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 640px;  /* gleich wie Main-Image Breite */
  margin: 10px auto;
}

/* Thumbnails als flexibles Scroll-Element */
.thumb-nav #thumbnails {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  flex: 1;
  padding: 0 40px;     /* Platz für Pfeil-Buttons links/rechts */
  box-sizing: border-box;
}

/* Pfeil-Buttons links/rechts */
.thumb-nav {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 640px;    /* Breite passend zum Hauptbild */
  margin: 10px auto;
  box-sizing: border-box;
}

/* Thumbnails container: flex scroll und Platz für Buttons */
.thumb-nav #thumbnails {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 0 30px;     /* Innenabstand für Pfeile */
  box-sizing: border-box;
}

/* Einzelne Thumbnails */
.thumb-nav img.thumbnail {
  flex: 0 0 auto;
  width: 100px;
  height: 75px;
  object-fit: cover;
  scroll-snap-align: start;
  border: 1px solid transparent;
  border-radius: 4px;
  transition: border-color 0.2s;
}
.thumb-nav img.thumbnail.loaded {
  border-color: #fff;
}
.thumb-nav img.thumbnail.active {
  border-color: #c82323 !important;
}

/* Prev/Next Buttons */
.thumb-nav .thumb-prev,
.thumb-nav .thumb-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1;
}
.thumb-nav .thumb-prev { left: 0; }
.thumb-nav .thumb-next { right: 0; }

/* Scrollbar ausblenden */
.thumb-nav #thumbnails::-webkit-scrollbar { display: none; }
.thumb-nav #thumbnails { -ms-overflow-style: none; scrollbar-width: none; }


/* === Overlay: Bild zentrieren (Override) === */
/* Diese Regeln sollten nach allen anderen Overlay-Stilen geladen werden */

#imageOverlay {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
}

#overlayImage {
  max-width: 90vw !important;
  max-height: 90vh !important;
  width: auto !important;
  height: auto !important;
  margin: 0 auto !important;
  object-fit: contain !important;
}

/* Beschriftung "Bild X von Y" oben rechts positionieren wie im Hauptbild */
#imageOverlay .overlay-caption {
  position: absolute !important;
  top: 20px !important;
  right: 20px !important;
  color: #fff !important;
  font-size: 1rem !important;
  background: rgba(0, 0, 0, 0.6) !important;
  padding: 6px 10px !important;
  border-radius: 4px !important;
}

/* Close-Button größer machen */
.closeOverlay {
  position: absolute !important;
  top: 20px !important;
  right: 20px !important;
  width: 50px !important;
  height: 50px !important;
  font-size: 2.5rem !important;
  background: rgba(0, 0, 0, 0.6) !important;
  border-radius: 50% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  z-index: 1100 !important;
}

/* Navigation-Pfeile direkt neben den Bildkanten */
.overlay-nav {
  position: absolute !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  left: 5vw !important;
  right: 5vw !important;
  display: flex !important;
  justify-content: space-between !important;
  width: auto !important;
  pointer-events: none !important;
}

.overlay-nav span {
  font-size: 4rem !important;
  color: #fff !important;
  cursor: pointer !important;
  pointer-events: auto !important;
}

.calculator {
      max-width: 1200px;
      margin: 0 auto;
      color: #fff;
      background: #101820;
    }
    .calculator h1 {
      font-size: 1.5rem;
      margin-bottom: 20px;
    }
    .grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
      gap: 16px;
      margin-bottom: 20px;
    }
    .field {
      display: flex;
      flex-direction: column;
    }
    .field label {
      margin-bottom: 6px;
      font-size: 0.9rem;
    }
    .field input,
    .field select {
      padding: 8px;
      font-size: 1rem;
      border: 1px solid #333;
      border-radius: 4px;
      background: #fff;
      color: #000;
    }
    .actions {
      display: flex;
      gap: 16px;
    }
    .actions button {
      flex: 1;
      padding: 12px;
      font-size: 1rem;
      border: none;
      border-radius: 4px;
      cursor: pointer;
    }
    .actions .submit {
      background: #c82323;
      color: #fff;
    }
    .actions .reset {
      background: #555;
      color: #fff;
    }