/*!
 * Story Player Styles v3.0.0
 * Author: Amir Rezaie (https://amir-rezaie.ir)
 * License: MIT
 */

#stories-container {
    display: flex;
    gap: 15px;
    padding: 15px;
    overflow-x: auto;
}

#stories-container {
    overflow-x: auto;
    display: flex;
    gap: 1rem;
    padding: 1rem;
    cursor: grab;
    scroll-snap-type: none !important;
    user-select: none;
    -webkit-user-drag: none;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

#stories-container img {
    -webkit-user-drag: none;
    user-select: none;
    pointer-events: none;
    /* جلوگیری از تداخل کلیک تصویر با درگ */
}

#stories-container:active {
    cursor: grabbing;
}

#stories-container::-webkit-scrollbar {
    height: 5px;
    display: none;
}

#stories-container:hover::-webkit-scrollbar {
    display: block;
}

#stories-container::-webkit-scrollbar-track {
    background: transparent;
}

#stories-container::-webkit-scrollbar-thumb {
    background: #10b981;
    border-radius: 10px;
}

.story {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
}

.story-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    padding: 2px;
    background: linear-gradient(45deg, #ff6b6b, #ff3838);
    transition: background 0.3s;
}

.story-avatar.viewed {
    background: #ddd !important;
}

.story-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid white;
    object-fit: cover;
}

.story-username {
    margin-top: 5px;
    font-size: 12px;
    color: #333;
    white-space: nowrap;
}

.story-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
}

.progress-container {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
}

.progress-fill {
    width: 0%;
    height: 100%;
    background: #4CAF50;
    border-radius: 2px;
    transition: width linear;
}

.story-content {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.media-container {
    position: relative;
    width: 100%;
    display: flex;
    height: 100%;
    align-items: center;
}

.story-media {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    display: none;
}

.video-media {
    display: none;
}

.nav-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.3);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    color: white;
    font-size: 24px;
    cursor: pointer;
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: center;
}

.prev-button {
    right: 20px;
}

.next-button {
    left: 20px;
}

.close-button {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.3);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: white;
    font-size: 24px;
    cursor: pointer;
    z-index: 1001;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.story-link {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 14px;
    z-index: 1002;
}


.story-media,
.video-media {
    width: 100%;
    height: 90%;
    object-fit: contain;
    display: block;
}

.category-page-v2 {
    padding: 1.15rem 0 1.6rem;
    background: transparent;
    direction: rtl;
    text-align: right
}

.category-page-v2 * {
    box-sizing: border-box
}

.category-breadcrumb {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: .45rem;
    flex-wrap: wrap;
    margin: .35rem 0 1.35rem;
    color: #6b7280;
    font-size: .78rem;
    line-height: 1.8
}

.category-breadcrumb a {
    display: flex;
    align-items: center;
    gap: .35rem;
    color: #6b7280;
    transition: .2s
}

.category-breadcrumb a:hover {
    color: var(--color-primary)
}

.category-breadcrumb .sep {
    color: #9ca3af
}

.category-breadcrumb .current {
    color: #6b7280;
    text-align: right;
    direction: rtl;
    white-space: nowrap
}

.category-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    margin-bottom: 1.7rem
}

.category-section-title {
    position: relative;
    display: inline-block;
    padding-bottom: 1.05rem;
    margin: 0;
    font-size: 1.35rem;
    line-height: 2rem;
    font-weight: 900;
    color: #111827;
    text-align: right
}

.dark .category-section-title {
    color: #e5e7eb
}

.category-section-title:before {
    content: "";
    position: absolute;
    right: 0;
    bottom: .05rem;
    width: .55rem;
    height: .55rem;
    border-radius: 999px;
    background: var(--color-primary)
}

.category-section-title:after {
    content: "";
    position: absolute;
    right: 1rem;
    bottom: .11rem;
    width: 7.25rem;
    height: .45rem;
    border-radius: 999px;
    background: var(--color-primary)
}

.category-strip {
    display: grid;
    grid-template-columns: repeat(9, minmax(0, 1fr));
    gap: .8rem;
    margin-bottom: 2.05rem
}

.category-tile {
    height: 6.35rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: .85rem;
    box-shadow: 0 2px 8px rgba(15, 23, 42, .08);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .48rem;
    color: #111827;
    transition: .2s
}

.category-tile:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(15, 23, 42, .1)
}

.category-tile img {
    width: 4.45rem;
    height: 3.45rem;
    object-fit: contain
}

.category-tile span {
    font-size: .78rem;
    font-weight: 800
}

.dark .category-tile {
    background: #161b22;
    border-color: #374151;
    color: #e5e7eb
}

.category-shop-grid {
    display: grid;
    grid-template-columns: 17.25rem minmax(0, 1fr);
    gap: 1rem;
    align-items: start
}

