/**
 * Upcreators
 * Upcreators is the template for Agency, Streamers, Shop, Blog, Portfolio, Events, etc
 * Exclusively on https://1.envato.market/upcreators-html
 *
 * @encoding        UTF-8
 * @version         1.0.0
 * @copyright       (C) 2018 - 2022 Merkulove ( https://merkulov.design/ ). All rights reserved.
 * @license         Envato License https://1.envato.market/KYbje
 * @contributors    Lilith Lamber (winter.rituel@gmail.com)
 * @support         help@merkulov.design
 **/
// cart popup component

.cart {
    &_popup {
        position: fixed;
        top: 64px;
        left: 50%;
        transform: translateX(-50%);
        z-index: 1000000;
        right: 0;
        width: 100%;
        max-width: 1770px;
        padding: 0 20px;
        display: flex;
        justify-content: flex-end;
        transition: .15s linear;
        opacity: 0;
        visibility: hidden;

        &.visible {
            opacity: 1;
            visibility: visible;
        }

        &-backdrop {
            @include cover;
            z-index: 1;
        }

        &-wrapper {
            max-height: calc(100vh - 84px);
            overflow-y: auto;
            padding: 20px;
            position: relative;
            z-index: 30;
        }

        &-helper {
            max-width: 405px;
            background: #fff;
            border: 1px solid $black;
            position: relative;

            &:after {
                content: '';
                display: block;
                position: absolute;
                background: #fff;
                border-top: 1px solid $black;
                border-right: 1px solid $black;
                width: 15px;
                height: 15px;
                top: -9px;
                right: 55px;
                transform: rotate(-45deg);
                z-index: 20;
            }
        }

        .note {
            font-size: 10px;
            color: $grayText;
            font-weight: 700;
        }

        &-header {
            font-size: 10px;
            padding-bottom: 20px;
            border-bottom: 1px solid #D7D7D7;

            .success .icon {
                font-size: 16px;
            }

            .note {
                width: 100%;
                margin-top: 5px;
            }

            .cartID, .success {
                text-transform: uppercase;
                line-height: 1;
            }

            .cartID {
                color: $grayText;
                font-weight: 700;
            }
        }

        &-main {
            &_list {
                .list-item {
                    display: flex;
                    align-items: stretch;
                    padding: 20px 0;
                    border-bottom: 1px solid #D7D7D7;
                    gap: 10px;

                    .media {
                        width: 70px;
                        height: 90px;

                        img {
                            height: 100%;
                        }
                    }

                    .main {
                        flex-grow: 1;
                        height: auto;
                        display: flex;
                        flex-direction: column;

                        &_info {
                            display: flex;
                            flex-direction: column;
                            height: 100%;

                            .wrapper {
                                display: flex;
                                justify-content: space-between;
                                align-items: center;
                                line-height: 1;

                                &:first-of-type {
                                    font-size: 12px;
                                    font-weight: 700;
                                    color: $grayText;
                                    margin-bottom: 10px;
                                }
                            }

                            &-remove {
                                display: inline-flex;
                                align-items: center;
                                gap: 5px;
                                text-transform: uppercase;

                                &:hover, &:focus {
                                    color: $accent3;
                                }

                                .text {
                                    font-size: 10px;
                                }
                            }

                            &-details {
                                display: flex;
                                text-transform: uppercase;
                                font-weight: 700;
                                font-size: 10px;
                                gap: 10px;
                                margin: 5px 0;
                                flex-grow: 1;

                                .property {
                                    color: $grayText;
                                }
                            }

                            &-qty {
                                display: flex;

                                &_label {
                                    text-transform: uppercase;
                                    color: $grayText;
                                    font-size: 10px;
                                    font-weight: 700;
                                    margin-right: 5px;
                                }

                                .qty {
                                    border: none;
                                    padding: 0;
                                    height: unset;

                                    .control {
                                        font-size: 12px;
                                    }

                                    &_amount {
                                        &-display {
                                            font-weight: 700;
                                            font-size: 11px;
                                            width: 30px;
                                            text-align: center;
                                        }
                                    }
                                }
                            }

                            &-price {
                                font-weight: 700;
                                font-size: 12px;
                            }
                        }
                    }
                }
            }
        }

        &-footer {
            padding-top: 20px;

            &_summary {
                gap: 5px;

                .total, .subtotal {
                    display: flex;
                    justify-content: space-between;
                    align-items: center;
                    text-transform: uppercase;
                }

                .subtotal {
                    font-size: 12px;
                    font-weight: 700;
                }
            }

            &_action {
                flex-direction: column;
                gap: 10px;
                margin: 20px 0 10px;
            }
        }
    }
}

// media queries

// --- mobile landscape
@media screen and (min-width: 567.98px) {
    .cart_popup-wrapper {
        padding: 30px;
    }
    .cart_popup-footer_action {
        flex-direction: row;

        .btn {
            width: calc(50% - 5px);
            padding: 10px 0;
        }
    }
}

// --- tablet
@media screen and (min-width: 767.98px) {
    .cart {
        &_popup {
            top: 74px;
        }
    }
}

// --- desktop
@media screen and (min-width: 1169.98px) {
    .cart {
        &_popup {
            top: 84px;
            &-helper:after {
                right: 100px;
            }
            &-wrapper {
                max-height: calc(100vh - 104px);
            }
        }
    }
}
