/* THE CATEGORY LIST, ENDLESS (plp-infinite.js). The loading line under the list is the reference's
   (G:\Projects\Design\plp\plp-mobile-1.png): four grey diamonds and «در حال بارگذاری...», then a grey pill with the
   page being brought of all pages. Skeleton cards stand in the grid meanwhile, the card's own geometry
   (assets/product-card: the cell, the 3:4 media, the text inset). */

/* ---- the page links: still in the page for search engines and keyboards, out of sight ---- */

.tc-plpi-on .km-category-grid-footer .km-pagination:not(:focus-within) {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    margin: -1px !important;
    padding: 0 !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.tc-plpi-on .km-plp-next-page {
    display: none !important;
}

/* ---- the line under the list ---- */

.tc-plpi {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.tc-plpi__sentinel {
    width: 100%;
    height: 1px;
}

.tc-plpi__loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 32px 16px 40px;
}

.tc-plpi__loader[hidden],
.tc-plpi__error[hidden] {
    display: none;
}

.tc-plpi__line {
    display: flex;
    align-items: center;
    gap: 12px;
}

.tc-plpi__text {
    font-size: 15px;
    line-height: 24px;
    font-weight: 400;
    color: #9E9E9E;
}

/* four diamonds in a square, lit one after another round it */
.tc-plpi__spin {
    display: grid;
    grid-template-columns: 9px 9px;
    grid-template-rows: 9px 9px;
    gap: 9px;
    flex: none;
}

.tc-plpi__spin i {
    display: block;
    width: 9px;
    height: 9px;
    background: #8C8C8C;
    border-radius: 1px;
    transform: rotate(45deg);
    animation: tc-plpi-spin 1.2s linear infinite;
}

.tc-plpi__spin i:nth-child(2) { animation-delay: .3s; }
.tc-plpi__spin i:nth-child(4) { animation-delay: .6s; }
.tc-plpi__spin i:nth-child(3) { animation-delay: .9s; }

@keyframes tc-plpi-spin {
    0%, 60%, 100% { opacity: 1; }
    30% { opacity: .25; }
}

.tc-plpi__count {
    display: inline-flex;
    align-items: center;
    height: 36px;
    padding: 0 18px;
    border-radius: 100px;
    background: #6B6B6B;
    color: #FFF;
    font-size: 15px;
    line-height: 36px;
    font-weight: 500;
    white-space: nowrap;
}

.tc-plpi__error {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 28px 16px 36px;
    font-size: 13px;
    line-height: 22px;
    color: #5E5E5E;
}

.tc-plpi__retry {
    height: 36px;
    padding: 0 20px;
    border: 1px solid #E0E0E2;
    border-radius: 8px;
    background: #FFF;
    color: #2F2F2F;
    font: inherit;
    font-size: 13px;
    cursor: pointer;
}

/* ---- «نمایش کالاهای صفحه قبل», entered on page n > 1 ---- */

.tc-plpi-prev {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    max-width: 360px;
    height: 40px;
    margin: 12px auto 4px;
    border: 1px solid #E0E0E2;
    border-radius: 8px;
    background: #FFF;
    color: #2F2F2F;
    font-size: 13px;
    line-height: 22px;
    text-decoration: none;
}

.tc-plpi-prev:hover {
    color: #2F2F2F;
    border-color: #C9C9CC;
}

.tc-plpi-prev[hidden] {
    display: none;
}

.tc-plpi-prev svg {
    width: 18px;
    height: 18px;
    flex: none;
}

.tc-plpi-prev.is-loading {
    pointer-events: none;
    opacity: .55;
}

@media only screen and (max-width: 991.98px) {
    .tc-plpi-prev {
        margin-inline: 16px;
    }
}

/* ---- skeleton cards ---- */

.tc-plpi-skel__card {
    display: flex;
    flex-direction: column;
    width: 100%;
    padding-bottom: 20px;
}

.tc-plpi-skel__media {
    width: 100%;
    aspect-ratio: 3 / 4;
    background: #EDEDEF;
}

@supports not (aspect-ratio: 1 / 1) {
    .tc-plpi-skel__media { height: 0; padding-top: 133.33%; }
}

.tc-plpi-skel__body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px 10px 0;
}

.tc-plpi-skel__body i {
    display: block;
    height: 12px;
    border-radius: 6px;
    background: #EDEDEF;
}

.tc-plpi-skel__body i.is-short { width: 60%; }

.tc-plpi-skel__body i.is-price {
    width: 45%;
    height: 16px;
    margin-top: 8px;
    margin-inline-start: auto;
}

/* a light passing over the grey, the same on every skeleton */
.tc-plpi-skel__media,
.tc-plpi-skel__body i {
    background-image: linear-gradient(90deg, rgba(255, 255, 255, 0) 0, rgba(255, 255, 255, .7) 50%, rgba(255, 255, 255, 0) 100%);
    background-size: 200% 100%;
    background-repeat: no-repeat;
    animation: tc-plpi-shine 1.3s ease-in-out infinite;
}

@keyframes tc-plpi-shine {
    0% { background-position: 150% 0; }
    100% { background-position: -50% 0; }
}

@media (prefers-reduced-motion: reduce) {
    .tc-plpi__spin i,
    .tc-plpi-skel__media,
    .tc-plpi-skel__body i {
        animation: none;
    }
}
