/* =========================================================
   GLOBAL RESET & LAYOUT-STABILITÄT
   ========================================================= */

*{
  box-sizing:border-box;
}

html{
  /* verhindert horizontales Springen bei Seiten mit / ohne Scrollbar */
  overflow-y: scroll;
}

body{
  margin:0;
  padding:0;
  min-height:100vh;
  font-family: system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  color:#0f172a;
  background:#ffffff;
}

a{ color:inherit; }
img{ max-width:100%; display:block; }

:root{
  --text:#0f172a;
  --muted:#64748b;
  --line: rgba(15,23,42,.12);
  --accent:#2563eb;
  --accentBg: rgba(37,99,235,.12);
  --shadow: 0 18px 50px rgba(2,6,23,.18);
  --radius:18px;
}

/* =========================================================
   BASICS
   ========================================================= */

.container{
  width:min(1120px, calc(100% - 32px));
  margin:0 auto;
}

.skip-link{
  position:absolute;
  left:-9999px;
}
.skip-link:focus{
  left:16px;
  top:16px;
  background:#fff;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid var(--line);
  z-index:300;
}

/* =========================================================
   HEADER & NAVIGATION
   ========================================================= */

.site-header{
  min-height:72px;
  position:sticky;
  top:0;
  z-index:100;
  background:#fff;
  border-bottom:1px solid var(--line);
}

.header-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding:12px 0;
}

.brand{
  display:flex;
  align-items:center;
  text-decoration:none;
}

.brand-logo{
  width:140px;
}

.nav-toggle{
  display:none;
  background:#fff;
  border:1px solid var(--line);
  border-radius:12px;
  padding:10px 12px;
  font-weight:800;
  cursor:pointer;
}

/* --- Desktop Nav --- */

.site-nav{
  display:flex;
  align-items:center;
  gap:6px;
}

.site-nav .nav-link{
  display:inline-flex;
  align-items:center;
  padding:10px 12px;
  border-radius:12px;
  text-decoration:none;
  font-weight:700;
  line-height:1;
  border:1px solid transparent; /* verhindert Shift */
}

.site-nav .nav-link:hover{
  background:rgba(2,6,23,.06);
}

.site-nav .nav-link.is-active{
  background:var(--accentBg);
  color:var(--accent);
}

/* =========================================================
   Mobile bis (ab 900px)
   ========================================================= */
   
@media (max-width: 900px) {
  .nav-toggle {
    display: block !important;
  }

  .site-nav {
    display: none;
    position: absolute;
    right: 16px;
    top: 70px;
    flex-direction: column;

    /* WICHTIG: verhindert die optische “Einrückung” durch Zentrierung */
    align-items: stretch;

    width: calc(100% - 32px);
    max-width: 400px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 12px;
    box-shadow: var(--shadow);
  }

  .site-nav.is-open { display: flex !important; }

  /* Reset für Listen */
  .site-nav ul {
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
  }

  .nav-link {
    display: block;
    width: 100%;
    padding: 14px 16px;
    border-radius: 16px;
    text-align: left;
    font-weight: 700;
  }

/* Unterpunkte 1. Ebene */
.nav-dropdown-menu .nav-link {
  padding-left: 36px;
  font-size: 15px;
}

/* Unterpunkte 2. Ebene */
.nav-dropdown-submenu .nav-link {
  padding-left: 56px;
  font-size: 14px;
}


  .nav-dropdown-menu, .nav-dropdown-submenu {
    display: none;
    position: static;
    width: 100%;
    box-shadow: none;
    border: 0;
    padding: 0;
    flex-direction: column;
  }

  .nav-dropdown.is-open > .nav-dropdown-menu,
  .nav-dropdown-sub.is-open > .nav-dropdown-submenu {
    display: flex;
  }

  /* Unterpunkte-Einrückung (nur innerhalb der Menüs) */
  .nav-dropdown-menu .nav-link { padding-left: 16px; font-size: 15px; }
  .nav-dropdown-submenu .nav-link { padding-left: 32px; font-size: 14px; }
}

/* =========================================================
   DESKTOP NAVIGATION (ab 901px)
   ========================================================= */

