/* ============================================================================ */
/* Page Header – matching chiemgau.bavaria design */
/* ============================================================================ */
/* ============================================================================ */
/* Header */
/* ============================================================================ */
#pageHeader {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1030;
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
  height: 120px;
  padding-left: 210px;
  padding-right: 50px;
  padding-top: 18px;
  background: linear-gradient(180deg, rgba(22, 52, 95, 0.85) 0%, rgba(22, 52, 95, 0) 100%);
  color: #fff;
  transition: background 0.25s ease, color 0.25s ease, height 0.25s ease, border-color 0.25s ease;
}
#pageHeader.pageHeader--background {
  background: #ffffff;
  border-bottom: 1px solid #c8c8c8;
  color: #292929;
  height: 70px;
  padding-top: 0;
}
@media (max-width: 1729.98px) {
  #pageHeader {
    height: 70px;
    padding-left: 110px;
    padding-right: 18px;
    padding-top: 0;
  }
  #pageHeader.pageHeader--background {
    height: 70px;
  }
}

/* ============================================================================ */
/* Logo */
/* ============================================================================ */
#pageHeader__logo {
  position: absolute;
  left: 20px;
  top: 0;
  display: block;
  overflow: hidden;
}
#pageHeader__logo .pageHeader__logo__img {
  height: 110px;
  width: auto;
  display: block;
  transition: height 0.25s ease;
}
@media (max-width: 1729.98px) {
  #pageHeader__logo .pageHeader__logo__img {
    height: 60px;
    margin-top: 0;
  }
}

#pageHeader.pageHeader--background #pageHeader__logo .pageHeader__logo__img {
  height: 55px;
}

/* ============================================================================ */
/* Desktop Main Navigation */
/* ============================================================================ */
#mainNav {
  display: inline-flex;
  align-items: flex-start;
  height: 100%;
}
@media (max-width: 1729.98px) {
  #mainNav {
    display: none;
  }
}

.mainNav__item1 {
  position: relative;
  display: flex;
  align-items: stretch;
  margin: 0 20px 0 0;
}
.mainNav__item1 > .mainNav__item1__link {
  position: relative;
  display: flex;
  align-items: flex-start;
  padding: 32px 15px 21px;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 1.8px;
  line-height: 1.25em;
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s ease, color 0.2s ease;
}
.mainNav__item1 > .mainNav__item1__link:hover, .mainNav__item1 > .mainNav__item1__link:focus {
  background: rgba(22, 52, 95, 0.85);
  color: #fff;
  outline: none;
}
/* Underline sits at the bottom of the link, inset to the text width */
.mainNav__item1 > .mainNav__item1__link::after {
  content: "";
  position: absolute;
  left: 15px;
  right: 15px;
  bottom: 0;
  height: 3px;
  background: transparent;
  transition: background 0.2s ease;
}
.mainNav__item1:hover > .mainNav__item1__link::after, .mainNav__item1:focus-within > .mainNav__item1__link::after {
  background: #fff;
}
/* Scrolled state: dark text, tighter padding for the 70px header */
#pageHeader.pageHeader--background .mainNav__item1 > .mainNav__item1__link {
  padding-top: 24px;
  padding-bottom: 22px;
  color: #292929;
}
#pageHeader.pageHeader--background .mainNav__item1 > .mainNav__item1__link:hover, #pageHeader.pageHeader--background .mainNav__item1 > .mainNav__item1__link:focus {
  background: #16345F;
  color: #fff;
}

/* ============================================================================ */
/* Desktop Dropdown (level 2) */
/* ============================================================================ */
.mainNav__item__structure2 {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  background: #16345F;
  padding: 20px 20px 30px;
  min-width: 210px;
  max-width: 24vw;
  white-space: normal;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: top 0.3s ease, opacity 0.3s ease;
  z-index: 100;
}
.mainNav__item1:hover .mainNav__item__structure2, .mainNav__item1:focus-within .mainNav__item__structure2 {
  opacity: 1;
  top: calc(100% - 1px);
  visibility: visible;
  pointer-events: auto;
}

.mainNav__item2:not(:last-child) {
  margin-bottom: 10px;
}

.mainNav__item2__link {
  display: block;
  color: #fff;
  font-size: 17px;
  font-weight: 400;
  line-height: 1.5em;
  text-decoration: none;
  padding: 8px 0;
}
.mainNav__item2__link:hover, .mainNav__item2__link:focus {
  color: #ADBF52;
}

/* ============================================================================ */
/* Functional Nav (right side) */
/* ============================================================================ */
#pageHeader__func {
  display: inline-flex;
  align-items: flex-start;
  height: 100%;
}
@media (max-width: 1729.98px) {
  #pageHeader__func {
    align-items: stretch;
  }
}

.pageHeader__func__item {
  display: flex;
  align-items: flex-start;
  padding: 32px 0 21px;
  margin-left: 40px;
  color: inherit;
  text-decoration: none;
  font-size: 17px;
  font-weight: 400;
  cursor: pointer;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.pageHeader__func__item:hover, .pageHeader__func__item:focus {
  color: #ADBF52;
  border-bottom-color: #fff;
  outline: none;
}
.pageHeader__func__item .pageHeader__func__item__icon {
  font-size: 20px;
  margin-right: 6px;
}
.pageHeader__func__item .pageHeader__func__item__text {
  font-size: 18px;
  line-height: 1.25em;
}
@media (max-width: 1729.98px) {
  .pageHeader__func__item {
    margin-left: 0;
    height: 100%;
    border-bottom: none;
    padding: 0 16px;
    align-items: center;
  }
  .pageHeader__func__item .pageHeader__func__item__icon {
    font-size: 26px;
    margin-right: 0;
  }
}

.pageHeader__func__item--search .pageHeader__func__item__text {
  border-bottom: 2px solid rgba(255, 255, 255, 0.7);
  padding-bottom: 8px;
  min-width: 120px;
}
.pageHeader__func__item--search:hover .pageHeader__func__item__text, .pageHeader__func__item--search:focus .pageHeader__func__item__text {
  border-bottom-color: #fff;
}

#pageHeader.pageHeader--background .pageHeader__func__item--search .pageHeader__func__item__text {
  border-bottom-color: rgba(41, 41, 41, 0.45);
}