.category-sidebar {
    grid-column: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem
}

.category-main {
    grid-column: 2;
    min-width: 0
}

.category-products {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    background: #fff;
    border-radius: .55rem;
    overflow: hidden;
    border: 1px solid #f2e7e7
}

.dark .category-products {
    background: #161b22;
    border-color: #374151
}

.cat-product {
    position: relative;
    min-height: 13.85rem;
    background: #fff;
    border-left: 1px solid #f5eded;
    border-bottom: 1px solid #f5eded;
    padding: 1rem .78rem .7rem;
    transition: .2s
}

.cat-product:hover {
    z-index: 2;
    box-shadow: 0 10px 28px rgba(15, 23, 42, .09)
}

.dark .cat-product {
    background: #161b22;
    border-color: #374151
}

.cat-product .discount {
    position: absolute;
    top: .68rem;
    right: .68rem;
    background: #ff9f1c;
    color: #fff;
    border-radius: .7rem .7rem .7rem .25rem;
    font-size: .66rem;
    font-weight: 900;
    padding: .22rem .48rem;
    z-index: 3
}

.cat-product .color-dots {
    position: absolute;
    top: .82rem;
    left: .62rem;
    display: flex;
    flex-direction: column;
    gap: .28rem;
    z-index: 3
}

.cat-product .color-dots span {
    width: .42rem;
    height: .42rem;
    border-radius: 999px;
    background: #fbbf24
}

.cat-product figure {
    height: 6.35rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 0 .7rem
}

.cat-product img {
    max-width: 8.4rem;
    max-height: 6.2rem;
    object-fit: contain
}

.cat-product h3 {
    height: 2.8rem;
    margin: 0 0 .35rem;
    overflow: hidden;
    color: #111827;
    font-size: .76rem;
    font-weight: 900;
    line-height: 1.85;
    text-align: right
}

.dark .cat-product h3 {
    color: #e5e7eb
}

.cat-product .old-price {
    height: 1rem;
    text-align: left;
    color: #9ca3af;
    text-decoration: line-through;
    font-size: .68rem
}

.cat-product .product-meta {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: .5rem;
    margin-top: .05rem
}

.cat-product .rating {
    display: flex;
    align-items: center;
    gap: .14rem;
    font-size: .78rem;
    font-weight: 900;
    color: #111827
}

.dark .cat-product .rating {
    color: #e5e7eb
}

.cat-product .star {
    color: #f8b400;
    font-size: 1rem;
    line-height: 1
}

.cat-product .price {
    font-size: .86rem;
    font-weight: 900;
    letter-spacing: .02em;
    color: #111827;
    text-align: left
}

.dark .cat-product .price {
    color: #f3f4f6
}

.filter-card-v2 {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: .85rem;
    box-shadow: 0 6px 15px rgba(15, 23, 42, .08);
    padding: 1rem
}

.dark .filter-card-v2 {
    background: #161b22;
    border-color: #374151
}

.filter-heading {
    position: relative;
    margin: 0 0 .92rem;
    padding-bottom: .9rem;
    color: #111827;
    font-size: .9rem;
    font-weight: 900;
    text-align: right
}

.dark .filter-heading {
    color: #e5e7eb
}

.filter-heading:before {
    content: "";
    position: absolute;
    right: 0;
    bottom: 0;
    width: .45rem;
    height: .45rem;
    border-radius: 999px;
    background: var(--color-primary)
}

.filter-heading:after {
    content: "";
    position: absolute;
    right: .85rem;
    bottom: .08rem;
    width: 5.1rem;
    height: .38rem;
    border-radius: 999px;
    background: var(--color-primary)
}

.filter-search-box {
    position: relative
}

.filter-search-box input {
    width: 100%;
    height: 2.7rem;
    border: 1px solid #d8dee9;
    border-radius: .55rem;
    background: #fff;
    color: #111827;
    padding: 0 2.5rem 0 .85rem;
    font-size: .75rem;
    outline: none;
    text-align: right
}

.filter-search-box svg {
    position: absolute;
    right: .75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.22rem;
    height: 1.22rem;
    color: #111827
}

.dark .filter-search-box input {
    background: #0d1117;
    border-color: #374151;
    color: #e5e7eb
}

.filter-tags {
    display: flex;
    flex-wrap: wrap;
    gap: .55rem
}

.filter-tag {
    font-size: .7rem;
    color: #6b7280;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    padding: .34rem .65rem
}

.dark .filter-tag {
    background: #0d1117;
    border-color: #374151;
    color: #d1d5db
}

.filter-colors {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: .8rem;
    margin-top: .85rem
}

.filter-color-pill {
    font-size: .72rem;
    color: #374151;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    padding: .34rem .65rem;
    display: flex;
    align-items: center;
    gap: .45rem
}

