﻿/* Start dropdown */
.dropdown {
    position: relative;
    z-index: 1;
}

.dropdown__inner {
    position: absolute;
    top: 100%;
    inset-inline-end: 0;
    display: none;
    width: 195px;
    background-color: #fff;
    border: 1px solid #e9edef;
    -webkit-box-shadow: -2px 4px 32px rgba(202, 202, 202, 0.5);
    box-shadow: -2px 4px 32px rgba(202, 202, 202, 0.5);
    padding: 0;
    border-radius: 5px;
    font-size: 14px;
}

.dropdown__inner.show {
    display: block;
}

.dropdown__list {
    position: relative;
    padding: 8px 0;
    margin: 0;
}

.dropdown__list:not(:last-child):after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    display: block;
    height: 1px;
    background-color: #e9edef;
}

.dropdown__btn {
    position: relative;
    width: 100%;
    text-align: left;
    background: none;
    color: inherit;
    padding: 8px 32px 8px 16px;
    border: 0;
    margin: 0;
    outline: none;
}

.dropdown__btn[data-sort-direction] {
    padding: 8px 32px 8px 36px;
}

.dropdown__btn[data-sort-direction]:before {
    content: '';
    position: absolute;
    inset-inline-start: 16px;
    top: 50%;
    display: inline-block;
    width: 16px;
    height: 16px;
    background-repeat: no-repeat;
    background-size: contain;
    background-position: center center;
    -webkit-transform: translateY(-50%);
    transform: translateY(-50%);
    opacity: .75;
}

.dropdown__btn[data-sort-direction].active:before {
    opacity: 1;
}

.dropdown__btn[data-sort-direction='asc']:before {
    background-image: url(../image/arrow-asc.svg);
}

.dropdown__btn[data-sort-direction='desc']:before {
    background-image: url(../image/arrow-desc.svg);
}

.dropdown__btn:after {
    content: '';
    position: absolute;
    inset-inline-end: 16px;
    top: 50%;
    display: inline-block;
    width: 16px;
    height: 16px;
    background-repeat: no-repeat;
    background-size: contain;
    background-position: center center;
    -webkit-margin-start: auto;
    margin-inline-start: auto;
    -webkit-transform: translateY(-50%);
    transform: translateY(-50%);
}

.dropdown__btn.active {
    color: #000;
}

.dropdown__btn.active:after {
    background-image: url(../image/check-icon.svg);
}
/* End dropdown */

/* Start sort__btn */
.sort__btn,
.dropdown__toggle {
    display: -webkit-inline-box;
    display: -ms-inline-flexbox;
    display: inline-flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: end;
    -ms-flex-pack: end;
    justify-content: flex-end;
    padding: 10px 0;
    background: none;
    border: 0;
    margin: 0;
    outline: none;
}

.sort__btn-text,
.sort__btn-period,
.dropdown__toggle-text {
    color: #8f9296;
    font-size: 14px;
    line-height: 1.4;
}

.sort__btn-period,
.dropdown__toggle-text {
    display: inline-block;
    -webkit-margin-start: 5px;
    margin-inline-start: 5px;
    border-bottom: 1px dashed #6f6f6f;
    max-width: 150px;
    word-wrap: normal;
    white-space: nowrap;
    overflow: hidden;
    -o-text-overflow: ellipsis;
    text-overflow: ellipsis;
}

.sort__btn[data-sort-type]:after,
.dropdown__toggle:after {
    content: '';
    display: inline-block;
    width: 10px;
    height: 20px;
    background-repeat: no-repeat;
    background-position: center center;
    background-image: url(../image/arrow-asc-desc.svg);
    -webkit-margin-start: 7px;
    margin-inline-start: 7px;
    opacity: .75;
}

.dropdown__toggle.arrow-asc:after,
.sort__btn.arrow-asc[data-sort-type]:after {
    background-image: url(../image/arrow-asc.svg);
}

.dropdown__toggle.arrow-desc:after,
.sort__btn.arrow-desc[data-sort-type]:after {
    background-image: url(../image/arrow-desc.svg);
}

