/* ===== SITE HEADER ===== */
.site-header {
  background: var(--color-bg-white);
  border-bottom: 1px solid var(--color-border);
}

/* --- ROW 1: USP BAR --- */
.usp-bar {
  background: #f7f7f7;
  border-bottom: 1px solid var(--color-border-light);
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}
.usp-bar-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 6px var(--padding-desktop);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.usp-items {
  display: flex;
  gap: 24px;
  align-items: center;
}
.usp-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-weight: 500;
  white-space: nowrap;
}
.usp-item svg {
  width: 14px;
  height: 14px;
  color: var(--color-primary);
  flex-shrink: 0;
}
/* Same 24px target trick as the service link below. */
.usp-link {
  padding: 5px 0;
  margin: -5px 0;
  color: inherit;
  text-decoration: none;
}
.usp-link:hover {
  color: var(--color-primary-text);
}
.usp-service-link {
  display: flex;
  align-items: center;
  gap: 5px;
  /* A 24px target (2.5.8) without making the bar, and so the 147px header, any taller. */
  padding: 5px 0;
  margin: -5px 0;
  border: 0;
  background: none;
  font-family: inherit;
  font-size: inherit;
  color: var(--color-text-muted);
  text-decoration: none;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
}
.usp-service-link svg {
  width: 14px;
  height: 14px;
  color: var(--color-primary);
}
.usp-service-link:hover {
  color: var(--color-primary-text);
}
.usp-service-dropdown .usp-service-menu {
  left: auto;
  right: 0;
}

/* --- ROW 2: LOGO + SEARCH + ACTIONS --- */
.header-main {
  border-bottom: 1px solid var(--color-border-light);
}
.header-main-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 14px var(--padding-desktop);
  display: flex;
  align-items: center;
  gap: 32px;
}
.header-logo img {
  height: 44px;
  width: auto;
}
.header-search {
  flex: 1;
  max-width: 480px;
  display: flex;
  align-items: center;
  border: 2px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color 0.2s;
}
.header-search:focus-within {
  border-color: var(--color-primary);
}
.header-search-input {
  flex: 1;
  border: none;
  outline: none;
  padding: 10px 16px;
  font-size: var(--font-size-md);
  font-family: var(--font-family);
  color: var(--color-text);
}
.header-search-input::placeholder {
  color: var(--color-text-placeholder);
}
.header-search-btn {
  background: var(--color-primary-strong);
  border: none;
  color: white;
  padding: 10px 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.header-search-btn svg {
  width: 20px;
  height: 20px;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-left: auto;
}
.header-social {
  display: flex;
  align-items: center;
  gap: 8px;
}
.header-social-label {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  white-space: nowrap;
}
.header-social-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--color-text);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: background 0.2s;
}
.header-social-icon svg {
  width: 18px;
  height: 18px;
}
.header-social-icon[aria-label="Facebook"] {
  background: var(--color-facebook);
}
.header-social-icon[aria-label="Instagram"] {
  background: var(--color-instagram);
}
.header-social-icon:hover {
  background: var(--color-primary);
}
.btn-inserat {
  background: var(--color-primary-strong);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 20px;
  font-weight: 600;
  font-size: var(--font-size-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  white-space: nowrap;
}
.btn-inserat:hover {
  background: var(--color-primary-strong-hover);
}
.btn-mein-konto {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  border: 1.5px solid var(--color-border-input);
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: var(--font-size-md);
  color: var(--color-text);
  text-decoration: none;
  white-space: nowrap;
  transition: border-color 0.2s;
}
.btn-mein-konto svg {
  width: 18px;
  height: 18px;
}
.btn-mein-konto-label {
  max-width: 18ch;
  overflow: hidden;
  text-overflow: ellipsis;
}
.btn-mein-konto:hover {
  border-color: var(--color-primary);
  color: var(--color-primary-text);
}

/* --- ROW 3: MAIN NAVIGATION --- */
.header-nav {
  background: var(--color-bg-white);
}
.header-nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--padding-desktop);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.header-nav-links {
  display: flex;
  align-items: center;
  gap: 0;
}
/* Direct children only: the entries inside the dropdowns are links too and have a style of
   their own. */
