$transition: 0.3s all linear;

@keyframes sidebarItemEnter {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.wbk_sidebar {
    &__wrapper {
        height: 100%;
        position: relative;
        transition: $transition;

        &--open {
            width: 250px;
        }

        &--hidden {
            width: 0;
        }

        @media screen and (max-width: 768px) {
            &--open {
                position: absolute;
                top: 0;
                left: 0;
                width: 100%;
                max-width: 100%;
                height: 100%;
                z-index: 1;
            }
        }
    }

    &__toggle-button {
        background-color: #ffffff;
        box-shadow: 0px 0px 16px 0px #3f3f4629;
        width: 24px;
        height: 24px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        position: absolute;
        top: 50%;
        left: -12px;
        transition: $transition;
        z-index: 1;
        transform: rotate(180deg);
        transition: 0.3s all linear;

        &--hidden {
            transform: rotate(0deg);
        }

        &:hover {
            background-color: #22292f;

            img {
                filter: invert(1);
            }
        }

        img {
            transition: 0.3s all linear;
        }
    }

    &__inner-wrapper {
        width: 250px;
        background-color: colors.$wbk-secondary-500;
        border-left: 1px solid #edeff2;
        height: 100%;
        position: relative;
        transition: $transition;
        display: flex;
        flex-flow: column;
        border-top-right-radius: colors.$wbk-border-radius;
        border-bottom-right-radius: colors.$wbk-border-radius;

        &--open {
            width: 250px;

            @media screen and (max-width: 768px) {
                width: 100%;
            }
        }

        &--hidden {
            width: 0;
            visibility: hidden;
            overflow: hidden;
            display: none;
        }
    }

    &__mobile-close-button {
        width: 24px;
        height: 24px;
        cursor: pointer;
        position: absolute;
        right: 24px;
        top: 26px;
        display: none;

        @media screen and (max-width: 768px) {
            display: block;
        }
    }

    &__title {
        font-weight: 400 !important;
        font-size: 20px !important;
        line-height: 28px !important;
        letter-spacing: 0.5%;
        vertical-align: middle;
        color: colors.$wbk-color-sidebar !important;
        font-family: colors.$wbk-font !important;
        margin: 0 !important;
        margin-bottom: 24px;
        text-align: left !important;
        padding: 24px 24px 0;

        @media screen and (max-width: 768px) {
            padding-bottom: 24px;
        }
    }

    &__items {
        display: flex;
        flex-flow: column;
        margin-bottom: 24px;
        margin-top: 16px;
        gap: 16px;

        &__inner {
            @extend .wbk_sidebar__items;
            max-height: 360px;
            overflow-y: auto;
            overflow-x: hidden;
            scroll-behavior: smooth;
            margin-top: 0;

            &::-webkit-scrollbar {
                width: 6px;
                background: transparent;
            }

            &::-webkit-scrollbar-thumb {
                background: #d1d5db;
                border-radius: 4px;
            }

            &::-webkit-scrollbar-thumb:hover {
                background: #b0b8c1;
            }

            scrollbar-width: thin;
            scrollbar-color: #d1d5db transparent;
        }

        &__item {
            display: flex;
            gap: 16px;
            justify-content: flex-end;
            align-items: flex-start;
            width: 100%;
            padding-top: 16px;
            border-top: 1px solid #edeff2;
            padding: 4px 24px 4px 24px;

            &--vertical {
                flex-flow: column;
                gap: 8px;
            }

            &__inner {
                display: flex;
                gap: 16px;
                justify-content: flex-end;
                align-items: flex-start;
                width: 100%;
            }

            &:first-child {
                border-top: none;
                padding-top: 0;

                @include mobile {
                    border-top: 1px solid #edeff2;
                    padding-top: 16px;
                }
            }

            &--animated {
                animation: sidebarItemEnter 0.4s cubic-bezier(0.23, 1, 0.32, 1);
            }

            &__info {
                margin-right: auto;
            }

            &__slot-wrapper {
                display: flex;
                align-items: center;
                gap: 4px;

                &:hover {
                    .wbk_sidebar__items__item__slot-wrapper__remove-button {
                        display: flex;
                    }
                }

                &__remove-button {
                    border: 1px solid colors.$wbk-color-sidebar;
                    border-radius: 50%;
                    min-width: 14px;
                    width: 14px;
                    height: 14px;
                    min-height: 14px;
                    display: flex;
                    align-items: center;
                    justify-content: center;
                    cursor: pointer;
                    transition: 0.3s all linear;
                    display: none;

                    svg {
                        path {
                            fill: colors.$wbk-color-sidebar;
                        }
                    }

                    svg {
                        width: 8px;
                        height: 8px;
                        object-fit: contain;
                    }
                }
            }

            &__title {
                font-weight: 400 !important;
                font-size: 14px !important;
                line-height: 22px !important;
                letter-spacing: 1%;
                vertical-align: middle;
                margin: 0;
                color: colors.$wbk-color-sidebar !important;
                margin-bottom: 4px !important;
                margin-right: auto;
                text-transform: none !important;
            }

            &__price {
                @extend .wbk_sidebar__items__item__title;
                white-space: nowrap;
                margin-right: unset;
                text-align: right;
            }

            &__subline {
                font-weight: 300;
                font-size: 14px;
                line-height: 18px;
                letter-spacing: 1%;
                vertical-align: middle;
                color: colors.$wbk-color-sidebar;
                // opacity: 0.8;
                margin: 0;
                margin-bottom: 0 !important;
            }

            &__meta {
                display: flex;
                flex-flow: column;
                gap: 8px;
                margin-top: 12px;
                width: 100%;
            }

            &__meta-row {
                display: flex;
                align-items: flex-start;
                gap: 8px;
            }

            &__meta-icon {
                flex-shrink: 0;
                width: 16px;
                height: 16px;
                color: colors.$wbk-color-sidebar;
                opacity: 0.9;

                svg {
                    width: 16px;
                    height: 16px;
                }
            }

            &__meta-content {
                display: flex;
                flex-direction: column;
                gap: 2px;
                min-width: 0;
            }

            &__meta-label {
                font-family: colors.$wbk-font;
                font-weight: 600;
                font-size: 14px;
                line-height: 20px;
                color: colors.$wbk-color-sidebar;
            }

            &__meta-description {
                font-family: colors.$wbk-font;
                font-weight: 400;
                font-size: 13px;
                line-height: 18px;
                color: colors.$wbk-color-sidebar;
                opacity: 0.85;
            }

            &__button-remove {
                cursor: pointer;
                display: inline-flex;
                margin-top: 6px;
                transition: 0.2s all linear;
                width: 16px;
                height: 16px;
                max-width: 16px;
                min-width: 16px;
                max-height: 16px;
                min-height: 16px;
                border: 1px solid transparent;
                border-radius: 50%;
                padding: 2px;
                display: flex;
                align-items: center;
                justify-content: center;

                svg {
                    width: 12px;
                    height: 12px;
                    max-width: 12px;
                    max-height: 12px;
                    min-width: 12px;
                    min-height: 12px;
                    object-fit: contain;
                    transition: 0.2s all linear;

                    path {
                        fill: colors.$wbk-color-sidebar;
                    }
                }

                &:hover {
                    border: 1px solid colors.$wbk-color-sidebar;

                    svg {
                        transform: scale(0.7);
                    }
                }
            }

            &__details {
                width: 100%;
                display: flex;
                flex-flow: column;
                gap: 2px;

                &__price {
                    display: flex;
                    align-items: center;
                    gap: 8px;
                    justify-content: space-between;
                    width: 100%;
                    font-family: colors.$wbk-font;
                    font-size: 12px;
                    line-height: 20px;
                    letter-spacing: 1%;
                    vertical-align: middle;
                    color: colors.$wbk-color-sidebar;

                    p {
                        margin: 0 !important;

                        &:last-child {
                            font-weight: 600;
                        }
                    }
                }
            }

            &__expand-button {
                display: flex;
                align-items: center;
                gap: 8px;
                cursor: pointer;
                font-family: colors.$wbk-font;
                font-size: 14px;
                line-height: 22px;
                letter-spacing: 1%;
                vertical-align: middle;
                color: colors.$wbk-color-sidebar;
                font-weight: 600;

                &__icon {
                    transition: .3s all ease-in;

                    path {
                        fill: colors.$wbk-color-sidebar;
                    }

                    &--expanded {
                        transform: rotate(180deg);
                    }
                }
            }
        }

        &--less-gap {
            gap: 0px;

            .wbk_sidebar__items__item {
                padding: 8px 24px 0px 24px;
            }
        }
    }

    &__summary-toggle {
        // padding: 8px 24px 16px;
        border-top: 1px solid #edeff2;

        &__btn {
            display: flex;
            align-items: center;
            gap: 8px;
            cursor: pointer;
            font-family: colors.$wbk-font;
            font-size: 12px;
            line-height: 18px;
            color: colors.$wbk-color-sidebar;
            font-weight: 500;
            border: none;
            background: none;
            padding: 8px 24px 0;

            &:focus {
                outline: none;
            }
        }

        &__icon {
            transition: 0.3s all ease-in;

            path {
                fill: colors.$wbk-color-sidebar;
            }

            &--expanded {
                transform: rotate(180deg);
            }
        }
    }

    &__summary-detail {
        margin-top: 8px;
        padding-top: 8px;
        border-top: 1px solid #edeff2;
        display: flex;
        flex-flow: column;
        gap: 4px;
        font-size: 11px;
        line-height: 16px;
        color: colors.$wbk-color-sidebar;
        font-family: colors.$wbk-font;
        padding: 8px 24px 8px;

        &__row {
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
    }

    &__add-more {
        padding: 0 24px;

        &__button {
            width: 100%;
        }
    }

    &__empty {
        font-weight: 400;
        font-size: 14px;
        line-height: 22px;
        letter-spacing: 1%;
        vertical-align: middle;
        margin: 0;
        color: colors.$wbk-color-sidebar;
        // opacity: 0.8;
        padding: 0px 24px;
        margin-bottom: 4px;
        text-align: left !important;
    }

    &__help {
        margin-top: auto;

        &__title {
            font-weight: 400 !important;
            font-size: 14px !important;
            line-height: 22px !important;
            letter-spacing: 1%;
            vertical-align: middle;
            color: colors.$wbk-color-sidebar !important;
            font-family: colors.$wbk-font !important;
            padding: 0 24px 10px;
            margin-bottom: 10px;
            border-bottom: 1px solid #edeff2;
            word-break: break-word;
        }

        &__text {
            display: flex;
            flex-flow: column;
            gap: 10px;
            padding: 0 24px 24px 24px;

            a {
                text-decoration: none;
                font-weight: 300;
                font-size: 14px;
                line-height: 22px;
                letter-spacing: 1%;
                vertical-align: middle;
                display: flex;
                align-items: center;
                gap: 8px;
                color: colors.$wbk-color-sidebar;
                // opacity: 0.8;
                word-break: break-word;
            }
        }
    }

    &__bottom-summary {
        &__wrapper {
            width: 100%;
            max-width: 750px;
            margin: 0 auto;
            z-index: 10;
            background: colors.$wbk-secondary-500;
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 12px 24px 12px 24px;
            border-top: 1px solid #edeff2;
            border-radius: 0 0 colors.$wbk-border-radius colors.$wbk-border-radius;
            gap: 16px;
            min-height: 56px;

            @media screen and (max-width: 768px) {
                // flex-direction: column;
                align-items: stretch;
                padding: 12px 8px;
                max-width: 100%;
                border-radius: 0 0 colors.$wbk-border-radius colors.$wbk-border-radius;
            }
        }

        &__total-section {
            display: flex;
            flex-direction: column;
            align-items: flex-start;
            gap: 2px;
        }

        &__label {
            font-size: 13px;
            color: colors.$wbk-color-sidebar;
            // opacity: 0.8;
            font-weight: 400;
            margin-bottom: 2px;
        }

        &__total {
            font-size: 18px;
            color: colors.$wbk-color-sidebar;
            // opacity: 0.9;
            font-weight: 500;
            margin-bottom: 2px;
        }

        &__subline {
            font-size: 12px;
            color: colors.$wbk-color-sidebar;
            font-weight: 300;
        }

        &__show-summary-button {
            color: colors.$wbk-color-sidebar !important;

            img {
                width: 12px;
                height: 12px;
                min-width: 12px;
                min-height: 12px;
                max-width: 12px;
                max-height: 12px;
            }
        }
    }
}