.sort__btn.sort__btn--mobile {
    display: none;
}

.ctr__col--first .sort__btn {
    -webkit-box-pack: start;
    -ms-flex-pack: start;
    justify-content: flex-start;
}

.sort__btn-direction {
    -webkit-margin-start: 7px;
    margin-inline-start: 7px;
}
/* End sort__btn */

/* Start sort__modal-btn */
.sort__modal-direction {
    color: #68ad5c;
    background: none;
    border: none;
    padding: 0;
    margin: 0;
}

.sort__modal-direction span {
    display: none;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
}

.sort__modal-direction span.active {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
}

.sort__modal-direction span::after {
    content: '';
    display: inline-block;
    width: 18px;
    height: 18px;
    background-repeat: no-repeat;
    background-size: contain;
    background-position: center center;
    -webkit-margin-start: 4px;
    margin-inline-start: 4px;
}

.sort__modal-direction span[data-sort-direction='desc']::after {
    background-image: url(../image/arrow-desc-green.svg);
}

.sort__modal-direction span[data-sort-direction='asc']::after {
    background-image: url(../image/arrow-asc-green.svg);
}

.sort__modal-direction span[data-sort-direction='none']::after {
    background-image: url(../image/arrow-asc-desc-green.svg);
}

.sort__modal-list {
    padding: 0 0 18px 0;
    margin: 0;
}

.sort__modal h4 {
    color: #272e36;
    font-size: 16px;
    font-weight: 600;
    border-bottom: 1px solid #e9edef;
    margin: 0 0 6px 0;
    padding: 0 0 8px 0;
}

.sort__modal-btn {
    position: relative;
    width: 100%;
    text-align: left;
    font-size: 16px;
    line-height: 1.5;
    color: #272e36;
    background: none;
    border: none;
    padding: 6px 0;
    -webkit-padding-end: 24px;
    padding-inline-end: 24px;
    margin: 0;
}

.sort__modal-btn.hover:before {
    content: '';
    display: block;
    width: 100vw;
    height: 100%;
    background-color: #f3f5f6;
    position: absolute;
    left: 50%;
    top: 0;
    -webkit-transform: translate(-50%, 0);
    transform: translate(-50%, 0);
    z-index: -1;
}

.sort__modal-btn:after {
    content: '';
    position: absolute;
    inset-inline-end: 2px;
    top: 50%;
    display: inline-block;
    width: 16px;
    height: 16px;
    background-repeat: no-repeat;
    background-size: contain;
    background-position: center center;
    -webkit-margin-start: 7px;
    margin-inline-start: 7px;
    -webkit-transform: translate(0, -50%);
    transform: translate(0, -50%);
}

.sort__modal-btn.active:after {
    background-image: url(../image/check-icon.svg);
}
/* End sort__modal-btn */

/* RTL start */
.rtl .dropdown__btn {
    text-align: initial;
    padding: 8px 16px 8px 32px;
}

.rtl .dropdown__btn[data-sort-direction] {
    padding: 8px 36px 8px 32px;
}

.rtl .sort__modal-btn {
    text-align: right;
}
/* RTL end */

@media (hover: hover) and (pointer: fine) {
    .dropdown__btn:hover {
        background-color: #f3f5f6;
    }
}

@media (max-width: 480px),
(max-height: 480px) and (orientation: landscape) {
    .ctr__row .sort__btn.sort__btn--mobile {
        display: -webkit-inline-box;
        display: -ms-inline-flexbox;
        display: inline-flex;
    }

    .sort__btn.sort__btn--mobile+.sort__btn,
    .ctr__row .dropdown {
        display: none;
    }

    .sort__btn-period {
        border-bottom: none;
    }

    .sort__btn:after,
    .dropdown__toggle:after {
        -webkit-margin-start: 2px;
        margin-inline-start: 2px;
    }
}

@media (max-width: 360px),
(max-height: 360px) and (orientation: landscape) {
    .sort__modal-direction {
        margin-top: 10px;
    }
}
