/**
 * Брендовый фильтр MPKM v2 — панель-«toolbar», без тяжёлой «коробки» каталога.
 * Только body.page-shop-brand
 */

body.page-shop-brand .mpkm-brand-toolbar {
	--t-bg: rgba(255, 255, 255, 0.92);
	--t-line: rgba(24, 95, 165, 0.14);
	--t-accent: #185fa5;
	--t-muted: #64748b;
	margin: 0 0 0.85rem;
	padding: 0;
	font-size: 14px;
	color: #0f172a;
}

body.page-shop-brand .mpkm-brand-toolbar__form {
	margin: 0;
	padding: 0.5rem 0 0.65rem;
	background: transparent;
	border: 0;
	border-bottom: 1px solid var(--t-line);
	border-radius: 0;
	box-shadow: none;
}

body.page-shop-brand .mpkm-brand-toolbar__row {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: 0.55rem 0.75rem;
}

body.page-shop-brand .mpkm-brand-toolbar__row--main {
	margin-bottom: 0.35rem;
}

body.page-shop-brand .mpkm-brand-toolbar__row--meta {
	padding-top: 0.45rem;
	margin-top: 0.15rem;
	border-top: 0;
	align-items: flex-end;
}

body.page-shop-brand .mpkm-brand-toolbar__group {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: 0.35rem 0.45rem;
	min-width: 0;
}

body.page-shop-brand .mpkm-brand-toolbar__group--price {
	flex: 1 1 11rem;
}

body.page-shop-brand .mpkm-brand-toolbar__group--chips {
	flex: 3 1 16rem;
}

body.page-shop-brand .mpkm-brand-toolbar__group--actions {
	flex: 0 0 auto;
	margin-left: auto;
	gap: 0.4rem;
}

body.page-shop-brand .mpkm-brand-toolbar__group--sort {
	flex: 2 1 12rem;
	min-width: 10rem;
}

body.page-shop-brand .mpkm-brand-toolbar__group--per {
	flex: 0 0 auto;
	min-width: 6.5rem;
}

body.page-shop-brand .mpkm-brand-toolbar__label {
	display: block;
	font-size: 0.58rem;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--t-muted);
	margin-bottom: 0.12rem;
	width: 100%;
}

body.page-shop-brand .mpkm-brand-toolbar__field {
	display: flex;
	flex-direction: column;
	min-width: 0;
	flex: 1 1 auto;
}

body.page-shop-brand .mpkm-brand-toolbar__price-inputs {
	display: inline-flex;
	align-items: center;
	gap: 0.25rem;
	flex-wrap: wrap;
}

body.page-shop-brand .mpkm-brand-toolbar__input {
	width: 4.1rem;
	max-width: 100%;
	padding: 0.28rem 0.4rem;
	border: 1px solid rgba(148, 163, 184, 0.55);
	border-radius: 6px;
	font-size: 0.8rem;
	background: var(--t-bg);
	color: #0f172a;
	box-sizing: border-box;
	transition: border-color 0.12s, box-shadow 0.12s;
}

body.page-shop-brand .mpkm-brand-toolbar__input:focus {
	outline: none;
	border-color: #5b9bd5;
	box-shadow: 0 0 0 2px rgba(24, 95, 165, 0.1);
}

body.page-shop-brand .mpkm-brand-toolbar__dash {
	color: #94a3b8;
	font-weight: 600;
	font-size: 0.75rem;
	user-select: none;
}

body.page-shop-brand .mpkm-brand-toolbar__chip {
	display: inline-flex;
	align-items: center;
	gap: 0.22rem;
	margin: 0;
	padding: 0.22rem 0.48rem;
	border-radius: 999px;
	border: 1px solid rgba(148, 163, 184, 0.45);
	background: var(--t-bg);
	font-size: 0.72rem;
	font-weight: 600;
	color: #475569;
	cursor: pointer;
	user-select: none;
	transition: border-color 0.12s, background 0.12s, color 0.12s;
}

body.page-shop-brand .mpkm-brand-toolbar__chip input {
	margin: 0;
	width: 0.78rem;
	height: 0.78rem;
	accent-color: var(--t-accent);
	flex-shrink: 0;
}

body.page-shop-brand .mpkm-brand-toolbar__chip:has(input:checked) {
	border-color: rgba(24, 95, 165, 0.45);
	background: rgba(24, 95, 165, 0.06);
	color: #0c447c;
}

