.noUi-target,
.noUi-target * {
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
    -webkit-user-select: none;
    -ms-touch-action: none;
    touch-action: none;
    -ms-user-select: none;
    -moz-user-select: none;
    user-select: none;
    -moz-box-sizing: border-box;
    box-sizing: border-box
}

.noUi-target {
    position: relative
}

.noUi-base,
.noUi-connects {
    width: 100%;
    height: 100%;
    position: relative;
    z-index: 1
}

.noUi-connects {
    overflow: hidden;
    z-index: 0
}

.noUi-connect,
.noUi-origin {
    will-change: transform;
    position: absolute;
    z-index: 1;
    top: 0;
    right: 0;
    height: 100%;
    width: 100%;
    -ms-transform-origin: 0 0;
    -webkit-transform-origin: 0 0;
    -webkit-transform-style: preserve-3d;
    transform-origin: 0 0;
    transform-style: flat
}

.noUi-txt-dir-rtl.noUi-horizontal .noUi-origin {
    left: 0;
    right: auto
}

.noUi-vertical .noUi-origin {
    top: -100%;
    width: 0
}

.noUi-horizontal .noUi-origin {
    height: 0
}

.noUi-handle {
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    position: absolute
}

.noUi-touch-area {
    height: 100%;
    width: 100%
}

.noUi-state-tap .noUi-connect,
.noUi-state-tap .noUi-origin {
    -webkit-transition: transform .3s;
    transition: transform .3s
}

.noUi-state-drag * {
    cursor: inherit !important
}

.noUi-horizontal {
    height: 18px
}

.noUi-horizontal .noUi-handle {
    width: 34px;
    height: 28px;
    right: -17px;
    top: -6px
}

.noUi-vertical {
    width: 18px
}

.noUi-vertical .noUi-handle {
    width: 28px;
    height: 34px;
    right: -6px;
    bottom: -17px
}

.noUi-txt-dir-rtl.noUi-horizontal .noUi-handle {
    left: -17px;
    right: auto
}

.noUi-target {
    background: #FAFAFA;
    border-radius: 4px;
    border: 1px solid #D3D3D3;
    box-shadow: inset 0 1px 1px #F0F0F0, 0 3px 6px -5px #BBB
}

.noUi-connects {
    border-radius: 3px
}

.noUi-connect {
    background: #3FB8AF
}

.noUi-draggable {
    cursor: ew-resize
}

.noUi-vertical .noUi-draggable {
    cursor: ns-resize
}

.noUi-handle {
    border: 1px solid #D9D9D9;
    border-radius: 3px;
    background: #FFF;
    cursor: default;
    box-shadow: inset 0 0 1px #FFF, inset 0 1px 7px #EBEBEB, 0 3px 6px -3px #BBB
}

.noUi-active {
    box-shadow: inset 0 0 1px #FFF, inset 0 1px 7px #DDD, 0 3px 6px -3px #BBB
}

.noUi-handle:after,
.noUi-handle:before {
    content: "";
    display: block;
    position: absolute;
    height: 14px;
    width: 1px;
    background: #E8E7E6;
    left: 14px;
    top: 6px
}

.noUi-handle:after {
    left: 17px
}

.noUi-vertical .noUi-handle:after,
.noUi-vertical .noUi-handle:before {
    width: 14px;
    height: 1px;
    left: 6px;
    top: 14px
}

.noUi-vertical .noUi-handle:after {
    top: 17px
}

[disabled] .noUi-connect {
    background: #B8B8B8
}

[disabled] .noUi-handle,
[disabled].noUi-handle,
[disabled].noUi-target {
    cursor: not-allowed
}

.noUi-pips,
.noUi-pips * {
    -moz-box-sizing: border-box;
    box-sizing: border-box
}

.noUi-pips {
    position: absolute;
    color: #999
}

.noUi-value {
    position: absolute;
    white-space: nowrap;
    text-align: center
}

.noUi-value-sub {
    color: #ccc;
    font-size: 10px
}

.noUi-marker {
    position: absolute;
    background: #CCC
}

.noUi-marker-sub {
    background: #AAA
}

.noUi-marker-large {
    background: #AAA
}

.noUi-pips-horizontal {
    padding: 10px 0;
    height: 80px;
    top: 100%;
    left: 0;
    width: 100%
}

.noUi-value-horizontal {
    -webkit-transform: translate(-50%, 50%);
    transform: translate(-50%, 50%)
}

.noUi-rtl .noUi-value-horizontal {
    -webkit-transform: translate(50%, 50%);
    transform: translate(50%, 50%)
}

.noUi-marker-horizontal.noUi-marker {
    margin-left: -1px;
    width: 2px;
    height: 5px
}

.noUi-marker-horizontal.noUi-marker-sub {
    height: 10px
}

