/* Каталог рецептов (макет 7.5). Телефонная схема — до 1024 px, десктопная — от 1024 px.
   Карточка рецепта общая для сайта и свёрстана утилитами в recipe_card.html. */

/* Manrope на всей странице каталога, включая общую шапку и подвал. */
body:has(#catalog) {
    --cat-font: 'Manrope', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-family-base: var(--cat-font);
    --font-family-display: var(--cat-font);
    font-family: var(--cat-font);
}
body:has(#catalog) .font-sans { font-family: var(--cat-font); }

.catalog {
    --cat-bg: #F7F3EE;
    --cat-ink: #1F2A24;
    --cat-soft: #4F5A54;
    --cat-line: #E6DED3;
    --cat-chip-line: #D9CFC2;
    --cat-field-line: #8F8372;
    --cat-green: #356C54;
    --cat-forest: #213D2F;
    --cat-mint: #E3EEE7;
    --cat-mint-line: #B9D3C3;
    --cat-club: #A23B62;
    --cat-sand: #F1EBE3;
    --cat-on-dark: #F3EDE4;
    --cat-on-dark-soft: #DCD5CA;
    --cat-on-ink-soft: #CFD8D2;
    --cat-gutter: 20px;
    --cat-sticky-top: 0px;

    background: var(--cat-bg);
    color: var(--cat-ink);
    font-family: var(--cat-font);
    -webkit-font-smoothing: antialiased;
    min-height: 70vh;
    overflow-anchor: none;
}
@media (min-width: 1024px) { .catalog { --cat-gutter: 24px; } }

.catalog *, .catalog *::before, .catalog *::after { box-sizing: border-box; }
.catalog h1, .catalog h2 { margin: 0; text-wrap: balance; font-variant-numeric: lining-nums; }
.catalog p { margin: 0; text-wrap: pretty; }
.catalog button { font-family: inherit; cursor: pointer; }
.catalog a { text-underline-offset: 3px; }
.catalog :is(a, button, input, summary):focus-visible,
.catalog label:has(input:focus-visible) {
    outline: 3px solid var(--cat-green);
    outline-offset: 3px;
}
.catalog .cat-dark :is(a, button):focus-visible { outline-color: var(--cat-mint-line); }
.catalog [hidden] { display: none !important; }

.cat-wrap { max-width: 1240px; margin: 0 auto; padding-inline: var(--cat-gutter); }
.cat-sr {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap;
}
.cat-num { font-variant-numeric: tabular-nums; }
@media (max-width: 1023.98px) { .cat-desktop { display: none !important; } }
@media (min-width: 1024px) { .cat-mobile { display: none !important; } }
.cat-icon { flex: none; }

/* ------------------------------------------------------------------ Шапка каталога */
.cat-head { display: flex; flex-direction: column; gap: 8px; padding-block: 16px 12px; }
.cat-head__main { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.cat-head__side { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.cat-crumbs { display: none; font-size: 14px; line-height: 20px; color: var(--cat-soft); }
.cat-crumbs a { color: var(--cat-soft); padding: 4px 0; text-decoration: underline; }
.cat-title {
    font-family: var(--cat-font); font-weight: 600; font-size: 30px; line-height: 1.14;
    letter-spacing: -0.01em; overflow-wrap: anywhere;
}
.cat-title:focus { outline: none; }
.cat-lead { display: none; font-size: 17px; line-height: 1.6; color: var(--cat-soft); max-width: 600px; }
.cat-author {
    align-self: flex-start; display: flex; align-items: center; gap: 10px; min-height: 44px;
    text-decoration: none; color: var(--cat-ink);
}
.cat-author img {
    width: 40px; height: 40px; border-radius: 999px; object-fit: cover; object-position: 50% 30%;
    flex: none; background: #D9CBBB;
}
.cat-author__text { display: flex; flex-direction: column; }
.cat-author__name { font-size: 14px; line-height: 20px; font-weight: 700; }
.cat-author__note { font-size: 13px; line-height: 18px; color: var(--cat-soft); }
.cat-author .cat-icon { color: var(--cat-soft); }

.cat-search { margin-top: 4px; }
.cat-search__field { position: relative; }
.cat-search__icon { position: absolute; left: 16px; top: 16px; width: 20px; height: 20px; color: var(--cat-soft); pointer-events: none; }
.cat-search__input {
    width: 100%; height: 52px; padding: 0 16px 0 46px; border: 1.5px solid var(--cat-field-line);
    border-radius: 16px; background: #fff; font: inherit; font-size: 16px; color: var(--cat-ink);
    appearance: none;
}
.cat-search__input::placeholder { color: #6B746F; opacity: 1; }

.cat-season {
    display: flex; align-items: center; gap: 12px; padding: 8px 12px 8px 8px;
    background: var(--cat-mint); border-radius: 16px; text-decoration: none; color: var(--cat-ink);
}
.cat-thumb { width: 52px; height: 52px; border-radius: 12px; object-fit: cover; flex: none; background: #E9DCC6; }
.cat-season__text { display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; min-width: 0; }
.cat-eyebrow {
    font-size: 12px; line-height: 16px; font-weight: 700; letter-spacing: 0.08em;
    text-transform: uppercase; color: var(--cat-green);
}
.cat-season__title { font-size: 16px; line-height: 22px; font-weight: 700; }

@media (min-width: 1024px) {
    .cat-head {
        flex-direction: row; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
        gap: 24px 64px; padding-block: 24px 16px;
    }
    .cat-head__main { flex: 1 1 560px; gap: 12px; }
    .cat-head__side { flex: 0 1 470px; }
    .cat-crumbs { display: block; }
    .cat-title { font-size: 44px; }
    .cat-lead { display: block; }
    .cat-author { gap: 12px; min-height: 0; padding: 4px 0; }
    .cat-author img { width: 44px; height: 44px; }
    .cat-author__name { font-size: 15px; }
    .cat-author__note { font-size: 14px; line-height: 20px; }
    .cat-search { margin-top: 0; }
    .cat-search__icon { left: 18px; top: 17px; width: 22px; height: 22px; }
    .cat-search__input { height: 56px; padding: 0 20px 0 52px; }
    .cat-season { margin-top: 12px; }
}

/* ------------------------------------------------------------------ Чипы и кнопки */
.cat-chip {
    display: inline-flex; align-items: center; justify-content: center; height: 44px; padding: 0 16px;
    border: 1.5px solid var(--cat-chip-line); border-radius: 999px; background: #fff; color: var(--cat-ink);
    font-size: 15px; font-weight: 600; line-height: 1; white-space: nowrap; text-decoration: none; flex: none;
}
.cat-chip__count { min-width: 3ch; margin-left: 6px; text-align: right; font-weight: 500; color: var(--cat-soft); font-variant-numeric: tabular-nums; }
.cat-chip[aria-pressed="true"], .cat-chip[aria-expanded="true"], .cat-chip.is-active {
    background: var(--cat-ink); border-color: var(--cat-ink); color: #fff;
}
.cat-chip[aria-pressed="true"] .cat-chip__count, .cat-chip.is-active .cat-chip__count { color: var(--cat-on-ink-soft); }
.cat-chip[aria-disabled="true"] { color: #8A918C; background: transparent; cursor: default; }
.cat-chip[aria-disabled="true"] .cat-chip__count { color: #8A918C; }
.cat-chip--menu { gap: 6px; padding: 0 14px 0 16px; }
.cat-chip--filters { gap: 8px; padding: 0 12px 0 14px; border-color: var(--cat-ink); }
.cat-badge-count {
    width: 28px; min-width: 28px; height: 22px; padding: 0 4px; border-radius: 999px; background: var(--cat-ink); color: #fff;
    font-size: 13px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center;
}
.cat-badge-count.is-empty { visibility: hidden; }
.cat-chip--applied {
    gap: 6px; padding: 0 12px 0 16px; background: var(--cat-mint); border-color: var(--cat-green); color: var(--cat-forest);
}
.cat-link-button {
    display: inline-flex; align-items: center; height: 44px; padding: 0 8px; border: 0; background: transparent;
    color: var(--cat-ink); font-size: 15px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px;
    white-space: nowrap; flex: none;
}
.cat-icon-button {
    width: 44px; height: 44px; border: 0; padding: 0; border-radius: 999px; background: transparent; color: var(--cat-ink);
    display: inline-flex; align-items: center; justify-content: center; flex: none;
}

/* ------------------------------------------------------------------ Ограничения «Без …» */
.cat-filters { position: relative; z-index: 3; }
.cat-restrictions { display: flex; flex-direction: column; gap: 4px; padding-bottom: 8px; }
.cat-restrictions__chips { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 8px; }
.cat-restrictions__chips .cat-chip { grid-column: span 4; padding: 0 2px; gap: 3px; font-size: 14px; min-width: 0; }
.cat-restrictions__chips .cat-chip:nth-child(n + 4) { grid-column: span 5; }
.cat-restrictions__chips .cat-chip__count { display: none; }
.cat-restrictions__chips .cat-chip svg { width: 12px; height: 12px; }
.cat-info {
    grid-column: span 2; height: 44px; padding: 0; border: 0; border-radius: 999px; background: var(--cat-mint);
    color: var(--cat-green); display: inline-flex; align-items: center; justify-content: center;
}
@media (max-width: 374px) { .cat-restrictions__chips .cat-chip { font-size: 13px; } }
/* 320–339 px: те же два ряда, шрифт и счётчик выдачи компактнее. */
@media (max-width: 339px) {
    .cat-restrictions__chips { gap: 6px; }
    .cat-restrictions__chips .cat-chip { font-size: 12px; letter-spacing: -0.01em; }
    .cat-switch__count { display: none; }
}
.cat-check {
    position: relative; display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 15px; font-weight: 600;
    color: var(--cat-ink); text-decoration: none; border-radius: 12px; align-self: flex-start;
}
.cat-box {
    width: 18px; height: 18px; border: 2px solid var(--cat-field-line); border-radius: 5px; flex: none;
    display: flex; align-items: center; justify-content: center; color: #fff;
}
.cat-box svg { width: 12px; height: 12px; visibility: hidden; }
[aria-checked="true"] > .cat-box, input:checked + .cat-box { background: var(--cat-ink); border-color: var(--cat-ink); }
[aria-checked="true"] > .cat-box svg, input:checked + .cat-box svg { visibility: visible; }
@media (min-width: 1024px) {
    .cat-filters {
        background: #fff; border-block: 1px solid var(--cat-line);
        box-shadow: 0 8px 20px -18px rgba(31, 42, 36, 0.35);
    }
    .cat-filters__inner { display: flex; flex-direction: column; gap: 12px; padding-block: 16px; }
    .cat-restrictions { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px; padding-bottom: 0; }
    .cat-restrictions__chips { display: contents; }
    .cat-restrictions__chips .cat-chip, .cat-restrictions__chips .cat-chip:nth-child(n + 4) { padding: 0 16px; gap: 0; font-size: 15px; }
    .cat-restrictions__chips .cat-chip__count { display: inline; }
    .cat-restrictions__chips .cat-chip svg { width: 16px; height: 16px; margin-right: 6px; }
    .cat-info { width: 36px; background: transparent; border-radius: 12px; }
    .cat-check { padding: 0 8px; white-space: nowrap; align-self: auto; }
}

/* ------------------------------------------------------------------ Лента фильтров (телефон) */
.cat-ribbon {
    background: #fff; border-block: 1px solid var(--cat-line); height: 64px; overflow-x: auto; overflow-y: hidden;
    scrollbar-width: none; margin-inline: calc(var(--cat-gutter) * -1);
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 32px), transparent);
    mask-image: linear-gradient(90deg, #000 calc(100% - 32px), transparent);
}
.cat-ribbon::-webkit-scrollbar { display: none; }
.cat-ribbon__inner { display: flex; align-items: center; gap: 8px; padding: 10px var(--cat-gutter); width: max-content; }
.cat-ribbon .cat-chip { gap: 4px; }
.cat-ribbon .cat-chip--filters { gap: 8px; }
.cat-ribbon .cat-chip--applied { gap: 6px; }

/* ------------------------------------------------------------------ Панель фильтров (десктоп) */
.cat-bar { display: none; }
@media (min-width: 1024px) {
    .cat-ribbon { display: none; }
    .cat-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; }
    .cat-bar__menus { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
    .cat-bar__side { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; }
}

.cat-menu { position: relative; }
.cat-popover {
    position: absolute; top: 52px; left: 0; z-index: 30; width: 320px; max-width: calc(100vw - 32px);
    background: #fff; border: 1px solid var(--cat-line); border-radius: 20px;
    box-shadow: 0 24px 48px -16px rgba(31, 42, 36, 0.28); padding: 8px; display: flex; flex-direction: column; gap: 2px;
    max-height: min(70vh, 560px); overflow-y: auto; overscroll-behavior: contain;
}
.cat-popover--right { left: auto; right: 0; width: 240px; }
.cat-popover__title {
    padding: 10px 12px 6px; font-size: 13px; line-height: 18px; font-weight: 700; letter-spacing: 0.1em;
    text-transform: uppercase; color: var(--cat-green);
}
.cat-popover__note {
    margin: 6px 4px 4px !important; padding: 12px 8px 4px; border-top: 1px solid var(--cat-line);
    font-size: 13px; line-height: 18px; color: var(--cat-soft);
}
.cat-option {
    display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 12px; border-radius: 12px;
    font-size: 15px; font-weight: 600; color: var(--cat-ink); text-decoration: none; background: #fff;
}
.cat-option:hover, .cat-option[aria-checked="true"] { background: var(--cat-bg); }
.cat-option[aria-disabled="true"] { color: #8A918C; cursor: default; background: #fff; }
.cat-option__count { margin-left: auto; font-weight: 500; color: var(--cat-soft); font-variant-numeric: tabular-nums; }
.cat-option[aria-disabled="true"] .cat-option__count { color: #8A918C; }
.cat-radio {
    width: 20px; height: 20px; border: 1.5px solid #6B746F; border-radius: 999px; flex: none; display: flex;
    align-items: center; justify-content: center; background: #fff;
}
[aria-checked="true"] > .cat-radio { border-color: var(--cat-ink); border-width: 2px; }
[aria-checked="true"] > .cat-radio::after { content: ""; width: 10px; height: 10px; border-radius: 999px; background: var(--cat-ink); }
.cat-option .cat-box { width: 20px; height: 20px; border-radius: 6px; }

.cat-segment { display: inline-flex; padding: 4px; background: var(--cat-sand); border-radius: 999px; gap: 2px; flex: none; }
.cat-segment__item {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 16px; border: 0;
    border-radius: 999px; background: transparent; color: var(--cat-ink); font-size: 14px; font-weight: 600;
    text-decoration: none; white-space: nowrap;
}
.cat-segment__item[aria-pressed="true"], .cat-segment__item:has(input:checked) { background: var(--cat-ink); color: #fff; }
.cat-segment__count { font-weight: 500; color: var(--cat-soft); font-variant-numeric: tabular-nums; }
.cat-bar .cat-segment__count { min-width: 3ch; text-align: right; }
.cat-segment__item[aria-pressed="true"] .cat-segment__count,
.cat-segment__item:has(input:checked) .cat-segment__count { color: var(--cat-on-ink-soft); }
.cat-segment__item--club { color: var(--cat-club); }
.cat-segment__item[aria-disabled="true"] { color: #8A918C; cursor: default; }
.cat-segment__item[aria-disabled="true"] .cat-segment__count { color: #8A918C; }

.cat-sort-button {
    display: inline-flex; align-items: center; justify-content: flex-end; gap: 6px; width: 264px; height: 44px; padding: 0 14px; margin-right: -14px; border: 0;
    border-radius: 999px; background: transparent; color: var(--cat-ink); font-size: 15px; font-weight: 600; white-space: nowrap;
}
.cat-sort-button__label { color: var(--cat-soft); font-weight: 500; }

/* ------------------------------------------------------------------ Итог выдачи */
.cat-main { display: flex; flex-direction: column; gap: 16px; padding-block: 0 40px; }
.cat-results { display: flex; flex-direction: column; gap: 12px; }
.cat-summary { display: flex; align-items: center; gap: 4px; padding: 8px 0; margin-right: -12px; }
.catalog .cat-summary__count { flex: 1 1 auto; min-width: 0; font-size: 15px; line-height: 20px; font-weight: 700; white-space: nowrap; }
.cat-summary__free { display: none; }
.cat-applied { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; min-width: 0; }
.cat-applied__chips {
    display: flex; align-items: center; gap: 8px; min-width: 0; max-width: 100%;
    overflow-x: auto; padding: 4px; margin: -4px; scrollbar-width: thin;
}
.cat-applied__reset { max-width: 100%; white-space: normal; text-align: left; }
.cat-switch {
    display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 4px; border: 0; background: transparent;
    color: var(--cat-ink); font-size: 14px; font-weight: 600; white-space: nowrap; flex: none; text-decoration: none; border-radius: 12px;
}
.cat-switch__track { width: 36px; height: 22px; border-radius: 999px; background: var(--cat-field-line); position: relative; flex: none; transition: background-color .15s; }
.cat-switch__track::after {
    content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 999px; background: #fff;
    transition: transform .15s;
}
.cat-switch[aria-checked="true"] .cat-switch__track { background: var(--cat-green); }
.cat-switch[aria-checked="true"] .cat-switch__track::after { transform: translateX(14px); }
.cat-switch__count { font-weight: 500; color: var(--cat-soft); }
.cat-grid-wrap { margin-top: 4px; }

@media (min-width: 1024px) {
    .cat-main { gap: 32px; padding-block: 32px 80px; }
    .cat-results { display: flex; flex-direction: column; gap: 16px; }
    .cat-summary { min-height: 44px; gap: 8px; padding: 0; margin-right: 0; }
    .catalog .cat-summary__count { flex: none; margin-right: 8px; font-weight: 400; color: var(--cat-soft); white-space: normal; }
    .cat-summary__count strong { color: var(--cat-ink); font-weight: 700; }
    .cat-summary__free { display: inline; }
    .cat-applied { flex-direction: row; flex-wrap: wrap; align-items: center; }
    .cat-applied__chips { display: contents; }
    .cat-summary .cat-switch, .cat-summary .cat-menu--sort-mobile { display: none; }
    .cat-applied .cat-chip--applied { padding: 0 10px 0 14px; border: 0; font-size: 14px; }
    .cat-applied .cat-link-button { font-size: 14px; }
    .cat-grid-wrap { margin-top: 0; }
}

/* ------------------------------------------------------------------ Сетка */
.cat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 12px; row-gap: 24px; align-items: start; }
.cat-grid > .cat-wide { grid-column: 1 / -1; }
@media (min-width: 768px) { .cat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .cat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 40px 24px; } }
.cat-grid .recipe-card { scroll-margin-top: 96px; }

.cat-skeleton { display: flex; flex-direction: column; gap: 10px; }
.cat-skeleton::before { content: ""; aspect-ratio: 1 / 1; border-radius: 16px; background: #EFE7DC; }
.cat-skeleton::after { content: ""; height: 62px; border-radius: 8px; background: linear-gradient(#EFE7DC 20px, transparent 20px 28px, #EFE7DC 28px 44px, transparent 44px); }
@media (min-width: 1024px) { .cat-skeleton::before { aspect-ratio: 4 / 3; } }
@media (prefers-reduced-motion: no-preference) { .cat-skeleton { animation: cat-pulse 1.2s ease-in-out infinite; } }
@keyframes cat-pulse { 50% { opacity: .55; } }

/* Подборки: строка плиток на десктопе, список на телефоне. */
.cat-sets { display: flex; flex-direction: column; gap: 12px; }
.cat-sets__head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.cat-h2 { font-family: var(--cat-font); font-weight: 600; font-size: 24px; line-height: 1.2; }
.cat-sets__row { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.cat-set { display: flex; align-items: center; gap: 12px; padding: 4px 0; border-radius: 16px; text-decoration: none; color: var(--cat-ink); min-width: 0; }
.cat-set__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cat-set__title { font-size: 15px; line-height: 20px; font-weight: 700; }
.cat-set__count { font-size: 13px; line-height: 18px; color: var(--cat-soft); }
.cat-set:hover .cat-set__title, .cat-setlist a:hover .cat-setlist__title, .cat-season:hover .cat-season__title { text-decoration: underline; text-decoration-thickness: 1px; }

.cat-setlist { border-top: 1px solid var(--cat-line); margin-top: 24px; padding: 24px 0 0; display: flex; flex-direction: column; gap: 16px; }
.cat-setlist ul { list-style: none; margin: 0; padding: 0; }
.cat-setlist li { border-bottom: 1px solid var(--cat-line); }
.cat-setlist a { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 8px 0; text-decoration: none; color: var(--cat-ink); }
.cat-setlist .cat-thumb { width: 44px; height: 44px; }
.cat-setlist__text { display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; min-width: 0; }
.cat-setlist__title { font-size: 16px; line-height: 22px; font-weight: 700; }
@media (min-width: 1024px) { .cat-setlist--browse { display: none; } }

/* ------------------------------------------------------------------ Клуб: полоса и плитка */
.cat-pill-club {
    align-self: flex-start; height: 28px; display: inline-flex; align-items: center; gap: 5px; padding: 0 10px;
    background: var(--cat-club); color: #fff; font-size: 12px; font-weight: 700; border-radius: 999px;
}
.cat-club {
    background: var(--cat-forest); color: var(--cat-on-dark); border-radius: 24px; padding: 20px 20px 8px;
    display: flex; flex-direction: column; gap: 10px;
}
.cat-club__body { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.cat-club__title { font-family: var(--cat-font); font-weight: 600; font-size: 24px; line-height: 1.2; }
.cat-club__text { font-size: 15px; line-height: 1.55; color: var(--cat-on-dark-soft); }
.cat-club__members { display: flex; gap: 10px; font-size: 15px; line-height: 22px; }
.cat-club__members svg { flex: none; margin-top: 1px; color: var(--cat-mint-line); }
.cat-club__price { font-size: 15px; line-height: 1.55; }
.cat-club__price strong { white-space: nowrap; }
.cat-club__price-rest { display: block; color: var(--cat-on-dark-soft); }
.cat-club__actions { display: flex; flex-direction: column; gap: 10px; }
.cat-club__cta {
    order: -1; margin-top: 4px; height: 52px; display: flex; align-items: center; justify-content: center; background: #fff;
    color: var(--cat-forest); text-decoration: none; border-radius: 999px; font-weight: 700; font-size: 16px;
}
.cat-club__link { min-height: 44px; display: flex; align-items: center; justify-content: center; color: var(--cat-on-dark); font-weight: 600; font-size: 15px; text-decoration: underline; }
@media (min-width: 1024px) {
    .cat-club { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px 48px; padding: 32px 40px; }
    .cat-club__body { flex: 1 1 520px; gap: 12px; }
    .cat-club__title { font-size: 30px; line-height: 1.15; }
    .cat-club__text { font-size: 16px; line-height: 1.6; max-width: 560px; }
    .cat-club__members { align-items: center; }
    .cat-club__members svg { margin-top: 0; }
    .cat-club__price-rest { display: inline; }
    .cat-club__actions { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 12px 24px; }
    .cat-club__cta { order: 0; margin-top: 0; height: 56px; padding: 0 32px; font-size: 17px; }
    .cat-club__link { justify-content: flex-start; }
}

.cat-tile { display: flex; flex-direction: column; background: var(--cat-forest); color: var(--cat-on-dark); border-radius: 16px; overflow: hidden; align-self: start; min-width: 0; }
.cat-tile__photos { aspect-ratio: 1 / 1; position: relative; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 2px; }
.cat-tile__photos img { width: 100%; height: 100%; object-fit: cover; display: block; min-height: 0; }
.cat-tile__photos > :first-child { grid-row: span 2; }
.cat-tile__photos--single > :first-child { grid-column: span 2; }
.cat-tile__more { display: flex; align-items: center; justify-content: center; background: var(--cat-green); color: #fff; font-size: 20px; font-weight: 700; }
.cat-tile__blank { background: #2C4A3B; }
.cat-tile__badge { position: absolute; top: 8px; left: 8px; padding: 0 8px; }
.cat-tile__label { padding: 10px 12px 0; font-size: 13px; line-height: 20px; color: var(--cat-mint-line); font-weight: 600; }
.cat-tile__count { padding: 2px 12px 0; font-size: 15px; line-height: 20px; font-weight: 700; }
.cat-tile__note { padding: 0 12px; font-size: 13px; line-height: 20px; color: var(--cat-on-dark-soft); }
.cat-tile__action { padding: 12px; }
.cat-tile__cta { height: 44px; display: flex; align-items: center; justify-content: center; background: #fff; color: var(--cat-forest); text-decoration: none; border-radius: 999px; font-weight: 700; font-size: 15px; }
@media (max-width: 374px) {
    .cat-tile__label, .cat-tile__note { font-size: 12px; }
    .cat-tile__count { font-size: 14px; }
}
@media (min-width: 1024px) {
    .cat-tile__photos { aspect-ratio: 4 / 3; }
    .cat-tile__badge { top: 12px; left: 12px; }
    .cat-tile__label { padding: 14px 16px 0; font-size: 14px; line-height: 22px; }
    .cat-tile__count { padding: 4px 16px 0; font-size: 17px; line-height: 22px; }
    .cat-tile__note { padding: 4px 16px 0; font-size: 14px; }
    .cat-tile__action { padding: 12px 16px 16px; }
}

/* ------------------------------------------------------------------ «Показать ещё» */
.cat-more { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.cat-more__text { font-size: 14px; line-height: 20px; color: var(--cat-soft); }
.cat-more__bar { width: 200px; height: 4px; background: var(--cat-line); border-radius: 999px; overflow: hidden; }
.cat-more__bar span { display: block; height: 100%; min-width: 4px; background: var(--cat-green); border-radius: 999px; }
.cat-more__button {
    width: 100%; height: 56px; display: flex; align-items: center; justify-content: center; padding: 0 24px;
    border: 1.5px solid var(--cat-ink); color: var(--cat-ink); text-decoration: none; border-radius: 999px; font-weight: 700; font-size: 16px;
}
.cat-more__button[aria-busy="true"] { opacity: .6; pointer-events: none; }
@media (min-width: 1024px) {
    .cat-more { gap: 16px; padding-top: 8px; }
    .cat-more__text { font-size: 15px; }
    .cat-more__bar { width: 280px; }
    .cat-more__button { width: auto; min-width: 280px; font-size: 17px; }
}

/* ------------------------------------------------------------------ Пустая выдача */
.cat-empty { display: flex; flex-direction: column; gap: 16px; padding-top: 24px; max-width: 640px; }
.cat-empty__card { background: #fff; border: 1px solid var(--cat-line); border-radius: 20px; padding: 24px 20px 12px; display: flex; flex-direction: column; gap: 8px; }
.cat-empty__icon { width: 48px; height: 48px; border-radius: 999px; background: var(--cat-mint); color: var(--cat-green); display: flex; align-items: center; justify-content: center; margin-bottom: 4px; }
.cat-empty__text { font-size: 15px; line-height: 1.55; color: var(--cat-soft); margin-bottom: 4px !important; }
.cat-relax { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; padding: 8px 0; border-top: 1px solid var(--cat-line); text-decoration: none; color: var(--cat-ink); }
.cat-relax__text { display: flex; flex-direction: column; gap: 2px; }
.cat-relax__label { font-size: 16px; line-height: 22px; font-weight: 600; }
.cat-relax__count { font-size: 13px; line-height: 18px; color: var(--cat-soft); }
.cat-relax svg { color: var(--cat-green); }
.cat-empty__card .cat-link-button { align-self: flex-start; padding: 0; }
.cat-ask { background: var(--cat-mint); color: var(--cat-forest); border-radius: 24px; padding: 24px 20px; display: flex; flex-direction: column; gap: 12px; }
.cat-ask p { font-size: 15px; line-height: 1.55; }
.cat-button-green {
    height: 56px; display: flex; align-items: center; justify-content: center; width: 100%; border: 0; background: var(--cat-green);
    color: #fff; text-decoration: none; border-radius: 999px; font-weight: 700; font-size: 16px;
}
.cat-ask .cat-button-green { margin-top: 4px; }
@media (min-width: 1024px) { .cat-empty { padding-top: 0; } }

/* ------------------------------------------------------------------ Панель фильтров (диалог) */
.cat-dialog {
    position: fixed; inset: 48px 0 0 0; width: 100%; max-width: none; height: auto; max-height: none; margin: 0; padding: 0; border: 0;
    border-radius: 24px 24px 0 0; background: #fff; color: var(--cat-ink); overflow: hidden;
    font-family: var(--cat-font);
}
.cat-dialog[open] { display: flex; flex-direction: column; }
.cat-dialog::backdrop { background: rgba(31, 42, 36, 0.55); }
.cat-dialog form { display: flex; flex-direction: column; min-height: 0; flex: 1 1 auto; }
.cat-dialog__grip { display: flex; justify-content: center; padding-top: 8px; }
.cat-dialog__grip span { width: 40px; height: 4px; border-radius: 999px; background: var(--cat-chip-line); }
.cat-dialog__head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 4px 8px 8px 12px; border-bottom: 1px solid var(--cat-line); }
.cat-dialog__head h2 { font-size: 17px; line-height: 24px; font-weight: 700; }
.cat-dialog__head h2:focus { outline: none; }
.cat-dialog__head .cat-link-button { justify-self: start; }
.cat-dialog__head .cat-icon-button { justify-self: end; }
.cat-dialog__body { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.cat-dialog__scroll {
    flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain; padding: 24px 20px 24px; display: flex; flex-direction: column; gap: 24px;
}
.cat-dialog__foot {
    flex: none; padding: 12px 20px calc(24px + env(safe-area-inset-bottom, 0px)); background: #fff; border-top: 1px solid var(--cat-line);
    box-shadow: 0 -8px 20px -16px rgba(31, 42, 36, 0.4);
}
.cat-dialog__foot button[disabled] { opacity: .5; cursor: default; }
.cat-field { margin: 0; padding: 0; border: 0; min-width: 0; display: flex; flex-direction: column; }
.cat-legend { padding: 0 0 12px; font-size: 13px; line-height: 18px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--cat-green); }
.cat-legend--tight { padding-bottom: 4px; }
.cat-note { font-size: 13px; line-height: 18px; color: var(--cat-soft); }
.cat-row {
    position: relative; display: flex; align-items: flex-start; gap: 12px; min-height: 52px; font-size: 16px; line-height: 22px;
    font-weight: 600; border-bottom: 1px solid var(--cat-line);
}
.cat-row input, .cat-pick input, .cat-segment__item input { position: absolute; width: 1px; height: 1px; opacity: 0; margin: 0; }
.cat-row .cat-box { width: 22px; height: 22px; border-radius: 6px; margin-top: 14px; }
.cat-row__text { display: flex; flex-direction: column; gap: 2px; padding: 14px 0; flex: 1 1 auto; min-width: 0; }
.cat-row__hint { font-size: 13px; line-height: 18px; font-weight: 500; color: var(--cat-soft); }
.cat-row__count { flex: none; margin-left: auto; padding: 14px 0 0 12px; font-size: 15px; font-weight: 500; color: var(--cat-soft); font-variant-numeric: tabular-nums; }
.cat-row--plain { border-bottom: 0; min-height: 0; padding-top: 14px; font-size: 15px; }
.cat-row--plain .cat-box { margin-top: 0; }
.cat-row--plain .cat-row__text { padding: 0; }
.cat-row.is-disabled { color: #8A918C; }
.cat-picks { display: flex; flex-wrap: wrap; gap: 8px; }
.cat-picks--grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 8px; }
.cat-picks--grid > :last-child:nth-child(odd) { grid-column: 1 / -1; }
.cat-pick { position: relative; }
.cat-pick:has(input:checked) { background: var(--cat-ink); border-color: var(--cat-ink); color: #fff; }
.cat-pick:has(input:checked) .cat-chip__count { color: var(--cat-on-ink-soft); }
.cat-pick:has(input:disabled) { color: #8A918C; background: transparent; }
.cat-pick:has(input:disabled) .cat-chip__count { color: #8A918C; }
.cat-dialog .cat-segment { display: flex; }
.cat-dialog .cat-segment__item { position: relative; flex: 1 1 auto; height: 44px; padding: 0 10px; }
.cat-fold { border-top: 1px solid var(--cat-line); }
.cat-fold summary {
    display: flex; align-items: center; justify-content: space-between; min-height: 52px; font-size: 16px; font-weight: 600;
    cursor: pointer; list-style: none;
}
.cat-fold summary::-webkit-details-marker { display: none; }
.cat-fold[open] summary svg { transform: rotate(180deg); }
.cat-fold .cat-picks { padding-bottom: 16px; }
.cat-folds { display: flex; flex-direction: column; }
@media (min-width: 1024px) {
    .cat-dialog { inset: 0; margin: auto; width: 480px; height: min(88vh, 860px); border-radius: 24px; }
    .cat-dialog__grip { display: none; }
    .cat-dialog__head { padding-top: 12px; }
}

.cat-dialog--labels { inset: auto 0 0 0; height: auto; max-height: calc(100% - 48px); }
.cat-dialog--labels .cat-dialog__scroll { gap: 16px; padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px)); }
.cat-labels { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.cat-labels strong { display: block; font-size: 16px; line-height: 22px; font-weight: 600; }
.cat-labels span { font-size: 14px; line-height: 20px; color: var(--cat-soft); }
@media (min-width: 1024px) { .cat-dialog--labels { inset: 0; width: 440px; height: fit-content; max-height: 80vh; } }

/* ------------------------------------------------------------------ Липкая панель и «Наверх» */
.cat-compact {
    position: fixed; top: var(--cat-sticky-top); left: 0; right: 0; z-index: 39; height: 64px; background: #fff;
    border-bottom: 1px solid var(--cat-line); box-shadow: 0 10px 24px -18px rgba(31, 42, 36, 0.45);
    transform: translateY(-110%); visibility: hidden; transition: transform .2s ease-out, top .2s ease-out, visibility 0s .2s;
}
.cat-compact.is-visible { transform: none; visibility: visible; transition: transform .2s ease-out, top .2s ease-out; }
.cat-compact__inner { height: 100%; display: flex; align-items: center; gap: 8px; padding-right: 8px; }
.cat-compact__text { flex: 1 1 auto; min-width: 0; font-size: 13px; line-height: 18px; color: var(--cat-soft); }
.cat-compact__text strong { display: block; color: var(--cat-ink); font-weight: 700; }
.cat-compact__text span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (min-width: 1024px) { .cat-compact__inner { padding-right: var(--cat-gutter); } }
@media (prefers-reduced-motion: reduce) { .cat-compact, .cat-compact.is-visible { transition: none; } }

.cat-top {
    position: fixed; right: 16px; bottom: 24px; z-index: 38; width: 48px; height: 48px; border-radius: 999px; background: #fff;
    border: 1px solid var(--cat-line); box-shadow: 0 8px 20px -10px rgba(31, 42, 36, 0.4); color: var(--cat-ink);
    display: flex; align-items: center; justify-content: center; opacity: 0; visibility: hidden; transition: opacity .2s, visibility 0s .2s;
}
.cat-top.is-visible { opacity: 1; visibility: visible; transition: opacity .2s; }

/* Шапка сайта уезжает при прокрутке вниз и возвращается при прокрутке вверх (только на странице каталога). */
body > header { transition: transform .2s ease-out; }
html.cat-header-hidden body > header { transform: translateY(-100%); }
@media (prefers-reduced-motion: reduce) { body > header { transition: none; } }
