.history__wrapper {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.history__header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.history__count {
    font-family: var(--font-family);
    font-weight: 500;
    font-size: clamp(15px, 13.286px + 0.536vw, 18px);
    line-height: 140%;
    color: var(--seryy);
}

.history__header .title {
    margin: 0;
}

.history-card {
    box-shadow: 0 0 30px 0 rgba(0, 0, 0, 0.07);
    background: var(--belyy);
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(3, auto);
    padding: 15px;
    font-family: var(--font-family);
}

.history-card__status {
    display: flex;
    flex-direction: column;
    gap: 3px;
    background: var(--svetlo-seryy);
    padding: 7px;
    font-weight: 500;
    font-size: clamp(15px, 13.286px + 0.536vw, 18px);
    line-height: 140%;
    grid-area: 1 / 1 / 2 / 2;
    margin-bottom: 10px;
}

.history-card__status-label {
    color: #097010;
}

.history-card__status-id {
    color: var(--seryy);
}

.history-card__movement {
    display: flex;
    flex-direction: column;
    gap: 3px;
    grid-area: 2 / 1 / 3 / 2;
    margin-bottom: 15px;
}

.history-card__movement-value {
    font-weight: 600;
    font-size: 20px;
    line-height: 120%;
    text-transform: uppercase;
    color: #097010;
}

.history-card__movement-date {
    font-weight: 500;
    font-size: clamp(15px, 13.286px + 0.536vw, 18px);
    line-height: 140%;
    color: var(--chernyy);
}

.history-card__movement-date--black {
    font-weight: 600;
    font-size: 20px;
    line-height: 120%;
    text-transform: uppercase;
    color: var(--chernyy);
}

.history-card__movement-location {
    font-weight: 500;
    font-size: clamp(15px, 13.286px + 0.536vw, 18px);
    line-height: 140%;
    color: var(--chernyy);
}

.history-card__purchase {
    display: flex;
    flex-direction: column;
    gap: 3px;
    grid-area: 3 / 1 / 4 / 2;
}

.history-card__purchase-label {
    font-weight: 500;
    font-size: clamp(15px, 13.286px + 0.536vw, 18px);
    line-height: 140%;
    color: var(--chernyy);
}

.history-card__purchase-value {
    font-weight: 700;
    font-size: clamp(15px, 13.214px + 0.558vw, 20px);
    line-height: 140%;
    color: var(--chernyy);
}

.history-card__compound {
    display: flex;
    flex-direction: column;
    gap: 5px;
    grid-area: 1 / 2 / 3 / 3;
    justify-self: end;
    margin-bottom: 21px;
}

.history-card__compound-label {
    font-weight: 500;
    font-size: clamp(15px, 13.286px + 0.536vw, 18px);
    line-height: 140%;
    color: var(--chernyy);
}

.history-card__compound-image {
    width: 80px;
    height: 80px;
    padding: 15px 24px;
    box-shadow: inset 0 0 9px 0 rgba(224, 224, 224, 0.7);
    background: var(--belyy);
}

.history-card__compound-wr {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.history-card__more {
    background: var(--svetlo-seryy);
    padding: 15px;
    font-family: var(--font-family);
    font-weight: 500;
    font-size: clamp(15px, 13.286px + 0.536vw, 18px);
    line-height: 140%;
    color: var(--chernyy);
    grid-area: 3 / 2 / 4 / 3;
}

@media (min-width: 768px) {
    .history__header {
        gap: 20px;
        margin-bottom: 20px;
    }
    .history__wrapper {
        gap: 15px;
    }
    .history-card {
        padding: 20px;
    }

    .history-card__status {
        padding: 10px;
        flex-direction: row;
        gap: 10px;
        height: max-content;
        width: max-content;
    }

    .history-card__purchase-value {
        font-weight: 500;
        line-height: 125%;
    }

    .history-card__compound {
        gap: 10px;
    }

    .history-card__compound-wr {
        flex-direction: row;
        gap: 10px;
    }

    .history-card__compound-image {
        width: 124px;
        height: 124px;
        padding: 20px;
    }

    .history-card__more {
        padding: 17px 30px;
    }
}
@media (min-width: 1200px) {
    .history__wrapper {
        gap: 20px;
    }
    .history-card {
        grid-template-columns: auto 1fr auto auto;
        grid-template-rows: repeat(2, auto);
        align-items: end;
        column-gap: 60px;
    }

    .history-card__status {
        grid-area: 1 / 1 / 2 / 2;
        margin: 0;
        align-self: flex-start;
    }

    .history-card__movement {
        grid-area: 2 / 1 / 3 / 2;
        margin: 0;
    }

    .history-card__movement-date--black {
        font-weight: 500;
        font-size: 18px;
        line-height: 140%;
    }

    .history-card__purchase {
        grid-area: 2 / 3 / 3 / 4;
    }

    .history-card__compound {
        grid-area: 1 / 2 / 3 / 3;
        margin: 0 auto;
    }

    .history-card__more {
        grid-area: 2 / 4 / 3 / 5;
    }

    .history-card__movement-date {
        color: var(--seryy);
    }

    .history-card__movement-location {
        color: var(--seryy);
    }
    .history-card__movement-value {
        font-weight: 500;
        font-size: 18px;
        line-height: 140%;
        color: var(--chernyy);
    }
}

/* CRM-driven history: spending / expiry are red, the "more" control is a link */
.history-card__status-label--minus,
.history-card__movement-value--minus {
    color: var(--firmennyy);
}

a.history-card__more {
    display: flex;
    align-items: center;
    justify-content: center;
}

.points__empty {
    font-weight: 500;
    font-size: 15px;
    line-height: 140%;
}

.points__empty a {
    color: var(--firmennyy);
}

.points__pager {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-top: 15px;
    font-weight: 500;
    font-size: 15px;
}

/* Phones (Figma "М. Бонусы"): one picture however many units the order has */
@media (max-width: 767px) {
    .history-card__compound-image:nth-child(n + 2) {
        display: none;
    }

    .history-card__compound-image img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }
}
