/* Главные категории: перенос плиток с klondaik-service.ru */
.legacy-main-categories {
    margin: 0 0 34px;
}

.legacy-main-categories__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
    justify-items: stretch;
}

.legacy-main-category-wrap {
    min-width: 0;
}

.legacy-main-category {
    display: flex;
    position: relative;
    width: 100%;
    height: 100px;
    min-height: 100px;
    overflow: hidden;
    flex-direction: column;
    justify-content: space-between;
    padding: 10px;
    border: 1px solid #e3e5e8;
    border-radius: 10px;
    background-color: #f0f1f2;
    background-image: var(--category-image);
    background-repeat: no-repeat;
    background-position: right bottom;
    background-size: contain;
    box-shadow: 1px 1px 1px rgba(10, 10, 10, .30);
    color: #202124;
    text-decoration: none;
    transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease;
}

.legacy-main-category:hover {
    transform: translateY(-2px);
    box-shadow: 0 7px 16px rgba(20, 28, 40, .13);
    color: #202124;
}

.legacy-main-category:focus-visible {
    outline: 3px solid rgba(246, 160, 0, .38);
    outline-offset: 2px;
}

.legacy-main-category__name {
    position: relative;
    z-index: 2;
    display: block;
    width: 58%;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.18;
    overflow-wrap: anywhere;
}

.legacy-main-category__fallback {
    position: absolute;
    right: 12px;
    bottom: 8px;
    font-size: 42px;
    line-height: 1;
}

@media (max-width: 760px) {
    .legacy-main-categories__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .legacy-main-category {
        height: 96px;
        min-height: 96px;
    }

    .legacy-main-category__name {
        width: 56%;
        font-size: 12px;
    }
}