.header-nav-links > a {
  padding: 12px 14px;
  font-size: var(--font-size-md);
  font-weight: 500;
  color: var(--color-text);
  text-decoration: none;
  white-space: nowrap;
}
.header-nav-links > a:hover,
.header-nav-links > a.active {
  color: var(--color-primary-text);
}
.site-header :is(a, button, input):focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* --- NAV DROPDOWNS --- */
.nav-dropdown {
  position: relative;
  display: flex;
  align-items: stretch;
}
.nav-dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 12px 2px 12px 14px;
  font-size: var(--font-size-md);
  font-weight: 500;
  color: var(--color-text);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
  cursor: pointer;
}
/* The submenu's own trigger, sized 30x36 so it also works as a pointer target. */
.nav-dropdown-chevron {
  display: flex;
  align-items: center;
  justify-content: center;
  /* 2.5.8: below 24px the trigger would stop being a valid target, including in the
     tighter variant from 1400px down. */
  min-width: 24px;
  padding: 12px 12px 12px 2px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--color-text);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.nav-chevron {
  width: 12px;
  height: 12px;
  transition: transform 0.2s;
  flex-shrink: 0;
}
.nav-dropdown:hover .nav-chevron,
.nav-dropdown.is-open .nav-chevron {
  transform: rotate(180deg);
}
.nav-dropdown:hover .nav-dropdown-toggle,
.nav-dropdown:hover .nav-dropdown-chevron,
.nav-dropdown.is-open .nav-dropdown-toggle,
.nav-dropdown.is-open .nav-dropdown-chevron,
.nav-dropdown-toggle:hover {
  color: var(--color-primary-text);
  border-bottom-color: var(--color-primary);
}
.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 232px;
  background: var(--color-bg-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 28px rgb(0 0 0 / 12%);
  padding: 6px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
  z-index: 100;
}
/* Bridges the gap above the menu, so the pointer can cross it without :hover dropping. */
.nav-dropdown-menu::after {
  content: "";
  position: absolute;
  bottom: 100%;
  left: -1px;
  right: -1px;
  height: 8px;
}
/* The category menus span the content box, hung from the nav row instead of their trigger:
   the third level needs columns, and a menu right below the whole row is not lost on a
   diagonal path towards it. */
.header-nav-inner {
  position: relative;
}
.header-nav .nav-dropdown {
  position: static;
}
/* Hangs straight off the header's bottom border, square on top, so the panel reads as part
   of the header rather than a card floating over the hero video. */
.nav-mega {
  top: calc(100% + 1px);
  left: var(--padding-desktop);
  right: var(--padding-desktop);
  padding: 20px 8px 8px;
  border-top: 0;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.nav-mega::after {
  height: 1px;
}
.nav-mega-columns {
  columns: 4;
  column-gap: 24px;
}
.nav-mega-group {
  break-inside: avoid;
  padding-bottom: 16px;
}
.nav-mega .nav-dropdown-item {
  white-space: normal;
}
.nav-mega .nav-mega-link {
  padding-top: 7px;
  padding-bottom: 7px;
  font-weight: 400;
  color: var(--color-text);
}
.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown.is-open .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
/* Keeps the menu shut after Escape while the pointer still rests on the group: :hover
   would otherwise pull it straight back open. Has to follow the rule above. */
.nav-dropdown.is-dismissed .nav-dropdown-menu {
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
}
/* Attached to the header, the panel only fades: sliding would open a gap under the border. */
.header-nav .nav-dropdown .nav-mega {
  transform: none;
}
/* Moving from one category to the next swaps the panels at once: crossfading, the page below
   flashed through between them. Leaving the row still fades. */
.header-nav-links:hover .nav-mega {
  transition: none;
}
.nav-dropdown-item {
  display: flex;
  align-items: center;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  font-size: var(--font-size-md);
  font-weight: 600;
  color: var(--color-text-dark);
  text-decoration: none;
  transition: background 0.15s;
  white-space: nowrap;
}
.nav-dropdown-item:is(:hover, :focus-visible) {
  background: var(--color-bg-input);
}
/* The category itself, set apart from its subcategories by size and space alone: the panel
   already has edges enough. */
.nav-dropdown-item-all {
  gap: 6px;
  margin-bottom: 8px;
  font-size: var(--font-size-lg);
  font-weight: 700;
}

.header-nav-lang {
  display: flex;
  gap: 8px;
  align-items: center;
}
.lang-flag {
  display: flex;
  border-radius: 3px;
  overflow: hidden;
  opacity: 0.6;
  transition: opacity 0.15s;
}
.lang-flag:hover,
.lang-flag.active {
  opacity: 1;
}

/* --- MOBILE HEADER --- */
.mobile-header {
  display: none;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 8px var(--padding-mobile);
}
.mobile-logo {
  display: flex;
}
.mobile-logo img {
  height: 28px;
  width: auto;
}
.mobile-hamburger {
  width: 36px;
  height: 36px;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--color-text);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.mobile-hamburger svg {
  width: 24px;
  height: 24px;
}
.mobile-menu-inserat {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 16px 20px;
  padding: 12px 20px;
  background: var(--color-primary-strong);
  color: white;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: var(--font-size-md);
  text-decoration: none;
}
.mobile-menu-inserat:hover {
  background: var(--color-primary-strong-hover);
}
.mobile-menu-inserat svg {
  width: 16px;
  height: 16px;
}
.mobile-header-icons {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-left: auto;
}
.mobile-header-inserat {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border-radius: var(--radius-pill);
  background: var(--color-primary-strong);
  color: white;
  font-weight: 600;
  font-size: var(--font-size-md);
  text-decoration: none;
  white-space: nowrap;
}
.mobile-header-inserat:hover {
  background: var(--color-primary-strong-hover);
}
.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  background: var(--color-bg-white);
  color: var(--color-text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  text-decoration: none;
}
.icon-btn svg {
  width: 18px;
  height: 18px;
}
.icon-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--color-primary-strong);
  color: white;
  font-size: var(--font-size-2xs);
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* --- MOBILE SEARCH --- */
.mobile-search {
  display: none !important;
}