@media (min-width: 901px) {
  .nav-toggle { display: none !important; }

  .site-nav {
    display: flex !important;
    align-items: center;
    gap: 6px;
  }

  .nav-link {
    display: inline-flex;
    align-items: center;
    padding: 10px 12px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 700;
    line-height: 1;
    border: 1px solid transparent;
  }

  .nav-link:hover { background: rgba(2, 6, 23, .06); }
  .nav-link.is-active { background: var(--accentBg); color: var(--accent); }

  /* Dropdown Logik */
  .nav-dropdown { position: relative; }

  .nav-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 8px;
    width: 240px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 10px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    transition: all .16s ease;
    z-index: 120;
  }

  .nav-dropdown:hover > .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  /* Zweite Ebene */
  .nav-dropdown-sub { position: relative; }

  .nav-dropdown-submenu {
    position: absolute;
    top: -10px;
    left: 100%;
    margin-left: 8px;
    width: 220px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 10px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transition: all .16s ease;
  }

  .nav-dropdown-sub:hover > .nav-dropdown-submenu {
    opacity: 1;
    visibility: visible;
  }
}

/* =========================================================
   CONTENT & COMPONENTS
   ========================================================= */

.section{ padding:28px 0 54px; }

.card{
  border:1px solid var(--line);
  border-radius:18px;
  padding:16px;
  background:#fff;
}
.card img {
  max-height: 180px !important;
  width: auto;
  max-width: 100%;
  display: block;
  margin: 0 auto 12px; /* Die 12px margin-bottom von deinem HTML direkt hierhin */
  object-fit: contain;
  border: none !important; /* Das löscht den Rahmen aus dem HTML-Style */
}

.grid-2{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:16px;
}

.grid-3{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:16px;
}

@media (max-width:900px){
  .grid-2,.grid-3{ grid-template-columns:1fr; }
}

/* =========================================================
   FOOTER
   ========================================================= */

.site-footer{
  border-top:1px solid var(--line);
  padding:18px 0;
  font-size:14px;
  color:var(--muted);
}

.footer-row{
  display:flex;
  justify-content:space-between;
  flex-wrap:wrap;
  gap:10px;
}

.footer-links a{
  text-decoration:none;
  color:var(--muted);
}

.footer-links a:hover{
  text-decoration:underline;
}
/* =========================================================
   HERO / SLIDER (Startseite) – stabil (nur 1 Slide sichtbar)
   ========================================================= */

.hero{ padding:28px 0; }

