﻿.sc-steam-sales {
    --sc-ss-bg-frame: #25272d;
    --sc-ss-bg-frame-hover: #3c4049;
    --sc-ss-bg-dark: #191a1e;
    --sc-ss-primary: #1081df;
    --sc-ss-text: #ffffff;
    --sc-ss-font: 'Vazir', 'Vazir', 'Tahoma', sans-serif;
    --sc-ss-transition: 0.22s cubic-bezier(0.4, 0, 0.2, 1);

    width: 100%;
    max-width: 1640px;
    margin: 64px auto 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
    direction: rtl;
    font-family: var(--sc-ss-font);
    overflow: hidden;
}

.sc-steam-sales__header {
    width: min(1640px, calc(100% - 32px));
    display: flex;
    align-items: center;
    justify-content: space-between;
    direction: ltr;
}

.sc-steam-sales__all-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    padding: 8px 12px;
    border-radius: 4px;
    background: var(--sc-ss-bg-frame);
    color: var(--sc-ss-text);
    font-family: var(--sc-ss-font);
    font-size: 16px;
    font-weight: 400;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color var(--sc-ss-transition), transform var(--sc-ss-transition);
}

.sc-steam-sales__all-link:hover,
.sc-steam-sales__all-link:focus-visible {
    background: var(--sc-ss-bg-frame-hover);
    color: var(--sc-ss-text);
    transform: translateY(-1px);
}

.sc-steam-sales__title-wrap {
    position: relative;
    width: 221px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-self: end;
}

