/* =========================================
   Variablen & Basis
========================================= */
:root {
  --primary-blue: #0e76bb;
  --bg-dark: #404041;
  --bg-light: #f5f5f5;
  --text-light: #ffffff;
  --text-dark: #333333;
}

*,
*::before,
*::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
  font-family: 'Barlow', sans-serif;
  color: var(--text-dark);
  background: #fff;
  margin: 0;
  padding-top: 64px; /* Platz für fixe Navbar */
}

/* =========================================
   Navbar / Header
========================================= */
.sticky-header {
  background-color: var(--bg-dark);
  position: fixed;
  inset: 0 0 auto 0;
  width: 100%;
  z-index: 1000;
}

.sticky-header .container-fluid { position: relative; }

/* Brand-Logo */
.navbar-brand img {
  height: 50px;
  width: auto;
  display: block;
}

/* Desktop: Brand exakt mittig */
@media (min-width: 992px) {
  .navbar .navbar-brand {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%,-50%);
    margin: 0;
  }
}

/* Nav-Links */
.navbar-nav {
  display: flex;
  flex-direction: row;
  gap: 20px;
  align-items: center;
  margin: 0;
  padding: 0;
}

.navbar-nav .nav-link {
  color: #fff;
  font-weight: 500;
  font-size: 0.95rem;
  padding: 5px 10px;
  text-decoration: none;
}
.navbar-nav .nav-link:hover,
.navbar-nav .nav-link:focus { color: var(--primary-blue); }

/* Contact-Buttons (Desktop rechts) */
.contact-buttons { display: flex; gap: 10px; }

/* Runde Icon-Buttons */
.contact-icon {
  background: var(--primary-blue);
  color: #fff;
  border: none;
  font-size: 1.3rem;
  padding: 0.6em 0.8em;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.25s ease;
  text-decoration: none;
}
.contact-icon:hover,
.contact-icon:focus { background: #095a8e; color: #fff; }

/* Toggler hell */
.navbar-toggler {
  filter: none;
  border-color: rgba(255,255,255,0.5);
}
.navbar-toggler:focus { box-shadow: 0 0 0 .125rem rgba(255,255,255,.35); }
.navbar-toggler-icon {
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='rgb(255,255,255)' stroke-width='2' stroke-linecap='round' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E");
}

/* -------- Mobile Kopf: Grid = [Toggler] [Logo] [Spacer] -------- */
@media (max-width: 991.98px) {
  .mobile-head {
    --toggler-w: 48px;
    display: grid;
    grid-template-columns: var(--toggler-w) 1fr var(--toggler-w);
    align-items: center;
    gap: .5rem;
    min-height: 60px;
    padding: .25rem .5rem;
  }

  /* Toggler links – statisch (nicht absolute) */
  .mobile-head .navbar-toggler {
    width: var(--toggler-w);
    height: 44px;
    padding: 0;
    margin: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .mobile-head .navbar-toggler-icon { width: 24px; height: 24px; background-size: 100% 100%; }

  /* Logo wirklich mittig */
  .mobile-head .navbar-brand {
    justify-self: center;
    text-align: center;
    margin: 0;
  }
  .mobile-head .mobile-logo { max-height: 52px; height: auto; display: inline-block; }

  /* Unsichtbarer Spacer mit gleicher Breite wie der Toggler */
  .mobile-head .toggler-spacer {
    width: var(--toggler-w);
    height: 44px;
    opacity: 0;
    pointer-events: none;
  }

  /* Mobile: Menüpunkte im Collapse vertikal */
  .navbar-nav { flex-direction: column; align-items: flex-start; gap: 10px; }

  /* Mobile: Kontakt-Buttons unter Logo zentriert */
  .contact-buttons { justify-content: center; gap: 14px; }
}

/* =========================================
   Sections, Typo, Links
========================================= */
section { padding: 80px 20px; }

.section-title {
  text-align: center;
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 50px;
}

.primary-blue { color: var(--primary-blue); }

.bg-light-section { background: var(--bg-light); color: var(--text-dark); }
.bg-dark-section  { background: var(--bg-dark);  color: var(--text-light); }

a { color: var(--primary-blue); }
a:hover, a:focus { color: #095a8e; }

/* =========================================
   Hero
========================================= */
.hero-section {
  position: relative;
  background: url('/static/media/hero.gif') top/cover no-repeat;
  min-height: 60vh;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 120px 20px 80px;
}
.hero-section::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
}
.hero-section h1 {
  position: relative;
  font-size: 2.2rem;
  font-weight: 700;
  color: #fff;
  z-index: 1;
  margin: 0;
}

/* =========================================
   Services Grid & Tiles
========================================= */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 25px;
}
@media (min-width: 900px) { .services-grid { grid-template-columns: repeat(3, 1fr); } }

.service-tile {
  position: relative;
  height: 250px;
  background-size: cover;
  background-position: center;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(0,0,0,0.3);
  transition: transform .3s ease, box-shadow .3s ease;
}
.service-tile::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(14,118,187,.4), rgba(14,118,187,.8));
  transition: background .3s ease;
}
.service-tile:hover {
  transform: translateY(-8px) scale(1.03);
  box-shadow: 0 12px 25px rgba(0,0,0,0.4);
}

