/* ============================================================
   HEADER – FIXED, PREMIUM, SAUBER
============================================================ */

.top-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: rgba(255,255,255,0.88);
  backdrop-filter: blur(12px);
  padding: 1rem 2.4rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

/* WICHTIG: Platzverteilung */
.top-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-width: 0;
}

/* LOGO + TITEL */
.header-left {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  min-width: 0;
}

.site-logo {
  width: 50px;
}

.site-title {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  min-width: 0;
}

.site-title-main,
.site-title-sub {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* HAUPTTITEL – EPA-FARBE */
.site-title-main {
  font-size: 2rem;
  font-weight: 700;
  color: #808042;
}

/* UNTERTITEL – EPA-FARBE */
.site-title-sub {
  font-size: 1.2rem;
  opacity: 0.95;
  color: #808042;
}

/* ============================================================
   DESKTOP NAVIGATION
============================================================ */
.header-right {
  margin-left: auto;
  display: flex;
  gap: 2.2rem;
}

.header-right > a,
.nav-main {
  display: inline-flex;
  align-items: center;
  line-height: 1.2;
  padding: 0.7rem 0;
  font-size: 1.35rem;
  font-weight: 600;
  color: #333;
  transition: 0.25s ease;
  cursor: pointer;
}

.header-right > a:hover,
.nav-main:hover {
  color: inherit !important;
}

/* ============================================================
   FUTURISTISCHE NEON-LINIE – STATISCH + GLOW ON HOVER
============================================================ */

.nav-item {
  position: relative;
  padding-bottom: 4px;
}

.nav-item::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0.35em;
  right: 0.35em;
  height: 2px;
  width: calc(100% - 0.7em);
  border-radius: 2px;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.nav-item:hover::after {
  opacity: 1;
}

.nav-item.tragwerk::after {
  background: #ff9f40;
  box-shadow: 0 0 6px #ff9f40, 0 0 12px #ff9f40;
}

.nav-item.energie::after {
  background: #4dcaff;
  box-shadow: 0 0 6px #4dcaff, 0 0 12px #4dcaff;
}

.nav-item.sanierung::after {
  background: #9ea4aa;
  box-shadow: 0 0 6px #9ea4aa, 0 0 12px #9ea4aa;
}

/* ============================================================
   DROPDOWN
============================================================ */

.nav-dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  background: #ffffff;
  border-radius: 10px;
  box-shadow: 0 4px 18px rgba(0,0,0,0.12);
  padding: 0.4rem 0;
  display: none;
  min-width: 200px;
  z-index: 99999;
}

.nav-dropdown:hover .dropdown-menu {
  display: block;
}

.dropdown-menu a {
  display: block;
  padding: 0.9rem 1.4rem 0.9rem 0.8rem;
  color: #333;
  font-size: 1.25rem;
  font-weight: 500;
  text-align: right;
  transition: 0.2s ease;
}

.dropdown-menu a.dd-statik:hover {
  background: rgba(230,126,34,0.12);
  color: #e67e22;
}

.dropdown-menu a.dd-energie:hover {
  background: rgba(41,128,185,0.12);
  color: #2980b9;
}

.dropdown-menu a.dd-sanierung:hover {
  background: rgba(93,109,126,0.15);
  color: #5d6d7e;
}

/* ============================================================
   BURGER MENU
============================================================ */

.burger {
  width: 36px;
  height: 28px;
  position: relative;
  cursor: pointer;
  display: none;
  z-index: 10000;
  margin-left: auto;
  flex-shrink: 0;
}

.burger span {
  position: absolute;
  left: 0;
  width: 100%;
  height: 3px;
  background: #808042 !important;
  border-radius: 3px;
  transition: transform 0.35s ease, opacity 0.25s ease;
}

.burger span:nth-child(1) { top: 0; }
.burger span:nth-child(2) { top: 12px; }
.burger span:nth-child(3) { top: 24px; }

.burger.active span:nth-child(1) {
  transform: translateY(12px) rotate(45deg);
}

.burger.active span:nth-child(2) {
  opacity: 0;
}

.burger.active span:nth-child(3) {
  transform: translateY(-12px) rotate(-45deg);
}

@media (max-width: 900px) {
  .burger { display: block; }
  .header-right { display: none !important; }
}

/* ============================================================
   MOBILE MENU – FIXED HEIGHT BUG (KORRIGIERT)
============================================================ */

.mobile-menu {
  position: fixed;
  top: 70px;
  left: 0;
  right: 0;

  /* FIX: nicht mehr voller Bildschirm */
  height: auto;
  max-height: 0;
  overflow: hidden;

  background: #ffffff;
  box-shadow: 0 4px 14px rgba(0,0,0,0.08);
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  padding: 0 1rem;
  z-index: 9998;

  transition: max-height 0.35s ease;
}

.mobile-menu.active {
  max-height: calc(100vh - 70px);
  padding: 1rem;
}

.mobile-menu a {
  color: #444;
  font-size: 1.1rem;
  padding: 0.5rem 0;
}

/* Accordion */
.accordion-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  color: #444;
  cursor: pointer;
  padding: 0.4rem 0;
}

.accordion-header .arrow {
  transition: transform 0.3s ease;
}

.accordion.open .arrow {
  transform: rotate(90deg);
}

.accordion-content {
  display: none;
  flex-direction: column;
  padding-left: 0.8rem;
  gap: 0.4rem;
}

.accordion.open .accordion-content {
  display: flex;
}

.mobile-menu a.dd-statik:hover { color: #e67e22; }
.mobile-menu a.dd-energie:hover { color: #2980b9; }
.mobile-menu a.dd-sanierung:hover { color: #5d6d7e; }

/* ============================================================
   RESPONSIVE HEADER – MOBILE FIX
============================================================ */

@media (max-width: 900px) {

  .top-header {
    padding: 0.6rem 1.2rem;
  }

  .site-logo {
    width: 48px;
  }

  .site-title-main {
    font-size: 1.4rem;
  }

  .site-title-sub {
    font-size: 0.9rem;
  }
}

/* ============================================================
   AUTOMATISCHE SKALIERUNG FÜR KLEINE HANDYS
============================================================ */

@media (max-width: 420px) {

  .site-logo {
    width: 38px;
  }

  .site-title-main {
    font-size: 1.2rem;
  }

  .site-title-sub {
    font-size: 0.8rem;
  }
}

@media (max-width: 360px) {

  .site-logo {
    width: 32px;
  }

  .site-title-main {
    font-size: 1.05rem;
  }

  .site-title-sub {
    font-size: 0.75rem;
  }
}

/* ============================================================
   FIX: Energieberatung – Titelblock NICHT zentrieren
============================================================ */

body.energie-page .tw-head-left,
body.energie-page .tw-head-inner-left {
    width: 100% !important;
    max-width: none !important;
    display: block !important;
    justify-content: flex-start !important;
    align-items: flex-start !important;
    text-align: left !important;
    margin: 0 !important;
    padding: 0 !important;
}