/* User icon (login link when anonymous, menu trigger when signed in) */
/* Icon box gets the main nav's text line height (17px * 1.25) so the glyph */
/* centers on the same line as "Unternehmen A-Z" / "Gewerbeimmobilien". */
.pageHeader__func__item--user .pageHeader__func__item__icon {
  display: flex;
  align-items: center;
  height: 21.25px;
  font-size: 26px;
  line-height: 1;
  margin-right: 0;
}
.pageHeader__func__item--user .pageHeader__func__item__icon::before {
  vertical-align: 0;
}

/* Scrolled state: same padding as .mainNav__item1__link */
@media (min-width: 1730px) {
  #pageHeader.pageHeader--background .pageHeader__func__item {
    padding-top: 24px;
    padding-bottom: 22px;
  }
}
/* User menu (icon trigger + dropdown) */
.pageHeader__func__menu {
  position: relative;
  display: flex;
  align-items: stretch;
}

.pageHeader__func__menu__list {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: #16345F;
  padding: 20px;
  min-width: 180px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: top 0.3s ease, opacity 0.3s ease;
  z-index: 100;
}
.pageHeader__func__menu:hover .pageHeader__func__menu__list, .pageHeader__func__menu:focus-within .pageHeader__func__menu__list {
  opacity: 1;
  top: calc(100% - 1px);
  visibility: visible;
  pointer-events: auto;
}

.pageHeader__func__menu__link {
  display: block;
  color: #fff;
  font-size: 17px;
  font-weight: 400;
  line-height: 1.5em;
  text-decoration: none;
  padding: 8px 0;
  white-space: nowrap;
}
.pageHeader__func__menu__link:hover, .pageHeader__func__menu__link:focus {
  color: #ADBF52;
}

/* Mobile hamburger always stays white */
#pageHeader__opener {
  color: #fff !important;
}

/* Scrolled state for func items */
#pageHeader.pageHeader--background .pageHeader__func__item {
  color: #292929;
  border-bottom-color: transparent;
}
@media (min-width: 1730px) {
  #pageHeader.pageHeader--background .pageHeader__func__item {
    padding-top: 24px;
    padding-bottom: 22px;
  }
}
#pageHeader.pageHeader--background .pageHeader__func__item:hover, #pageHeader.pageHeader--background .pageHeader__func__item:focus {
  color: #16345F;
  border-bottom-color: #16345F;
}

/* ============================================================================ */
/* Mobile Off-canvas Menu */
/* ============================================================================ */
#mobileNav {
  background: #0e2341;
  max-width: 500px;
}
#mobileNav .offcanvas-header {
  padding: 20px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  min-height: 70px;
}
#mobileNav .offcanvas-body {
  padding: 0;
  overflow-y: auto;
}

.mainNav__mobile__link {
  display: block;
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  text-decoration: none;
  padding: 18px 40px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  transition: background 0.15s ease;
}
.mainNav__mobile__link:hover, .mainNav__mobile__link:focus {
  background: rgba(0, 0, 0, 0.2);
  color: #fff;
}
.mainNav__mobile__link.mainNav__mobile__link--action {
  font-weight: 400;
  text-transform: none;
  color: rgba(255, 255, 255, 0.8);
  letter-spacing: normal;
}

.mainNav__mobile__sub {
  background: rgba(0, 0, 0, 0.15);
}
.mainNav__mobile__sub .mainNav__mobile__sub__link {
  display: block;
  color: rgba(255, 255, 255, 0.85);
  font-size: 15px;
  font-weight: 400;
  text-decoration: none;
  padding: 12px 40px 12px 60px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.mainNav__mobile__sub .mainNav__mobile__sub__link:hover, .mainNav__mobile__sub .mainNav__mobile__sub__link:focus {
  color: #fff;
  background: rgba(0, 0, 0, 0.1);
}

.mainNav__mobile__divider {
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  margin: 10px 0;
}

/* ============================================================================ */
/* Responsive display helpers at the 1730px navbar breakpoint */
/* Use these instead of Bootstrap's d-lg-* in navbar templates. */
/* ============================================================================ */
.nav-desktop {
  display: none !important;
}
@media (min-width: 1730px) {
  .nav-desktop {
    display: flex !important;
  }
}

.nav-mobile {
  display: flex !important;
}
@media (min-width: 1730px) {
  .nav-mobile {
    display: none !important;
  }
}

/* ============================================================================ */
/* Admin Navbar (separate, unchanged purpose) */
/* ============================================================================ */
.navbar-admin {
  height: 70px;
  background-color: #16345F !important;
}

/* The logo hangs from the top edge and fills the admin bar down to its
   coloured border (bar 70px incl. 4px border; the image is 226x187). */
.navbar-admin .navbar-brand {
  padding: 0;
}
.navbar-admin .navbar-logo {
  height: 66px;
  width: auto;
}
