/* Quick navigation block button */
.quick-navigation-button {
    position: absolute;
    top: 20px;
    right: 25px;
    font-family: 'Zalando Sans', sans-serif;
}

.quick-navigation-button .wp-block-button__link {
    background-color: rgba(0, 0, 0, 0.5);
    color: #fff !important;
    border: none;
    border-radius: 999px;
    padding: 11px 16px;
    font-size: 14px;
    font-weight: 400;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 13px;
    text-decoration: none;
    box-shadow: none;
    line-height: 1;
    padding-bottom: 9px !important;
}

.quick-navigation-button .wp-block-button__link::after {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    background-image: url('/wp-content/uploads/2025/12/quick-nav-icon.svg');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    margin-top: -2px;
}

.quick-navigation-button .wp-block-button__link:hover,
.quick-navigation-button .wp-block-button__link:focus {
    background-color: rgba(0, 0, 0, 0.65);
    color: #fff !important;
}

:has(> .quick-navigation-button) {
    position: relative;
}

.module-container>*:not(.formulas-container)>.quick-navigation-button {
    position: static;
    align-self: flex-end;
}

@media (max-width: 796px) {
    .quick-navigation-button {
        position: static;
        display: block;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        margin-top: -10px;

        .wp-block-button {
            width: 100%;
        }
    }

    .quick-navigation-button .wp-block-button__link {
        width: 100%;
        justify-content: space-between;
    }

    :has(> .quick-navigation-button) {
        position: static;
    }
}

/* Quick Nav Pill Wrapper – always visible */
.quick-nav-pill-wrapper {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000001;
    display: block;
    font-family: 'Zalando Sans', sans-serif;
}

/* Overlay / Backdrop Blur */
.quick-nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(36, 36, 36, 0.6);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    z-index: 1;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;

    &.is-visible {
        opacity: 1;
        visibility: visible;
    }
}

/* The Pill Button */
.quick-nav-pill {
    position: relative;
    z-index: 20;
    background-color: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 11px 16px;
    font-size: 14px;
    font-weight: 400;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 13px;

    .close-icon {
        width: 16px;
        height: 16px;
    }
}

/* The Menu Itself */
.quick-nav-wrapper {
    position: absolute;
    bottom: 100%;
    right: 0;
    margin-bottom: 12px;
    background: #fff;
    width: 300px;
    max-height: 600px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    display: none;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 10;
    flex-direction: column;

    &.is-visible {
        display: flex;
        opacity: 1;
        transform: translateY(0);
    }
}

.quick-nav-container {
    overflow-y: auto;
    flex: 1;
    padding: 16px 0;

    /* Scrollbar */
    &::-webkit-scrollbar {
        width: 6px;
    }

    &::-webkit-scrollbar-thumb {
        background-color: #ddd;
        border-radius: 3px;
    }
}

/* List Styles */
.quick-nav-content {
    ul {
        list-style: none;
        margin: 0;
        padding: 0;
    }

    /* L1 Items only */
    >ul>li {
        position: relative;
        padding-bottom: 8px;
        margin-bottom: 13px;

        &::after {
            content: '';
            position: absolute;
            bottom: 0;
            left: 20px;
            right: 20px;
            height: 1px;
            background-color: black;
            z-index: 1;
        }
    }

    li {
        margin: 0;

        >ul.sub-menu {
            display: none;
        }

        &.is-open>ul.sub-menu {
            display: block;
        }

        &.is-open>.nav-item-header .icon-toggle::before {
            -webkit-mask-image: url('/wp-content/uploads/2025/12/quick-nav-minus.svg');
            mask-image: url('/wp-content/uploads/2025/12/quick-nav-minus.svg');
        }

        /* Link Styles */
        a {
            display: block;
            padding: 4px 20px 4px 40px;
            text-decoration: none;
            color: #676767;
            font-size: 12px;
        }
    }
}

/* Headers (L1, L2) */
.nav-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 20px;
    cursor: pointer;
    transition: background-color 0.2s;
}

/* L2 (Accordion) Header when inside a sub-menu */
.sub-menu .nav-item-header {
    padding: 4px 20px 4px 30px;

    .toggle-label {
        width: 80%;
        font-size: 12px;
        color: #676767;
        font-weight: 400;
    }
}

/* Typography */
.toggle-label {
    font-size: 18px;
    color: black;
    font-weight: 500;
}

/* Toggle Icons (+ / -) */
.icon-toggle {
    display: inline-block;
    width: 16px;
    height: 16px;
    position: relative;
    color: black !important;

    &::before {
        content: '' !important;
        display: block;
        width: 100%;
        height: 100%;
        background-color: currentColor;
        -webkit-mask-image: url('/wp-content/uploads/2025/12/quick-nav-plus.svg');
        mask-image: url('/wp-content/uploads/2025/12/quick-nav-plus.svg');
        -webkit-mask-size: contain;
        mask-size: contain;
        -webkit-mask-repeat: no-repeat;
        mask-repeat: no-repeat;
        -webkit-mask-position: center;
        mask-position: center;
    }
}

/* Pill Icons */
.quick-nav-icon {
    width: 16px;
    height: 16px;
    display: block;
}

/* Mobile Styling for Pill */
@media (max-width: 768px) {
    .icon-toggle::before {
        content: '' !important;
        display: block !important;
        width: 100%;
        height: 100%;
        min-width: 16px;
        min-height: 16px;
        background-color: currentColor;
        -webkit-mask-image: url('/wp-content/uploads/2025/12/quick-nav-plus.svg');
        mask-image: url('/wp-content/uploads/2025/12/quick-nav-plus.svg');
        -webkit-mask-size: contain;
        mask-size: contain;
        -webkit-mask-repeat: no-repeat;
        mask-repeat: no-repeat;
        -webkit-mask-position: center;
        mask-position: center;
    }

    .quick-nav-pill-wrapper {
        width: 100%;
        max-width: calc(100vw - 30px);
        right: 15px;
        left: auto;
    }

    .quick-nav-pill {
        justify-content: space-between;
        gap: 66px;
        width: 100%;
        height: 40px;
        border-radius: 30px;
        box-sizing: border-box;
    }

    .quick-nav-pill .quick-nav-icon,
    .quick-nav-pill .close-icon {
        flex: none;
        order: 1;
        flex-grow: 0;
    }

    /* The Menu Itself */
    .quick-nav-wrapper {
        width: 100%;
    }
}