/* Подборки СтолТумбы: компактная строка + полный справочник в выдвижной панели. Все правила ограничены .stk-coll*. */
.stk-coll {
    --stk-blue: #6f9a22;
    --stk-blue-dark: #5e8618;
    --stk-line: #e3e7ee;
    --stk-chip-line: #c5d7a4;
    --stk-text: #1f2937;
    --stk-muted: #6b7280;
    margin: 0 0 20px;
    border-bottom: 1px solid var(--stk-line);
}
.stk-coll-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
    min-height: 44px;
    padding: 6px 0 12px;
}
.stk-coll-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--stk-text);
    margin-right: 6px;
    white-space: nowrap;
}
.stk-coll-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 32px;
    padding: 4px 14px;
    border: 1px solid var(--stk-chip-line);
    border-radius: 16px;
    background: #fff;
    color: var(--stk-blue);
    font-size: 14px;
    line-height: 20px;
    text-decoration: none;
    white-space: nowrap;
    transition: border-color .15s, background-color .15s;
}
.stk-coll-chip:hover, .stk-coll-chip:focus-visible { border-color: var(--stk-blue); color: var(--stk-blue); text-decoration: none; }
.stk-coll-chip-current { background: #f3f8e8; border-color: var(--stk-blue); font-weight: 600; }
.stk-coll-chip-parent { color: var(--stk-text); }
.stk-coll-chip i { font-size: 13px; }

.stk-coll-all { display: inline-block; }
.stk-coll-all[open] { display: block; flex: 0 0 100%; }
.stk-coll-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 34px;
    padding: 6px 14px 6px 16px;
    border-radius: 6px;
    background: var(--stk-blue);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    line-height: 20px;
    cursor: pointer;
    list-style: none;
    white-space: nowrap;
    user-select: none;
    transition: background-color .15s;
}
.stk-coll-btn::-webkit-details-marker { display: none; }
.stk-coll-btn::marker { content: ""; }
.stk-coll-btn { background: #9ac63b; }
.stk-coll-btn:hover { background: #7ca02e; }
.stk-coll-btn:focus-visible { outline: 2px solid var(--stk-blue); outline-offset: 2px; }

/* Панель (без JS — раскрывается на месте; с JS — переносится в dialog) */
.stk-coll-all > .stk-coll-panel { margin-top: 10px; border: 1px solid var(--stk-line); border-radius: 8px; padding: 16px; }
.stk-coll-panel { background: #fff; color: var(--stk-text); box-sizing: border-box; }
.stk-coll-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stk-coll-h { margin: 0; font-size: 27px; line-height: 1.2; font-weight: 600; color: var(--stk-text); outline: none; }
.stk-coll-close {
    flex: 0 0 auto; width: 44px; height: 44px; margin-right: -10px;
    display: inline-flex; align-items: center; justify-content: center;
    border: 0; border-radius: 6px; background: transparent; color: var(--stk-text); font-size: 22px; cursor: pointer;
}
.stk-coll-close:hover { background: #f3f5f9; }
.stk-coll-close:focus-visible { outline: 2px solid var(--stk-blue); outline-offset: 0; }
.stk-coll-context { margin: 2px 0 16px; font-size: 14px; color: var(--stk-muted); }
.stk-coll-search { position: relative; margin: 0 0 8px; }
.stk-coll-search[hidden] { display: none; }
.stk-coll-search-field {
    display: flex; align-items: center; gap: 10px; margin: 0;
    height: 44px; padding: 0 44px 0 14px; border: 1px solid #cfd6e2; border-radius: 6px; background: #fff; cursor: text;
}
.stk-coll-search-field:focus-within { border-color: var(--stk-blue); box-shadow: 0 0 0 3px rgba(111, 154, 34, .18); }
.stk-coll-search-field i { color: var(--stk-muted); font-size: 16px; }
.stk-coll-search-input {
    flex: 1 1 auto; min-width: 0; height: 100%; border: 0; outline: none; background: transparent;
    font-size: 16px; color: var(--stk-text); padding: 0;
}
.stk-coll-search-input::-webkit-search-cancel-button { display: none; }
.stk-coll-search-clear {
    position: absolute; right: 2px; top: 2px; width: 40px; height: 40px; border: 0; background: transparent;
    color: var(--stk-muted); font-size: 16px; cursor: pointer; border-radius: 6px;
}
.stk-coll-search-clear:focus-visible { outline: 2px solid var(--stk-blue); }
.stk-coll-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.stk-coll-group { border-bottom: 1px solid var(--stk-line); }
.stk-coll-group[hidden] { display: none; }
.stk-coll-group-head {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    min-height: 48px; padding: 8px 0; cursor: pointer; list-style: none;
    font-size: 17px; font-weight: 600; color: var(--stk-blue);
}
.stk-coll-group-head::-webkit-details-marker { display: none; }
.stk-coll-group-head::marker { content: ""; }
.stk-coll-group-head .stk-coll-ico, .stk-coll-group-head i { font-size: 18px; color: var(--stk-blue); transition: transform .2s; }
.stk-coll-group[open] > .stk-coll-group-head .stk-coll-ico-down,
.stk-coll-group[open] > .stk-coll-group-head i { transform: rotate(180deg); }
.stk-coll-ico { display: inline-block; width: 1em; height: 1em; vertical-align: -0.15em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
.stk-coll-group-head:focus-visible { outline: 2px solid var(--stk-blue); outline-offset: -2px; }
.stk-coll-items { list-style: none; margin: 0 0 8px; padding: 0; }
.stk-coll-item { margin: 0; padding: 0; }
.stk-coll-item::before { display: none !important; }
.stk-coll-item[hidden] { display: none; }
.stk-coll-item a {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    min-height: 44px; padding: 8px 4px 8px 12px; border-bottom: 1px solid #eef0f4;
    color: var(--stk-text); font-size: 15px; line-height: 1.35; text-decoration: none;
}
.stk-coll-item:last-child a { border-bottom: 0; }
.stk-coll-item a:hover { color: var(--stk-blue); background: #f7f9fc; text-decoration: none; }
.stk-coll-item a:focus-visible { outline: 2px solid var(--stk-blue); outline-offset: -2px; }
.stk-coll-item a i { flex: 0 0 auto; color: var(--stk-muted); font-size: 16px; }
.stk-coll-item.is-current a { color: var(--stk-blue); font-weight: 600; background: #f3f8e8; }
.stk-coll-badge { font-style: normal; font-weight: 400; font-size: 12px; color: var(--stk-muted); margin-left: 6px; white-space: nowrap; }
.stk-coll-empty { padding: 24px 0; text-align: center; color: var(--stk-muted); font-size: 15px; }
.stk-coll-empty[hidden] { display: none; }
.stk-coll-empty p { margin: 0 0 12px; }
.stk-coll-empty-clear {
    min-height: 40px; padding: 8px 16px; border: 1px solid var(--stk-blue); border-radius: 6px;
    background: #fff; color: var(--stk-blue); font-size: 14px; cursor: pointer;
}

/* Диалог (JS) */
.stk-coll-dialog {
    position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none;
    margin: 0; padding: 0; border: 0; background: transparent; overflow: hidden; color: inherit;
    --stk-top: 0px;
}
.stk-coll-dialog::backdrop { background: transparent; }
.stk-coll-dialog:not([open]) { display: none; }
.stk-coll-shade {
    position: absolute; left: 0; right: 0; bottom: 0; top: var(--stk-top);
    background: rgba(17, 24, 39, .45); opacity: 0; transition: opacity .2s ease;
}
.stk-coll-dialog .stk-coll-panel {
    position: absolute; right: 0; top: var(--stk-top); bottom: 0;
    width: 490px; max-width: 100%;
    display: flex; flex-direction: column;
    padding: 20px 24px 0; box-shadow: -8px 0 24px rgba(17, 24, 39, .12);
    transform: translateX(100%); transition: transform .22s ease;
}
.stk-coll-dialog .stk-coll-list {
    flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
    margin: 0 -24px; padding: 0 24px calc(24px + env(safe-area-inset-bottom, 0px));
    -webkit-overflow-scrolling: touch;
}
.stk-coll-dialog.is-open .stk-coll-shade { opacity: 1; }
.stk-coll-dialog.is-open .stk-coll-panel { transform: none; }
/* Только html: у шаблона html и body высотой 100%, overflow:hidden на body сбрасывает прокрутку в 0 */
html.stk-coll-locked { overflow: hidden !important; }

.stk-coll-chip[hidden] { display: none; }

/* Внутри строки «Фильтр / сортировка»: шаблон переключает панель на мобильную при 720px */
@media (min-width: 721px) {
    .ns-bitrix.c-catalog .catalog-panel.stk-coll-host {
        display: flex; align-items: center; margin-left: -10px; margin-right: -10px; padding-bottom: 5px; position: relative;
    }
    .ns-bitrix.c-catalog .catalog-panel.stk-coll-host > .catalog-panel-wrapper[data-device="desktop"] { display: contents; }
    .ns-bitrix.c-catalog .catalog-panel.stk-coll-host > .catalog-panel-wrapper > .catalog-panel-views { flex: 0 0 auto; order: 1; }
    .ns-bitrix.c-catalog .catalog-panel.stk-coll-host > .catalog-panel-wrapper > .catalog-panel-sort { order: 3; margin-left: auto; }
    .stk-coll.stk-coll-in-panel { order: 2; flex: 1 1 auto; min-width: 0; margin: 0 10px 0 20px; border: 0; }
    .stk-coll-in-panel .stk-coll-bar { padding: 0; min-height: 0; gap: 10px; }
    /* nowrap + скрытие лишних чипов скриптом; отступ под обводку фокуса */
    .stk-coll-in-panel[data-stk-ready] .stk-coll-bar { flex-wrap: nowrap; overflow: hidden; padding: 3px; margin: -3px; }
}
@media (min-width: 992px) {
    .stk-coll.stk-coll-in-panel { margin-top: 5px; margin-left: 28px; }
    .stk-coll-in-panel .stk-coll-title { font-size: 20px; margin-right: 4px; }
    .stk-coll-in-panel .stk-coll-chip { min-height: 46px; padding: 0 22px; border-radius: 25px; font-size: 16px; }
    .stk-coll-in-panel .stk-coll-chip .stk-coll-ico { font-size: 15px; }
    .stk-coll-in-panel .stk-coll-btn { padding: 10px 28px; border-radius: 10px; font-size: 20px; }
}

@media (max-width: 720px) {
    .stk-coll-bar { gap: 8px; padding-bottom: 10px; }
    .stk-coll-title { flex: 0 0 100%; font-size: 17px; margin: 0; }
    .stk-coll-bar > .stk-coll-chip:not(.stk-coll-chip-current):not(.stk-coll-chip-parent):nth-of-type(n+3) { display: none; }
    .stk-coll-chip, .stk-coll-btn { min-height: 40px; }
}

@media (max-width: 767px) {
    .stk-coll-dialog .stk-coll-panel {
        top: 0; width: 100%; height: 100%;
        padding: calc(12px + env(safe-area-inset-top, 0px)) 16px 0;
        box-shadow: none; transform: translateY(24px); opacity: 0; transition: transform .2s ease, opacity .2s ease;
    }
    .stk-coll-dialog.is-open .stk-coll-panel { opacity: 1; }
    .stk-coll-dialog .stk-coll-list { margin: 0 -16px; padding: 0 16px calc(24px + env(safe-area-inset-bottom, 0px)); }
    .stk-coll-h { font-size: 24px; }
    .stk-coll-shade { top: 0; }
}
@media (prefers-reduced-motion: reduce) {
    .stk-coll-shade, .stk-coll-dialog .stk-coll-panel, .stk-coll-group-head i { transition: none !important; }
}
