/* ============================================================
   IRISHDOG NAV – v20
   Final / kompatibel zu bestehendem PHP + JS
============================================================ */

:root {
  --nav-h: 7.5rem;
  --nav-h-mob: 6.8rem;
  --nav-bg-desk: #2d5a27;
  --nav-bg-mob: #ffffff;
  --nav-accent: #BC4749;
  --nav-brand-green: #a7c957;
  --c-max: 98rem;
  --c-gap: 1.5rem;
  --scrollbar-w: 0px;
  --nav-logo-offset-mob: 0rem;
  --nav-accent-border-layer: #e3e3e3;
}

html,
body {
  height: 100%;
  overscroll-behavior-y: none;
}

.de-header,
.de-header * {
  box-sizing: border-box;
}

.de-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--nav-h);
  background: transparent;
  z-index: 1000;
  transition: background-color .35s ease, box-shadow .35s ease, backdrop-filter .35s ease;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  will-change: transform, background-color;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.de-header.scrolled {
  background: rgba(45, 90, 39, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 2px 18px rgba(0,0,0,.14);
}

.de-container {
  width: 100%;
  max-width: var(--c-max);
  margin: 0 auto;
  padding: 0 var(--c-gap);
  height: 100%;
  position: relative;
}

.de-nav {
  display: flex;
  align-items: center;
  height: var(--nav-h);
  border-bottom: 1px solid rgba(255,255,255,.3);
}

.de-nav-logo {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  width: auto;
  height: var(--nav-h);
  margin-right: 3.5rem;
  padding: 0;
  overflow: visible;
  text-decoration: none;
  position: relative;
  transform: none;
}

.de-nav-logo img {
  width: 2rem;
  height: auto;
  display: block;
  filter: brightness(0) invert(1) opacity(.88) !important;
  opacity: .92 !important;
}

/* Nur Bild-Stabilität, keine Hero-Höhen / keine Textposition */
.hero,
.urlaub_spo_1,
.urlaub_gardasee_1,
.urlaub_tegernsee_1,
.urlaub_usedom_1,
.urlaub_usedom_2,
.urlaub_garmisch_1,
.stadt_berlin_1,
.stadt_muc_1,
.herodaten,
.herot,
.steck,
.wesen,
.trimmen,
.sport,
.heroimp {
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  will-change: transform;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  background-attachment: scroll !important;
}

/* ============================================================
   DESKTOP NAV
============================================================ */

.de-nav-links {
  display: flex;
  align-items: stretch;
  height: var(--nav-h);
  margin: 0;
  padding: 0;
  gap: 0;
  list-style: none !important;
}

.de-nav-links > li {
  display: flex;
  align-items: center;
  position: static !important;
  padding: 0;
  color: transparent !important;
  list-style: none !important;
}

.de-nav-links > li > a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: var(--nav-h);
  padding: 0 2.5rem;
  margin-bottom: 0;
  font-size: 1.3rem;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  color: #fafafa !important;
  position: relative;
  transition: color .2s ease, background .2s ease;
}

.de-nav-links > li:hover > a,
.de-nav-links > li.active > a {
  color: #fff !important;
  background: rgba(255,255,255,.1);
}

.de-nav-links > li > a::after {
  content: "";
  position: absolute;
  left: 2.5rem;
  right: 2.5rem;
  bottom: calc(50% - 1.45rem);
  height: 2px;
  background: var(--nav-accent);
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s ease;
}

.de-nav-links > li:hover > a::after,
.de-nav-links > li.active > a::after {
  transform: scaleX(1);
}

.nav-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 10px;
  height: 10px;
  flex-shrink: 0;
  margin-bottom: 0;
  transition: transform .25s ease;
}

.nav-arrow svg {
  width: 10px;
  height: 6px;
  display: block;
  overflow: visible;
  fill: none;
  stroke: #fafafa;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke .2s ease;
}

.de-nav-links > li:hover > a .nav-arrow {
  transform: rotate(180deg);
}

.de-nav-links > li:hover > a .nav-arrow svg {
  stroke: #fff;
}

/* ============================================================
   NAV RESET – schützt Nav-Spans vor globalem span-Abstand
============================================================ */

.de-header span,
.mobile-nav-layer span {
  margin: 0;
}

