/**
 * tpl_oszee2026 – navigation.css
 * Desktop: Hover-Dropdowns 3 Ebenen
 * Mobil (<= 1300px): Accordion mit Pfeil rechts neben Link
 */

/* Accordion-Toggle auf Desktop IMMER unsichtbar */
.nav-accordion-toggle { display: none !important; }

/* =====================================================
   DESKTOP
===================================================== */
.tpl-nav { display: flex; align-items: center; }
.tpl-nav ul { display: flex; list-style: none; margin: 0; padding: 0; }
.tpl-nav > ul { align-items: center; }
.tpl-nav > ul > li { position: relative; }

.tpl-nav > ul > li > a,
.tpl-nav > ul > li > span {
  display: flex; align-items: center;
  color: var(--text-color);
  font-family: var(--font-heading);
  font-size: 17px; font-weight: 600;
  height: var(--header-height);
  letter-spacing: 0.04em; padding: 0 17px;
  text-decoration: none; text-transform: uppercase;
  transition: color var(--transition), background var(--transition);
  white-space: nowrap; cursor: pointer;
}
.tpl-nav > ul > li > a:hover,
.tpl-nav > ul > li.active > a,
.tpl-nav > ul > li.current > a {
  color: var(--blue-primary); background: var(--gray-light);
}
.tpl-nav > ul > li.parent > a::after {
  content: '▾'; font-size: 12px; margin-left: 5px; opacity: 0.6;
}

/* Level 2 */
.tpl-nav > ul > li > ul {
  display: none; flex-direction: column;
  position: absolute; top: 100%; left: 0;
  background: var(--white);
  border-top: 3px solid var(--blue-primary);
  box-shadow: var(--shadow-md); min-width: 230px;
  z-index: 600;
}
.tpl-nav > ul > li:hover > ul,
.tpl-nav > ul > li:focus-within > ul { display: flex; }

.tpl-nav > ul > li > ul > li {
  position: relative; border-bottom: 1px solid var(--gray-mid);
}
.tpl-nav > ul > li > ul > li:last-child { border-bottom: none; }
.tpl-nav > ul > li > ul > li > a {
  display: flex; align-items: center; justify-content: space-between;
  color: var(--text-color); font-family: var(--font-body);
  font-size: 14px; padding: 11px 18px;
  text-decoration: none; white-space: nowrap; width: 100%;
  transition: background var(--transition), color var(--transition);
}
.tpl-nav > ul > li > ul > li > a:hover,
.tpl-nav > ul > li > ul > li.active > a {
  background: var(--gray-light); color: var(--blue-primary);
}
.tpl-nav > ul > li > ul > li.parent > a::after {
  content: '›'; font-size: 18px; margin-left: 8px; opacity: 0.5;
}

/* Level 3 */
.tpl-nav > ul > li > ul > li > ul {
  display: none; flex-direction: column;
  position: absolute; top: 0; left: 100%;
  background: var(--white);
  border-top: 3px solid var(--blue-secondary);
  box-shadow: var(--shadow-md); min-width: 210px; z-index: 700;
}
.tpl-nav > ul > li > ul > li:hover > ul,
.tpl-nav > ul > li > ul > li:focus-within > ul { display: flex; }

.tpl-nav > ul > li > ul > li > ul > li { border-bottom: 1px solid var(--gray-mid); }
.tpl-nav > ul > li > ul > li > ul > li:last-child { border-bottom: none; }
.tpl-nav > ul > li > ul > li > ul > li > a {
  display: block; color: var(--text-color);
  font-family: var(--font-body); font-size: 13px;
  padding: 9px 16px; text-decoration: none; white-space: nowrap;
  transition: background var(--transition), color var(--transition);
}
.tpl-nav > ul > li > ul > li > ul > li > a:hover { background: var(--gray-light); color: var(--blue-secondary); }

/* =====================================================
   MOBILE ab 1300px
===================================================== */
@media (max-width: 1300px) {

  /* Nav-Container */
  .tpl-nav {
    display: none !important;
    position: absolute !important;
    top: calc(var(--header-height) + 3px) !important;
    left: 0 !important; right: 0 !important;
    background: var(--white) !important;
    border-top: 2px solid var(--blue-primary) !important;
    box-shadow: var(--shadow-md) !important;
    z-index: 490 !important;
    max-height: calc(100vh - var(--header-height) - var(--topbar-height)) !important;
    overflow-y: auto !important;
  }
  .tpl-nav.is-open { display: block !important; }

  /* Alle ul: vertikal, volle Breite, NIEMALS absolut positioniert */
  .tpl-nav ul,
  .tpl-nav ul ul,
  .tpl-nav ul ul ul {
    display: flex !important;
    flex-direction: column !important;
    position: static !important;
    width: 100% !important;
    min-width: 0 !important;
    box-shadow: none !important;
    animation: none !important;
    border-top: none !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
  }

  /* Alle li: einfache Zeile */
  .tpl-nav li {
    border-bottom: 1px solid var(--gray-mid) !important;
    position: static !important;
    width: 100% !important;
  }

  /* Desktop-Pfeile im Link ausblenden */
  .tpl-nav li > a::after,
  .tpl-nav li > span::after { display: none !important; }

  /* Alle Links */
  .tpl-nav li > a,
  .tpl-nav li > span {
    height: auto !important;
    min-height: 54px !important;
    padding: 16px 18px !important;
    white-space: normal !important;
    border-bottom: none !important;
  }

  /* Level 1 Links */
  .tpl-nav > ul > li > a,
  .tpl-nav > ul > li > span {
    font-size: 15px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    min-height: 54px !important;
  }

  /* Pfeil-Button */
  .nav-accordion-toggle {
    display: flex !important;
    flex: 0 0 46px !important;
    align-self: stretch !important;
    align-items: center !important;
    justify-content: center !important;
    background: transparent !important;
    border: none !important;
    border-left: 1px solid var(--gray-mid) !important;
    color: var(--blue-primary) !important;
    cursor: pointer !important;
    font-size: 14px !important;
    padding: 0 !important;
    flex-shrink: 0 !important;
    transition: background var(--transition) !important;
    min-height: 54px !important;
  }
  .nav-accordion-toggle:hover { background: var(--gray-light) !important; }
  .nav-accordion-toggle.is-open { background: var(--gray-light) !important; }
  .nav-accordion-toggle.is-open .nav-toggle-icon { transform: rotate(180deg); }
  .nav-toggle-icon { display: block; pointer-events: none; transition: transform 0.22s ease; }

  /* Submenu-Wrapper (per JS eingefügt) */
  .nav-submenu-wrapper {
    width: 100% !important;
  }

  /* Level 2 Untermenü */
  .nav-submenu-wrapper > ul,
  .tpl-nav > ul > li > ul {
    border-left: 4px solid var(--blue-primary) !important;
    background: var(--gray-light) !important;
  }
  .nav-submenu-wrapper > ul > li > a,
  .nav-submenu-wrapper > ul > li > span {
    font-size: 14px !important;
    font-weight: 400 !important;
    padding: 11px 18px 11px 22px !important;
    text-transform: none !important;
  }

  /* Level 3 Untermenü */
  .nav-submenu-wrapper .nav-submenu-wrapper > ul {
    border-left: 4px solid var(--blue-secondary) !important;
    background: #eef4f8 !important;
  }
  .nav-submenu-wrapper .nav-submenu-wrapper > ul > li > a {
    font-size: 13px !important;
    padding: 10px 18px 10px 32px !important;
    text-transform: none !important;
  }
}
