/* HB Bau & Service – aufgeräumter Header, Leistungs-Untermenü und Scroll-Animationen */

:root {
  --header-height: 88px;
  --ease-premium: cubic-bezier(.22, 1, .36, 1);
}

html {
  scroll-padding-top: 105px;
}

body.nav-open {
  overflow: hidden;
}

.scroll-progress {
  position: fixed;
  inset: 0 auto auto 0;
  width: 0;
  height: 3px;
  z-index: 9999;
  pointer-events: none;
  background: linear-gradient(90deg, #ff7900, #ffb04d);
  box-shadow: 0 0 18px rgba(255, 121, 0, .7);
}

.site-header {
  z-index: 1000 !important;
  transition: background .35s ease, box-shadow .35s ease, border-color .35s ease;
}

.site-header.is-scrolled {
  background: rgba(7, 7, 7, .96) !important;
  border-bottom-color: rgba(255, 121, 0, .18) !important;
  box-shadow: 0 14px 40px rgba(0, 0, 0, .32);
}

.header-inner {
  position: relative;
  min-height: var(--header-height) !important;
  gap: 22px !important;
  transition: min-height .35s var(--ease-premium);
}

.site-header.is-scrolled .header-inner {
  min-height: 72px !important;
}

.brand {
  flex: 0 0 auto;
  min-width: max-content;
}

.brand img {
  width: 70px !important;
  height: 54px !important;
  transition: width .35s var(--ease-premium), height .35s var(--ease-premium), transform .35s var(--ease-premium);
}

.brand:hover img {
  transform: translateY(-2px) scale(1.02);
}

.site-header.is-scrolled .brand img {
  width: 60px !important;
  height: 46px !important;
}

.header-social-icons {
  display: none !important;
}

.main-nav {
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 4px !important;
  margin-left: auto;
  font-size: 15px !important;
}

.nav-link,
.nav-dropdown-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  padding: 10px 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #ececec;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  transition: color .22s ease, background .22s ease, transform .22s ease;
}

.nav-link::after,
.nav-dropdown-toggle::after {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 5px;
  height: 2px;
  border-radius: 99px;
  background: #ff7900;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform .28s var(--ease-premium);
}

.nav-link:hover,
.nav-dropdown-toggle:hover,
.nav-link.is-active,
.nav-dropdown-toggle.is-active,
.nav-dropdown.is-open > .nav-dropdown-toggle {
  color: #ff9a37;
  background: rgba(255, 121, 0, .08);
}

.nav-link:hover::after,
.nav-dropdown-toggle:hover::after,
.nav-link.is-active::after,
.nav-dropdown-toggle.is-active::after,
.nav-dropdown.is-open > .nav-dropdown-toggle::after {
  transform: scaleX(1);
}

.nav-caret {
  width: 14px;
  height: 14px;
  transition: transform .28s var(--ease-premium);
}

.nav-dropdown.is-open .nav-caret,
.nav-dropdown:hover .nav-caret {
  transform: rotate(180deg);
}

.nav-dropdown {
  position: relative;
}

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 14px);
  left: 50%;
  width: min(660px, 82vw);
  padding: 14px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  background: rgba(17, 17, 17, .98);
  border: 1px solid rgba(255, 255, 255, .11);
  border-top: 3px solid #ff7900;
  border-radius: 22px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, .52);
  backdrop-filter: blur(20px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate(-50%, 12px) scale(.98);
  transform-origin: top center;
  transition: opacity .24s ease, visibility .24s ease, transform .34s var(--ease-premium);
}

.nav-dropdown-menu::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -10px;
  width: 18px;
  height: 18px;
  background: #ff7900;
  transform: translateX(-50%) rotate(45deg);
  z-index: -1;
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu,
.nav-dropdown.is-open .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate(-50%, 0) scale(1);
}

.nav-dropdown-menu a {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 12px;
  align-items: center;
  min-width: 0;
  padding: 13px;
  border: 1px solid transparent;
  border-radius: 15px;
  color: #fff;
  transition: background .22s ease, border-color .22s ease, transform .22s ease;
}

