/*
 * Ok2Shop Filter — панель фильтров витрины.
 *
 * Цвета и размеры — переменные --o2fs-* из настроек «Вид» (с запасом на цвета темы магазина --ok2shop-*, --wd-*).
 * Варианты подачи — классы o2f-{группа}-{значение} на <body> (витрина) или на обёртке предпросмотра (админка).
 */

.o2f,
.o2f-pop,
.o2f-chips-bar,
button.o2f-trigger {
	--o2f-accent: var(--o2fs-accent, var(--ok2shop-primary, var(--wd-primary-color, #439665)));
	--o2f-on-accent: var(--o2fs-on-accent, var(--o2ui-on-accent, #fff));
	--o2f-surface: var(--o2fs-surface, var(--o2ui-surface,#fff));
	--o2f-text: var(--o2fs-text, var(--ok2shop-text, var(--o2ui-text,#2b2b2b)));
	--o2f-title: var(--o2fs-heading, var(--ok2shop-title, var(--o2ui-text,#1f1f1f)));
	--o2f-muted: var(--o2fs-muted, var(--o2ui-muted,#8b8b8b));
	--o2f-line: var(--o2fs-border, var(--o2ui-line,#ebebeb));
	--o2f-soft: var(--o2fs-hover, var(--o2ui-soft,#f5f5f5));
	--o2f-radius: var(--o2fs-radius, 10px);
	--o2f-r: var(--o2fs-ctl-radius, 8px);
	--o2f-fs: var(--o2fs-font-size, 14px);
	--o2f-tint: color-mix(in srgb, var(--o2f-accent) 12%, var(--o2f-surface));
	--o2f-tint-2: color-mix(in srgb, var(--o2f-accent) 20%, var(--o2f-surface));
	--o2f-row: 34px;
	--o2f-head: 48px;
	--o2f-px: 16px;
	box-sizing: border-box;
	font-size: var(--o2f-fs);
	color: var(--o2f-text);
}
.o2f *, .o2f *::before, .o2f *::after { box-sizing: border-box; }

/* Плотность */
.o2f-density-compact .o2f { --o2f-row: 28px; --o2f-head: 40px; --o2f-px: 12px; }
.o2f-density-comfortable .o2f { --o2f-row: 40px; --o2f-head: 56px; --o2f-px: 20px; }

/* Кнопки панели. Тема (Woodmart) оформляет все button правилом :is(button, …) — сбрасываем его и его :hover. */
button:is(.o2f-all, .o2f__reset, .o2f__close, .o2f-chip--reset, .o2f-chip, .o2f-sec__head, .o2f-more, .o2f-pop__btn, .o2f__submit, .o2f-trigger) { min-height: 0; height: auto; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; color: inherit; font-family: inherit; font-size: inherit; font-weight: inherit; line-height: 1.25; letter-spacing: normal; text-transform: none; text-shadow: none; text-align: left; justify-content: flex-start; gap: 0; transition: background-color .15s, color .15s, border-color .15s, filter .15s; }
button.o2f__reset:hover, button.o2f-chip--reset:hover { background: none; color: var(--o2f-accent); }
button.o2f__close:hover { background: var(--o2f-line); color: var(--o2f-text); }
button.o2f-chip:hover { color: var(--o2f-title); }
button.o2f-sec__head:hover { color: var(--o2f-title); }
button.o2f-pop__btn:hover, button.o2f__submit:hover { background: var(--o2f-accent); color: var(--o2f-on-accent); }
button.o2f-trigger:hover { background: var(--o2f-surface); color: var(--o2f-title); border-color: var(--o2f-accent); }

/* Липкий сайдбар прокручивается сам, а не тянется на всю страницу */
@media (min-width: 1025px) {
	.ok2shop-sidebar { max-height: calc(100vh - 40px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
	.o2f-sticky-off .ok2shop-sidebar { position: static; max-height: none; overflow: visible; }
}

/* ---------- Панель ---------- */
.o2f { display: flex; flex-direction: column; background: var(--o2f-surface); border: 1px solid var(--o2f-line); border-radius: var(--o2f-radius); }
.o2f__head { display: flex; align-items: center; gap: 8px; padding: 14px var(--o2f-px); border-bottom: 1px solid var(--o2f-line); }
.o2f__title { font-size: calc(var(--o2f-fs) + 2px); font-weight: 700; color: var(--o2f-title); }
.o2f-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--o2f-accent); color: var(--o2f-on-accent); font-size: 12px; font-weight: 700; line-height: 1; }
.o2f-badge[hidden] { display: none; }
button.o2f__reset { margin-left: auto; white-space: nowrap; color: var(--o2f-accent); font-size: calc(var(--o2f-fs) - 1px); font-weight: 600; cursor: pointer; }
button.o2f__reset:hover { text-decoration: underline; }
button.o2f__reset[hidden] { display: none; }
button.o2f__reset[hidden] + button.o2f__close { margin-left: auto; }
button.o2f__close { display: none; margin-left: 8px; width: 36px; height: 36px; border-radius: 50%; background: var(--o2f-soft); font-size: 22px; line-height: 1; color: var(--o2f-text); cursor: pointer; }
.o2f__body { display: flex; flex-direction: column; }
.o2f__foot { display: none; }

/* Варианты оформления панели */
.o2f-panel-flat .o2f { --o2f-px: 0px; background: transparent; border: 0; border-radius: 0; }
.o2f-panel-elevated .o2f { border-color: transparent; box-shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 10px 30px rgba(0, 0, 0, .08); }
.o2f-panel-sections .o2f { background: transparent; border: 0; border-radius: 0; }
.o2f-panel-sections .o2f__head { padding: 0 0 12px; border: 0; }
.o2f-panel-sections .o2f__body { gap: 10px; }
.o2f-panel-sections .o2f-sec,
.o2f-panel-sections .o2f-sec:last-child { background: var(--o2f-surface); border: 1px solid var(--o2f-line); border-radius: var(--o2f-radius); overflow: hidden; }

/* Чипы выбранного */
.o2f__chips:empty { display: none; }
.o2f__chips,
.o2f-chips-bar { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px var(--o2f-px); border-bottom: 1px solid var(--o2f-line); }
.o2f-chips-bar { padding: 0; border: 0; margin: 0 0 16px; background: none; }
.o2f-chips-bar:empty { display: none; }
@media (min-width: 1025px) { .o2f__chips { display: none; } }
.o2f-chips-panel .o2f__chips:not(:empty),
.o2f-chips-both .o2f__chips:not(:empty) { display: flex; }
.o2f-chips-panel .o2f-chips-bar,
.o2f-chips-none .o2f-chips-bar,
.o2f-chips-none .o2f__chips { display: none; }
button.o2f-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; min-height: 30px; padding: 4px 6px 4px 12px; border-radius: 999px; background: var(--o2f-tint); color: var(--o2f-title); font-size: calc(var(--o2f-fs) - 1px); line-height: 1.2; cursor: pointer; }
.o2f-chip-rounded button.o2f-chip { border-radius: var(--o2f-r); }
button.o2f-chip b { font-weight: 400; color: var(--o2f-muted); }
button.o2f-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
button.o2f-chip i { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%; background: color-mix(in srgb, var(--o2f-text) 12%, transparent); font-style: normal; font-size: 14px; }
button.o2f-chip:hover { background: var(--o2f-tint-2); }
button.o2f-chip--reset { background: none; padding: 4px 8px; color: var(--o2f-accent); font-weight: 600; }
button.o2f-chip--reset:hover { background: none; }

/* ---------- Секции ---------- */
.o2f-sec { border-bottom: 1px solid var(--o2f-line); }
.o2f-sec:last-child { border-bottom: 0; }
.o2f-sep-off .o2f-sec { border-bottom-color: transparent; }
button.o2f-sec__head { display: flex; align-items: center; gap: 8px; width: 100%; min-height: var(--o2f-head); padding: 10px var(--o2f-px); background: none; color: var(--o2f-title); font-weight: 600; text-align: left; cursor: pointer; }
button.o2f-sec__head:hover { background: var(--o2f-soft); }
.o2f-panel-flat button.o2f-sec__head:hover { background: none; color: var(--o2f-accent); }
.o2f-title-caps button.o2f-sec__head { font-size: calc(var(--o2f-fs) - 2px); font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.o2f-title-bold button.o2f-sec__head { font-size: calc(var(--o2f-fs) + 1px); font-weight: 700; }
.o2f-sec__name { flex: 1; min-width: 0; }
.o2f-sec__count { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--o2f-accent); color: var(--o2f-on-accent); font-size: 11px; font-weight: 700; letter-spacing: 0; }
.o2f-sec__count[hidden] { display: none; }
.o2f-sec__chev { flex: none; width: 8px; height: 8px; border-right: 2px solid var(--o2f-muted); border-bottom: 2px solid var(--o2f-muted); transform: rotate(45deg) translateY(-2px); transition: transform .2s; }
.o2f-sec.is-open .o2f-sec__chev { transform: rotate(-135deg) translateY(-2px); }
.o2f-icon-plus .o2f-sec__chev,
.o2f-icon-plus .o2f-sec.is-open .o2f-sec__chev { position: relative; width: 12px; height: 12px; border: 0; transform: none; }
.o2f-icon-plus .o2f-sec__chev::before,
.o2f-icon-plus .o2f-sec__chev::after { content: ""; position: absolute; left: 0; top: 5px; width: 12px; height: 2px; border-radius: 1px; background: var(--o2f-muted); transition: transform .2s; }
.o2f-icon-plus .o2f-sec__chev::after { transform: rotate(90deg); }
.o2f-icon-plus .o2f-sec.is-open .o2f-sec__chev::after { transform: rotate(0deg); }
.o2f-sec__body { display: none; padding: 0 var(--o2f-px) 14px; }
.o2f-sec.is-open .o2f-sec__body { display: block; }

/* Поиск по значениям */
.o2f-search { display: flex; align-items: center; gap: 8px; height: 36px; margin: 0 0 8px; padding: 0 10px; border: 1px solid var(--o2f-line); border-radius: var(--o2f-r); color: var(--o2f-muted); }
.o2f-search:focus-within { border-color: var(--o2f-accent); }
.o2f-search input { flex: 1; min-width: 0; height: 100%; border: 0 !important; padding: 0 !important; background: none !important; box-shadow: none !important; color: var(--o2f-text); font-size: calc(var(--o2f-fs) - 1px); outline: none; }

/* ---------- Значения ---------- */
.o2f-list { display: flex; flex-direction: column; gap: 2px; }
.o2f-opt { position: relative; display: flex; align-items: center; gap: 10px; min-height: var(--o2f-row); padding: 4px 6px; margin: 0 -6px; border-radius: 6px; cursor: pointer; line-height: 1.3; transition: background .12s; }
.o2f-opt:hover { background: var(--o2f-soft); }
.o2f-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.o2f-opt__box { flex: none; width: 18px; height: 18px; border: 1.5px solid color-mix(in srgb, var(--o2f-text) 35%, transparent); border-radius: 4px; background: var(--o2f-surface); transition: background .12s, border-color .12s; }
.o2f-check-square .o2f-opt__box { border-radius: 2px; }
.o2f-check-circle .o2f-opt__box,
.o2f-sec[data-ui="radio"] .o2f-opt__box { border-radius: 50%; }
.o2f-opt:hover .o2f-opt__box { border-color: var(--o2f-accent); }
.o2f-opt input:checked + .o2f-opt__box { border-color: var(--o2f-accent); background: var(--o2f-accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m3.5 8.2 3 3 6-6.4' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/14px no-repeat; }
.o2f-sec[data-ui="radio"] .o2f-opt input:checked + .o2f-opt__box { background: var(--o2f-surface); box-shadow: inset 0 0 0 4px var(--o2f-accent); }
.o2f-opt input:focus-visible + span { outline: 2px solid var(--o2f-accent); outline-offset: 2px; }
.o2f-opt__name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
/* Выбранные — подсвеченной группой вверху списка, под ней тонкий разделитель */
.o2f-list:is(.o2f-list--list_1, .o2f-list--list_2) .o2f-opt:has(input:checked) { background: var(--o2f-tint); }
.o2f-list:is(.o2f-list--list_1, .o2f-list--list_2) .o2f-opt:has(input:checked):hover { background: var(--o2f-tint-2); }
.o2f-list--list_1 .o2f-opt.is-sel-last { margin-bottom: 7px; }
.o2f-list--list_1 .o2f-opt.is-sel-last::after { content: ""; position: absolute; left: 6px; right: 6px; bottom: -5px; height: 1px; background: var(--o2f-line); }
button.o2f-more[hidden] { display: none; }
.o2f-opt input:checked ~ .o2f-opt__name { font-weight: 600; color: var(--o2f-title); }
.o2f-opt__count { flex: none; color: var(--o2f-muted); font-size: calc(var(--o2f-fs) - 2px); font-variant-numeric: tabular-nums; }
.o2f-counts-pill .o2f-opt__count { padding: 1px 7px; border-radius: 999px; background: var(--o2f-soft); font-size: 11px; }
.o2f-counts-paren .o2f-opt__count::before { content: "("; }
.o2f-counts-paren .o2f-opt__count::after { content: ")"; }
.o2f-opt.is-zero { opacity: .4; cursor: default; }
.o2f-opt.is-zero:hover { background: none; }
.o2f-opt.is-extra,
.o2f-opt.is-filtered { display: none; }
.o2f-opt.is-hidden { display: none !important; }
.o2f-sec.is-expanded .o2f-opt.is-extra:not(.is-filtered) { display: flex; }

/* «Показать все (N)»: кнопка во всю ширину, раскрытый список прокручивается внутри (не простыня на всю панель) */
.o2f-sec.is-expanded .o2f-list { max-height: 320px; overflow-y: auto; overscroll-behavior: contain; margin-right: -6px; padding-right: 6px; scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--o2f-text) 25%, transparent) transparent; }
.o2f-sec.is-expanded .o2f-list::-webkit-scrollbar { width: 6px; }
.o2f-sec.is-expanded .o2f-list::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--o2f-text) 25%, transparent); border-radius: 3px; }
button.o2f-more { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin-top: 10px; padding: 9px 12px; border: 1px solid var(--o2f-line); border-radius: var(--o2f-r); background: var(--o2f-soft); color: var(--o2f-title); font-size: calc(var(--o2f-fs) - 1px); font-weight: 600; text-align: center; cursor: pointer; }
button.o2f-more::after { content: ""; width: 6px; height: 6px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-2px); transition: transform .2s; }
button.o2f-more:hover { border-color: var(--o2f-accent); background: color-mix(in srgb, var(--o2f-accent) 8%, var(--o2f-surface)); color: var(--o2f-accent); }
.o2f-sec.is-expanded button.o2f-more { border-color: var(--o2f-accent); color: var(--o2f-accent); background: var(--o2f-surface); }
.o2f-sec.is-expanded button.o2f-more::after { transform: rotate(-135deg) translateY(-2px); }

/* Две колонки */
.o2f-list--list_2 { display: grid; grid-template-columns: 1fr 1fr; column-gap: 12px; }

/* Плитки и теги */
.o2f-list--tiles,
.o2f-list--tags { flex-direction: row; flex-wrap: wrap; gap: 6px; }
.o2f-list--tiles .o2f-opt,
.o2f-list--tags .o2f-opt { margin: 0; padding: 6px 12px; border: 1px solid var(--o2f-line); border-radius: var(--o2f-r); min-height: 36px; }
.o2f-list--tags .o2f-opt { border-radius: 999px; }
.o2f-list--tiles .o2f-opt__box,
.o2f-list--tags .o2f-opt__box { display: none; }
.o2f-list--tiles .o2f-opt:has(input:checked),
.o2f-list--tags .o2f-opt:has(input:checked) { border-color: var(--o2f-accent); background: color-mix(in srgb, var(--o2f-accent) 10%, var(--o2f-surface)); }
.o2f-list--tiles .o2f-opt__count,
.o2f-list--tags .o2f-opt__count { font-size: 11px; }

/* Цвета */
.o2f-list--swatches { flex-direction: row; flex-wrap: wrap; gap: 8px; }
.o2f-list--swatches .o2f-opt { flex-direction: column; gap: 4px; width: 64px; margin: 0; padding: 4px; text-align: center; font-size: 12px; }
.o2f-list--swatches .o2f-opt__count { display: none; }
.o2f-opt__swatch { flex: none; width: 32px; height: 32px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, .15); box-shadow: inset 0 0 0 2px var(--o2f-surface); }
.o2f-list:not(.o2f-list--swatches) .o2f-opt__swatch { width: 18px; height: 18px; box-shadow: none; }
.o2f-opt input:checked + .o2f-opt__swatch { outline: 2px solid var(--o2f-accent); outline-offset: 2px; }

/* Выпадающий список */
.o2f-select { width: 100%; height: 40px; border: 1px solid var(--o2f-line); border-radius: var(--o2f-r); padding: 0 10px; background: var(--o2f-surface); color: var(--o2f-text); }

/* ---------- Диапазон (цена, числовые характеристики) ---------- */
.o2f-range { position: relative; height: 28px; margin: 4px 8px 6px; }
.o2f-range__track { position: absolute; left: 0; right: 0; top: 12px; height: 4px; border-radius: 4px; background: var(--o2f-line); }
.o2f-range__fill { position: absolute; top: 0; bottom: 0; border-radius: 4px; background: var(--o2f-accent); }
.o2f-range input[type="range"] { position: absolute; left: -8px; right: -8px; top: 4px; width: calc(100% + 16px); height: 20px; margin: 0; padding: 0; background: none; border: 0; -webkit-appearance: none; appearance: none; pointer-events: none; }
.o2f-range input[type="range"]::-webkit-slider-runnable-track { background: none; border: 0; }
.o2f-range input[type="range"]::-moz-range-track { background: none; border: 0; }
.o2f-range input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; pointer-events: auto; width: 20px; height: 20px; border-radius: 50%; background: var(--o2f-surface); border: 2px solid var(--o2f-accent); box-shadow: 0 1px 3px rgba(0, 0, 0, .2); cursor: grab; }
.o2f-range input[type="range"]::-moz-range-thumb { pointer-events: auto; width: 16px; height: 16px; border-radius: 50%; background: var(--o2f-surface); border: 2px solid var(--o2f-accent); box-shadow: 0 1px 3px rgba(0, 0, 0, .2); cursor: grab; }
.o2f-range__inputs { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.o2f-range__inputs label { display: flex; align-items: center; gap: 6px; height: 38px; padding: 0 10px; border: 1px solid var(--o2f-line); border-radius: var(--o2f-r); color: var(--o2f-muted); font-size: 12px; }
.o2f-range__inputs label:focus-within { border-color: var(--o2f-accent); }
.o2f-range__inputs input { flex: 1; min-width: 0; width: 100%; height: 100%; border: 0 !important; padding: 0 !important; background: none !important; box-shadow: none !important; color: var(--o2f-text); font-size: var(--o2f-fs); outline: none; -moz-appearance: textfield; }
.o2f-range__inputs input::-webkit-outer-spin-button,
.o2f-range__inputs input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.o2f-range__values { display: flex; justify-content: space-between; gap: 8px; color: var(--o2f-text); font-size: calc(var(--o2f-fs) - 1px); font-variant-numeric: tabular-nums; }
.o2f-range__values span:last-child:not([data-o2f-range-to]) { display: none; }

/* Категории */
.o2f-cats { margin: 0; padding: 0; list-style: none; }
.o2f-cats .o2f-opt { display: block; min-height: 0; margin: 0; padding: 0; }
.o2f-sec.is-expanded .o2f-cats .o2f-opt.is-extra { display: block; }
.o2f-cats a { display: block; padding: 6px 8px; margin: 0 -8px; border-radius: 6px; color: var(--o2f-text); text-decoration: none; }
.o2f-cats a:hover { background: var(--o2f-soft); color: var(--o2f-accent); }

/* ---------- Всплывающая кнопка «Показать N» ---------- */
.o2f-pop { position: absolute; z-index: 60; display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 14px; background: var(--o2f-surface); border-radius: var(--o2f-r); box-shadow: 0 8px 28px rgba(0, 0, 0, .18), 0 0 0 1px var(--o2f-line); white-space: nowrap; animation: o2f-pop .22s ease-out; transition: top .4s cubic-bezier(.22, .61, .36, 1), --o2f-arrow .4s cubic-bezier(.22, .61, .36, 1); }
.o2f-pop.is-instant { transition: none; }
.o2f-pop[hidden] { display: none; }
/* Стрелка едет вместе с кнопкой, а не перескакивает. */
@property --o2f-arrow { syntax: "<length>"; inherits: true; initial-value: 20px; }
.o2f-pop::before { content: ""; position: absolute; left: -6px; top: var(--o2f-arrow, 50%); width: 12px; height: 12px; background: var(--o2f-surface); box-shadow: -1px 1px 0 var(--o2f-line); transform: translateY(-50%) rotate(45deg); }
.o2f-pop.is-left::before { left: auto; right: -6px; box-shadow: 1px -1px 0 var(--o2f-line); }
.o2f-pop__text { position: relative; color: var(--o2f-text); font-size: calc(var(--o2f-fs) - 1px); }
.o2f-pop__text b { color: var(--o2f-title); }
button.o2f-pop__btn,
button.o2f__submit { position: relative; display: inline-flex; align-items: center; justify-content: center; height: 36px; padding: 0 16px; border-radius: var(--o2f-r); background: var(--o2f-accent); color: var(--o2f-on-accent); font-weight: 600; text-align: center; cursor: pointer; }
button.o2f-pop__btn:hover,
button.o2f__submit:hover { filter: brightness(.92); }
button.o2f__submit[disabled] { opacity: .55; cursor: default; filter: none; }
.o2f-pop.is-loading .o2f-pop__text { opacity: .5; }
.o2f-pop.is-empty button.o2f-pop__btn { background: var(--o2f-line); color: var(--o2f-muted); cursor: default; }
@keyframes o2f-pop { from { opacity: 0; transform: translateX(-6px); } to { opacity: 1; transform: none; } }

/* Подача «Кнопка внизу панели» вместо всплывающей */
.o2f-apply-bar .o2f-pop { display: none !important; }
@media (min-width: 1025px) {
	.o2f-apply-bar .o2f__foot { display: block; position: sticky; bottom: 0; z-index: 2; padding: 12px var(--o2f-px); border-top: 1px solid var(--o2f-line); background: var(--o2f-surface); border-radius: 0 0 var(--o2f-radius) var(--o2f-radius); }
	.o2f-apply-bar button.o2f__submit { width: 100%; height: 42px; }
	.o2f-apply-bar.o2f-panel-flat .o2f__foot,
	.o2f-apply-bar.o2f-panel-sections .o2f__foot { padding-left: 0; padding-right: 0; border-top: 0; background: transparent; }
}

/* Загрузка списка товаров */
[data-ok2shop-results] { transition: opacity .15s; }
[data-ok2shop-results].is-loading { opacity: .45; pointer-events: none; }

/* ---------- Размещение на десктопе: справа, сверху ---------- */
@media (min-width: 1025px) {
	.o2f-place-right .ok2shop-layout { grid-template-columns: minmax(0, 1fr) var(--o2fs-side, 270px); }
	.o2f-place-right .ok2shop-sidebar { order: 2; }

	/* Сверху: строка «таблеток», значения — в выпадающих окнах */
	.o2f-place-top .ok2shop-layout { grid-template-columns: minmax(0, 1fr); gap: 20px; }
	.o2f-place-top .ok2shop-sidebar { position: relative; z-index: 30; max-height: none; overflow: visible; }
	.o2f-place-top .o2f { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; }
	.o2f-place-top .o2f__head { order: 3; margin-left: auto; padding: 0; border: 0; }
	.o2f-place-top .o2f__title,
	.o2f-place-top .o2f__head .o2f-badge { display: none; }
	.o2f-place-top .o2f__body { flex-direction: row; flex-wrap: wrap; gap: 8px; }
	.o2f-place-top .o2f__chips,
	.o2f-place-top .o2f__foot { display: none !important; }
	.o2f-place-top .o2f-sec,
	.o2f-place-top .o2f-sec:last-child { position: relative; border: 0; background: none; overflow: visible; }
	.o2f-place-top button.o2f-sec__head { width: auto; min-height: 38px; padding: 0 14px; border: 1px solid var(--o2f-line); border-radius: 999px; background: var(--o2f-surface); }
	.o2f-place-top.o2f-chip-rounded button.o2f-sec__head { border-radius: var(--o2f-r); }
	.o2f-place-top button.o2f-sec__head:hover,
	.o2f-place-top .o2f-sec.is-open button.o2f-sec__head { border-color: var(--o2f-accent); background: var(--o2f-surface); color: var(--o2f-title); }
	.o2f-place-top button.o2f-sec__head:has(.o2f-sec__count:not([hidden])) { border-color: var(--o2f-accent); background: var(--o2f-tint); }
	.o2f-place-top .o2f-sec__body { position: absolute; top: calc(100% + 8px); left: 0; z-index: 40; width: 300px; max-height: 440px; overflow-y: auto; padding: 14px 16px 0; background: var(--o2f-surface); border: 1px solid var(--o2f-line); border-radius: var(--o2f-radius); box-shadow: 0 12px 36px rgba(0, 0, 0, .14); }
	.o2f-place-top .o2f-sec[data-o2f-price] .o2f-sec__body { width: 320px; }
	.o2f-place-top .o2f-sec.is-flip .o2f-sec__body { left: auto; right: 0; }
	.o2f-place-top .o2f-sec__foot { position: sticky; bottom: 0; display: flex; gap: 8px; margin: 12px -16px 0; padding: 12px 16px; border-top: 1px solid var(--o2f-line); background: var(--o2f-surface); }
	.o2f-place-top .o2f-sec__foot button.o2f__submit { flex: 1; }
	.o2f-place-top .o2f-pop { display: none !important; }
	.o2f-place-top .o2f:not(.is-all) .o2f-sec.is-overflow:not(:has(.o2f-sec__count:not([hidden]))) { display: none; }
	.o2f-place-top button.o2f-all { display: inline-flex; align-items: center; min-height: 38px; padding: 0 14px; border: 1px dashed var(--o2f-line); border-radius: 999px; background: none; color: var(--o2f-accent); font-weight: 600; cursor: pointer; }
	.o2f-place-top.o2f-chip-rounded button.o2f-all { border-radius: var(--o2f-r); }
	.o2f-place-top button.o2f-all:hover { border-color: var(--o2f-accent); background: var(--o2f-tint); color: var(--o2f-accent); }
}
button.o2f-all { display: none; }
.o2f-sec__foot { display: none; }

/* ---------- Мобильная версия: выезжающая панель ---------- */
button.o2f-trigger { display: none; align-items: center; gap: 8px; height: 44px; padding: 0 18px; margin: 0 0 16px; border: 1px solid var(--o2f-line); border-radius: var(--o2f-r); background: var(--o2f-surface); color: var(--o2f-title); font-weight: 600; cursor: pointer; }
.o2f-backdrop { position: fixed; inset: 0; z-index: 9998; background: rgba(0, 0, 0, .4); }
.o2f-backdrop[hidden] { display: none; }

@media (max-width: 1024px) {
	button.o2f-trigger { display: inline-flex; }
	.o2f { position: fixed; z-index: 9999; top: 0; bottom: 0; left: 0; width: min(420px, 92vw); border: 0; border-radius: 0; background: var(--o2f-surface); transform: translateX(-105%); transition: transform .25s ease; }
	.o2f.is-open { transform: none; box-shadow: 0 0 40px rgba(0, 0, 0, .25); }
	.o2f-panel-flat .o2f,
	.o2f-panel-sections .o2f { --o2f-px: 16px; background: var(--o2f-surface); }
	.o2f-panel-sections .o2f__head { padding: 14px 16px; border-bottom: 1px solid var(--o2f-line); }
	.o2f-panel-sections .o2f__body { padding: 10px; }
	button.o2f__close { display: inline-flex; align-items: center; justify-content: center; }
	.o2f__body { flex: 1; overflow-y: auto; overscroll-behavior: contain; }
	.o2f__foot { display: block; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--o2f-line); background: var(--o2f-surface); }
	button.o2f__submit { width: 100%; height: 48px; font-size: 15px; }
	.o2f-pop { display: none !important; }
	body.o2f-locked { overflow: hidden; }

	/* Справа */
	.o2f-mobile-right .o2f { left: auto; right: 0; transform: translateX(105%); }
	.o2f-mobile-right .o2f.is-open { transform: none; }

	/* Шторка снизу */
	.o2f-mobile-sheet .o2f { top: auto; left: 0; right: 0; width: 100%; max-height: 88vh; border-radius: 18px 18px 0 0; transform: translateY(105%); }
	.o2f-mobile-sheet .o2f.is-open { transform: none; }
	.o2f-mobile-sheet .o2f__head { position: relative; padding-top: 22px; }
	.o2f-mobile-sheet .o2f__head::before { content: ""; position: absolute; top: 8px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 2px; background: var(--o2f-line); }

	/* Плавающая кнопка «Фильтры» внизу экрана (над нижней панелью темы) */
	.o2f-trigger-float button.o2f-trigger { position: fixed; z-index: 9990; left: 50%; bottom: calc(78px + env(safe-area-inset-bottom)); margin: 0; padding: 0 22px; border: 0; border-radius: 999px; background: var(--o2f-accent); color: var(--o2f-on-accent); box-shadow: 0 8px 24px rgba(0, 0, 0, .22); transform: translateX(-50%); }
	.o2f-trigger-float button.o2f-trigger .o2f-badge { background: var(--o2f-on-accent); color: var(--o2f-accent); }
	.o2f-trigger-float.o2f-locked button.o2f-trigger,
	body.o2f-locked button.o2f-trigger { display: none; }
}

@media (prefers-reduced-motion: reduce) {
	.o2f, .o2f *, .o2f-pop { transition: none !important; animation: none !important; }
}

/* Ленивая секция: догрузка скрытых значений. */
.o2f-sec.is-loading .o2f-more, .o2f-sec.is-loading .o2f-search { opacity: .55; pointer-events: none; }