.noUi-marker-horizontal.noUi-marker-large {
    height: 15px
}

.noUi-pips-vertical {
    padding: 0 10px;
    height: 100%;
    top: 0;
    left: 100%
}

.noUi-value-vertical {
    -webkit-transform: translate(0, -50%);
    transform: translate(0, -50%);
    padding-left: 25px
}

.noUi-rtl .noUi-value-vertical {
    -webkit-transform: translate(0, 50%);
    transform: translate(0, 50%)
}

.noUi-marker-vertical.noUi-marker {
    width: 5px;
    height: 2px;
    margin-top: -1px
}

.noUi-marker-vertical.noUi-marker-sub {
    width: 10px
}

.noUi-marker-vertical.noUi-marker-large {
    width: 15px
}

.noUi-tooltip {
    display: block;
    position: absolute;
    border: 1px solid #D9D9D9;
    border-radius: 3px;
    background: #fff;
    color: #000;
    padding: 5px;
    text-align: center;
    white-space: nowrap
}

.noUi-horizontal .noUi-tooltip {
    -webkit-transform: translate(-50%, 0);
    transform: translate(-50%, 0);
    left: 50%;
    bottom: 120%
}

.noUi-vertical .noUi-tooltip {
    -webkit-transform: translate(0, -50%);
    transform: translate(0, -50%);
    top: 50%;
    right: 120%
}

.noUi-horizontal .noUi-origin>.noUi-tooltip {
    -webkit-transform: translate(50%, 0);
    transform: translate(50%, 0);
    left: auto;
    bottom: 10px
}

.noUi-vertical .noUi-origin>.noUi-tooltip {
    -webkit-transform: translate(0, -18px);
    transform: translate(0, -18px);
    top: auto;
    right: 28px
}

/******/
:root {
    --primary-color: #e63946;
    --primary-hover: #c1121f;
    --secondary-color: #2a9d8f;
    --secondary-hover: #1d7874;
    --tertiary-color: #457b9d;
    --text-dark: #333;
    --text-medium: #555;
    --text-light: #777;
    --border-color: #e0e0e0;
    --bg-light: #f5f5f5;
    --bg-white: #ffffff;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --out-of-stock: #6c757d;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Vazirmatn', sans-serif;
    direction: rtl;
    background: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
}

.container {
    display: flex;
    max-width: 1650px;
    /*width: 1500px;*/
    margin: 30px auto;
    gap: 25px;
    padding: 0 20px;
    position: relative;
}

.filter-box {
    width: 300px;
    background: var(--bg-white);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 20px;
    height: fit-content;
    align-self: flex-start;
    transition: all 0.3s ease;
}

.filter-box h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text-dark);
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.filter-section {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.filter-section:last-child {
    border-bottom: none;
    margin-bottom: 15px;
}

.filter-section label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 12px;
}

.price-inputs {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    align-items: center;
}

.price-input {
    flex: 1;
    position: relative;
}

.price-input input {
    width: 100%;
    padding: 10px 12px 10px 40px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: 'Vazirmatn', sans-serif;
    font-size: 13px;
    text-align: center;
    transition: all 0.2s;
}

.price-input input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(229, 57, 70, 0.2);
}

.price-input::before {
    content: 'تومان';
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    color: var(--text-light);
}

#price-slider {
    margin: 25px 0 15px;
}

.noUi-target {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: none;
    height: 6px;
    background: #f8f9fa;
}

.noUi-connect {
    background: linear-gradient(to right, var(--secondary-color), var(--primary-color));
}

.noUi-handle {
    width: 24px;
    height: 24px;
    right: -12px;
    top: -12px !important;
    background: var(--bg-white);
    border: 2px solid var(--primary-color);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 50%;
}

.noUi-handle::before,
.noUi-handle::after {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    color: var(--primary-color);
    font-size: 14px;
    font-weight: bold;
}

.noUi-handle-lower::before {
    content: '<';
}

.noUi-handle-upper::before {
    content: '>';
}

.noUi-handle:hover {
    transform: scale(1.1);
}

.noUi-tooltip {
    display: none;
}

.slider-value-display {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
}

.slider-value-box {
    background: var(--primary-color);
    color: white;
    padding: 5px 10px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    min-width: 80px;
    text-align: center;
}

.filter-options {
    max-height: 200px;
    overflow-y: auto;
    padding-right: 5px;
}

.filter-options label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: color 0.2s;
}

.filter-options label:hover {
    color: var(--primary-color);
}

.filter-options input[type="checkbox"] {
    accent-color: var(--primary-color);
}

.filter-box button {
    padding: 3px 8px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    /* margin-top: 15px; */
    font-family: 'Vazirmatn', sans-serif;
    font-size: 14px;
}

.filter-box button:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

.products-container {
    flex: 1;
}