.nav-dropdown-menu a:hover,
.nav-dropdown-menu a.is-active {
  color: #fff !important;
  background: linear-gradient(135deg, rgba(255, 121, 0, .16), rgba(255, 255, 255, .05));
  border-color: rgba(255, 121, 0, .28);
  transform: translateY(-2px);
}

.dropdown-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  color: #111;
  background: linear-gradient(135deg, #ff7900, #ffad42);
  font-size: 15px;
  font-weight: 950;
  box-shadow: 0 10px 24px rgba(255, 121, 0, .18);
}

.dropdown-copy {
  min-width: 0;
}

.dropdown-copy strong {
  display: block;
  color: #fff;
  font-size: 15px;
  line-height: 1.2;
  margin-bottom: 3px;
}

.dropdown-copy small {
  display: block;
  color: #a9a9a9;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
}

.dropdown-overview {
  grid-column: 1 / -1;
  display: flex !important;
  grid-template-columns: none !important;
  justify-content: center;
  padding: 11px 14px !important;
  color: #ff9a37 !important;
  background: rgba(255, 121, 0, .08);
  border-color: rgba(255, 121, 0, .2) !important;
  font-weight: 900;
}

.header-btn {
  flex: 0 0 auto;
  padding: 13px 19px !important;
  white-space: nowrap;
  transition: transform .25s var(--ease-premium), box-shadow .25s ease, filter .25s ease;
}

.header-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 38px rgba(255, 121, 0, .35) !important;
  filter: brightness(1.04);
}

.nav-toggle {
  display: none;
  position: relative;
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 14px;
  background: rgba(255, 255, 255, .06);
  cursor: pointer;
}

.nav-toggle span {
  position: absolute;
  left: 13px;
  width: 22px;
  height: 2px;
  border-radius: 99px;
  background: #fff;
  transition: transform .28s var(--ease-premium), opacity .2s ease, top .28s var(--ease-premium);
}

.nav-toggle span:nth-child(1) { top: 15px; }
.nav-toggle span:nth-child(2) { top: 23px; }
.nav-toggle span:nth-child(3) { top: 31px; }

.nav-toggle[aria-expanded="true"] span:nth-child(1) { top: 23px; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { top: 23px; transform: rotate(-45deg); }

.mobile-nav-cta {
  display: none;
}

.nav-backdrop {
  position: fixed;
  inset: 0;
  z-index: 990;
  background: rgba(0, 0, 0, .62);
  backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s ease, visibility .25s ease;
}

body.nav-open .nav-backdrop {
  opacity: 1;
  visibility: visible;
}

/* Scroll-Animationen */
.js-enabled [data-reveal] {
  opacity: 0;
  transition:
    opacity .82s var(--ease-premium),
    transform .82s var(--ease-premium),
    filter .82s var(--ease-premium);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}

.js-enabled [data-reveal="up"] {
  transform: translate3d(0, 42px, 0);
}

.js-enabled [data-reveal="left"] {
  transform: translate3d(-50px, 0, 0);
}

.js-enabled [data-reveal="right"] {
  transform: translate3d(50px, 0, 0);
}

.js-enabled [data-reveal="scale"] {
  transform: scale(.92);
  filter: blur(3px);
}

.js-enabled [data-reveal].is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
  filter: blur(0);
}

.hero-content > *,
.service-hero .container > * {
  animation: heroEnter .8s var(--ease-premium) both;
}

.hero-content > *:nth-child(2),
.service-hero .container > *:nth-child(2) { animation-delay: .08s; }
.hero-content > *:nth-child(3),
.service-hero .container > *:nth-child(3) { animation-delay: .16s; }
.hero-content > *:nth-child(4),
.service-hero .container > *:nth-child(4) { animation-delay: .24s; }
.hero-content > *:nth-child(5),
.service-hero .container > *:nth-child(5) { animation-delay: .32s; }