/* ============================================================
   DROPDOWN / MEGA MENU
============================================================ */

.de-nav-links .sub-menu,
.de-nav-links .mega-menu {
  position: absolute;
  top: var(--nav-h);
  left: var(--c-gap);
  right: var(--c-gap);
  width: auto;
  max-width: calc(var(--c-max) - (var(--c-gap) * 2));
  margin: 0 auto;
  padding: 0;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity .2s ease, transform .2s ease, visibility .2s ease;
  z-index: 9999;
  list-style: none !important;
}

.de-nav-links > li:hover > .sub-menu,
.de-nav-links > li:hover > .mega-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.de-nav-links .sub-menu {
  background: #fff;
  border-top: 3px solid var(--nav-accent-border-layer);
  border-radius: 0 0 12px 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,.12);
  padding: .6rem 0 .8rem !important;
}

.de-nav-links .sub-menu li {
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
  color: inherit !important;
  list-style: none !important;
}

.de-nav-links .sub-menu a {
  display: flex !important;
  align-items: center;
  gap: 10px;
  padding: 1rem 2rem !important;
  font-size: 1.4rem !important;
  font-weight: 600 !important;
  color: #333 !important;
  text-decoration: none;
  text-transform: none !important;
  letter-spacing: 0 !important;
  border-bottom: 1px solid #f4f4f4;
  transition: color .18s ease, background .18s ease;
}

.de-nav-links .sub-menu li:last-child a {
  border-bottom: none !important;
}

.de-nav-links .sub-menu a::before,
.mega-cat::before,
.mega-city::before {
  content: "";
  display: inline-block;
  flex-shrink: 0;
  border-right: 2px solid #ccc;
  border-bottom: 2px solid #ccc;
  transform: rotate(-45deg);
  transition: border-color .18s ease;
}

.de-nav-links .sub-menu a::before,
.mega-cat::before {
  width: 6px;
  height: 6px;
}

.de-nav-links .sub-menu a:hover,
.de-nav-links .sub-menu li.active a {
  color: var(--nav-accent) !important;
}

.de-nav-links .sub-menu a:hover::before,
.mega-cat:hover::before,
.mega-city:hover::before {
  border-color: var(--nav-accent);
}

.mega-inner {
  background: #fff;
  border-top: 3px solid var(--nav-accent-border-layer);
  border-radius: 0 0 12px 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,.12);
  padding: 2rem var(--c-gap);
}

.mega-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.5rem 4rem;
}

.mega-grid,
.mega-grid * {
  list-style: none !important;
}

.mega-city {
  display: flex;
  align-items: center;
  gap: 11px;
  padding-bottom: .6rem;
  margin-bottom: .7rem;
  border-bottom: 2px solid #f0f0f0;
  font-size: 1.5rem !important;
  font-weight: 800 !important;
  color: #111 !important;
  text-decoration: none;
  text-transform: none !important;
  letter-spacing: 0 !important;
  transition: color .18s ease;
}

.mega-city::before {
  width: 7px;
  height: 7px;
}

.mega-city:hover {
  color: var(--nav-accent) !important;
}

.mega-cat {
  display: flex !important;
  align-items: center;
  gap: 10px;
  padding: .6rem 0;
  font-size: 1.4rem !important;
  font-weight: 600 !important;
  color: #333 !important;
  text-decoration: none;
  text-transform: none !important;
  letter-spacing: 0 !important;
  transition: color .18s ease;
}

.mega-cat:hover {
  color: var(--nav-accent) !important;
}

.mega-cat--cluster {
  margin-top: .6rem !important;
  padding-top: .4rem !important;
  padding-bottom: .35rem !important;
  font-size: 1.25rem !important;
  font-weight: 800 !important;
  color: #333 !important;
  text-transform: uppercase !important;
  letter-spacing: .04em !important;
  border-top: none !important;
  cursor: default !important;
  pointer-events: none;
}

.mega-col > .mega-city + .mega-cat--cluster {
  margin-top: 2rem !important;
}

.mega-cat--cluster + .mega-cat--child + .mega-cat--child + .mega-cat--cluster,
.mega-cat--cluster + .mega-cat--child + .mega-cat--child + .mega-cat--child + .mega-cat--cluster {
  margin-top: 2rem !important;
}

