/* ==========================================================================
   home_showcase — витрина товаров и сетка блоков на главной (шаблон SLIM).
   Подключается на всех страницах, поэтому всё под префиксом .hs
   ========================================================================== */

.hs {
    --hs-primary: rgb(251, 71, 75);
    --hs-card: rgb(36, 39, 49);
    --hs-card-2: rgb(44, 48, 60);
    --hs-text: rgb(165, 169, 180);
    --hs-dim: rgba(165, 169, 180, 0.6);
    --hs-green: #3ccf7a;
    container-type: inline-size;
    /* Отступ от линии-разделителя над блоком, как у слайдера «Актуальное» */
    margin-top: 30px;
    margin-bottom: 30px;
    color: var(--hs-text);
}

/* ------------------------------- Витрина -------------------------------- */

.hs-shop {
    position: relative;
    padding: 18px 20px 20px;
    border-radius: 12px;
    background:
        radial-gradient(60% 120% at 0% 0%, rgba(251, 71, 75, 0.09), transparent 60%),
        var(--hs-card);
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.hs-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 14px;
    margin-bottom: 12px;
}

.hs-head__title {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
}

.hs-head__actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.hs-timer {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    white-space: nowrap;
    color: var(--hs-dim);
    background: rgba(255, 255, 255, 0.04);
}

.hs-timer b {
    display: inline-block;
    min-width: 1.4em;
    text-align: center;
    color: #fff;
    font-variant-numeric: tabular-nums;
}

.hs-timer__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--hs-green);
    box-shadow: 0 0 0 0 rgba(60, 207, 122, 0.6);
    animation: hs-pulse 1.8s infinite;
}

.hs--paused .hs-timer__dot {
    background: #ffc247;
    animation: none;
}

@keyframes hs-pulse {
    0% { box-shadow: 0 0 0 0 rgba(60, 207, 122, 0.55); }
    70% { box-shadow: 0 0 0 8px rgba(60, 207, 122, 0); }
    100% { box-shadow: 0 0 0 0 rgba(60, 207, 122, 0); }
}

.hs-shuffle i {
    transition: transform 0.35s ease;
}

.hs-shuffle:hover i {
    transform: rotate(180deg);
}

.hs-all {
    white-space: nowrap;
}

.hs-progress {
    height: 3px;
    margin-bottom: 16px;
    border-radius: 3px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.05);
}

.hs-progress span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: 3px;
    background: linear-gradient(90deg, rgba(251, 71, 75, 0.5), var(--hs-primary));
    transition: width 1s linear;
}

/* Карточки: в широкой колонке — все в ряд, в узкой — лента с прокруткой */
.hs-items {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: calc((100% - 4 * 12px) / 5);
    gap: 12px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.hs-items::-webkit-scrollbar {
    display: none;
}

.hs-items--out {
    opacity: 0;
    transform: translateY(6px);
}

.hs-item {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    border-radius: 10px;
    overflow: hidden;
    color: inherit;
    text-decoration: none;
    scroll-snap-align: start;
    background: var(--hs-card-2);
    border: 1px solid rgba(255, 255, 255, 0.04);
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
    animation: hs-in 0.45s ease both;
    animation-delay: calc(var(--i, 0) * 70ms);
}

.hs-item:hover {
    color: inherit;
    text-decoration: none;
    transform: translateY(-4px);
    border-color: rgba(251, 71, 75, 0.45);
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.35);
}

@keyframes hs-in {
    from { opacity: 0; transform: translateY(14px) scale(0.97); }
    to { opacity: 1; transform: none; }
}

.hs-item__media {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: rgb(28, 30, 38);
}

.hs-item__img {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    transition: transform 0.4s ease;
}

.hs-item:hover .hs-item__img {
    transform: scale(1.07);
}

.hs-item__img--empty {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
    color: rgba(251, 71, 75, 0.7);
    background: radial-gradient(circle at 50% 40%, rgba(251, 71, 75, 0.15), transparent 70%);
}

.hs-item__media::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 40%;
    background: linear-gradient(0deg, var(--hs-card-2), transparent);
    pointer-events: none;
}

.hs-item__tag {
    position: absolute;
    z-index: 1;
    top: 8px;
    left: 8px;
    padding: 3px 7px;
    border-radius: 5px;
    font-size: 0.6875rem;
    font-weight: 700;
    color: #fff;
    background: var(--hs-primary);
    box-shadow: 0 4px 12px rgba(251, 71, 75, 0.4);
}

.hs-item__body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 3px;
    padding: 8px 10px 10px;
}

.hs-item__cat {
    overflow: hidden;
    font-size: 0.625rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--hs-dim);
}

.hs-item__title {
    display: -webkit-box;
    overflow: hidden;
    min-height: 2.5em;
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.25;
    color: #fff;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.hs-item__foot {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 6px;
    margin-top: auto;
    padding-top: 6px;
}

.hs-item__price {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.15;
}

.hs-item__price small,
.hs-item__price s {
    font-size: 0.625rem;
    color: var(--hs-dim);
}

.hs-item__price b {
    overflow: hidden;
    font-size: 0.875rem;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--hs-primary);
}

.hs-item__buy {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 7px;
    font-size: 0.75rem;
    color: #fff;
    background: rgba(251, 71, 75, 0.15);
    transition: background 0.25s ease;
}

.hs-item:hover .hs-item__buy {
    background: var(--hs-primary);
}

.hs-empty {
    grid-column: 1 / -1;
    padding: 30px 10px;
    text-align: center;
    color: var(--hs-dim);
}