.hero-card{
  border:1px solid var(--line);
  border-radius:24px;
  background:linear-gradient(180deg, rgba(37,99,235,.06), #fff);
  padding:18px;
}

/* Slider visibility */
.slider{ position:relative; }
.slides{ position:relative; }



.slide-grid{
  display:grid;
  grid-template-columns: 1.15fr .85fr;
  gap:18px;
  align-items:center;
}

@media (max-width:900px){
  .slide-grid{ grid-template-columns:1fr; }
}

.eyebrow{
  margin:0 0 8px;
  font-weight:900;
  color:var(--muted);
  text-transform:uppercase;
  letter-spacing:.08em;
  font-size:12px;
}

h1{
  margin:0 0 10px;
  font-size:clamp(28px, 3.2vw, 44px);
  letter-spacing:-0.02em;
}

h2{
  margin:0 0 10px;
  font-size:clamp(22px, 2.2vw, 30px);
  letter-spacing:-0.02em;
}

.lead{
  margin:0 0 14px;
  color:var(--muted);
  line-height:1.5;
}

.checklist{
  margin:0 0 16px;
  padding-left:18px;
  color:var(--muted);
}

.meta{
  color:var(--muted);
  margin:10px 0 0;
  font-size:14px;
}

/* Media: verhindert, dass das Bild den Hero "aufbläst" */
.slide-media{
  position:relative;
  overflow:hidden;
  border-radius:18px;
  border:1px solid var(--line);
}

.slide-media img{
  width:100%;
  height:100%;
  object-fit:cover;
}



/* Slider dots */
.slider-controls{
  display:flex;
  gap:8px;
  margin-top:12px;
}

.dot{
  width:10px;
  height:10px;
  border-radius:999px;
  border:1px solid var(--line);
  background:#fff;
  cursor:pointer;
}

.dot.is-active{
  background:var(--accent);
  border-color:var(--accent);
}

/* =========================================================
   ANFAHRT – sauberes Layout + Map-Placeholder
   ========================================================= */

.muted{ color: var(--muted); }

.anfahrt-layout{
  display:grid;
  grid-template-columns: 1.25fr .75fr;
  gap:24px;
  align-items:start;
}

.anfahrt-main{
  padding:22px;
}

.anfahrt-main h2{
  margin:0 0 14px;
  font-size:26px;
  letter-spacing:-0.01em;
}

.anfahrt-address,
.anfahrt-contact{
  margin:0 0 10px;
  line-height:1.55;
}

.anfahrt-contact a{
  color:var(--accent);
  text-decoration:none;
}
.anfahrt-contact a:hover{ text-decoration:underline; }

.anfahrt-map{
  margin-top:14px;
  border-radius:18px;
  overflow:hidden;
  border:1px solid var(--line);
  background:#f8fafc;
  min-height:520px;
}

.anfahrt-map iframe{
  width:100%;
  height:520px;
  border:0;
  display:block;
}

/* Placeholder styling */
.anfahrt-map-placeholder{
  display:flex;
  align-items:center;
  justify-content:center;
  padding:18px;
}

.map-placeholder-inner{
  width:100%;
  max-width:520px;
  border:1px dashed rgba(15,23,42,.25);
  border-radius:18px;
  padding:22px;
  text-align:center;
  background: rgba(255,255,255,.75);
}

/* Right column */
.anfahrt-side{
  padding-top:10px;
}

.anfahrt-side h2{
  margin:0 0 10px;
  font-size:20px;
  letter-spacing:-0.01em;
}

@media (max-width:900px){
  .anfahrt-layout{ grid-template-columns:1fr; }
  .anfahrt-map{ min-height:380px; }
  .anfahrt-map iframe{ height:380px; }
}

/* =========================================================
   Disabled Button State
   ========================================================= */

.btn-disabled,
.btn:disabled{
  opacity:.55;
  cursor:not-allowed;
  pointer-events:none;
  filter:grayscale(30%);
}

/* =========================================================
   BUTTONS – Final Override (stellt sicher, dass Primary blau ist)
   ========================================================= */

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:11px 14px;
  border-radius:14px;
  border:1px solid rgba(15,23,42,.12);
  text-decoration:none;
  font-weight:800;
  line-height:1;
  background:#fff;
  color:#0f172a;
  cursor:pointer;
}

/* Primary immer blau – für <a> und <button> */
a.btn.btn-primary,
button.btn.btn-primary{
  background:#2563eb !important;
  border-color:#2563eb !important;
  color:#ffffff !important;
}

/* Hover/Focus für Primary */
a.btn.btn-primary:hover,
button.btn.btn-primary:hover{
  filter:brightness(0.95);
}

a.btn.btn-primary:focus-visible,
button.btn.btn-primary:focus-visible{
  outline:3px solid rgba(37,99,235,.25);
  outline-offset:2px;
}

/* Disabled State */
.btn:disabled,
.btn.btn-disabled{
  opacity:.55 !important;
  cursor:not-allowed !important;
  pointer-events:none !important;
  filter:grayscale(30%);
}

/* =========================================================
   CTA Buttons – gleiche Größe erzwingen
   ========================================================= */

.cta-row{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
}

.cta-row .btn{
  min-width:160px;          /* gleiche Breite */
  height:44px;              /* gleiche Höhe */
  justify-content:center;
  font-size:15px;
  padding:0 18px;           /* vertikales Padding entfällt wegen fester Höhe */
}

/* =========================================================
   Sticky Header (für Partials)
   ========================================================= */

#site-header{
  position: sticky;
  top: 0;
  z-index: 200;          /* über Content, unter Modals */
  background: #fff;
  border-bottom: 1px solid rgba(15,23,42,.12);
}

/* Optional: falls der innere Header auch sticky war, neutralisieren */
#site-header .site-header{
  position: static;
  border-bottom: 0;
}

/* =========================================================
   Hero Slider – Crossfade (robust)
   ========================================================= */

.slider .slides{
  position: relative;
  min-height: 420px; /* ggf. anpassen */
}