@keyframes heroEnter {
  from { opacity: 0; transform: translateY(28px); }
  to { opacity: 1; transform: translateY(0); }
}

.service-card,
.service-hub-card,
.benefit-card,
.related-card,
.faq-item,
.area-card,
.content-card,
.side-card,
.service-explanation-card {
  transition: transform .32s var(--ease-premium), box-shadow .32s ease, border-color .32s ease !important;
}

.service-card:hover,
.service-hub-card:hover,
.benefit-card:hover,
.related-card:hover,
.faq-item:hover,
.area-card:hover,
.service-explanation-card:hover {
  transform: translateY(-7px);
  border-color: rgba(255, 121, 0, .3) !important;
  box-shadow: 0 26px 70px rgba(0, 0, 0, .32) !important;
}

@media (max-width: 1120px) {
  .brand span {
    display: none;
  }

  .nav-link,
  .nav-dropdown-toggle {
    padding-inline: 12px;
  }
}

@media (max-width: 980px) {
  :root {
    --header-height: 76px;
  }

  .header-inner {
    min-height: var(--header-height) !important;
  }

  .site-header.is-scrolled .header-inner {
    min-height: 68px !important;
  }

  .brand span {
    display: inline;
  }

  .header-btn {
    display: none !important;
  }

  .nav-toggle {
    display: block;
    margin-left: auto;
    z-index: 1002;
  }

  .main-nav {
    position: fixed;
    inset: 76px 14px auto 14px;
    z-index: 1001;
    display: flex !important;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 5px !important;
    max-height: calc(100vh - 96px);
    overflow: auto;
    padding: 14px;
    margin: 0;
    border: 1px solid rgba(255, 255, 255, .12);
    border-top: 3px solid #ff7900;
    border-radius: 22px;
    background: rgba(15, 15, 15, .985);
    box-shadow: 0 28px 80px rgba(0, 0, 0, .58);
    backdrop-filter: blur(22px);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-18px) scale(.98);
    transform-origin: top;
    transition: opacity .24s ease, visibility .24s ease, transform .34s var(--ease-premium);
  }

  body.nav-open .main-nav {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
  }

  .nav-link,
  .nav-dropdown-toggle {
    width: 100%;
    min-height: 48px;
    justify-content: space-between;
    padding: 12px 14px;
    border-radius: 13px;
  }

  .nav-link::after,
  .nav-dropdown-toggle::after {
    display: none;
  }

  .nav-dropdown-menu {
    position: static;
    width: 100%;
    max-height: 0;
    overflow: hidden;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
    border: 0;
    border-radius: 14px;
    box-shadow: none;
    background: rgba(255, 255, 255, .035);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
    transition: max-height .42s var(--ease-premium), padding .3s ease, margin .3s ease;
  }

  .nav-dropdown-menu::before {
    display: none;
  }

  .nav-dropdown:hover .nav-dropdown-menu,
  .nav-dropdown:focus-within .nav-dropdown-menu {
    max-height: 0;
    padding: 0;
    margin: 0;
  }

  .nav-dropdown.is-open .nav-dropdown-menu {
    max-height: 720px;
    padding: 8px;
    margin-top: 4px;
  }

  .nav-dropdown-menu a {
    grid-template-columns: 38px 1fr;
    padding: 10px;
  }

  .dropdown-icon {
    width: 38px;
    height: 38px;
    border-radius: 11px;
  }

  .dropdown-overview {
    justify-content: flex-start;
  }

  .mobile-nav-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 50px;
    margin-top: 6px;
    border-radius: 14px;
    background: linear-gradient(135deg, #ff7900, #ffad42);
    color: #111 !important;
    font-weight: 950;
  }
}

@media (max-width: 620px) {
  .brand span {
    display: none;
  }

  .main-nav {
    inset-inline: 10px;
  }

  .nav-dropdown-menu a {
    grid-template-columns: 36px 1fr;
  }

  .dropdown-copy small {
    font-size: 11px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }

  .js-enabled [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
  }
}