body.page-shop-brand .mpkm-brand-toolbar__apply {
	font-size: 0.74rem;
	font-weight: 700;
	padding: 0.32rem 0.75rem;
	border-radius: 7px;
	border: 0;
	background: var(--t-accent);
	color: #fff;
	cursor: pointer;
	transition: filter 0.12s, transform 0.08s;
}

body.page-shop-brand .mpkm-brand-toolbar__apply:hover {
	filter: brightness(1.06);
}

body.page-shop-brand .mpkm-brand-toolbar__apply:active {
	transform: translateY(1px);
}

body.page-shop-brand .mpkm-brand-toolbar__reset {
	font-size: 0.72rem;
	font-weight: 600;
	color: var(--t-accent);
	text-decoration: none;
	white-space: nowrap;
	padding: 0.32rem 0.15rem;
}

body.page-shop-brand .mpkm-brand-toolbar__reset:hover {
	text-decoration: underline;
}

body.page-shop-brand .mpkm-brand-toolbar__select {
	width: 100%;
	max-width: 100%;
	padding: 0.28rem 0.42rem;
	border: 1px solid rgba(148, 163, 184, 0.55);
	border-radius: 7px;
	font-size: 0.76rem;
	background: var(--t-bg);
	color: #1e293b;
	cursor: pointer;
}

body.page-shop-brand .mpkm-brand-toolbar__select:focus {
	outline: none;
	border-color: #5b9bd5;
	box-shadow: 0 0 0 2px rgba(24, 95, 165, 0.08);
}

body.page-shop-brand .mpkm-brand-toolbar__group--per .mpkm-brand-toolbar__select {
	max-width: 5.5rem;
}

@media (max-width: 720px) {
	body.page-shop-brand .mpkm-brand-toolbar__group--actions {
		margin-left: 0;
		width: 100%;
		justify-content: flex-start;
	}
}

/* Скрыть возможные остатки старого блока с теми же семействами классов */
body.page-shop-brand .mpkm-brand-filter {
	display: none !important;
}

/* Панель сортировки (без цены / чекбоксов / старой формы каталога) */
body.page-shop-brand .mpkm-brand-sortbar {
	margin: 0 0 0.85rem;
	padding: 0.55rem 0 0.65rem;
	border-bottom: 1px solid rgba(24, 95, 165, 0.14);
	font-size: 14px;
	color: #0f172a;
}

body.page-shop-brand .mpkm-brand-tradehead .mpkm-brand-sortbar {
	margin-bottom: 0;
	padding: 0.35rem 0 0.15rem;
	border-bottom: 0;
}

body.page-shop-brand .mpkm-brand-sortbar__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: 0.65rem 1rem;
}

body.page-shop-brand .mpkm-brand-sortbar__inner--pills-only {
	align-items: center;
	justify-content: flex-start;
	gap: 0.4rem 0.55rem;
}

body.page-shop-brand .mpkm-brand-sortbar__label-row {
	flex: 1 1 100%;
	display: flex;
	flex-direction: row;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.2rem 0.45rem;
}

body.page-shop-brand .mpkm-brand-sortbar__label-row--compact {
	flex: 0 1 auto;
	min-width: min(100%, 12rem);
}

body.page-shop-brand .mpkm-brand-sortbar__default-note {
	font-size: 0.72rem;
	font-weight: 600;
	color: #475569;
	margin-left: 0.15rem;
}

body.page-shop-brand .mpkm-brand-sortbar__default-note strong {
	color: #0c447c;
	font-weight: 800;
}

body.page-shop-brand .mpkm-brand-toolbar-unified .mpkm-brand-sortbar__inner {
	align-items: center;
	flex-wrap: wrap;
	justify-content: flex-start;
	gap: 0.45rem 0.65rem;
}

@media (max-width: 900px) {
	body.page-shop-brand .mpkm-brand-toolbar-unified .mpkm-brand-sortbar__inner {
		flex-wrap: wrap;
	}
}

body.page-shop-brand .mpkm-brand-toolbar-unified .mpkm-brand-sortbar__label-row {
	flex: 1 0 100%;
	width: 100%;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.25rem 0.55rem;
}

body.page-shop-brand .mpkm-brand-toolbar-unified .mpkm-brand-sortbar__label-row--compact .mpkm-brand-sortbar__default-note {
	margin-left: 0;
	margin-top: 0;
}

body.page-shop-brand .mpkm-brand-toolbar-unified .mpkm-brand-sortbar__pills {
	flex: 1 1 auto;
	min-width: min(100%, 12rem);
}

