/* Каталог категорий */
main.category-catalog {
    width: min(100%, 620px);
    margin: 0 auto;
    padding: 18px 14px 110px;
}

.catalog-heading {
    margin: 0 0 22px;
}

.catalog-heading .eyebrow {
    margin: 0 0 5px;
    color: #788391;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.catalog-heading h1 {
    margin: 0;
    color: #172b3d;
    font-size: clamp(25px, 5vw, 32px);
    font-weight: 750;
    line-height: 1.15;
}

.catalog-heading > p:last-child {
    margin: 6px 0 0;
    color: #778392;
    font-size: 14px;
}

.cat-section {
    --tile-bg: #f0f7fe;
    margin: 0 0 23px;
}

.cat-section:nth-of-type(2) {/* --tile-bg: #ffebe8; */}
.cat-section:nth-of-type(3) {/* --tile-bg: #e5f0ff; */}
.cat-section:nth-of-type(4) {/* --tile-bg: #f2ebff; */}
.cat-section:nth-of-type(5) {/* --tile-bg: #fff1d9; */}

.cat-title {
    display: block;
    margin: 0 0 11px;
    color: #172b3d;
    font-size: 18px;
    font-weight: 750;
    line-height: 1.25;
    text-decoration: none;
}

.cat-title .cat-count { display: none; }
.cat-title .cat-name { padding: 0; }
.cat-title .cat-name::before { display: none; }

.sub-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px;
}

.sub-list--single {
    grid-template-columns: minmax(0, 1fr);
}

.sub-list--double {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.sub-list--four {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.sub-list--five {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.sub-list--seven {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.sub-item {
    position: relative;
    display: block;
    min-width: 0;
    height: 140px;
    overflow: hidden;
    padding: 11px 10px;
    border: 0;
    border-radius: 25px;
    color: #172b3d;
    background: var(--tile-bg);
    text-decoration: none;
    isolation: isolate;
    transition: transform .18s ease, box-shadow .18s ease;
}

.sub-item:hover,
.sub-item:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 7px 18px rgba(36, 54, 76, .12);
}

.sub-item:focus-visible {
    outline: 2px solid #1769aa;
    outline-offset: 2px;
}

.sub-item img {
    position: absolute;
    z-index: -1;
    right: -4px;
    bottom: -6px;
    width: calc(100% + 8px);
    height: 67%;
    border-radius: 0 0 25px 25px;
    object-fit: contain;
    object-position: center bottom;
    mix-blend-mode: multiply;
}

.sub-list--single .sub-item img {
    right: 0;
    width: 58%;
    height: 100%;
}

.sub-item .sub-name {
    position: relative;
    z-index: 1;
    display: -webkit-box;
    overflow: hidden;
    max-height: 2.55em;
    color: inherit;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.28;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    text-wrap: pretty;
}

.sub-item .sub-count { display: none; }

/* Большие карточки для основных молочных групп, если они есть в каталоге. */
.cat-section .sub-item[data-wide="true"] { grid-column: span 2; }
.sub-list--double .sub-item[data-wide="true"] { grid-column: auto; }

.empty {
    padding: 36px 18px;
    border-radius: 20px;
    background: #f4f7fa;
    color: #687789;
    text-align: center;
}

@media (max-width: 380px) {
    main.category-catalog { padding-right: 11px; padding-left: 11px; }
    .sub-list { gap: 7px; }
    .sub-item { height: 130px; padding: 9px 8px; border-radius: 21px; }
    .sub-item .sub-name { font-size: 13px; }
}

@media (min-width: 700px) {
    main.category-catalog { width: min(100%, 900px); padding-top: 28px; }
    .sub-list { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
    .sub-list--four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sub-list--five { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .sub-list--seven { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .sub-item { height: 162px; padding: 14px; }
}