/* --- MOBILE OFF-CANVAS MENU --- */
.mobile-menu-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 999;
}
.mobile-menu-overlay.open {
  display: block;
}
.mobile-menu {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 280px;
  background: var(--color-bg-white);
  z-index: 1000;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  visibility: hidden;
}
.mobile-menu.open {
  transform: translateX(0);
  visibility: visible;
}
/* Vidoomy's floating player sets an inline z-index of 2147483647 and sits after the header in
   <body>, so no z-index of ours can cover it; hidden, not removed, so its script keeps running. */
body:has(.mobile-menu.open) > div:has(> [data-vidoomy-player]) {
  visibility: hidden !important;
}
.mobile-menu-close {
  align-self: flex-end;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 8px 8px 0 0;
}
.mobile-menu-close svg {
  width: 24px;
  height: 24px;
}
.mobile-menu-panel {
  display: none;
  flex-direction: column;
  flex: 1;
}
.mobile-menu-panel.active {
  display: flex;
}
.mobile-menu-links {
  display: flex;
  flex-direction: column;
  padding: 8px 0;
  border-bottom: 1px solid var(--color-border-light);
}
.mobile-menu-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 24px;
  font-size: var(--font-size-lg);
  font-weight: 500;
  color: var(--color-text);
  text-decoration: none;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  font-family: var(--font-family);
  cursor: pointer;
}
.mobile-menu-link svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}
.mobile-menu-link:hover {
  color: var(--color-primary-text);
  background: #f5f5f5;
}
.mobile-menu-submenu-trigger {
  justify-content: space-between;
}

/* Konto section inside the mobile menu — mirrors the desktop sidebar's
   account block (templates/messaging/_sidebar.html.twig). Only renders when
   logged in. */
.mobile-menu-section-title {
  padding: 14px 24px 6px;
  font-size: var(--font-size-2xs);
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--color-text-muted, #61646B);
}

.mobile-menu-account .mobile-menu-link.active {
  background: var(--color-primary-light, #FEF8F5);
  color: var(--color-primary, #E84E0F);
  font-weight: 600;
}

.mobile-menu-account .sidebar-badge {
  margin-left: auto;
}
.mobile-menu-chevron {
  width: 16px;
  height: 16px;
  color: var(--color-text-muted);
}
.mobile-menu-back {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 20px;
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: var(--color-text);
  background: none;
  border: none;
  border-bottom: 1px solid var(--color-border-light);
  cursor: pointer;
  font-family: var(--font-family);
}
.mobile-menu-back svg {
  width: 20px;
  height: 20px;
}
.mobile-menu-back:hover {
  color: var(--color-primary-text);
}
.mobile-menu-link-all {
  font-weight: 600;
  color: var(--color-primary-text);
}
.mobile-menu-logout {
  color: var(--color-text-muted);
}
.mobile-menu-logout:hover {
  color: var(--color-danger);
}
.mobile-menu-actions {
  display: flex;
  flex-direction: column;
  padding: 8px 0;
}
.mobile-menu-lang {
  display: flex;
  gap: 8px;
  padding: 16px 24px;
  border-top: 1px solid var(--color-border-light);
  margin-top: auto;
}
.mobile-menu-lang-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  text-decoration: none;
  border: 1px solid var(--color-border-light);
}
.mobile-menu-lang-btn.active {
  color: var(--color-text);
  border-color: var(--color-primary);
}
.mobile-menu-lang-btn svg {
  border-radius: 2px;
  flex-shrink: 0;
}

/* --- HEADER RESPONSIVE --- */
@media (max-width: 1400px) {
  .usp-items {
    gap: 8px;
  }

  .header-nav-links > a {
    padding-left: 6px;
    padding-right: 6px;
  }

  .nav-dropdown-toggle {
    padding-left: 6px;
  }

  .nav-dropdown-chevron {
    padding-left: 2px;
    padding-right: 6px;
  }
}

@media (max-width: 1200px) {
  .usp-bar,
  .header-main,
  .header-nav {
    display: none;
  }
  .mobile-header {
    display: flex;
  }

  .mobile-search {
    display: flex !important;
    margin-left: 20px;
  }
  .mobile-search-toggle {
    display: none;
  }
}

@media (max-width: 768px) {
  .mobile-search {
    order: 1;
    flex-basis: 100%;
    max-width: none;
    height: 40px;
    margin-left: 0;
  }
  .mobile-search:not(.open) {
    display: none !important;
  }
  .mobile-search-toggle {
    display: flex;
  }
}

@media (max-width: 576px) {
  .mobile-header-inserat {
    width: 36px;
    padding: 0;
    justify-content: center;
  }
  .mobile-header-inserat-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
}
