.right_sidebar {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    z-index: 1000;
    inset: 0;

    &.is-open {
        display: flex;

        .right_sidebar__overlay {
            animation: rightSidebarfadeIn .4s cubic-bezier(0.16, 1, 0.3, 1);
        }

        .right_sidebar__container {
            animation: rightSidebarslideIn .45s cubic-bezier(0.16, 1, 0.3, 1);
        }
    }

    &[aria-hidden="true"] {
        .right_sidebar__overlay {
            animation: rightSidebarfadeOut .4s cubic-bezier(0.16, 1, 0.3, 1);
        }

        .right_sidebar__container {
            animation: rightSidebarslideOut .45s cubic-bezier(0.16, 1, 0.3, 1);
        }
    }

    &__overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.6);
        inset: 0;

        &:focus {
            outline: 2px solid var(--focus-outline);
        }
    }

    &__container {
        @extend .flex-between;

        border: 1px solid var(--transp-1);
        background-color: var(--background);
        flex-direction: column;
        overflow: hidden auto;
        box-sizing: border-box;
        will-change: transform;
        box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);

        @include media(pc) {
            margin: 10px;
            margin-left: auto;
            min-width: 400px;
            height: calc(100vh - 20px);
            border-radius: var(--border1);
        }

        @include media(mobile) {
            width: 100% !important;
            height: 100vh;
            border-radius: 0;
        }

        &:focus {
            outline: none;
        }
    }

    &__content {
        padding: 20px 25px;
        padding-top: 0;
        overflow-y: auto;

        @include media(pc) {
            max-width: 50vw;
        }
    }

    &__header {
        @extend .flex-between;

        padding: 20px 25px;
        padding-bottom: 0;
        width: 100%;
    }

    &__title {
        margin-top: 0;
        margin-bottom: 0;
        font-size: 1.25rem;
    }

    &__close {
        background: transparent;
        border: 0;
        width: 40px;
        height: 40px;
        color: var(--text-400);
        @include transition(all);
        border-radius: var(--border05);
        cursor: pointer;
        line-height: 1;
        flex-shrink: 0;
        border: 1px solid var(--transp-1);

        &:hover,
        &:focus {
            background-color: var(--transp-2);
            color: var(--text);
            outline: none;
        }

        &::before {
            content: "\2715";
            font-size: 1.3rem;
        }
    }

    &__footer {
        @extend .align-center;

        gap: 10px;
        flex-direction: row;
        padding: 20px 25px;
        padding-top: 0;
    }

    &__content-loading {
        display: flex;
        flex-direction: column;
        margin-top: 2rem;
        gap: 10px;
    }

    &__content-loading-box,
    &__content-loading-box-large {
        background-color: var(--background-900);
        min-width: 300px;
        min-height: 40px;
    }

    &__content-loading-box-large {
        min-height: 80px;
    }
}

@keyframes rightSidebarfadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes rightSidebarfadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

@keyframes rightSidebarslideIn {
    from {
        transform: translateX(100%);
    }

    to {
        transform: translateX(0);
    }
}

@keyframes rightSidebarslideOut {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(100%);
    }
}

@media (prefers-reduced-motion: reduce) {

    .right_sidebar__overlay,
    .right_sidebar__container {
        animation: none !important;
        transition: none !important;
    }
}