.sub-menu {
    display: none;
}
.menu-item{
    position: relative;
}
.menu-item.is-open > .sub-menu {
    display: block;
}

.sub-menu:not(:has(.sub-menu)) {
    max-height: 80vh;
    overflow-y: auto;
}

.menu-item:has(.sub-menu) > a {
    padding-right: 26px;
    display:flex;
    align-items: center;
    position:relative;
}
.sub-menu-btn, .sub-menu-btn:focus {
    appearance: none;
    -webkit-appearance: none;
    background: none;
    border: 0;
    box-shadow: none;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    position: absolute;
    top: 0;
    right: 0;
    z-index: 9999;
    transform: rotate(-90deg);
    transform-origin: center;
    transition: transform 0.2s ease;
}


.menu-item:has(.sub-menu) > a::after {
    content: "\f502";
    display: inline-block;
    font: normal 8px/1 Genericons;
    position: absolute;
    right: 12px;
    top: calc(50% - 2px);
    vertical-align: text-bottom;
    transform: rotate(-90deg);
    transform-origin: center;
    transition: transform 0.2s ease;
}

.sub-menu-btn::before {
    content: "\f502";
    display: inline-block;
    font: normal 8px/1 Genericons;
    vertical-align: text-bottom;
    position:relative;
    top:2px;
    left:0px;
}

.menu-item.is-open > .sub-menu-btn {
    transform: rotate(0deg);
}
@media (min-width: 767px) {
    .primary-navigation .menu-item:has(.sub-menu) > a::after{
        transform: rotate(0deg);
    }
}

@media (max-width: 767px) {
    .menu-item:has(.sub-menu) > a::after{
        display:none;
    }
}
