@counter-style partak-best-persian {
    system: numeric;
    symbols: '۰' '۱' '۲' '۳' '۴' '۵' '۶' '۷' '۸' '۹';
    suffix: '';
}

.partak-bestsellers {
    --partak-best-columns: 4;
    --partak-best-gap: 14px;
    --partak-best-radius: 22px;
    --partak-best-padding: 18px;
    --partak-best-image: 80px;
    --partak-best-bg: #fff;
    --partak-best-text: #111;
    --partak-best-rank-bg: #e30613;
    --partak-best-rank-text: #fff;
    min-width: 0;
    width: 100%;
    counter-reset: partak-best-rank;
}

.partak-bestsellers .products.wd-products {
    display: grid;
    grid-template-columns: repeat(var(--partak-best-columns), minmax(0, 1fr));
    gap: var(--partak-best-gap);
    margin: 0;
}

.partak-bestsellers .products > .product-grid-item {
    position: relative;
    min-width: 0;
    width: auto;
    max-width: none;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: var(--partak-best-radius);
    background: var(--partak-best-bg);
    counter-increment: partak-best-rank;
}

.partak-bestsellers .wd-hover-small .product-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 100%;
    min-height: 100px;
    padding: var(--partak-best-padding);
    border-radius: inherit;
}

.partak-bestsellers .wd-hover-small .product-element-top {
    flex: 0 0 var(--partak-best-image);
    width: var(--partak-best-image);
    min-width: 32px;
    margin: 0;
}

.partak-bestsellers .product-element-top img {
    width: 100%;
    height: var(--partak-best-image);
    object-fit: contain;
}

.partak-bestsellers .wd-hover-small .product-element-bottom {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
    padding: 0;
    text-align: start;
}

.partak-bestsellers.has-rank .product-element-bottom::before {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    margin-bottom: 4px;
    padding-inline: 4px;
    border-radius: 50%;
    background: var(--partak-best-rank-bg);
    color: var(--partak-best-rank-text);
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    content: counter(partak-best-rank, partak-best-persian);
}

.partak-bestsellers .wd-entities-title {
    display: -webkit-box;
    max-height: none;
    margin: 0;
    overflow: hidden;
    color: var(--partak-best-text);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.7;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.partak-bestsellers .wd-entities-title a {
    display: -webkit-box;
    overflow: hidden;
    white-space: normal;
    overflow-wrap: anywhere;
    text-overflow: ellipsis;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    color: inherit;
}

.partak-bestsellers .partak-bestsellers__card-link {
    position: absolute;
    z-index: 3;
    inset: 0;
    border-radius: inherit;
}

.partak-bestsellers:not(.has-price) .price,
.partak-bestsellers .star-rating,
.partak-bestsellers .wd-product-cats,
.partak-bestsellers .wd-product-brands-links,
.partak-bestsellers .product-labels {
    display: none;
}

.partak-bestsellers a:focus-visible,
.partak-bestsellers__viewport:focus-visible {
    outline: 2px solid var(--partak-best-rank-bg);
    outline-offset: 2px;
}

.partak-bestsellers__empty {
    margin: 0;
    padding: 20px;
    text-align: center;
}

@media (max-width: 1024px) {
    .partak-bestsellers {
        --partak-best-columns: 2;
    }
}

@media (max-width: 767px) {
    .partak-bestsellers {
        --partak-best-columns: 1;
        --partak-best-gap: 10px;
        --partak-best-padding: 12px;
        --partak-best-image: 72px;
    }

    .partak-bestsellers__viewport {
        overflow-x: auto;
        overscroll-behavior-x: contain;
        scroll-snap-type: x proximity;
        scrollbar-width: thin;
        padding: 4px 4px 12px;
    }

    .partak-bestsellers .products.wd-products {
        grid-template-columns: repeat(var(--partak-best-mobile-columns, 1), 82%);
        grid-auto-flow: row;
        align-items: stretch;
    }

    .partak-bestsellers .products > .product-grid-item {
        scroll-snap-align: start;
    }

    .partak-bestsellers .wd-hover-small .product-wrapper {
        min-height: 120px;
    }
}
