/*  Mega-Menü "Alle Sprachen" (_tools/seitenbau/megamenue.py) und runde Flaggen.
 *  Das Webflow-Dropdown steuert weiter Öffnen/Schließen; hier nur die Gestalt.
 */

.cl-flagge {
  display: inline-block;
  flex: none;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(20, 20, 20, .12);
  vertical-align: middle;
  line-height: 0;
}
.cl-flagge svg { display: block; }

/* ---------------------------------------------------------------- Desktop */
@media (min-width: 992px) {
  .nav-dropdown-list.megamenu.cl-mega,
  .nav-dropdown-list.megamenu.cl-mega.w--open {
    left: calc(173px - min(480px, 47vw));
    width: min(960px, 94vw);
    padding: 12px 0 0;            /* unsichtbare Brücke: Maus verliert den Hover nicht */
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }
  .nav-dropdown-list.megamenu.cl-mega.w--open { display: block; }
}

.cl-mega .cl-mega-innen {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  overflow: hidden;
  border: 1px solid rgba(41, 91, 88, .12);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 30px 70px rgba(20, 20, 20, .16);
  font-family: Epilogue, sans-serif;
}

.cl-mega .cl-mega-haupt { padding: 28px 30px 30px; }
.cl-mega .cl-mega-seite {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 28px 26px;
  background: linear-gradient(170deg, #fff9f4 0%, #f2fdfc 100%);
  border-left: 1px solid rgba(41, 91, 88, .1);
}

.cl-mega .cl-mega-titel {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--dark-slate-grey, #295b58);
}
.cl-mega .cl-mega-weitere + .cl-mega-titel,
.cl-mega .cl-mega-beliebt + .cl-mega-titel { margin-top: 24px; }

/* Webflow-Dropdown-Links zurücksetzen */
.cl-mega a.w-dropdown-link {
  margin: 0;
  padding: 0;
  color: var(--primary-dark, #141414);
  font-size: 15px;
  text-transform: none;
  white-space: normal;
  text-decoration: none;
}

.cl-mega .cl-mega-beliebt {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.cl-mega a.cl-mega-kachel {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(41, 91, 88, .1);
  border-radius: 14px;
  transition: background-color .15s ease, border-color .15s ease, transform .15s ease;
}
.cl-mega a.cl-mega-kachel:hover,
.cl-mega a.cl-mega-kachel:focus-visible {
  background: #fffbe8;
  border-color: var(--primary, #ffdb51);
  transform: translateY(-1px);
}
.cl-mega .cl-mega-kachel span { display: flex; flex-direction: column; min-width: 0; }
.cl-mega .cl-mega-kachel strong { font-size: 16px; font-weight: 800; line-height: 1.3em; }
.cl-mega .cl-mega-kachel small { font-size: 13px; line-height: 1.35em; color: var(--paragraph-gray, #535756); }

.cl-mega .cl-mega-weitere {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 2px 10px;
}
.cl-mega a.cl-mega-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  transition: background-color .15s ease;
}
.cl-mega a.cl-mega-link:hover,
.cl-mega a.cl-mega-link:focus-visible { background: #f2fdfc; }

.cl-mega a[aria-current="page"] { background: #fffbe8; }

.cl-mega .cl-mega-globus {
  display: grid;
  flex: none;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #eef5f4;
  color: var(--dark-slate-grey, #295b58);
}
.cl-mega a.cl-mega-kachel--alle { background: #f7fbfb; }

/* Seitenleiste */
.cl-mega .cl-mega-stufen { display: flex; gap: 8px; }
.cl-mega a.cl-mega-stufe {
  flex: 1;
  padding: 9px 0;
  border: 1px solid rgba(41, 91, 88, .2);
  border-radius: 10px;
  background: #fff;
  font-size: 14px;
  font-weight: 800;
  text-align: center;
  color: var(--dark-slate-grey, #295b58);
}
.cl-mega a.cl-mega-stufe:hover { background: var(--dark-slate-grey, #295b58); color: #fff; }

.cl-mega .cl-mega-test {
  padding: 18px;
  border-radius: 14px;
  background: var(--primary, #ffdb51);
}
.cl-mega .cl-mega-test-titel { margin: 0 0 4px; font-size: 16px; font-weight: 800; color: #141414; }
.cl-mega .cl-mega-test-text { margin: 0 0 12px; font-size: 14px; line-height: 1.45em; color: #141414; }
.cl-mega .cl-mega-test-knopf {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 0;
  border-radius: 10px;
  background: #141414;
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}
.cl-mega .cl-mega-test-knopf:hover { background: #2b2b2b; }

.cl-mega a.cl-mega-alle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  font-size: 15px;
  font-weight: 800;
  color: var(--dark-slate-grey, #295b58);
}

/* ------------------------------------------------- mobiles Menü (Burger) */
@media (max-width: 991px) {
  .nav-dropdown-list.megamenu.cl-mega,
  .nav-dropdown-list.megamenu.cl-mega.w--open {
    left: auto;
    width: 100%;
    box-sizing: border-box;
    height: auto;
    max-height: none;
    padding: 4px 0 12px;
    overflow: visible;
  }
  .cl-mega .cl-mega-innen {
    display: block;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }
  .cl-mega .cl-mega-haupt { padding: 0; }
  .cl-mega .cl-mega-seite { padding: 16px 0 0; border: 0; background: transparent; gap: 12px; }
  .cl-mega .cl-mega-titel { margin-bottom: 8px; }
  .cl-mega .cl-mega-beliebt,
  .cl-mega .cl-mega-weitere { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 10px; }
  .cl-mega a.cl-mega-kachel { padding: 8px 10px; border: 0; }
  .cl-mega .cl-mega-kachel .cl-flagge { width: 22px !important; height: 22px !important; }
  .cl-mega .cl-mega-kachel .cl-flagge svg { width: 22px; height: 22px; }
  .cl-mega .cl-mega-kachel strong { font-size: 15px; font-weight: 600; }
  .cl-mega .cl-mega-kachel small { display: none; }
  .cl-mega .cl-mega-globus { width: 22px; height: 22px; }
  .cl-mega .cl-mega-globus svg { width: 14px; height: 14px; }
  .cl-mega .cl-mega-innen, .cl-mega .cl-mega-haupt { width: 100%; }
  .cl-mega .cl-mega-test { display: none; }
}

/* Mobiles Menü: Webflow setzt das geöffnete Menü fest (position: fixed) und
   gibt ihm die Höhe der ganzen Seite. Fest positionierte Elemente, die höher
   als der Bildschirm sind, lassen sich nicht scrollen – mit aufgeklapptem
   Sprachen-Menü war der Rest unerreichbar. Daher: Bildschirmhöhe, eigenes Scrollen. */
@media (max-width: 991px) {
  .w-nav-overlay .w-nav-menu {
    height: 100vh !important;
    height: 100dvh !important;
    max-height: 100dvh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }
}