.service-content { position: absolute; bottom: 20px; left: 20px; right: 20px; z-index: 1; }
.service-content h4 { margin: 0 0 8px; font-weight: 700; font-size: 1.3rem; color: #fff; }
.service-content p  { margin: 0; font-size: .95rem; color: #f0f0f0; }

/* =========================================
   Price Cards
========================================= */
.price-card {
  background: #2e2e2f;
  border: none;
  border-radius: 12px;
  padding: 30px;
  text-align: center;
  box-shadow: 0 6px 15px rgba(0,0,0,0.4);
  color: var(--text-light);
}
.price-card h5 { color: #fff; margin-bottom: 15px; font-weight: 700; }
.price-card ul { list-style: none; padding: 0; margin: 0; text-align: left; }
.price-card ul li { margin: .25rem 0; }
.price-card ul li::before { content: "✔"; color: var(--primary-blue); margin-right: 8px; }

/* =========================================
   Footer
========================================= */
footer a { color: #fff; text-decoration: none; }
footer a:hover, footer a:focus { color: var(--primary-blue); text-decoration: underline; }

/* === FINAL MOBILE NAV CENTER FIX === */
@media (max-width: 991.98px) {
  /* Grid wirklich nutzen & Item-Ausrichtungen explizit setzen */
  .mobile-head {
    display: grid !important;
    grid-template-columns: auto 1fr auto; /* Toggler | Mitte | Spacer */
    align-items: center;
    justify-items: center;
    gap: .5rem;
    min-height: 60px;
    padding: .25rem .5rem;
  }

  /* Sicherstellen: keine absolute Positionen wirken noch */
  .mobile-head .navbar-toggler,
  .mobile-head .navbar-brand {
    position: static !important;
  }

  /* Linkes Item (Toggler) wirklich links halten */
  .mobile-head > .navbar-toggler {
    justify-self: start !important;
    width: 48px; height: 44px;
    padding: 0; margin: 0;
    display: inline-flex; align-items: center; justify-content: center;
    border-color: rgba(255,255,255,.5);
    filter: none;
  }
  .mobile-head > .navbar-toggler .navbar-toggler-icon {
    width: 24px; height: 24px; background-size: 100% 100%;
  }

  /* Mittleres Item (Logo) zentrieren */
  .mobile-head > .navbar-brand {
    justify-self: center !important;
    text-align: center !important;
    margin: 0 !important;
  }
  .mobile-head > .navbar-brand img,
  .mobile-head > .navbar-brand .mobile-logo {
    max-height: 52px; height: auto;
    display: inline-block; /* wichtig für zentriertes text-align */
  }

  /* Rechtes Item (unsichtbarer Spacer) wirklich rechts halten */
  .mobile-head > .toggler-spacer {
    justify-self: end !important;
    width: 48px; height: 44px;
    opacity: 0; pointer-events: none;
  }
}
/* --- Mobile Nav: zentriertes Logo + zuverlässige Gaps --- */
@media (max-width: 991.98px) {
  /* Container-Flex neutralisieren: mobile-head bekommt volle Breite */
  .sticky-header .container-fluid { display: block; }

  .sticky-header .mobile-head {
    display: grid !important;
    grid-template-columns: 48px 1fr 48px; /* Toggler | Logo | Spacer */
    align-items: center;
    column-gap: 8px; /* zuverlässiger als gap auf manchen mobilen Browsern */
    width: 100%;
    min-height: 60px;
    padding: 6px 8px;
  }

  /* Toggler: feste Breite/Höhe, keine externen Margins von Bootstrap */
  .sticky-header .mobile-head > .navbar-toggler {
    justify-self: start;
    width: 48px; height: 44px;
    padding: 0; margin: 0;
    display: inline-flex; align-items: center; justify-content: center;
    border-color: rgba(255,255,255,.5);
    filter: none;
  }
  .sticky-header .mobile-head > .navbar-toggler .navbar-toggler-icon {
    width: 24px; height: 24px; background-size: 100% 100%;
  }

  /* Brand: alle Bootstrap-Abstände killen und wirklich zentrieren */
  .sticky-header .mobile-head > .navbar-brand {
    justify-self: center;
    text-align: center;
    margin: 0 !important;
    padding: 0 !important;
  }
  .sticky-header .mobile-head > .navbar-brand img,
  .sticky-header .mobile-head > .navbar-brand .mobile-logo {
    max-height: 52px;
    height: auto;
    display: inline-block;
  }

  /* Spacer: spiegelt die Toggler-Breite, hält die Mitte wirklich mittig */
  .sticky-header .mobile-head > .toggler-spacer {
    justify-self: end;
    width: 48px; height: 44px;
    opacity: 0; pointer-events: none;
  }

  /* Kollabierte Liste untereinander und Kontakt-Buttons zentriert */
  .sticky-header .navbar-nav { flex-direction: column; align-items: flex-start; gap: 10px; }
  .sticky-header .contact-buttons { justify-content: center; gap: 14px; }
}

.primary-blue {
  color: var(--primary-blue);
}
