.allBazarIndex{
    margin: auto;
    .title{
        margin-bottom: 2rem;
        text-align: center;
        .title2{
            font-size: 2rem;
            text-align: center;
            font-weight: 900;
            color: black;
        }
        .body{
            font-size: 1rem;
            text-align: center;
            font-weight: 500;
            color: $green;
            text-decoration: underline;
            margin-top: 1rem;
            display: grid;
        }
    }
    #gallery {
        position: relative;
        left: calc(-1 * var(--adjust-size));
        display: grid;
        grid-template-columns: repeat(5,1fr);
        gap: 20px;
        max-width: 100vw;
        padding: 20px;
        .catName{
            display: grid;
            margin: .5rem 0;
        }
    }
    #gallery .item:nth-child(7n) {
        --duration: 1s;
        --pin-color: crimson;
    }
    #gallery .item:nth-child(7n + 1) {
        --duration: 1.8s;
        --pin-color: hotpink;
    }
    #gallery .item:nth-child(7n + 2) {
        --duration: 1.3s;
        --pin-color: magenta;
    }
    #gallery .item:nth-child(7n + 3) {
        --duration: 1.5s;
        --pin-color: orangered;
    }
    #gallery .item:nth-child(7n + 4) {
        --duration: 1.1s;
        --pin-color: darkorchid;
    }
    #gallery .item:nth-child(7n + 5) {
        --duration: 1.6s;
        --pin-color: deeppink;
    }
    #gallery .item:nth-child(7n + 6) {
        --duration: 1.2s;
        --pin-color: mediumvioletred;
    }
    #gallery .item:nth-child(3n) {
        --angle: 3deg;
    }
    #gallery .item:nth-child(3n + 1) {
        --angle: -3.3deg;
    }
    #gallery .item:nth-child(3n + 2) {
        --angle: 2.4deg;
    }
    #gallery .item:nth-child(odd) {
        --direction: alternate;
    }
    #gallery .item:nth-child(even) {
        --direction: alternate-reverse;
    }
    #gallery .item {
        --angle: 3deg;
        --count: 5;
        --duration: 1s;
        --delay: calc(-0.5 * var(--duration));
        --direction: alternate;
        --pin-color: red;
        display: grid;
        position: relative;
        margin: var(--adjust-size);
        padding: 0.5rem;
        border-radius: 5px;
        box-shadow: 0 7px 8px rgba(0, 0, 0, 0.4);
        width: 100%;
        height: auto;
        text-align: center;
        background-color: ghostwhite;
        background-image: url("/img/backB.jpg");
        background-size: cover;
        background-position: center;
        background-blend-mode: multiply;
        cursor: pointer;
        justify-content: center;
        transform-origin: center 0.22rem;
        will-change: transform;
        break-inside: avoid;
        overflow: hidden;
        outline: 1px solid transparent;
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
        .pic{
            position: relative;
            .price{
                display: flex;
                justify-content: left;
                align-items: center;
                gap: 5px;
                position: absolute;
                top: 0;
                left: 0;
                z-index: 10;
                background: $green;
                color: white;
                text-align: left;
                padding: 2px 5px;
                font-size: .9rem;
                border-radius: 5px;
                font-weight: 500;
                &:after{
                    content: "\F06C\00FE0E";
                    display: -webkit-box;
                    display: -ms-flexbox;
                    display: flex;
                    -webkit-box-align: center;
                    -ms-flex-align: center;
                    align-items: center;
                    -webkit-box-pack: center;
                    -ms-flex-pack: center;
                    justify-content: center;
                    font-weight: 300;
                    letter-spacing: normal;
                    font-family: digikala;
                    font-size: .9rem;
                    -webkit-font-smoothing: antialiased;
                    -moz-osx-font-smoothing: grayscale;
                    font-style: normal;
                    font-variant: normal;
                    text-decoration: none;
                    text-transform: none;
                    line-height: 1;
                    box-sizing: inherit;
                }
            }
        }
    }
    .showStory{
        position: fixed;
        top: 0;
        right: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.6);
        z-index: 4000;
        .show1 {
            width: 30%;
            margin: auto;
            position: absolute;
            left: 50%;
            top: 50%;
            transform: translate(-50%, -50%);
            background: white;
            overflow: hidden;
            height: 90%;
            .titleS{
                display: flex;
                justify-content: space-between;
                align-items: center;
                padding: .5rem;
                height: 4rem;
                .profile{
                    display: flex;
                    gap: .5rem;
                    align-items: center;
                    .pic{
                        overflow: hidden;
                        border-radius: 50%;
                        img{
                            width: 3rem;
                            height: 3rem;
                            object-fit: cover;
                        }
                    }
                    .detail{
                        .name{
                            font-size: .9rem;
                            font-weight: 300;
                            color: black;
                        }
                        .city{
                            font-size: .8rem;
                            font-weight: 300;
                            color: $text2;
                        }
                    }
                }
                i{
                    display: grid;
                    align-items: center;
                    cursor: pointer;
                    svg{
                        width: 1.5rem;
                        height: 1.5rem;
                        fill: $text1;
                    }
                }
            }
            .body{
                height: calc(100% - 6.5rem);
                .video-container{
                    height: 100%;
                }
                img,video{
                    width: 100%;
                    height: 100%;
                    object-fit: cover;
                }
            }
            .send{
                display: grid;
                justify-content: center;
                align-items: center;
                width: 100%;
                padding: .3rem .5rem;
                text-align: center;
                background: $green;
                color: white;
                font-size: 1rem;
                font-weight: 300;
                height: 2.5rem;
            }
        }
    }
    #gallery.active .item {
        animation-duration: var(--duration), 1.5s;
        animation-delay: var(--delay),
        calc(var(--delay) + var(--duration) * var(--count));
        animation-timing-function: ease-in-out;
        animation-iteration-count: var(--count), 1;
        animation-direction: var(--direction), normal;
        animation-fill-mode: both;
        animation-name: swing, swingEnd;
    }
    #gallery .item:after {
        position: absolute;
        top: 0.22rem;
        left: 50%;
        width: 0.7rem;
        height: 0.7rem;
        content: "";
        background: var(--pin-color);
        border-radius: 50%;
        box-shadow: -0.1rem -0.1rem 0.3rem 0.02rem rgba(0, 0, 0, 0.5) inset;
        filter: drop-shadow(0.3rem 0.15rem 0.2rem rgba(0, 0, 0, 0.5));
        transform: translateZ(0);
        z-index: 2;
    }
    .item img,video {
        aspect-ratio: 1 /1;
        width: 100%;
        height: 15rem;
        object-fit: cover;
        display: block;
        border-radius: 5px;
        z-index: 1;
    }
    .item .title2 {
        font-size: 1rem;
        font-weight: 400;
        display: grid;
        color: $text2;
        justify-content: right;
        white-space: pre-line;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        box-orient: vertical;
        -webkit-box-orient: vertical;
        line-clamp: 2;
        -webkit-line-clamp: 2;
        overflow: hidden;
        text-overflow: ellipsis;
        z-index: 1;
    }
    .item .title3 {
        color: crimson;
        font-size: 22px;
    }
    .item p,.catName {
        font-size: 17px;
    }
    .item small {
        font-size: 12px;
    }
    .item > div {
        width: 100%;
        height: 100%;
        position: relative;
        display: flex;
        justify-content: center;
        align-items: center;
    }
    @keyframes swing {
        0% {
            transform: rotate3d(0, 0, 1, calc(-1 * var(--angle)));
        }
        100% {
            transform: rotate3d(0, 0, 1, var(--angle));
        }
    }
    @keyframes swingEnd {
        to {
            transform: rotate3d(0, 0, 1, 0deg);
        }
    }
    #info {
        position: relative;
        text-align: center;
        z-index: 1;
    }
    #info a {
        font-size: 1.1rem;
    }
    @media (max-width: 800px) {
        #gallery {
            grid-template-columns: repeat(2,1fr);
            padding: 0 10px;
            gap: 10px;
            .item img,video {
                height: 10rem;
            }
        }
        .showStory{
            .show1 {
                width: 98%;
                .body{
                    img{
                        height: calc(100% - 14rem);
                    }
                }
            }
        }
    }
}