/* keine display:none/block-Regeln für .slide verwenden! */
.slider .slide{
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 2200ms ease-in-out; /* Dauer hier */
}

/* Active = im Stack, aber standardmäßig noch unsichtbar */
.slider .slide.is-active{
  pointer-events: auto;
}

/* Eingeblendet */
.slider .slide.is-visible{
  opacity: 1;
}

/* Ausblendend (optional, aber klarer) */
.slider .slide.is-fading-out{
  opacity: 0;
}

/* =========================================================
   Produktblöcke – Bild links / Text rechts
   ========================================================= */

.product-block{
  display: grid;
  grid-template-columns: 1.4fr 0.9fr; /* Text | Bild */
  gap: 32px;
  align-items: center;

  padding: 32px;
  margin-bottom: 56px;

  background: #ffffff;
  border-radius: 16px;

  /* leichter 3D-Effekt */
  box-shadow:
    0 6px 18px rgba(15, 23, 42, 0.08),
    0 2px 6px rgba(15, 23, 42, 0.04);

  transition: box-shadow 0.25s ease, transform 0.25s ease;
}

/* dezente Hover-Anhebung */
.product-block:hover{
  transform: translateY(-2px);
  box-shadow:
    0 10px 26px rgba(15, 23, 42, 0.12),
    0 4px 10px rgba(15, 23, 42, 0.06);
}

/* ---------------------------------------------------------
   Textbereich
--------------------------------------------------------- */

.product-content h2,
.product-content h3{
  margin-top: 0;
}

/* ---------------------------------------------------------
   Bildbereich
--------------------------------------------------------- */

.product-media{
  display: flex;
  justify-content: center;
  align-items: center;
}

.product-media img{
  max-width: 250px !important; /* Breite auf max 280px */
  max-height: none !important; /* Hebt die 180px von .card img hier wieder auf */
  width: 100%;
  height: auto;
  display: block;
}

/* ---------------------------------------------------------
   Tags
--------------------------------------------------------- */

.product-tags{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 24px;
}

.product-tags .tag{
  background: #0f3c8c; /* dunkles Blau */
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  white-space: nowrap;
}

/* ---------------------------------------------------------
   Buttons
--------------------------------------------------------- */

.product-block .cta-row{
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* ---------------------------------------------------------
   Variante: Bild rechts / Text links
--------------------------------------------------------- */

.product-block.reverse{
  grid-template-columns: 0.9fr 1.4fr;
}

.product-block.reverse .product-media{
  order: 1; /* Bild nach links */
}

.product-block.reverse .product-content{
  order: 2; /* Text nach rechts */
}

/* =========================================================
   SKIP-LINK (Barrierefreiheit - versteckt bis Tab-Fokus)
   ========================================================= */

.skip-link {
  position: absolute;
  top: -100px; /* Komplett außerhalb des Bildschirms */
  left: 16px;
  background: var(--accent);
  color: #fff !important;
  padding: 10px 15px;
  border-radius: 0 0 12px 12px;
  z-index: 2000;
  font-weight: bold;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 0; /* Erscheint nur bei Tastatur-Fokus */
}

/* --- FORCE: Mobile Untermenüs einrücken (kommt ganz ans CSS-Ende) --- */
@media (max-width: 900px) {
  /* 1. Ebene (Unterpunkte von Produkte/Service) */
  nav#site-nav .nav-dropdown-menu .nav-link {
    padding-left: 36px !important;
  }

  /* 2. Ebene (Unter-Unterpunkte) */
  nav#site-nav .nav-dropdown-submenu .nav-link {
    padding-left: 56px !important;
  }
} /* <--- Hier fehlte die schließende Klammer */

/* =========================================================
   MOBILE: Slider bleibt Crossfade (wie Desktop), aber ohne Überlauf
   ========================================================= */
