/* MW Desktop Mega-Menu – aus dem Theme-CSS übernommen und erweitert */
/* =========================================================
   18. MEGA MENU
========================================================= */
.elementor-widget-desktop-mega-menu .elementor-widget-container {
    display: flex;
    flex-direction: column;
}
nav.sb-desktop-mega-menu-wrapper {
    background: #00000091;
    border-radius: 15px;
    padding: 8px;
}
.sb-desktop-mega-menu ul,
.sb-desktop-mega-menu { list-style: none; padding-left: 0; }
.current-menu-item { color: #cfff2d !important; border: 0 !important; }
.current-menu-item > a:first-child {
    color: var(--e-global-color-accent) !important;
    background:white;
}
.current-page-parent > a:first-child {
    color: var(--e-global-color-accent) !important;
    border-color: var(--e-global-color-accent) !important;
}
.sb-child-sub-menu .current-menu-item > a:first-child { color: var(--e-global-color-accent) !important; }
.sb-sidenav-trigger { display: none; }
.sb-nav-header { display: none; }
.sb-mega-menu { position: relative; }
.sb-sub-menu span { padding: 10px 0; }
.menu-item img { width: 50px; height: 50px; flex: none; max-height: 50px !important; }
.menu-item a { display: flex; align-items: center; gap: 0; }
.sb-main-menu-title > a {
    padding: 12px 13px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;   
    border-radius: 10px;
    font-family: var(--e-global-typography-0efcf85-font-family), Sans-serif;
    font-size: var(--e-global-typography-0efcf85-font-size);
    font-weight: var(--e-global-typography-0efcf85-font-weight);
    line-height: var(--e-global-typography-0efcf85-line-height);
    color:white;
}
.sb-desktop-mega-menu { display: flex !important;gap:0px; }
.sb-sub-menu-card .sb-menu-title { border-right: 1px solid #f2f2f2; }
.sb-sub-menu-card {
    position: absolute;
    left: 0;
    top: 100%;              /* direkt unter dem Link, keine Überlappung */
    width: var(--sbm-w1, 350px);
    max-width: calc(100vw - 40px);
    padding-top: 12px;      /* transparente "Brücke" zum Submenü */
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;   /* blockiert beim Ausblenden keine anderen Punkte */
    transform: translateY(-8px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0.2s;
}
ul.sb-sub-menu {
    background: white;
    padding: 20px;
    list-style: none;
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    border: 1px solid #ddd;
    border-radius: 8px;
    position: relative;
}
ul.sb-sub-menu::before {
    content: "";
    width: 20px;
    border-top: 1px solid #ddd;
    border-left: 1px solid #ddd;
    border-radius: 2px;
    height: 20px;
    background: white;
    position: absolute;
    top: -10px;
    left: 25px;
    transform: rotate(45deg);
}
.sb-sub-menu a{
    color:var( --e-global-color-accent );
    font-family: var(--e-global-typography-3c8eb58-font-family), Sans-serif;
    font-size: var(--e-global-typography-3c8eb58-font-size);
    font-weight: var(--e-global-typography-3c8eb58-font-weight);
    line-height: var(--e-global-typography-3c8eb58-line-height);
}
.sb-mega-menu:hover > .sb-sub-menu-card {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
    transition-delay: 0s;
}
ul.sb-child-sub-menu {
    list-style: none;
    padding-left: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.sb-static .elementor-widget,
.sb-static { position: static; }
.sb-menu-title > a {
    pointer-events: none;
    padding: 15px;
    background: #f7f7f7;
    width: 100%;
    display: flex;
}
.sb-main-menu-title:hover > a,
.sb-mega-menu:hover > a,
.sb-mega-menu .sb-sub-menu-card:hover ~ a { background:#f7f7f7;color: var(--e-global-color-accent) !important; }
.sb-mega-menu.sb-main-menu-title > a::after {
    content: "";
    margin-left: 2px;
    position: relative;
    transition: all 0s ease;
    width: 15px;
    height: 15px;
     background-color: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") center / contain no-repeat;
            mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") center / contain no-repeat;
    background-size: cover;
}
.current_page_item > a.elementor-item { border-bottom: 0 solid !important; }
li.sb-mega-menu.sb-child-menu { position: relative !important; }
li.sb-mega-menu.sb-child-menu .sb-sub-menu { grid-template-columns: 1fr; min-width: 250px; }
ul.sb-child-sub-menu a,
.sb-child-menu .sb-sub-menu a {
    padding: 15px;
    border-bottom: 1px solid #f2f2f2;
    width: 100%;
    display: flex;
}


/* =========================================================
   Erweiterung: Bilder, Kurztext und Spalten im Untermenü
   (Optionen im Widget unter «Untermenü: Bilder & Spalten»)
========================================================= */

/* Mehrspaltig */
.sb-sub-menu-card.sb-cols { width: var(--sbm-wm, 680px); }
.sb-sub-menu-card.sb-cols > ul.sb-sub-menu { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 12px; }
.sb-sub-menu-card.sb-cols-3 > ul.sb-sub-menu { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* Einträge mit Bild */
.sb-desktop-mega-menu-wrapper .sb-sub-menu .sb-has-media > a {
    gap: 14px;
    padding: 8px 10px;
    border-radius: 12px;
    transition: background 0.2s ease;
}
.sb-desktop-mega-menu-wrapper .sb-sub-menu .sb-has-media > a:hover { background: #F2F5F9; }
.sb-desktop-mega-menu-wrapper .sb-sub-menu .sb-has-media span { padding: 0; }

.sb-desktop-mega-menu-wrapper .sb-menu-img {
    flex: none;
    width: var(--sbm-img, 48px);
    height: var(--sbm-img, 48px);
    border-radius: 10px;
    overflow: hidden;
    background: #EEF3F8;
    display: flex;
}
.sb-desktop-mega-menu-wrapper .sb-menu-img img {
    width: 100% !important;
    height: 100% !important;
    max-height: none !important;
    object-fit: cover;
    border-radius: 0;
    transition: transform 0.25s ease;
}
.sb-desktop-mega-menu-wrapper .sb-has-media > a:hover .sb-menu-img img { transform: scale(1.06); }

/* Text mit optionalem Kurztext */
.sb-desktop-mega-menu-wrapper .sb-sub-menu .sb-menu-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sb-desktop-mega-menu-wrapper .sb-sub-menu .sb-menu-text span { padding: 0; }
.sb-desktop-mega-menu-wrapper .sb-sub-menu li:not(.sb-has-media) > a > .sb-menu-text { padding: 10px 0; }
.sb-desktop-mega-menu-wrapper .sb-menu-caption {
    font-size: 12.5px;
    line-height: 1.35;
    color: #66707A;
    font-weight: 400;
}

@media (prefers-reduced-motion: reduce) {
    .sb-desktop-mega-menu-wrapper * { transition: none !important; }
}
