/* Menü verstecken bis mmenu-light es übernimmt */
#offcanvas-menu:not([data-mm-spn-title]) {
    position: absolute !important;
    left: -9999px !important;
    visibility: hidden !important;
}

/* ===============================================================
   Eigener Offcanvas-Drawer (ersetzt mm-ocd)
   =============================================================== */

body.mmenu-body--locked {
    overflow-y: hidden;
}

.mmenu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9998;
    background: rgba(0, 0, 0, 0);
    visibility: hidden;
    transition: background 0.3s ease, visibility 0s linear 0.3s;
}

.mmenu-overlay--open {
    visibility: visible;
    background: rgba(0, 0, 0, 0.25);
    transition: background 0.3s ease, visibility 0s linear 0s;
}

.mmenu-drawer {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 9999;
    width: 80%;
    min-width: 200px;
    max-width: 440px;
    background: #fff;
    transform: translate3d(-100%, 0, 0);
    transition: transform 0.3s ease;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.mmenu-drawer--open {
    transform: translate3d(0, 0, 0);
}

.mmenu-drawer #offcanvas-menu {
    height: 100%;
}

/* Burger nur mobil */
@media (min-width: 981px) {
    .mmenu-burger {
        display: none !important;
    }
    .mmenu-drawer,
    .mmenu-overlay {
        display: none !important;
    }
}

/* Navigation panel */
.mm-spn,
.mm-spn a,
.mm-spn li,
.mm-spn span,
.mm-spn ul {
    display: block;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}

:root {
    --mm-spn-item-height: 50px;
    --mm-spn-item-indent: 20px;
    --mm-spn-line-height: 24px;
    --mm-spn-panel-offset: 30%;
}

.mm-spn {
    width: 100%;
    height: 100%;
    -webkit-tap-highlight-color: transparent;
    -webkit-overflow-scrolling: touch;
    overflow: hidden;
    clip-path: inset(0 0 0 0);
    transform: translateX(0);
}

.mm-spn ul {
    -webkit-overflow-scrolling: touch;
    position: fixed;
    top: 0;
    left: 100%;
    bottom: 0;
    z-index: 2;
    width: calc(100% + var(--mm-spn-panel-offset));
    padding-right: var(--mm-spn-panel-offset);
    line-height: var(--mm-spn-line-height);
    overflow: visible;
    overflow-y: auto;
    background: inherit;
    transition: left 0.3s ease 0s;
    cursor: default;
}

.mm-spn ul::after {
    content: "";
    display: block;
    height: var(--mm-spn-item-height);
}

.mm-spn > ul {
    left: 0;
}

.mm-spn ul.mm-spn--open {
    left: 0;
}

.mm-spn ul.mm-spn--parent {
    left: calc(-1 * var(--mm-spn-panel-offset));
    overflow: visible;
}

.mm-spn li {
    position: relative;
    background: inherit;
    cursor: pointer;
}

.mm-spn li::before {
    content: "";
    display: block;
    position: absolute;
    top: calc(var(--mm-spn-item-height) / 2);
    right: calc(var(--mm-spn-item-height) / 2);
    z-index: 0;
    width: 10px;
    height: 10px;
    border-top: 2px solid;
    border-right: 2px solid;
    transform: rotate(45deg) translate(0, -50%);
    opacity: 0.4;
}

.mm-spn li::after {
    content: "";
    display: block;
    margin-left: var(--mm-spn-item-indent);
    border-top: 1px solid;
    opacity: 0.15;
}

.mm-spn a,
.mm-spn span {
    position: relative;
    z-index: 1;
    padding: calc((var(--mm-spn-item-height) - var(--mm-spn-line-height)) / 2) var(--mm-spn-item-indent);
}

.mm-spn a {
    background: inherit;
    color: inherit;
    text-decoration: none;
}

.mm-spn a:not(:last-child) {
    width: calc(100% - var(--mm-spn-item-height));
}

.mm-spn a:not(:last-child)::after {
    content: "";
    display: block;
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    border-right: 1px solid;
    opacity: 0.15;
}

.mm-spn span {
    background: none;
}

/* Navbar */
.mm-spn.mm-spn--navbar {
    cursor: pointer;
}

.mm-spn.mm-spn--navbar::before {
    content: "";
    display: block;
    position: absolute;
    top: calc(var(--mm-spn-item-height) / 2);
    left: var(--mm-spn-item-indent);
    width: 10px;
    height: 10px;
    margin-top: 2px;
    border-top: 2px solid;
    border-left: 2px solid;
    transform: rotate(-45deg) translate(50%, -50%);
    opacity: 0.4;
}

.mm-spn.mm-spn--navbar.mm-spn--main {
    cursor: default;
}