.mega-cat--cluster::before {
  display: none !important;
}

.mega-cat--child {
  padding-left: 1.4rem !important;
  font-weight: 500 !important;
  color: #555 !important;
}

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

.de-nav-burger {
  display: none;
  position: fixed;
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

.mobile-overlay,
.mobile-nav-layer,
.mobile-layer-close {
  display: none;
}

/* ============================================================
   DESKTOP
============================================================ */

@media screen and (min-width: 901px) {
  .de-nav-logo {
    height: var(--nav-h);
    transform: none !important;
  }

  .de-nav-logo img,
  .de-header.scrolled .de-nav-logo img {
    width: 3.5rem;
    height: auto;
    filter: brightness(0) invert(1) !important;
    opacity: 1 !important;
  }

  .de-header.scrolled .de-nav-logo::after {
    content: none !important;
  }
}

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

@media screen and (max-width: 900px) {

  .de-header {
    height: var(--nav-h-mob) !important;
    background: transparent !important;
    box-shadow: none !important;
    transition: background-color .25s ease, box-shadow .25s ease !important;
  }

  .de-header.scrolled {
    background: #ffffff !important;
    box-shadow: 0 2px 10px rgba(0,0,0,.08) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  .de-container,
  .de-nav {
    height: var(--nav-h-mob);
  }

  .de-nav {
    align-items: center;
    padding: 0;
    border-bottom: 1px solid rgba(255,255,255,.2);
  }

  .de-header.scrolled .de-nav {
    border-bottom: 1px solid rgba(0,0,0,.08);
  }

  .de-nav-links {
    display: none !important;
  }

  .de-nav-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3.15rem;
    height: var(--nav-h-mob);
    margin-right: 3.5rem;
    overflow: visible;
    padding: 0;
    transform: none;
    flex: 0 0 3.15rem;
  }

  .de-nav-logo img {
    width: 3.15rem;
    height: auto;
    display: block;
    filter: brightness(0) invert(1) !important;
    opacity: 1 !important;
    transition: opacity .2s ease;
  }

  .de-header.scrolled .de-nav-logo img {
    filter: none !important;
    opacity: 1 !important;
  }

  .de-header.scrolled .de-nav-logo::after {
    content: none;
  }

  .de-nav-burger {
    display: flex !important;
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    width: var(--nav-h-mob) !important;
    height: var(--nav-h-mob) !important;
    z-index: 99999 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
    cursor: pointer !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px !important;
    touch-action: manipulation !important;
    user-select: none !important;
    -webkit-user-select: none !important;
    -webkit-tap-highlight-color: transparent !important;
  }

  .de-nav-burger.open {
    opacity: 0 !important;
    pointer-events: none !important;
  }

  .de-nav-burger span {
    display: block !important;
    width: 28px !important;
    height: 3px !important;
    margin: 0 !important;
    font-size: 0 !important;
    line-height: 0 !important;
    background-color: #ffffff !important;
    border-radius: 2px !important;
    opacity: 1 !important;
    pointer-events: none !important;
    filter: none !important;
    box-shadow: none !important;
    transition: transform .28s ease, opacity .2s ease, background-color .2s ease !important;
  }

  .de-header.scrolled ~ .de-nav-burger span,
  .de-nav-burger.open span,
  body.nav-lock .de-nav-burger span {
    background-color: var(--nav-brand-green) !important;
  }

  .de-nav-burger.open span:nth-child(1) {
    transform: translateY(6px) rotate(45deg) !important;
  }

  .de-nav-burger.open span:nth-child(2) {
    opacity: 0 !important;
    transform: scaleX(0) !important;
  }

  .de-nav-burger.open span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg) !important;
  }

  .mobile-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity .28s ease, visibility .28s ease;
    z-index: 9000;
  }

  .mobile-overlay.open {
    opacity: 1;
    visibility: visible;
  }

  .mobile-nav-layer {
    display: block;
    position: fixed;
    inset: 0;
    width: 100%;
    max-width: none;
    height: 100dvh;
    padding-top: var(--nav-h-mob);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    background: #fff;
    z-index: 9100;
    box-shadow: none;
    transform: translateZ(0) translateX(100%);
    -webkit-transform: translateZ(0) translateX(100%);
    transition: transform .32s cubic-bezier(.4,0,.2,1);
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
  }

  .mobile-nav-layer.open {
    transform: translateZ(0) translateX(0);
    -webkit-transform: translateZ(0) translateX(0);
  }

  .mobile-nav-layer::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-h-mob);
    background: #ffffff;
    pointer-events: none;
    z-index: 1;
    box-shadow: 0 1px 0 rgba(0,0,0,.06);
  }

  .mobile-nav-layer::after {
    content: "";
    position: absolute;
    top: 0;
    left: var(--c-gap);
    width: 3.15rem;
    height: var(--nav-h-mob) !important;
    background-image: url("https://irishdog.de/project/images/logo_footer.svg");
    background-repeat: no-repeat;
    background-size: 3.15rem auto;
    background-position: center center;
    pointer-events: none;
    z-index: 2;
  }

  .mobile-layer-close {
    display: flex !important;
    position: absolute !important;
    top: 0 !important;
    right: var(--scrollbar-w) !important;
    width: var(--nav-h-mob) !important;
    height: var(--nav-h-mob) !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    z-index: 5 !important;
    border: 0 !important;
    background: transparent !important;
    cursor: pointer !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    touch-action: manipulation !important;
    -webkit-tap-highlight-color: transparent !important;
  }

  .mobile-nav-layer > .mobile-layer-close {
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .mobile-layer-close span {
    position: absolute;
    top: 50%;
    left: 50%;
    display: block;
    width: 28px;
    height: 3px;
    background-color: var(--nav-brand-green);
    border-radius: 2px;
    pointer-events: none;
    transform-origin: center;
  }

  .mobile-layer-close span:nth-child(1) {
    transform: translate(-50%, -50%) rotate(45deg);
  }

  .mobile-layer-close span:nth-child(2) {
    transform: translate(-50%, -50%) rotate(-45deg);
  }

  html.nav-lock,
  body.nav-lock {
    overflow: hidden !important;
    overscroll-behavior: none !important;
  }

  body.nav-lock {
    position: fixed;
    width: 100%;
    left: 0;
    right: 0;
    top: var(--lock-top, 0);
    padding-right: var(--scrollbar-w);
  }

  .mobile-nav-layer > * {
    max-width: var(--c-max);
    margin: 0 auto;
    padding-left: var(--c-gap);
    padding-right: var(--c-gap);
    box-sizing: border-box;
  }

  .mobile-nav-layer > .mobile-nav-list,
  .mobile-nav-layer > ul {
    margin: 0 auto;
    padding: .5rem var(--c-gap) 3rem;
    max-width: var(--c-max);
    list-style: none !important;
    position: relative;
    z-index: 2;
    box-sizing: border-box;
  }

  .mobile-nav-layer .mobile-nav-list {
    padding-top: .5rem;
  }

  .mobile-nav-layer .mobile-nav-list > li {
    color: #111 !important;
    border-bottom: 1px solid #f0f0f0;
    list-style: none !important;
  }

  .mobile-item-row {
    display: flex;
    align-items: center;
    min-height: 56px;
  }

  .mobile-item-link {
    flex: 1 1 auto;
    display: block;
    padding: 1.4rem 0;
    font-size: 1.6rem;
    font-weight: 400;
    color: rgba(0,0,0,.7) !important;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0;
  }

  .mobile-item-link,
  .mobile-arrow,
  .mobile-nav-layer .sub-menu a,
  .mobile-nav-layer .mobile-sub-link {
    transition: color .18s ease, border-color .18s ease;
  }

  .mobile-sub-toggle {
    flex: 0 0 var(--nav-h-mob);
    width: var(--nav-h-mob);
    min-height: 56px;
    align-self: stretch;
    position: relative;
    border: 0;
    background: transparent;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-arrow {
    position: absolute;
    top: 50%;
    left: 50%;
    display: block;
    width: 10px;
    height: 10px;
    border-right: 2.5px solid var(--nav-accent);
    border-bottom: 2.5px solid var(--nav-accent);
    transform: translate(-50%, -50%) rotate(45deg);
    transition: transform .25s ease, border-color .25s ease;
  }

  .mobile-nav-layer .has-sub.open > .mobile-item-row .mobile-arrow {
    transform: translate(-50%, -50%) rotate(-135deg);
    border-color: var(--nav-accent);
  }

  .mobile-nav-layer .sub-menu {
    position: static !important;
    top: auto !important;
    left: auto !important;
    width: auto !important;
    max-width: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    transform: none !important;
    display: block !important;
    box-shadow: none !important;
    background: #f8f8f8 !important;
    border-top: 1px solid #eee !important;
    border-radius: 0 !important;
    padding: 0 !important;
    max-height: 0;
    overflow: hidden;
    transition: max-height .32s cubic-bezier(.4,0,.2,1);
    list-style: none !important;
  }

  .mobile-nav-layer .has-sub.open > .sub-menu {
    max-height: 1400px;
  }

  .mobile-nav-layer .sub-menu > li {
    padding: 0 !important;
    margin: 0 !important;
    color: #444 !important;
    background: transparent !important;
    border-top: none !important;
    border-bottom: 1px solid #ececec;
    list-style: none !important;
  }

  .mobile-nav-layer .sub-menu > li:last-child {
    border-bottom: none;
  }

  .mobile-nav-layer .sub-menu a,
  .mobile-nav-layer .mobile-sub-link {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    font-size: 1.45rem !important;
    font-weight: 600 !important;
    color: #444 !important;
    text-decoration: none;
    text-transform: none !important;
    letter-spacing: 0 !important;
    background: transparent !important;
    border-top: none !important;
    border-bottom: none !important;
    border-radius: 0 !important;
    min-width: unset !important;
    white-space: normal !important;
  }

  .mobile-nav-layer .sub-menu a {
    padding: 1.3rem 0 1.3rem 2.8rem !important;
  }

  .mobile-nav-layer .sub-menu a::before {
    content: "";
    display: inline-block;
    width: 5px;
    height: 5px;
    flex-shrink: 0;
    border-right: 1.5px solid #bbb;
    border-bottom: 1.5px solid #bbb;
    transform: rotate(-45deg);
  }

  .mobile-nav-layer .sub-menu .sub-menu {
    background: #f0f0f0 !important;
  }

  .mobile-nav-layer .sub-menu .sub-menu a {
    padding-left: 3.8rem !important;
    font-size: 1.35rem !important;
    color: #666 !important;
  }

  .mobile-nav-layer .mobile-sub-link--cluster {
    margin-top: 0 !important;
    padding: 1.1rem 0 .8rem 4.2rem !important;
    font-size: 1.25rem !important;
    font-weight: 800 !important;
    color: #333 !important;
    background: #eeeeee !important;
    text-transform: uppercase !important;
    letter-spacing: .04em !important;
    border-top: none !important;
    cursor: default !important;
    pointer-events: none;
  }

  .mobile-nav-layer .sub-menu > li:first-child .mobile-sub-link--cluster {
    margin-top: .6rem !important;
  }

  .mobile-sub-link--cluster::before {
    display: none !important;
  }

  .mobile-sub-link--child {
    padding-left: 4.2rem !important;
    font-weight: 500 !important;
    color: #555 !important;
    background: #f5f5f5 !important;
  }

  .mobile-sub-link--child::before {
    border-color: #c9c9c9 !important;
  }

  .mobile-nav-layer .mobile-item-row:hover > .mobile-item-link,
  .mobile-nav-layer li.active > .mobile-item-row .mobile-item-link,
  .mobile-nav-layer .sub-menu a:hover,
  .mobile-nav-layer .mobile-sub-link:hover,
  .mobile-nav-layer .mobile-sub-link--cluster:hover,
  .mobile-nav-layer .mobile-sub-link--child:hover,
  .mobile-nav-layer .sub-menu .sub-menu a:hover {
    color: var(--nav-accent) !important;
  }

  .mobile-nav-layer .mobile-item-row:hover .mobile-arrow,
  .mobile-nav-layer .sub-menu a:hover::before,
  .mobile-nav-layer .mobile-sub-link:hover::before,
  .mobile-nav-layer .mobile-sub-link--child:hover::before {
    border-color: var(--nav-accent) !important;
  }
}