@use '../../utils' as *;

/*----------------------------------------*/
/*  8.1 Cart css
/*----------------------------------------*/

.cartmini{
    &__area{
        position: fixed;
        right: 0;
        top: 0;
        width: 360px;
        height: 100%;
        @include transform(translateX(calc(100% + 80px)));
        background: var(--tp-common-white)  none repeat scroll 0 0;
        @include tp-transition-mul((0.45s ease-in-out, opacity .45s ease-in-out));
        z-index: 999;
        
        overflow-y: scroll;
        overscroll-behavior-y: contain;
        scrollbar-width: none;

        &::-webkit-scrollbar {
            display: none; /* for Chrome, Safari, and Opera */
        }
        &.cartmini-opened{
            @include transform(translateX(0));
        }
    }
    &__wrapper{
        position: relative;
        min-height: 100%;
    }
    &__title{
        padding: 20px 20px;
		border-bottom: 1px solid var(--tp-border-primary);
        box-shadow: 0 0 10px 0 rgba(129,129,129,.2);
		& h4{
			font-size: 16px;
			text-transform: uppercase;
			font-weight: 600;
			margin-bottom: 0;
		}
    }
	&__close{
		position: absolute;
		top: 17px;
		right: 20px;
		&-btn{
			background: transparent;
			color: var(--tp-common-black);
			font-size: 22px;
			&:hover{
				@include transform(rotate(90deg));
			}
		}
	}
    &__widget{
        height: 100%;

        &-item{
            position: relative;
            display: flex;
            padding: 20px;
            padding-right: 35px;
            border-bottom: 1px solid rgba(129,129,129,.2);
            @include tp-transition(backgroud-color);
        }
    }
    &__thumb{
        margin-right: 15px;
        & img{
            width: 70px;
            height: 90px;
        }
    }
    &__content{
        & h5{
            font-size: 15px;
            margin-bottom: 12px;
            font-weight: 500;
            & a{
                &:hover{
                    color: var(--tp-theme-primary);
                }
            }
        }

        & .tp-product-quantity{
            width: 75px;
            padding: 0;

            .tp-cart-input[type="text"] {
                height: 30px;
                text-align: center;
                font-size: 13px;
                border: 1px solid var(--tp-border-primary);
                background-color: var(--tp-common-white);
                padding: 0;
            }

            .tp-cart-plus, 
            .tp-cart-minus {
                width: 20px;
                height: 30px;
                line-height: 30px;
                display: inline-block;
                text-align: center;
                font-size: 13px;
                left: 3px;
                & svg{
                    @include transform(translateY(-1px));
                    width: 10px;
                }

                &::after{
                    display: none;
                }
            }

            & .tp-cart-plus{
                left: auto;
                right: 3px;
            }
        }

    }
    &__del{
        position: absolute;
        top: 10px;
        right: 10px;
        width: 25px;
        height: 25px;
        line-height: 25px;
        text-align: center;
        color: var(--tp-common-black);
        font-size: 12px;
        &:hover{
            color: var(--tp-theme-primary);
        }
    }
    &__checkout{
        padding: 20px;
        padding-bottom: 85px;
        width: 100%;
        background: var(--tp-common-white);
        border-top: 2px solid var(--tp-border-primary);
        &-title{
            & h4{
                font-size: 18px;
                display: inline-block;
                font-weight: 600;
                margin-bottom: 0;
            }
            & span{
                float: right;
                font-size: 20px;
                color: var(--tp-common-black);
                font-weight: 600;
                color: var(--tp-theme-primary);
            }
        }
        &-btn{
            .tp-btn{
                background-color: var(--tp-grey-1);
                font-size: 15px;
                text-transform: capitalize;
                color: var(--tp-common-black);
                padding: 10px 30px;
                &:hover{
                    background-color: var(--tp-common-black);
                    color: var(--tp-common-white);
                }
            }

            & .tp-btn-border{
                padding: 10px 30px;
                font-size: 15px;
                text-transform: capitalize;
                
            }
        }
    }
    &__price{
        font-size: 14px;
        font-weight: 500;
        color: var(--tp-theme-primary);
    }
    &__quantity{
        font-size: 12px;
        font-weight: 500;
    }
    &__empty{
        margin-top: 150px;

        & img{
            margin-bottom: 30px;
        }

        & p{
            font-size: 16px;
            color: var(--tp-common-black);
            margin-bottom: 15px;
        }

        .tp-btn{
            background-color: var(--tp-grey-1);
            font-size: 15px;
            text-transform: capitalize;
            color: var(--tp-common-black);
            padding: 10px 30px;
            &:hover{
                background-color: var(--tp-common-black);
                color: var(--tp-common-white);
            }
        }
    }
}
.mini-cart {
    &-box {
        width: 300px;
        background: #fff;
        background-color: rgb(255, 255, 255);
        padding:  20px  20px;
        background-color: #fff;
        box-shadow: 0px 5px 10px rgba(62, 68, 90, 0.1);
        border: 1px solid #edeef5;
        position: absolute;
        z-index: 9999;
        right: 0;
        top: 100%;
        transform: scale(1, 0);
        transform-origin: 0 0;
        opacity: 0;
        visibility: hidden;
        transition: opacity 500ms ease, visibility 500ms ease, transform 700ms ease;
    }
    &-item {
        display: flex;
        align-items: center;
        margin-top: .625rem;
        padding-top: .625rem;
        border-top: 1px solid #EDEEF5;
        &:first-child {
            margin-top: 0;
            padding-top: 0;
            border-top: none;
        }
    }
    &-content {
        flex: 1;
        position: static;
        padding: 0;
        text-align: left;
    }
    &-thumb {
        flex: 0 0 auto;
        margin-right: 10px;
        & img {
            height: 56px;
            width: 56px;
            object-fit: cover;
        }
    }
    &-title {
        font-size: 16px;
        font-family: var(--tp-ff-body);
        margin-bottom: 0;
        & a {
            &:hover {
                color: var(--tp-theme-primary);
            }
        }
    } 
    &-remove {
        flex: 0 0 auto;
    }
    &-quantity {
        font-size: 14px;
        color: var(--tp-heading-primary);
        & span {
            color: var(--tp-theme-primary);
            font-size: 14px;
        }
    }
    &-amount {
        font-size: 14px;
        color: var(--tp-theme-primary);
    }
    &-total {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-top: 20px;
        margin-bottom: 15px;
        padding-top: 15px;
        border-top: 1px solid #EDEEF5;
    }
    &-buttons {
        & .tp-btn {
            width: 100%;
            font-weight: 500;
            padding: 7px 28px;
            font-size: 16px;
            &:hover {
                background-color: var(--tp-heading-primary);
                color: var(--tp-common-white);
                border-color: var(--tp-heading-primary);
            }
            &.cart-btn {
                background-color: var(--tp-common-white);
                color: var(--tp-theme-primary);
                &:hover {
                    background-color: var(--tp-heading-primary);  
                    color: var(--tp-common-white);  
                }
            }
        }
    }
}

.cart-list {
    &-wrap {
        padding: 34px 0;
        position: relative;
        @media #{$lg,$md,$xs} {
            padding: 28px 0;
        }
        &:hover {
            & .mini-cart-box {
                visibility: visible;
                opacity: 1;
                transform: scale(1);
            }
        }
    }
    &-wrapper {
        margin-left: 48px;
        
    }
}