.overlay-menu-container {
    margin-bottom: 2rem;
}

.overlay-menu-container,
.overlay-menu-container * {
    box-sizing: border-box;
}

.overlay-menu-container ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.wp-block-overlay-menu {
    align-items: center;
    display: flex;
    height: 2.5em;
    justify-content: center;
    width: 2.5em;
}

.menu-item-has-children > a {
    align-items: center;
    display: flex !important;
    justify-content: space-between;
}

.overlay-menu-container ul a {
    display: block;
    font-size: var(--wp--preset--font-size--small);
    font-weight: 400;
    padding: 0.5rem 0;
    text-decoration: underline;
    text-decoration-color: transparent;
    text-decoration-thickness: 1px;
    text-underline-offset: 6px;
    transition: text-decoration-color 0.3s ease;
}

.overlay-menu-container > ul > li > a {
    font-weight: 500;
    letter-spacing: 0.02em;
    padding: 20px 0;
}

.overlay-menu-container > ul ul a {
    color: var(--wp--preset--color--neutral-800);
    font-size: 0.875rem;
}

.overlay-menu-container ul li.current-menu-item > a,
.overlay-menu-container ul li.current-menu-ancestor > a {
    font-weight: 700;
    text-decoration-color: currentcolor;
}

/* ---- HAMBURGER TOGGLE ----- */

.wp-block-overlay-menu .menu-toggle {
    cursor: pointer;
}

.wp-block-overlay-menu .menu-toggle:not([aria-expanded=true]) .menu-toggle-label--open {
    display: none;
}

.wp-block-overlay-menu .menu-toggle[aria-expanded=true] .menu-toggle-label--closed {
    display: none;
}

.menu-toggle:not(.menu-toggle--toggled) + .menu-toggle .open {
    display: none;
}

.wp-block-overlay-menu .menu-toggle {
    background-color: transparent;
    border-width: 0;
    color: var(--wp--preset--color--base);
    display: block;
    line-height: 1;
    margin: 0;
    max-width: 3rem;
    min-height: 3rem;
    position: relative;
    text-align: center;
    z-index: 10;
}

.hamburger {
    display: block;
    height: 2rem;
    margin: auto;
    position: relative;
    transition: opacity 0.25s cubic-bezier(0.19, 1, 0.22, 1);
    width: 2rem;
    z-index: 99;
}

.hamburger > .line {
    background: white;
    border-radius: 3px;
    display: block;
    height: 3px;
    position: absolute;
    top: calc(17px - 1.5px);
    transform: rotate(0deg);
    width: 34px;
}

.hamburger > .line1 {
    top: calc(17px - 1.5px - 8px);
}

.hamburger > .line2 {
    opacity: 1;
}

.hamburger > .line3 {
    top: calc(17px - 1.5px + 8px);
}

.hamburger > .line4 {
    height: 0;
    left: calc(17px - 1.5px);
    opacity: 0;
    width: 3px;
}

.menu-toggle[aria-expanded=true] .hamburger {
    display: none;
    opacity: 0;
}

.mobile-menu-panel {
    background-color: white;
    border-width: 0;
    box-sizing: border-box;
    height: 100vh;
    height: calc(100vh - var(--header-height));
    max-width: 100%;
    overflow-y: auto;
    top: var(--header-height);
    width: 100%;
}

.mobile-menu-panel-additional {
    display: block;
}

.menu-toggle[aria-expanded=true] + .menu-toggle + .mobile-menu-panel {
    bottom: 0;
    opacity: 1;
    top: 0;
    z-index: 10;
}

.overlay-menu-container > ul ul {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    padding-left: 12px;
    transition:
        max-height 0.5s ease,
        opacity 0.5s ease;
}

.overlay-menu-container li.open > ul {
    margin-bottom: 20px;
    max-height: 100vh;
    opacity: 1;
}

.overlay-menu-container .menu-item-has-thumbnail img {
    display: none;
}

.overlay-menu-container .menu-item-has-children {
    border-bottom: 1px solid var(--wp--preset--color--neutral-600);
}

.overlay-menu-container .menu-item-has-children > a::after {
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='7' viewBox='0 0 12 7' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='currentColor' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E%0A");
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
    color: inherit;
    content: '';
    display: block;
    height: 10px;
    margin-left: 1rem;
    transform: rotate(0deg);
    transition: transform 0.3s ease;
    width: 10px;
}

.overlay-menu-container .menu-item-has-children.open > a::after {
    transform: rotate(180deg);
}

.overlay-menu-container figure {
    margin: 0;
}

/* Mobile search */

.mobile-menu-search {
    background-color: var(--wp--preset--color--primary);
    padding: 1rem;
    position: relative;
    left: -1rem;
    top: -1rem;
    width: 100vw;
}

.mobile-menu-search > .woocommerce-product-search {
    border: 2px solid white;
    border-radius: 5rem;
    box-sizing: border-box;
    display: flex;
    padding: 0.25rem;
    width: calc(100% - 3rem);
}

.mobile-menu-search > .woocommerce-product-search > .search-field {
    appearance: none;
    background-color: transparent;
    border-radius: 5rem;
    border-width: 0;
    color: white;
    flex-grow: 1;
    padding-inline: 0.5em;
}

.mobile-menu-search > .woocommerce-product-search > .search-field:focus {
    outline: none;
}

.mobile-menu-search > .woocommerce-product-search > .wp-element-button {
    background-color: white;
    border-radius: 5rem;
    color: black;
}

.mobile-menu-search > .woocommerce-product-search > .search-field::placeholder {
    color: white;
    opacity: 0.8;
}