.mm-spn.mm-spn--navbar.mm-spn--main::before {
    content: none;
    display: none;
}

.mm-spn.mm-spn--navbar::after {
    content: attr(data-mm-spn-title);
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: var(--mm-spn-item-height);
    padding: 0 calc(var(--mm-spn-item-indent) * 2);
    line-height: var(--mm-spn-item-height);
    opacity: 0.4;
    text-align: center;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.mm-spn.mm-spn--navbar.mm-spn--main::after {
    padding-left: var(--mm-spn-item-indent);
}

.mm-spn.mm-spn--navbar ul {
    top: calc(var(--mm-spn-item-height) + 1px);
}

.mm-spn.mm-spn--navbar ul::before {
    content: "";
    display: block;
    position: fixed;
    top: inherit;
    z-index: 2;
    width: 100%;
    border-top: 1px solid currentColor;
    opacity: 0.15;
}

/* Themes */
.mm-spn.mm-spn--light {
    color: #444;
    background: #f3f3f3;
}

.mm-spn.mm-spn--dark {
    color: #ddd;
    background: #333;
}

/* Vertical variant */
.mm-spn.mm-spn--vertical {
    overflow-y: auto;
}

.mm-spn.mm-spn--vertical ul {
    width: 100%;
    padding-right: 0;
    position: static;
}

.mm-spn.mm-spn--vertical ul ul {
    display: none;
    padding-left: var(--mm-spn-item-indent);
}

.mm-spn.mm-spn--vertical ul ul::after {
    height: calc(var(--mm-spn-item-height) / 2);
}

.mm-spn.mm-spn--vertical ul.mm-spn--open {
    display: block;
}

.mm-spn.mm-spn--vertical li.mm-spn--open::before {
    transform: rotate(135deg) translate(-50%, 0);
}

.mm-spn.mm-spn--vertical ul ul li:last-child::after {
    content: none;
    display: none;
}


/* ===============================================================
   Custom Overrides
   =============================================================== */

.mm-spn.mm-spn--light {
    background: #f3f3f3;
    background: #e4032e;
}

.mm-spn.mm-spn--light li {
    margin: 5px 10px !important;
    background: #fff;
    overflow: hidden;
}

.mm-spn.mm-spn--light li:first-child {
    margin-top: 0;
}

.mm-spn.mm-spn--light li:last-child {
    margin-bottom: 0;
}

.mm-spn.mm-spn--light li::after {
    margin-left: 0;
    border-top: 0;
}

.mm-spn.mm-spn--light li a img {
    width: 30px;
    height: 2em;
    object-fit: contain;
}

.mm-spn.mm-spn--light li.current-menu-item > a,
.mm-spn.mm-spn--light li.current-menu-ancestor > a,
.mm-spn.mm-spn--light li.current-menu-parent > a {
    font-weight: 700;
}

/* Navbar Light-Theme */
.mm-spn.mm-spn--light.mm-spn--navbar::before {
    color: #fff;
}

.mm-spn.mm-spn--light.mm-spn--navbar::after {
    opacity: 1;
    color: #fff;
    font-weight: 700;
}

.mm-spn.mm-spn--light.mm-spn--navbar ul {
    background: #f3f3f3;
    background: #e4032e;
}

.mm-spn.mm-spn--light.mm-spn--navbar ul::before {
    border-top: 0;
}

/* Main-Navbar: Logo statt Text */
.mm-spn.mm-spn--light.mm-spn--navbar.mm-spn--main::after {
    color: transparent;
    background: transparent var(--fn-logo) no-repeat scroll center;
    background-size: auto 50%;
}

/* Thumbnail-Icons */
.mm-spn.mm-spn--light .fn-menu-item-thumbnail {
    display: none;
}

.mm-spn.mm-spn--light .fn-menu-item-thumbnail img {
    width: 30px;
    height: 2em;
    object-fit: contain;
}

@media (min-width: 375px) {
    .mm-spn.mm-spn--light .fn-menu-item-thumbnail {
        display: block;
    }
}


/* ===============================================================
   Burger-Icon Styling
   =============================================================== */

.mmenu-burger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    cursor: pointer;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

.mmenu-burger__box {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 26px;
    height: 18px;
}

.mmenu-burger__line {
    display: block;
    width: 100%;
    height: 2px;
    background-color: #333;
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Burger-Animation wenn Menue offen */
body.mm-ocd-opened .mmenu-burger__line:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

body.mm-ocd-opened .mmenu-burger__line:nth-child(2) {
    opacity: 0;
}

body.mm-ocd-opened .mmenu-burger__line:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* Burger nur mobil anzeigen */
@media (min-width: 1200px) {
    .mmenu-burger {
        /*display: none !important;*/
    }
}