/* ==================================================
   ZAROS PRODUCT FILTER V3

   Navy   #002147
   Orange #CF4F00
   ================================================== */


/* WRAPPER */

.zaros-products-wrapper {
    width: 100%;
    direction: rtl;
}


/* FILTER BAR */

.zaros-filter-bar {
    position: relative;
    z-index: 20;

    display: flex;
    align-items: flex-end;
    gap: 18px;
    flex-wrap: wrap;

    width: 100%;
    margin-bottom: 30px;
    padding: 22px;

    background: #ffffff;

    border: 1px solid #e7e9ed;
    border-radius: 16px;

    box-shadow:
        0 8px 30px rgba(0, 33, 71, 0.07);
}


/* FIELD */

.zaros-filter-field {
    position: relative;

    flex: 1;

    min-width: 190px;
}


.zaros-filter-label {
    display: block;

    margin-bottom: 9px;

    color: #002147;

    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
}


/* ==================================================
   CUSTOM DROPDOWN
   ================================================== */

.zaros-dropdown {
    position: relative;

    width: 100%;
}


/* TRIGGER */

.zaros-dropdown-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 12px;

    width: 100%;
    height: 48px;

    padding: 0 15px;

    color: #002147;

    background: #ffffff;

    border: 1px solid #dfe3e8;
    border-radius: 18px;

    font-family: inherit;
    font-size: 13px;
    font-weight: 600;

    text-align: right;

    cursor: pointer;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background-color 0.2s ease;
}


.zaros-dropdown-trigger:hover {
    background: #fafbfc;

    border-color: #c3cad2;
}


.zaros-dropdown.is-open
.zaros-dropdown-trigger {
    border-color: #CF4F00;

    box-shadow:
        0 0 0 3px rgba(207, 79, 0, 0.08);
}


/* CURRENT */

.zaros-dropdown-current {
    overflow: hidden;

    text-overflow: ellipsis;

    white-space: nowrap;
}


/* ARROW */

.zaros-dropdown-arrow {
    display: flex;

    flex: 0 0 auto;

    align-items: center;
    justify-content: center;

    color: #697581;

    transition:
        color 0.2s ease,
        transform 0.2s ease;
}


.zaros-dropdown.is-open
.zaros-dropdown-arrow {
    color: #CF4F00;

    transform: rotate(180deg);
}


/* MENU */

.zaros-dropdown-menu {
    position: absolute;

    z-index: 999;

    top: calc(100% + 8px);
    right: 0;

    display: block;

    visibility: hidden;

    width: 100%;
    min-width: 220px;

    padding: 7px;

    opacity: 0;

    background: #ffffff;

    border: 1px solid #e3e7eb;
    border-radius: 18px;

    box-shadow:
        0 15px 45px rgba(0, 33, 71, 0.14);

    transform:
        translateY(-6px);

    pointer-events: none;

    transition:
        opacity 0.18s ease,
        transform 0.18s ease,
        visibility 0.18s ease;
}


.zaros-dropdown.is-open
.zaros-dropdown-menu {
    visibility: visible;

    opacity: 1;

    transform:
        translateY(0);

    pointer-events: auto;
}


/* OPTIONS */

.zaros-dropdown-options {
    max-height: 280px;

    overflow-y: auto;

    overscroll-behavior: contain;
}


/* SCROLLBAR */

.zaros-dropdown-options::-webkit-scrollbar {
    width: 5px;
}


.zaros-dropdown-options::-webkit-scrollbar-track {
    background: transparent;
}


.zaros-dropdown-options::-webkit-scrollbar-thumb {
    background: #d4d9df;

    border-radius: 20px;
}


/* OPTION */

.zaros-dropdown-option {
    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 10px;

    width: 100%;

    min-height: 42px;

    margin: 1px 0;

    padding: 8px 11px;

    color: #364451;

    background: transparent;

    border: 0;
    border-radius: 8px;

    font-family: inherit;
    font-size: 13px;
    font-weight: 500;

    text-align: right;

    cursor: pointer;

    transition:
        color 0.15s ease,
        background-color 0.15s ease;
}


.zaros-dropdown-option:hover {
    color: #CF4F00;

    background:
        rgba(207, 79, 0, 0.06);
}


/* SELECTED */

.zaros-dropdown-option.is-selected {
    color: #002147;

    background:
        rgba(0, 33, 71, 0.065);

    font-weight: 700;
}