body.page-shop-brand .mpkm-brand-toolbar-unified .mpkm-brand-sortbar__per {
	display: none !important;
}

body.page-shop-brand .mpkm-brand-toolbar-unified .mpkm-brand-sortbar {
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
}

body.page-shop-brand .mpkm-brand-toolbar-unified .mpkm-brand-sortbar__pill--active {
	font-weight: 800;
	letter-spacing: -0.01em;
}

body.page-shop-brand .mpkm-brand-toolbar-unified .mpkm-brand-sortbar__pills .mpkm-brand-sortbar__pill:first-of-type {
	font-size: 0.82rem;
}

body.page-shop-brand .mpkm-brand-sortbar__title {
	display: inline-block;
	font-size: 0.62rem;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: #64748b;
}

body.page-shop-brand .mpkm-brand-sortbar__current {
	display: inline-block;
	margin-left: 0.45rem;
	font-size: 0.82rem;
	font-weight: 800;
	color: #0c447c;
	letter-spacing: -0.02em;
}

body.page-shop-brand .mpkm-brand-sortbar__label-row .mpkm-brand-sortbar__hint {
	display: inline;
	margin-left: 0.35rem;
	margin-top: 0;
	font-size: 0.68rem;
	font-weight: 600;
	color: #94a3b8;
}

body.page-shop-brand .mpkm-brand-sortbar__pills {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.35rem 0.45rem;
	flex: 1 1 16rem;
	min-width: 0;
}

body.page-shop-brand .mpkm-brand-sortbar__pill {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.58rem 1rem;
	border-radius: 999px;
	border: 1px solid #e2e8f0;
	background: #ffffff;
	font-size: 0.95rem;
	font-weight: 600;
	min-height: 42px;
	color: #4a5568;
	text-decoration: none;
	white-space: nowrap;
	max-width: 100%;
	transition: all 0.15s ease;
}

body.page-shop-brand .mpkm-brand-sortbar__pill:hover {
	border-color: #fecc2f;
	background: #fffdf5;
	color: #1a202c;
	transform: translateY(-1px);
}

body.page-shop-brand .mpkm-brand-sortbar__pill--active {
	border-color: #fecc2f;
	background: linear-gradient(180deg, #fecc2f 0%, #fcd34d 100%);
	color: #1a202c;
	box-shadow: 0 2px 8px rgba(254, 204, 47, 0.35);
	font-weight: 600;
}

/* «По популярности» — главный режим по умолчанию */
body.page-shop-brand .mpkm-brand-sortbar__pill--popular {
	font-weight: 500;
}

body.page-shop-brand .mpkm-brand-sortbar__pill--popular.mpkm-brand-sortbar__pill--active {
	font-weight: 600;
	font-size: 0.85rem;
	padding: 0.4rem 0.85rem;
	border-width: 1px;
	border-color: #fecc2f;
	background: linear-gradient(180deg, #fecc2f 0%, #fcd34d 100%);
	box-shadow: 0 2px 8px rgba(254, 204, 47, 0.35);
}

body.page-shop-brand .mpkm-brand-sortbar__per {
	display: none !important;
}

body.page-shop-brand .mpkm-brand-sortbar__per-field {
	display: none !important;
}

body.page-shop-brand .mpkm-brand-sortbar__per-lbl {
	font-size: 0.58rem;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: #64748b;
}

body.page-shop-brand .mpkm-brand-sortbar__per-select {
	padding: 0.28rem 0.42rem;
	border: 1px solid rgba(148, 163, 184, 0.55);
	border-radius: 7px;
	font-size: 0.76rem;
	background: #fff;
	color: #1e293b;
	cursor: pointer;
	max-width: 6rem;
}

@media (max-width: 560px) {
	body.page-shop-brand .mpkm-brand-sortbar__pill {
		font-size: 0.88rem;
		padding: 0.5rem 0.78rem;
		min-height: 38px;
	}

	body.page-shop-brand .mpkm-brand-sortbar__hint {
		display: none !important;
	}
}

/* Mobile: сортировка и «на странице» — отдельные строки, без растягивания */
@media (max-width: 900px) {
	body.page-shop-brand .mpkm-brand-toolbar-unified .mpkm-brand-sortbar__inner {
		flex-direction: column;
		align-items: stretch;
		gap: 0.4rem;
	}

	body.page-shop-brand .mpkm-brand-toolbar-unified .mpkm-brand-sortbar__pills {
		width: 100%;
		flex-wrap: wrap;
	}
}