.sc-steam-sales__title-row {
    position: relative;
    z-index: 2;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.sc-steam-sales__title-text {
    color: var(--sc-ss-text);
    font-family: var(--sc-ss-font);
    font-size: 20px;
    font-weight: 500;
    line-height: 1.5;
    white-space: nowrap;
}

.sc-steam-sales__title-icon {
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.sc-steam-sales__title-icon svg {
    display: block;
    width: 32px;
    height: 32px;
}

.sc-steam-sales__title-mark {
    position: absolute;
    z-index: 1;
    left: 50%;
    top: -20px;
    width: 153px;
    height: 70px;
    transform: translateX(-50%);
    pointer-events: none;
}

.sc-steam-sales__viewport {
    width: 100%;
    height: 300px;
    overflow: hidden;
    position: relative;
    cursor: grab;
    user-select: none;
    touch-action: pan-y;
}

/* ── Figma: left & right fade shadow overlays (node 7548:16322 / 7548:16325) ── */
.sc-steam-sales__viewport::before,
.sc-steam-sales__viewport::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 169px;
    z-index: 5;
    pointer-events: none;
}

.sc-steam-sales__viewport::before {
    left: 0;
    background: linear-gradient(to right, #101114 0%, rgba(16, 17, 20, 0) 100%);
}

.sc-steam-sales__viewport::after {
    right: 0;
    background: linear-gradient(to left, #101114 0%, rgba(16, 17, 20, 0) 100%);
}

.sc-steam-sales__viewport.is-dragging {
    cursor: grabbing;
}

.sc-steam-sales__viewport.is-dragging .sc-steam-sales__track {
    animation-play-state: paused;
}

.sc-steam-sales__track {
    display: flex;
    flex-direction: row-reverse;
    align-items: stretch;
    gap: 16px;
    width: max-content;
    min-width: 100%;
    height: 300px;
    animation: sc-steam-sales-marquee 44s linear infinite;
    will-change: transform;
}

.sc-steam-sales__viewport:hover .sc-steam-sales__track,
.sc-steam-sales__viewport:focus-within .sc-steam-sales__track {
    animation-play-state: paused;
}

.sc-steam-sales__card {
    position: relative;
    display: block;
    width: 200px;
    height: 300px;
    flex: 0 0 200px;
    overflow: hidden;
    border-radius: 8px;
    color: var(--sc-ss-text);
    text-decoration: none;
    background: var(--sc-ss-bg-dark);
    isolation: isolate;
}

.sc-steam-sales__image {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    transform: scale(1);
    transition: transform 0.35s ease, filter 0.35s ease;
}

.sc-steam-sales__card--placeholder {
    cursor: default;
    background:
        radial-gradient(circle at 50% 40%, rgba(16, 129, 223, 0.16) 0, rgba(16, 129, 223, 0) 42%),
        linear-gradient(180deg, #25272d 0%, #191a1e 100%);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.sc-steam-sales__placeholder-art {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.9);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 112px;
    font-weight: 700;
    line-height: 1;
    text-shadow: 0 18px 48px rgba(16, 129, 223, 0.34);
}

.sc-steam-sales__card--placeholder .sc-steam-sales__shadow {
    background: linear-gradient(180deg, rgba(16, 17, 20, 0.08) 0%, #191a1e 100%);
}

.sc-steam-sales__card--placeholder .sc-steam-sales__discount:empty {
    min-width: 42px;
}

.sc-steam-sales__card--placeholder .sc-steam-sales__name:empty::before {
    content: '';
    display: block;
    width: 72%;
    height: 18px;
    margin: 0 auto;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
}

.sc-steam-sales__shadow {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: space-between;
    width: 100%;
    height: 100%;
    padding: 16px;
    overflow: hidden;
    border-radius: 8px;
    background: linear-gradient(180deg, rgba(16, 17, 20, 0) 0%, #191a1e 100%);
}

.sc-steam-sales__badges {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    direction: ltr;
}

.sc-steam-sales__timer,
.sc-steam-sales__discount {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 28px;
    color: var(--sc-ss-text);
    font-family: var(--sc-ss-font);
    font-size: 14px;
    font-weight: 400;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sc-steam-sales__timer {
    max-width: 148px;
    padding: 8px;
    background: var(--sc-ss-bg-frame);
    border-radius: 4px 0 0 4px;
}

.sc-steam-sales__discount {
    min-width: 42px;
    padding: 4px 8px;
    background: var(--sc-ss-primary);
    border-radius: 0 4px 4px 0;
}

.sc-steam-sales__name {
    width: 100%;
    margin: 0;
    color: var(--sc-ss-text);
    font-family: var(--sc-ss-font);
    font-size: 16px;
    font-weight: 400;
    line-height: 1.5;
    text-align: center;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.sc-steam-sales__card:not(.sc-steam-sales__card--placeholder):hover .sc-steam-sales__image,
.sc-steam-sales__card:not(.sc-steam-sales__card--placeholder):focus-visible .sc-steam-sales__image {
    transform: scale(1.04);
    filter: saturate(1.08);
}

.sc-steam-sales__card:focus-visible {
    outline: 2px solid var(--sc-ss-primary);
    outline-offset: 3px;
}

@keyframes sc-steam-sales-marquee {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(50%);
    }
}

@media (max-width: 991px) {
    .sc-steam-sales {
        margin-top: 48px;
        gap: 32px;
    }

    .sc-steam-sales__header {
        flex-direction: column-reverse;
        justify-content: center;
        gap: 20px;
    }
}

@media (max-width: 640px) {
    .sc-steam-sales__viewport::before,
    .sc-steam-sales__viewport::after {
        width: 80px;
    }

    .sc-steam-sales__viewport,
    .sc-steam-sales__track {
        height: 255px;
    }

    .sc-steam-sales__card {
        width: 170px;
        height: 255px;
        flex-basis: 170px;
    }

    .sc-steam-sales__shadow {
        padding: 12px;
    }

    .sc-steam-sales__timer,
    .sc-steam-sales__discount {
        height: 26px;
        font-size: 12px;
    }

    .sc-steam-sales__placeholder-art {
        font-size: 92px;
    }

    .sc-steam-sales__name {
        font-size: 14px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .sc-steam-sales__track {
        animation: none !important;
    }

    .sc-steam-sales *,
    .sc-steam-sales *::before,
    .sc-steam-sales *::after {
        transition: none !important;
    }
}