.zaros-dropdown-option.is-selected:hover {
    background:
        rgba(0, 33, 71, 0.09);
}


/* CHECK */

.zaros-option-check {
    visibility: hidden;

    flex: 0 0 auto;

    color: #CF4F00;

    font-size: 15px;
    font-weight: 800;
}


.zaros-dropdown-option.is-selected
.zaros-option-check {
    visibility: visible;
}


/* ==================================================
   BRAND SEARCH
   ================================================== */

.zaros-dropdown-search {
    display: flex;

    align-items: center;

    gap: 8px;

    height: 42px;

    margin-bottom: 6px;

    padding: 0 10px;

    color: #8b949d;

    background: #f6f7f9;

    border: 1px solid transparent;
    border-radius: 9px;

    transition:
        border-color 0.2s ease,
        background-color 0.2s ease;
}


.zaros-dropdown-search:focus-within {
    background: #ffffff;

    border-color:
        rgba(207, 79, 0, 0.35);
}


.zaros-dropdown-search svg {
    flex: 0 0 auto;
}


.zaros-brand-search {
    width: 100%;

    padding: 0 !important;

    color: #002147 !important;

    background: transparent !important;

    border: 0 !important;

    box-shadow: none !important;

    outline: 0 !important;

    font-family: inherit !important;
    font-size: 12px !important;
}


.zaros-brand-search::placeholder {
    color: #9aa3ac;
}


/* EMPTY SEARCH */

.zaros-brand-empty {
    display: none;

    padding: 18px 10px;

    color: #8b949d;

    font-size: 12px;

    text-align: center;
}


/* ==================================================
   PRICE
   ================================================== */

.zaros-price-field {
    flex: 1.4;

    min-width: 300px;
}


.zaros-price-filter {
    width: 100%;
}


.zaros-price-values {
    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 8px;

    margin-bottom: 10px;

    color: #002147;

    font-size: 12px;
    font-weight: 600;

    white-space: nowrap;
}


.zaros-price-separator {
    color: #8b949d;

    font-size: 10px;
    font-weight: 400;
}


/* RANGE */

.zaros-range {
    position: relative;

    width: 100%;
    height: 22px;
}


.zaros-range-track,
.zaros-range-progress {
    position: absolute;

    top: 50%;

    height: 4px;

    border-radius: 50px;

    transform:
        translateY(-50%);
}


.zaros-range-track {
    right: 0;
    left: 0;

    background: #e4e7eb;
}


.zaros-range-progress {
    right: 0;
    left: 0;

    background: #CF4F00;

    pointer-events: none;
}


/* RANGE INPUT */

.zaros-range input[type="range"] {
    position: absolute;

    top: 0;
    right: 0;

    width: 100%;
    height: 22px;

    margin: 0;
    padding: 0;

    background: transparent;

    border: 0;

    outline: none;

    pointer-events: none;

    appearance: none;
    -webkit-appearance: none;
}

.zaros-min-price {
    z-index: 3;
}

.zaros-max-price {
    z-index: 4;
}

/* وقتی دستگیره حداقل قیمت در حال استفاده است */
.zaros-min-price:focus,
.zaros-min-price:active {
    z-index: 5;
}

.zaros-max-price:focus,
.zaros-max-price:active {
    z-index: 5;
}

.zaros-range input[type="range"]::-webkit-slider-thumb {
    pointer-events: auto;
}

.zaros-range input[type="range"]::-moz-range-thumb {
    pointer-events: auto;
}

/* WEBKIT */

.zaros-range
input[type="range"]
::-webkit-slider-runnable-track {
    height: 4px;

    background: transparent;
}


.zaros-range
input[type="range"]
::-webkit-slider-thumb {
    width: 18px;
    height: 18px;

    margin-top: -7px;

    background: #ffffff;

    border: 3px solid #CF4F00;
    border-radius: 50%;

    box-shadow:
        0 2px 8px rgba(0, 33, 71, 0.20);

    cursor: grab;

    pointer-events: auto;

    appearance: none;
    -webkit-appearance: none;

    transition:
        transform 0.15s ease,
        box-shadow 0.15s ease;
}


.zaros-range
input[type="range"]
::-webkit-slider-thumb:hover {
    transform:
        scale(1.12);

    box-shadow:
        0 3px 11px rgba(207, 79, 0, 0.28);
}


/* FIREFOX */

.zaros-range
input[type="range"]
::-moz-range-track {
    height: 4px;

    background: transparent;
}