.sort-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-white);
    padding: 15px 20px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.sort-bar>span {
    font-size: 16px;
    font-weight: 600;
}

.sort-links {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.sort-link {
    padding: 8px 15px;
    background: var(--bg-light);
    border-radius: var(--radius-sm);
    color: var(--text-medium);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
    cursor: pointer;
}

.sort-link:hover {
    background: var(--primary-color);
    color: white;
}

.sort-link.active {
    background: var(--primary-color);
    color: white;
}

.products {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 25px;
}

.product {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 18px;
    display: flex;
    flex-direction: column;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.product:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.product img {
    width: 100%;
    height: 180px;
    object-fit: contain;
    margin-bottom: 15px;
    border-radius: var(--radius-sm);
    background: #f9f9f9;
    padding: 10px;
}

.product h4 {
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 10px;
    color: var(--text-dark);
    line-height: 1.4;
    height: 42px;
    overflow: hidden;
    display: -webkit-box;
    --webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.product-details {
    font-size: 14px;
    color: var(--text-medium);
    margin-bottom: 12px;
    line-height: 1.5;
}

.price-container {
    margin-top: auto;
    padding-top: 10px;
}

.price {
    color: var(--secondary-color);
    font-weight: 700;
    font-size: 18px;
    display: block;
    margin-bottom: 5px;
}

.old-price {
    color: var(--text-light);
    text-decoration: line-through;
    font-size: 14px;
    display: inline-block;
    margin-left: 8px;
}

.discount-badge {
    background: var(--primary-color);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
    display: inline-block;
    margin-bottom: 8px;
}

.product.out-of-stock {
    opacity: 0.7;
}

.product.out-of-stock img {
    filter: grayscale(100%);
}

.product.out-of-stock::after {
    content: 'ناموجود';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 15px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    z-index: 2;
}

.unavailable {
    color: var(--out-of-stock);
    font-weight: 600;
    font-size: 14px;
}

.low-stock {
    color: #d35400;
    font-size: 13px;
    font-weight: 600;
    margin-top: 8px;
}

.filter-toggle {
    display: none;
    background: var(--primary-color);
    color: white;
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    cursor: pointer;
    font-weight: 600;
    justify-content: center;
    align-items: center;
    gap: 8px;
    transition: background 0.3s;
}

.filter-toggle:hover {
    background: var(--primary-hover);
}

.filter-toggle img {
    width: 20px;
    height: 20px;
    filter: invert(1);
}

.close-filter {
    display: none;
    position: absolute;
    top: 15px;
    left: 15px;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-dark);
    cursor: pointer;
    z-index: 10;
}

#reset-filters {
    font-size: 14px;
    color: var(--primary-color);
    text-decoration: underline;
    cursor: pointer;
    margin-top: 10px;
    display: inline-block;
    transition: color 0.2s;
}

#reset-filters:hover {
    color: var(--primary-hover);
}

.pagination {
    display: flex;
    justify-content: center;
    margin-top: 40px;
    gap: 8px;
}

.pagination button {
    padding: 10px 15px;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: 'Vazirmatn', sans-serif;
    transition: all 0.2s;
}

.pagination button:hover {
    background: var(--bg-light);
}

.pagination button.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* موبایل */
@media (max-width: 1024px) {
    .container {
        flex-direction: column;
    }

    .filter-box {
        position: fixed;
        top: 0;
        right: -100%;
        width: 40%;
        max-width: none !important;
        font-size: 25px;
        height: 100vh;
        z-index: 1000;
        border-radius: 0;
        padding: 50px 20px 20px;
        overflow-y: auto;
        box-shadow: var(--shadow-md);
    }

    .filter-box.active {
        right: 0;
    }
    .filter-box button {
    display: block;
    }


    .filter-toggle {
        display: flex;
    }

    .close-filter {
        display: block;
    }

    .products {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .product {
        padding: 15px;
    }

    .product img {
        height: 150px;
    }

    .sort-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .sort-links {
        width: 100%;
        overflow-x: auto;
        padding-bottom: 5px;
    }
}

@media (max-width: 640px) {
    .products {
        grid-template-columns: 1fr;
    }

    .container {
        padding: 0 15px;
        margin: 20px auto;
    }

    .sort-bar>span {
        font-size: 15px;
    }

    .sort-link {
        padding: 6px 12px;
        font-size: 13px;
    }

    .pagination button {
        padding: 8px 12px;
        font-size: 14px;
    }
}

/* انیمیشن برای فیلتر موبایل */
@keyframes slideIn {
    from {
        right: -100%;
    }

    to {
        right: 0;
    }
}

@keyframes slideOut {
    from {
        right: 0;
    }

    to {
        right: -100%;
    }
}

/* backdrop برای فیلتر در موبایل */
.filter-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.filter-backdrop.active {
    display: block;
}