/* -------------------- Слайды «Актуальное» карточками -------------------- */

.hs-blocks {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    /* Персонажи выглядывают над карточками, как в слайдере шаблона */
    margin-top: 44px;
}

.hs-blocks--1 {
    grid-template-columns: minmax(0, 1fr);
}

.hs-blocks--2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.hs-block {
    position: relative;
    display: flex;
    align-items: flex-end;
    min-height: 270px;
    border-radius: 12px;
    color: inherit;
    text-decoration: none;
    isolation: isolate;
    transition: transform 0.3s ease;
    animation: hs-in 0.5s ease both;
    animation-delay: calc(var(--i, 0) * 90ms);
}

.hs-block:hover {
    color: inherit;
    text-decoration: none;
    transform: translateY(-5px);
}

/* Фон-карточка: картинка слайда, затемнение и рамка */
.hs-block__bg,
.hs-block::before {
    position: absolute;
    inset: 0;
    border-radius: 12px;
}

.hs-block::before {
    content: "";
    z-index: -2;
    background: var(--hs-card);
}

.hs-block__bg {
    z-index: -1;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
    transition: box-shadow 0.3s ease;
}

.hs-block__bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(0deg, rgb(26, 28, 36) 30%, rgba(26, 28, 36, 0.82) 52%, rgba(26, 28, 36, 0.15) 100%),
        radial-gradient(120% 70% at 50% 100%, rgba(251, 71, 75, 0.14), transparent 70%);
}

.hs-block:hover .hs-block__bg {
    box-shadow: inset 0 0 0 1px rgba(251, 71, 75, 0.55), 0 18px 36px rgba(0, 0, 0, 0.4);
}

/* Красная полоска снизу — растёт при наведении */
.hs-block::after {
    content: "";
    position: absolute;
    z-index: 3;
    left: 20px;
    right: 20px;
    bottom: 0;
    height: 3px;
    border-radius: 3px 3px 0 0;
    background: var(--hs-primary);
    transform: scaleX(0.25);
    transform-origin: left;
    transition: transform 0.35s ease;
}

.hs-block:hover::after {
    transform: scaleX(1);
}

.hs-block__person {
    position: absolute;
    z-index: 1;
    top: -44px;
    right: 0;
    left: 18%;
    height: 62%;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: right bottom;
    filter: drop-shadow(0 10px 16px rgba(0, 0, 0, 0.55));
    transition: transform 0.4s ease;
    pointer-events: none;
}

.hs-block:hover .hs-block__person {
    transform: translateY(-6px) scale(1.04);
}

.hs-block__body {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    padding: 18px 20px 20px;
}

.hs-block__title {
    font-size: 1.1875rem;
    font-weight: 700;
    line-height: 1.3;
    color: #fff;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.7);
}

.hs-block__title h2 {
    margin: 0;
    font: inherit;
}

.hs-block__title b {
    font-weight: 700;
    color: var(--hs-primary);
    border-bottom: 3px solid var(--hs-primary);
}

.hs-block__text {
    display: -webkit-box;
    overflow: hidden;
    font-size: 0.8125rem;
    line-height: 1.5;
    color: rgb(206, 209, 218);
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.8);
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.hs-block__text b {
    font-weight: 600;
    color: var(--hs-primary);
}

.hs-block__btn {
    align-self: flex-start;
    margin-top: 6px;
    padding: 9px 18px;
    border-radius: 8px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #fff;
    background: var(--hs-primary);
    box-shadow: 0 8px 20px rgba(251, 71, 75, 0.35);
    transition: box-shadow 0.3s ease;
}

.hs-block:hover .hs-block__btn {
    box-shadow: 0 10px 26px rgba(251, 71, 75, 0.55);
}

.hs-block__btn i {
    margin-left: 6px;
    font-size: 0.75rem;
    transition: transform 0.25s ease;
}

.hs-block:hover .hs-block__btn i {
    transform: translateX(4px);
}

/* -------------------------------- Адаптив -------------------------------- */

/* Колонка уже — товары лентой по 3 на экран, блоки лентой */
@container (max-width: 720px) {
    .hs-items {
        grid-auto-columns: calc((100% - 2 * 12px) / 3);
    }

    .hs-blocks {
        grid-auto-flow: column;
        grid-template-columns: none;
        grid-auto-columns: minmax(250px, 72%);
        margin-top: 0;
        padding-top: 44px;
        overflow-x: auto;
        overscroll-behavior-x: contain;
        scroll-snap-type: x mandatory;
        scrollbar-width: none;
    }

    .hs-blocks::-webkit-scrollbar {
        display: none;
    }

    .hs-block {
        scroll-snap-align: start;
    }
}

@container (max-width: 520px) {
    .hs-shop {
        padding: 14px 14px 16px;
    }

    .hs-head__title {
        flex-basis: 100%;
    }

    .hs-head__actions {
        flex: 1 1 auto;
        min-width: 0;
    }

    .hs-timer__label {
        display: none;
    }

    .hs-all {
        margin-left: auto;
    }

    .hs-items {
        grid-auto-columns: calc((100% - 12px) / 2.25);
        gap: 10px;
    }

    /* Вся карточка — ссылка, иконку корзины убираем: цене нужнее место */
    .hs-item__buy {
        display: none;
    }

    .hs-blocks {
        grid-auto-columns: 86%;
        gap: 10px;
    }

    .hs-block {
        min-height: 250px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hs-block,
    .hs-item,
    .hs-items,
    .hs-timer__dot {
        animation: none;
        transition: none;
    }
}