.zaros-range
input[type="range"]
::-moz-range-thumb {
    width: 14px;
    height: 14px;

    background: #ffffff;

    border: 3px solid #CF4F00;
    border-radius: 50%;

    box-shadow:
        0 2px 8px rgba(0, 33, 71, 0.20);

    cursor: grab;

    pointer-events: auto;
}


/* ==================================================
   RESET BUTTON
   ================================================== */

.zaros-reset-wrapper {
    flex: 0 0 auto;
}

.zaros-reset-filter {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    height: 48px;
    padding: 0 20px;

    color: #ffffff;
    background: #002147;

    border: 2px solid #002147;
    border-radius: 18px;

    font-family: inherit;
    font-size: 13px;
    font-weight: 700;

    white-space: nowrap;
    cursor: pointer;

    box-shadow: 0 5px 14px rgba(0, 33, 71, 0.15);

    transition: all 0.2s ease;
}

.zaros-reset-filter.is-active:hover {
    color: #ffffff;
    background: #CF4F00;
    border-color: #CF4F00;

    transform: translateY(-1px);

    box-shadow: 0 7px 18px rgba(207, 79, 0, 0.22);
}

.zaros-reset-filter:disabled {
    color: #ffffff;
    background: #8c98a5;
    border-color: #8c98a5;

    opacity: 0.55;
    cursor: default;
    box-shadow: none;
}

.zaros-products-loading {
    display: none;

    align-items: center;

    justify-content: center;

    gap: 9px;

    width: 100%;

    padding: 15px;

    color: #002147;

    font-size: 13px;
}


.zaros-products-loading.is-active {
    display: flex;
}


.zaros-loader {
    display: inline-block;

    width: 17px;
    height: 17px;

    border: 2px solid #dfe4e9;

    border-top-color: #CF4F00;

    border-radius: 50%;

    animation:
        zaros-spin 0.7s linear infinite;
}


@keyframes zaros-spin {

    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }

}


/* ==================================================
   RESULTS
   ================================================== */

.zaros-products-results {
    width: 100%;

    transition:
        opacity 0.2s ease;
}


.zaros-products-results.zaros-is-loading {
    opacity: 0.35;

    pointer-events: none;
}


/* EMPTY / ERROR */

.zaros-no-products,
.zaros-filter-message {
    display: flex;

    flex-direction: column;

    align-items: center;

    justify-content: center;

    gap: 6px;

    width: 100%;

    min-height: 130px;

    padding: 30px 20px;

    color: #002147;

    background: #f7f8fa;

    border: 1px solid #edf0f2;
    border-radius: 14px;

    text-align: center;
}


.zaros-no-products strong {
    font-size: 16px;
}


.zaros-no-products span {
    color: #77818c;

    font-size: 13px;
}


/* ==================================================
   TABLET
   ================================================== */

@media (max-width: 1024px) {

    .zaros-filter-bar {
        gap: 14px;

        padding: 18px;
    }


    .zaros-filter-field {
        min-width: 170px;
    }


    .zaros-price-field {
        min-width: 250px;
    }

}


/* ==================================================
   MOBILE
   ================================================== */

@media (max-width: 767px) {

    .zaros-filter-bar {
        display: block;

        padding: 15px;

        margin-bottom: 22px;

        border-radius: 14px;
    }


    .zaros-filter-field,
    .zaros-price-field {
        width: 100%;

        min-width: 100%;

        margin-bottom: 17px;
    }


    .zaros-dropdown-trigger {
        height: 46px;
    }


    .zaros-dropdown-menu {
        min-width: 100%;
    }


    .zaros-price-values {
        font-size: 11px;
    }


    .zaros-reset-wrapper {
        width: 100%;
    }


    .zaros-reset-filter {
        width: 100%;

        height: 46px;
    }

}

/* Force Zaros filter rounded corners */

.zaros-products-wrapper .zaros-dropdown-trigger {
    border-radius: 18px !important;
    overflow: hidden;
}

.zaros-products-wrapper .zaros-dropdown-menu {
    border-radius: 18px !important;
    overflow: hidden;
}

.zaros-products-wrapper .zaros-reset-filter {
    border-radius: 18px !important;
}

.zaros-products-wrapper .zaros-dropdown-option {
    border-radius: 12px !important;
}

.zaros-products-wrapper .zaros-dropdown-search {
    border-radius: 12px !important;
}

