.filter{
    position: relative;
    display: flex;
    align-items: flex-end;
    margin: 40px 0 25px;
}

div[role=flash-messages-container] + div{
    margin: 40px 0 25px;
}

.filter-items +  .filter .filter-button{
    position: absolute;
    right: 0;
    bottom: 0;
}

.filter-items{
    align-items: center;
    padding-right: 20px;
}

.filter-item{
    display: flex;
    align-items: center;
    font-size: 12px;
    margin: 0 10px 10px 0;
    padding: 5px 15px;
    background: #E4E4E4;
    border-radius: 20px;
}

.filter-item.clear-all{
    font-size: 14px;
    background: transparent;
}

.filter-item .close{
    position: relative;
    display: flex;
    align-items: center;
    width: 10px;
    height: 10px;
    margin-left: 12px;
    opacity: 1;
}

.filter-item .close i{
    position: absolute;
    width: 100%;
    height: 1px;
    background-color: var(--link-color);
    transform: rotate(45deg);
}

.filter-item:not(.clear-all) .close i{
    background: black;
}

.filter-item .close i:last-of-type{
    transform: rotate(-45deg);
}

.filter-popup{
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    max-width: 1170px;
    width: 100%;
    max-height: 570px;
    margin: auto;
    padding: 30px 0;
    background: white;
    border-radius: 5px;
    overflow: hidden;
}

.filter-popup .title{
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 36px;
}

.selected-values{
    display: none;
}

.filter-popup .buttons{
    width: max-content;
    margin: 65px auto 0;
}

.filter-popup .buttons .btn{
    width: 150px;
    margin: 0 15px;
}

.filer-box{
    display: flex;
    align-items: stretch;
    overflow: hidden;
}

.filter-popup .filer-box-wrapper{
    position: relative;
    flex: 1;
    padding: 0 0 0 30px;
}

.filter-popup .filer-box-wrapper .title .pop-title{
    display: none;
}

.filer-box .filer-box-wrapper .form-group{
    max-height: calc(100% - 55px);
    margin: 0;
    overflow-x: hidden;
}

.filer-box .filer-box-wrapper:not(:last-of-type):after{
    content: '';
    position: absolute;
    right: 0;
    bottom: 0;
    width: 1px;
    height: calc(100% - 55px);
    background-color: #C4C4C4;
}

.form-group > div:not(.triple-btns-wrapper, .checkbox-label-wrapper, .product-card-qty) {
    display: flex;
    flex-direction: column;
    padding-right: 30px;
}

.filer-box-wrapper label{
    font-weight: 300;
    position: relative;
    padding-left: 30px;
    cursor: pointer;
}

label:not(:last-of-type){
    margin-bottom: 20px;
}

label input[type=radio]:before{
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    border: 1px solid #555;
    border-radius: 50%;
    cursor: pointer;
}

label input[type=radio]:after{
    position: absolute;
    left: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 10px;
    height: 10px;
    background-color: var(--main-color);
    border-radius: 50%;
    cursor: pointer;
}

input[type=radio]:checked:after{
    content: '';
}

input[type=radio]:checked:before{
    border-color: var(--main-color);
}

label input[type=checkbox]:before{
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    border: 1px solid #555;
    border-radius: 2px;
    cursor: pointer;
}

label input[type=checkbox]:after{
    display: block;
    background: var(--main-color);
    background-repeat: no-repeat;
    background-image: url(../img/icon-check-invert.svg);
    background-size: 20px 20px;
    height: 18px;
    width: 18px;
    position: absolute;
    left: 4px;
    top: 42%;
    transform: translateY(-67%);
    cursor: pointer;
}

input[type=checkbox]:checked:after{
    content: '';
}

input[type=checkbox]:checked:before{
    border-color: var(--main-color);
}

.filter-popup .checkbox-wrapper{
    border: 1px solid #aaa;
}

.filter-button{
    display: flex;
    align-items: center;
    max-width: max-content;
    width: 100%;
    margin-left: auto;
    padding-bottom: 15px;
    font-weight: 500;
    line-height: 1;
    text-transform: uppercase;
    cursor: pointer;
}

.filter-button.disabled{
    opacity: 0.5;
    pointer-events: none;
}

.filter-button i{
    font-size: 20px;
    transform: rotate(-90deg);
    margin-left: 20px;
}

.filer-box-wrapper input{
    width: 0;
    border: none;
}

@media screen and (max-width: 1500px){
    .filter, div[role=flash-messages-container] + div{
        position: relative;
        margin: 30px 0 20px;
    }

    .filter-button{
        padding-bottom: 10px;
    }
}

