/* =========================================================
   AJORDI.CH – HEADER UND MOBILE NAVIGATION
   ========================================================= */

:root {
  --header-background: #ffffff;
  --header-text: #111111;
  --header-accent: #c62828;
  --header-border: rgba(0, 0, 0, 0.09);
  --header-shadow: 0 10px 28px rgba(0, 0, 0, 0.10);
}

.site-header {
  position: fixed;
  top: 0;
  z-index: 3000;
  width: 100%;
  background: var(--header-background);
  border-bottom: 1px solid var(--header-border);
}

.site-header .header-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  gap: 2rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--header-text);
  text-decoration: none;
  flex-shrink: 0;
}

.brand-logo {
  display: block;
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.brand-text {
  font-weight: 700;
  font-size: 1.2rem;
}

.site-nav {
  margin-left: auto;
}

.nav-list,
.dropdown-menu {
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.nav-list a,
.dropdown-toggle {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.65rem 0.85rem;
  border: 0;
  border-radius: 0.55rem;
  background: transparent;
  color: var(--header-text);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition:
    color 0.2s ease,
    background-color 0.2s ease;
}

.nav-list a:hover,
.nav-list a:focus-visible,
.dropdown-toggle:hover,
.dropdown-toggle:focus-visible {
  color: var(--header-accent);
  background: rgba(198, 40, 40, 0.08);
  outline: none;
}

.nav-dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 0.3rem);
  left: 0;
  display: none;
  min-width: 250px;
  padding: 0.5rem;
  background: var(--header-background);
  border: 1px solid var(--header-border);
  border-radius: 0.7rem;
  box-shadow: var(--header-shadow);
}

.nav-dropdown:hover > .dropdown-menu,
.nav-dropdown:focus-within > .dropdown-menu,
.nav-dropdown.is-open > .dropdown-menu {
  display: block;
}

.dropdown-menu a {
  display: flex;
  width: 100%;
}

/* Hamburger ist auf grossen Bildschirmen verborgen. */
.menu-toggle {
  display: none;
}

/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 900px) {
  .site-header .header-inner {
    min-height: 68px;
  }

  .menu-toggle {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: 46px;
    height: 46px;
    margin-left: auto;
    padding: 8px;
    border: 0;
    border-radius: 0.55rem;
    background: transparent;
    cursor: pointer;
    z-index: 2;
  }

  .menu-toggle:hover,
  .menu-toggle:focus-visible {
    background: rgba(198, 40, 40, 0.08);
    outline: none;
  }

  .menu-toggle span {
    display: block;
    width: 27px;
    height: 3px;
    background: var(--header-text);
    border-radius: 999px;
    transform-origin: center;
    transition:
      transform 0.25s ease,
      opacity 0.2s ease,
      background-color 0.2s ease;
  }

  .menu-toggle.is-open span,
  .menu-toggle:hover span {
    background: var(--header-accent);
  }

  .menu-toggle.is-open span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }

  .menu-toggle.is-open span:nth-child(2) {
    opacity: 0;
  }

  .menu-toggle.is-open span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }

  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    width: 100%;
    max-height: calc(100vh - 68px);
    margin: 0;
    padding: 0.8rem 1rem 1.2rem;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: var(--header-background);
    border-top: 1px solid var(--header-border);
    box-shadow: var(--header-shadow);
  }

  .site-nav.is-open {
    display: block;
  }

  .nav-list {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.25rem;
  }

  .nav-list > li,
  .nav-list a,
  .dropdown-toggle {
    width: 100%;
  }

  .nav-list a,
  .dropdown-toggle {
    justify-content: flex-start;
    min-height: 48px;
    padding: 0.75rem 0.85rem;
    text-align: left;
  }

  .dropdown-toggle::after {
    content: "▾";
    margin-left: auto;
    transition: transform 0.2s ease;
  }

  .nav-dropdown.is-open > .dropdown-toggle::after {
    transform: rotate(180deg);
  }

  .dropdown-menu {
    position: static;
    display: none;
    min-width: 0;
    margin: 0 0 0.45rem;
    padding: 0.25rem 0 0.25rem 0.8rem;
    border: 0;
    border-left: 3px solid rgba(198, 40, 40, 0.25);
    border-radius: 0;
    box-shadow: none;
  }

  .nav-dropdown:hover > .dropdown-menu,
  .nav-dropdown:focus-within > .dropdown-menu {
    display: none;
  }

  .nav-dropdown.is-open > .dropdown-menu {
    display: block;
  }

  body.mobile-menu-open {
    overflow: hidden;
  }
}

/* =========================================================
   KORREKTUR: REMOTE-SUPPORT-SYMBOL
   ========================================================= */

.nav-remote-support {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
}

.remote-support-link {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 58px;
  min-width: 58px;
  height: 58px;
  min-height: 58px;
  padding: 4px !important;
  overflow: hidden;
}

.remote-support-icon {
  display: block;
  width: 48px !important;
  max-width: 48px !important;
  height: 48px !important;
  max-height: 48px !important;
  object-fit: contain;
}

/* Beide Klassennamen werden unterstützt. */
.main-navigation.is-open,
.site-nav.is-open {
  display: block;
}

@media (max-width: 900px) {
  .nav-remote-support {
    width: 100%;
  }

  .remote-support-link {
    justify-content: flex-start;
    width: 100%;
    min-width: 0;
    height: auto;
    min-height: 48px;
    padding: 0.65rem 0.85rem !important;
  }

  .remote-support-icon {
    width: 38px !important;
    max-width: 38px !important;
    height: 38px !important;
    max-height: 38px !important;
  }
}
