/*
 * ADS Menu — layout only.
 * All colors, font sizes and weights come from the settings page
 * (inline CSS generated in ads-menu-plugin.php).
 * Breakpoint: desktop >= 1081px, mobile <= 1080px (keep in sync with ADS_MENU_BREAKPOINT).
 */

/* BASE */
.ads-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
}

.ads-menu-header .site-logo {
    display: flex;
    max-width: 160px;
    position: relative;
}

.ads-menu-header .site-logo a {
    width: 100%;
    display: inline-flex;
}

.ads-menu-header .site-logo a img {
    width: 100%;
    max-width: 100%;
    height: auto;
}

/* Submenu arrow icon */
.ads-menu-header .ads-menu-chevron {
    display: inline-flex;
    width: 1em;
    height: 1em;
    line-height: 1;
}

.ads-menu-header .ads-menu-chevron svg {
    display: block;
    width: 100%;
    height: 100%;
}

/* DESKTOP MENU */
@media only screen and (min-width: 1081px) {
    .ads-menu-header .header-menu {
        padding: 0 !important;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .ads-menu-header .header-menu li {
        position: relative;
        list-style: none;
    }

    .ads-menu-header .header-menu li.mobile-only {
        display: none;
    }

    .ads-menu-header .header-menu li span {
        display: none;
    }

    .ads-menu-header .header-menu li a {
        padding: 10px 12px;
        display: block;
        text-decoration: none;
        position: relative;
        transition: color 0.25s ease, background-color 0.25s ease;
    }

    .ads-menu-header .header-menu li.menu-item-has-children {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .ads-menu-header .header-menu li.menu-item-has-children > a {
        padding-right: 25px;
    }

    .ads-menu-header .header-menu li.menu-item-has-children > span {
        display: flex;
        align-items: center;
        justify-content: center;
        position: absolute;
        width: 10px;
        height: 10px;
        right: 8px;
    }

    .ads-menu-header .header-menu li.menu-item-has-children > span i {
        font-size: 10px;
        transition: 0.3s;
    }

    .ads-menu-header .header-menu li.menu-item-has-children > span.active i,
    .ads-menu-header .header-menu li.menu-item-has-children:hover > span i {
        transform: rotate(-180deg);
    }

    .ads-menu-header .header-menu > li > .sub-menu,
    .ads-menu-header .header-menu > li > .sub-menu > li > .sub-menu {
        position: absolute;
        top: 100%;
        right: 0;
        padding: 0;
        opacity: 0;
        visibility: hidden;
        transition: 0.2s;
        display: flex;
        flex-direction: column;
        z-index: 99;
        width: max-content;
        min-width: 0;
        max-width: 320px;
        white-space: normal;
        box-shadow: 2px 2px 10px 0 rgba(0, 0, 0, 0.2);
    }

    .ads-menu-header .header-menu > li > .sub-menu > li > .sub-menu {
        right: auto;
        left: 100%;
        top: 0;
    }

    .ads-menu-header .header-menu > li > .sub-menu li {
        order: 2;
        font-weight: 400;
    }

    .ads-menu-header .header-menu > li > .sub-menu li a {
        white-space: pre-line;
        display: block;
        width: 100%;
    }

    .ads-menu-header .header-menu > li:hover > .sub-menu,
    .ads-menu-header .header-menu > li > .sub-menu > li:hover > .sub-menu {
        opacity: 1;
        visibility: visible;
    }
}

/* HAMBURGER BUTTON */
.ads-menu-header .cmn-toggle-switch {
    display: none;
    position: relative;
    overflow: hidden;
    margin: 0;
    padding: 0;
    width: 50px;
    min-width: 50px;
    height: 50px;
    font-size: 0;
    text-indent: -9999px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    box-shadow: none;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: 1s;
    z-index: 9999;
    align-items: center;
}

.ads-menu-header .cmn-toggle-switch:focus {
    outline: none;
}

.ads-menu-header .cmn-toggle-switch:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

.ads-menu-header .cmn-toggle-switch span {
    display: block;
    position: absolute;
    left: 15%;
    right: 15%;
    height: 2px;
    transition: background 0s 0.3s;
}

.ads-menu-header .cmn-toggle-switch span::before,
.ads-menu-header .cmn-toggle-switch span::after {
    position: absolute;
    display: block;
    left: 0;
    width: 100%;
    height: 2px;
    content: "";
    transition-duration: 0.3s, 0.3s;
    transition-delay: 0.3s, 0s;
}

.ads-menu-header .cmn-toggle-switch span::before {
    top: -10px;
    transition-property: top, transform;
}

.ads-menu-header .cmn-toggle-switch span::after {
    bottom: -10px;
    transition-property: bottom, transform;
}

.ads-menu-header .cmn-toggle-switch.active {
    position: fixed;
    top: 30px;
    right: 30px;
    transition: 0.3s;
}

.ads-menu-header .cmn-toggle-switch.active span::before {
    top: 0;
    transform: rotate(45deg);
    transition-delay: 0s, 0.3s;
}

.ads-menu-header .cmn-toggle-switch.active span::after {
    bottom: 0;
    transform: rotate(-45deg);
    transition-delay: 0s, 0.3s;
}

/* MOBILE MENU */
@media only screen and (max-width: 1080px) {
    .ads-menu-header .cmn-toggle-switch {
        display: flex;
    }

    .ads-menu-header .site-logo {
        max-width: 140px;
    }

    .ads-menu-header .navigation-wrap {
        margin: 0 0 0 auto;
    }

    .ads-menu-header .header-menu {
        position: fixed;
        top: -100%;
        left: 0;
        height: 100%;
        width: 100%;
        z-index: 9998;
        transition: top 0.3s ease;
        overflow-y: auto;
        display: flex;
        align-items: flex-start;
        justify-content: flex-start;
        flex-direction: column;
        flex-wrap: nowrap;
        box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.215) !important;
        padding: 100px 25px 25px 25px !important;
    }

    .ads-menu-header.move .header-menu {
        top: 0;
    }

    .ads-menu-header .header-menu li {
        position: relative;
        display: inline-flex;
        width: auto;
    }

    .ads-menu-header .header-menu li.mobile-only {
        display: inline-block;
    }

    .ads-menu-header .header-menu li a {
        padding: 10px;
        display: inline-block;
        width: auto;
    }

    .ads-menu-header .header-menu li .current-menu-item {
        background: none;
    }

    .ads-menu-header .header-menu li .current-menu-item > a {
        margin-bottom: 10px;
    }

    .ads-menu-header .header-menu > li {
        padding: 5px 10px;
        margin-bottom: 5px;
    }

    .ads-menu-header .header-menu > li span {
        display: none;
    }

    .ads-menu-header .header-menu > li.menu-item-has-children {
        width: 100%;
        justify-content: space-between;
        align-items: center;
        flex-wrap: wrap;
    }

    .ads-menu-header .header-menu > li.menu-item-has-children > a {
        pointer-events: all;
    }

    .ads-menu-header .header-menu > li.menu-item-has-children > span {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 34px;
        height: 34px;
        z-index: 99;
        cursor: pointer;
        transition: 0.3s;
    }

    .ads-menu-header .header-menu > li.menu-item-has-children > span i {
        font-size: 18px;
        transition: 0.3s;
    }

    .ads-menu-header .header-menu > li.menu-item-has-children > span.active i {
        transform: rotate(180deg);
    }

    /* Collapsed by default; menu-script.js animates height between 0 and the content height */
    .ads-menu-header .header-menu > li > .sub-menu {
        display: block;
        box-sizing: border-box;
        width: 100%;
        height: 0;
        overflow: hidden;
        position: relative;
        border: none;
        border-radius: 0;
        padding: 0 20px;
        margin: 0;
        background-image: none;
        list-style: none;
        box-shadow: none;
        z-index: 10;
        opacity: 0;
        visibility: hidden;
        transition: height 0.35s ease, opacity 0.25s ease, visibility 0s linear 0.35s;
    }

    .ads-menu-header .header-menu > li > .sub-menu.is-open {
        opacity: 1;
        visibility: visible;
        transition: height 0.35s ease, opacity 0.25s ease 0.05s, visibility 0s;
    }

    /* Vertical spacing lives on the items so the measured height is exact */
    .ads-menu-header .header-menu > li > .sub-menu > li:first-child {
        margin-top: 5px;
    }

    .ads-menu-header .header-menu > li > .sub-menu > li:last-child {
        margin-bottom: 5px;
    }

    .ads-menu-header .header-menu > li .sub-menu {
        padding-left: 20px !important;
    }

    .ads-menu-header .header-menu > li > .sub-menu li {
        width: 100%;
    }

    .ads-menu-header .header-menu > li > .sub-menu li > a {
        border: none;
        font-weight: 300;
        width: auto;
        display: inline-block;
    }

    .ads-menu-header .header-menu > li .sub-menu > li.current-menu-item a {
        font-weight: 700;
    }

    .ads-menu-header .header-menu .site-logo {
        display: none !important;
    }

    body.menu-open {
        overflow: hidden;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ads-menu-header .header-menu,
    .ads-menu-header .header-menu .sub-menu,
    .ads-menu-header .header-menu li > span,
    .ads-menu-header .header-menu li > span i {
        transition: none !important;
    }
}
