.home-cats {
    background-color: #fff;
    padding: 20px 15px 24px;
}

@media (min-width: 992px) {
    .home-cats > .col-md-12 {
        padding: 0;
    }
}

.home-cats-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0 0 12px;
}

.home-cats-title {
    margin: 0;
    padding: 0;
    text-align: start;
    line-height: 1.3;
    font-size: 18px;
    font-weight: 600;
    color: #222;
}

.home-cats-all {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #2f78b0;
    text-decoration: none;
}

    .home-cats-all:hover,
    .home-cats-all:focus {
        color: #1f5f91;
        text-decoration: none;
    }

    .home-cats-all svg {
        width: 14px;
        height: 14px;
        flex: none;
    }

.home-cats-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
}

.home-cat-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    height: 106px;
    padding: 0 14px 0 16px;
    border: 1px solid #c4eef9;
    border-radius: 6px;
    background-color: #E6FAFF;
    color: #222;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.25;
    text-decoration: none;
    transition: box-shadow .15s ease;
}

    .home-cat-card:nth-child(even) {
        background-color: #D8F8FF;
    }

    .home-cat-card:hover,
    .home-cat-card:focus {
        color: #222;
        text-decoration: none;
        box-shadow: 0 4px 10px rgba(0, 0, 0, .18);
    }

.home-cat-name {
    min-width: 0;
    overflow-wrap: break-word;
    -webkit-hyphens: auto;
    hyphens: auto;
}

.home-cat-img {
    width: 90px;
    height: 90px;
    flex: none;
    object-fit: contain;
}

.home-cats-all-btn {
    display: none;
}

@media (min-width: 992px) and (max-width: 1199px) {
    .home-cat-card {
        padding: 0 10px 0 12px;
        font-size: 14px;
    }

    .home-cat-img {
        width: 72px;
        height: 72px;
    }
}

@media (max-width: 991px) {
    .home-cats {
        padding: 16px 0 20px;
    }

    .home-cats-head {
        display: none;
    }

    .home-cats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .home-cat-card {
        height: 96px;
        gap: 4px;
        padding: 0 6px 0 10px;
        font-size: 14px;
    }

    /* The image keeps its 80px while the name fits beside it, wrapping at spaces.
       Only a single word too long for that squeezes the image, down to 56px;
       past that the word is hyphenated. Basis 0 stops the name from claiming its
       one-line width, and its automatic minimum (capped by max-width) is the
       longest word. */
    .home-cat-name {
        flex: 1 1 0;
        min-width: auto;
        max-width: calc(100% - 60px);
    }

        /* Hyphenation points count towards the minimum width in some browsers,
           which would hyphenate a word before the image gives way; this unseen
           copy of the name keeps the minimum at the longest whole word. */
        .home-cat-name::before {
            content: attr(data-name);
            display: block;
            height: 0;
            overflow: hidden;
            visibility: hidden;
            -webkit-hyphens: manual;
            hyphens: manual;
        }

        .home-cat-card:nth-child(4n+3) {
            background-color: #D8F8FF;
        }

        .home-cat-card:nth-child(4n+4) {
            background-color: #E6FAFF;
        }

    .home-cat-img {
        flex: 0 1 80px;
        width: 80px;
        min-width: 56px;
        height: auto;
        max-height: 80px;
        aspect-ratio: 1 / 1;
    }

    .home-cats-all-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        height: 44px;
        margin-top: 12px;
        border: 1px solid #e3e3e3;
        border-radius: 6px;
        background-color: #fff;
        color: #2f78b0;
        font-size: 14px;
        font-weight: 600;
        text-decoration: none;
    }

        .home-cats-all-btn:hover,
        .home-cats-all-btn:focus {
            color: #1f5f91;
            text-decoration: none;
        }

        .home-cats-all-btn svg {
            width: 14px;
            height: 14px;
        }
}
