.custom-mobile-menu {
    margin-left: auto;
    width: fit-content;
    /* position: relative; */
}

.custom-mobile-menu__toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.custom-mobile-menu__toggle:hover,
.custom-mobile-menu__toggle:focus {
    background: unset;
}

.custom-mobile-menu__toggle-icon {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    width: 24px;
    height: 18px;
}

.custom-mobile-menu__toggle-icon span {
    display: block;
    height: 2px;
    background: #1d1d1d;
    border-radius: 1px;
    transition:
        transform 0.2s ease,
        opacity 0.2s ease;
}

.custom-mobile-menu.is-open .custom-mobile-menu__toggle-icon span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.custom-mobile-menu.is-open .custom-mobile-menu__toggle-icon span:nth-child(2) {
    opacity: 0;
}

.custom-mobile-menu.is-open .custom-mobile-menu__toggle-icon span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

.custom-mobile-menu__panel {
    position: absolute;
    right: 0;
    top: 100px;
    /* inset-inline: 0; */
    background: #f7f8f9;
    z-index: 100;
    width: 100vw;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
    /* transform: translateY(0px); */
    /* max-height: 0; */

    display: grid;

    grid-template-rows: 0fr;
    transition: grid-template-rows 0.5s ease-in-out;
    overflow: hidden;
}

.custom-mobile-menu__content {
    min-height: 0;
    transition: visibility 1s;
    visibility: hidden;
}

.custom-mobile-menu.is-open .custom-mobile-menu__panel {
    grid-template-rows: 1fr;
}

.custom-mobile-menu.is-open
    .custom-mobile-menu__panel
    .custom-mobile-menu__content {
    min-height: 100%;
    visibility: visible;
}

.custom-mobile-menu__list,
.custom-mobile-menu__list ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-direction: column;
    align-items: center;
    padding: 32px 0;
}

.custom-mobile-menu__list > li {
    /* border-bottom: 1px solid #eee; */
    text-align: center;
    font-weight: 700;
}

.custom-mobile-menu__list a {
    display: inline-block;
    width: fit-content;
    padding: 0.85rem 1rem;
    text-decoration: none;
    color: inherit;
    position: relative;
}

.custom-mobile-menu__list a::after {
    content: "";
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    display: block;
    height: 5px;
    background: #ff785a;
    border-radius: 1px;
    transition: width 0.2s ease;
}

.custom-mobile-menu__list a:hover::after {
    /* transform: scaleX(1); */
    width: 100%;
    /* opacity: 1; */
}

.custom-mobile-menu__item {
    display: flex;
    align-items: center;
}

.custom-mobile-menu__item > a {
    /* flex: 1 1 auto; */
}

.custom-mobile-menu__submenu-toggle {
    flex: 0 0 auto;
    background: none;
    border: none;
    padding: 0.85rem 1rem;
    cursor: pointer;
}

.custom-mobile-menu__submenu-toggle-icon {
    display: inline-block;
    transition: transform 0.2s ease;
}

.custom-mobile-menu__submenu-toggle[aria-expanded="true"]
    .custom-mobile-menu__submenu-toggle-icon {
    transform: rotate(180deg);
}

.custom-mobile-menu__list ul {
    max-height: 0;
    overflow: hidden;
    background: #fafafa;
    transition: max-height 0.2s ease;
}

.custom-mobile-menu__list li.is-open > ul {
    max-height: 1000px;
}

.custom-mobile-menu__list ul a {
    padding-inline-start: 2rem;
}