.dark .filter-color-pill {
    background: #0d1117;
    border-color: #374151;
    color: #d1d5db
}

.color-circle {
    width: .88rem;
    height: .88rem;
    border-radius: 999px;
    display: inline-block
}

.price-filter-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: .55rem;
    align-items: center;
    margin: 1rem 0 1.35rem
}

.price-filter-box {
    height: 2.5rem;
    border: 1px solid #e5e7eb;
    background: #f3f4f6;
    border-radius: .45rem;
    color: #111827;
    font-size: .74rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center
}

.price-filter-box small {
    font-size: .6rem;
    color: #6b7280;
    margin-top: .18rem
}

.dark .price-filter-box {
    background: #0d1117;
    border-color: #374151;
    color: #e5e7eb
}

.range-track {
    height: .34rem;
    background: #dc2626;
    border-radius: 999px;
    position: relative;
    margin: .25rem .35rem
}

.range-track:before,
.range-track:after {
    content: "";
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 1rem;
    height: 1rem;
    border-radius: 999px;
    background: #fff;
    border: 2px solid #dc2626
}

.range-track:before {
    right: 0
}

.range-track:after {
    left: 0
}

.brand-options {
    display: flex;
    flex-direction: column;
    gap: .65rem
}

.brand-options label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #374151;
    font-size: .78rem
}

.dark .brand-options label {
    color: #d1d5db
}

.category-page-v2 input[type=checkbox] {
    accent-color: #dc2626
}

.category-pagination {
    height: 3.45rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: .85rem;
    margin-top: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    color: #374151;
    font-size: .78rem
}

.dark .category-pagination {
    background: #161b22;
    border-color: #374151;
    color: #d1d5db
}

.category-pagination .current {
    width: 2rem;
    height: 2rem;
    background: var(--color-primary);
    border-radius: .5rem;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900
}

.category-desc {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: .85rem;
    box-shadow: 0 2px 8px rgba(15, 23, 42, .06);
    padding: 1.25rem 1.5rem;
    margin: 2rem 0 1.1rem
}

.dark .category-desc {
    background: #161b22;
    border-color: #374151
}

.category-desc p {
    margin: 0;
    color: #374151;
    text-align: justify;
    font-size: .83rem;
    line-height: 2.18
}

.dark .category-desc p {
    color: #d1d5db
}

.desc-action {
    display: flex;
    justify-content: flex-end;
    margin-top: .85rem
}

.desc-action a {
    background: #111827;
    color: #fff;
    border-radius: .48rem;
    font-size: .76rem;
    padding: .55rem .9rem
}

@media(max-width:1199px) {
    .category-strip {
        grid-template-columns: repeat(6, minmax(0, 1fr))
    }

    .category-shop-grid {
        grid-template-columns: 1fr
    }

    .category-sidebar {
        grid-column: 1;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        order: 2
    }

    .category-main {
        grid-column: 1;
        order: 1
    }

    .category-products {
        grid-template-columns: repeat(3, minmax(0, 1fr))
    }
}

@media(max-width:767px) {
    .category-page-v2 {
        padding-top: .85rem
    }

    .category-breadcrumb {
        font-size: .72rem;
        margin-bottom: 1rem
    }

    .category-title-row {
        margin-bottom: 1.1rem
    }

    .category-section-title {
        font-size: 1.08rem
    }

    .category-strip {
        display: flex;
        overflow-x: auto;
        gap: .7rem;
        margin-bottom: 1.2rem;
        padding-bottom: .4rem;
        scrollbar-width: none
    }

    .category-strip::-webkit-scrollbar {
        display: none
    }

    .category-tile {
        min-width: 7.1rem;
        height: 6rem
    }

    .category-shop-grid {
        display: flex;
        flex-direction: column
    }

    .category-main {
        width: 100%;
        order: 1
    }

    .category-sidebar {
        display: flex;
        width: 100%;
        order: 2
    }

    .category-products {
        grid-template-columns: repeat(2, minmax(0, 1fr))
    }

    .cat-product {
        min-height: 13.15rem;
        padding: .82rem .65rem
    }

    .cat-product img {
        max-width: 6.3rem
    }

    .filter-card-v2 {
        padding: .92rem
    }

    .category-desc {
        padding: 1rem
    }

    .category-desc p {
        font-size: .77rem;
        line-height: 2
    }

    .category-pagination {
        gap: .9rem
    }
}

@media(max-width:430px) {
    .category-products {
        grid-template-columns: 1fr
    }

    .cat-product img {
        max-width: 7.4rem
    }

    .category-sidebar {
        width: 100%
    }

    .category-title-row {
        justify-content: flex-start
    }

    .category-section-title:after {
        width: 6.5rem
    }
}