@media screen and (max-width: 991px){
    .modal.in{
        padding-right: 0 !important;
    }
    .modal-body:not(.social-login){
         padding: 0;
     }
    .modal-dialog{
        overflow: hidden;
     }
    .filer-box{
        overflow-x: auto;
        overflow-y: hidden;
    }
    .filter-popup .filer-box-wrapper{
        min-width: 230px;
    }
    .filter-popup .buttons{
        margin: 50px auto 0;
    }
}

@media screen and (max-width: 480px){
    .filter, div[role=flash-messages-container] + div{
        margin: 20px 0 10px;
    }
    .filter-button{
        font-size: 14px;
    }
    .filter-button i{
        font-size: 15px;
        margin-left: 15px;
    }
    .filter-items{
        display: none;
    }
    .filter-popup{
        justify-content: flex-end;
        height: 100vh;
        padding: 0;
    }
    .filter-popup .buttons{
        display: none;
    }
    .filer-box{
        flex-direction: column;
        height: calc(100% - 77px);
        overflow: visible;
    }
    .filter-popup .filer-box-wrapper{
        flex: unset;
        padding: 0 15px;
    }
    .filer-box .filer-box-wrapper .form-group{
        display: none;
    }
    .filer-box .filer-box-wrapper.active .form-group{
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 50%;
        margin: 0;
        background: #fff;
        border: 0;
        z-index: 2;
        overflow: visible;
    }
    .filer-box .filer-box-wrapper.active .form-group .filter-checkboxes-list{
        height: 100%;
        overflow: auto;
    }
    .filer-box .filer-box-wrapper.active .form-group .filter-radioboxes-list{
        height: 100%;
        overflow: auto;
    }
    .filer-box .filer-box-wrapper.active .form-group .pop-title{
        z-index: 99;
    }
    .filer-box .filer-box-wrapper.active .form-group ~ .form-group{
        top: 50%;
        height: 50%;
        padding: 35px 15px;
    }
    .filer-box .filer-box-wrapper.active .form-group ~ .form-group:after{
        content: '';
        position: absolute;
        top: 0;
        left: 15px;
        right: 15px;
        height: 1px;
        background-color: #c4c4c4;
    }
    .filer-box .filer-box-wrapper.active .form-group ~ .form-group > div{
        padding: 0;
    }
    .filter-popup .title{
        position: relative;
        font-size: 14px;
        font-weight: 500;
        margin: 0 0 40px;
    }
    .selected-values{
        font-size: 12px;
        font-weight: 100;
        position: absolute;
        top: 50%;
        right: 40px;
        width: 150px;
        display: -webkit-box;
        -webkit-line-clamp: 1;
        -webkit-box-orient: vertical;
        overflow: hidden;
        transform: translateY(-50%);
    }
    .filter-popup .title .arrow:before{
        background: #000;
        content: '';
        display: block;
        width: 12px;
        height: 1px;
        position: absolute;
        top: 50%;
        transform: rotate(-45deg);
        right: 0;
        transform-origin: right 50%;
    }
    .filter-popup .title .arrow:after{
        background: #000;
        content: '';
        display: block;
        width: 12px;
        height: 1px;
        position: absolute;
        top: 50%;
        transform: rotate(45deg);
        right: 0;
        transform-origin: right 50%;
    }
    .filter-popup .title .arrow span{
        background: #000;
        content: '';
        display: block;
        width: 25px !important;
        height: 1px !important;
        position: absolute !important;
        top: 50% !important;
        right: 0 !important;
        margin: 0 !important;
        background-image: none !important;
    }
    .form-group > div:not(.help-block):not(.triple-btns-wrapper):not(.checkbox-label-wrapper){
        padding: 80px 15px 15px;
    }
    .pop-title .back{
        position: absolute;
        left: 15px;
        top: 50%;
        transform: translateY(-50%);
        width: 20px;
        height: 20px;
    }
    .pop-title .back:before{
        content: '';
        position: absolute;
        width: 75%;
        height: 1px;
        top: 50%;
        left: 0;
        background: grey;
        transform-origin: left;
        transform: rotate(-45deg);
    }
    .pop-title .back:after{
        content: '';
        position: absolute;
        width: 75%;
        height: 1px;
        top: 50%;
        left: 0;
        background:#8F8F8F;
        transform-origin: left;
        transform: rotate(45deg);
    }
    .mobile-apply{
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        padding: 15px!important;
        background: inherit;
        z-index: 99;
    }
}