@media (max-width: 900px) {

  /* Clippt alles innerhalb der Hero-Kachel */
  .hero-card{
    overflow: hidden;
  }

  /* Wichtig: Slides-Container bekommt auf Mobile genug Höhe,
     damit Inhalte nicht „rausdrücken/rausragen“ */
  .slider .slides{
    min-height: clamp(560px, 78vh, 720px);
  }

  /* Sicherheit: Slides bleiben wirklich Overlay (Crossfade-Logik) */
  .slider .slide{
    position: absolute;
    inset: 0;
    width: 100%;
  }

  /* Bildbereich: kleiner + sauber innerhalb */
  .slide-media{
    width: 100%;
    overflow: hidden;
    border-radius: 18px;
  }

  .slide-media img{
    width: 100%;
    display: block;
    object-fit: cover;
  }
}

/* =========================================================
   HERO SLIDER: Bilder immer quadratisch (Desktop & Mobile)
   ========================================================= */

.slide-media {
  aspect-ratio: 1 / 1;     /* ⬅ immer quadratisch */
  width: 100%;
  overflow: hidden;
  border-radius: 18px;
}

/* Bild füllt das Quadrat sauber */
.slide-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;       /* oder contain, wenn du alles sehen willst */
  display: block;
}

/* =========================================================
   MOBILE: Produktkacheln – Bild nach oben (ohne HTML-Änderung)
   ========================================================= */
@media (max-width: 900px) {
  .product-block{
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  /* Bild block nach oben ziehen */
  .product-media{
    order: -1;
    display: flex;
    justify-content: center;
    align-items: center;
  }

  /* Bildgröße für Mobile sinnvoll begrenzen */
  .product-media img{
    width: min(320px, 100%);
    height: auto;
    max-height: 240px;
    object-fit: contain;
    display: block;
  }
}
/* =========================================================
   FIX: Mobile Startseite – Slider-Dots nicht vom Slide-Bild überdecken
   ========================================================= */
@media (max-width: 900px) {
  .slider-controls{
    position: relative;
    z-index: 50;
  }
}

/* =========================================================
   FIX: Mobile Startseite – Slider-Dots bleiben sichtbar (ab ~390px Breite)
   - dots nach vorne (z-index)
   - Slide-Bild etwas niedriger (kein extremes Quadrat auf sehr schmalen Screens)
   ========================================================= */
@media (max-width: 420px) {
  /* Dots immer über dem Slide */
  .slider-controls{
    position: relative;
    z-index: 9999;
  }

  /* Bildbereich auf sehr schmalen Displays weniger hoch, damit die Dots nicht überdeckt werden */
  .slide-media{
    aspect-ratio: 5 / 4;  /* etwas „flacher“ als 1/1 */
    max-height: 70vh;
  }

  .slide-media img{
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }
}
/* =========================================================
   FIX: Mobile Startseite – Slide-Bild max. 415px hoch (damit Dots sichtbar bleiben)
   ========================================================= */
@media (max-width: 900px) {
  .slide-media{
    /* Auf schmalen Geräten darf das Bild nicht zu hoch werden */
    height: min(100vw, 415px);
    max-height: 415px;
    aspect-ratio: auto;
  }

  .slide-media img{
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }
}
/* =========================================================
   FIX: Desktop – Slider-Dots klickbar (nicht vom aktiven Slide überdeckt)
   ========================================================= */
.slider-controls{
  position: relative;
  z-index: 9999;
}
/* =========================================================
   UPDATE: Slide-Bild immer quadratisch (auch wenn das Bild gestaucht werden darf)
   - Mobile: Größe auf max. 415px begrenzen UND quadratisch halten
   ========================================================= */
@media (max-width: 900px) {
  .slide-media{
    width: min(100%, 415px);
    aspect-ratio: 1 / 1;
    height: auto;        /* wird über aspect-ratio berechnet */
    max-height: 415px;
    margin-left: auto;
    margin-right: auto;
  }

  .slide-media img{
    width: 100%;
    height: 100%;
    object-fit: fill;    /* erlaubt Stauchen statt Abschneiden */
    display: block;
  }
}
/* Wiki-Anker */
#content section[id]{
  scroll-margin-top: 120px;
}

#content section[id]:target::before{
  content:"";
  display:block;
  height:120px;
  margin-top:-120px;
}

/* =========================================================
Style für Info Note
   ========================================================= */
.info-note{
  background: #f1f5ff;
  border-left: 4px solid #2563eb;
  padding: 14px 18px;
  margin-bottom: 28px;
  font-size: 0.95rem;
  color: #0f172a;
  border-radius: 8px;
}

