/* Sheet UI — только мобилка; десктоп без изменений поведения */

.brands-dropdown__sheet-head,
.brands-dropdown__search-wrap,
.brands-dropdown__backdrop {
	display: none;
}

@media (max-width: 768px) {
	body.brands-sheet-open {
		overflow: hidden;
		touch-action: none;
	}

	/* нижняя навигация перекрывала последний бренд — прячем на время sheet */
	body.brands-sheet-open .m-fixed-bottom-nav,
	body.brands-sheet-open .js-mobile-fixed-nav,
	body.brands-sheet-open .js-product-fixed-cart {
		visibility: hidden !important;
		pointer-events: none !important;
	}

	.brands-dropdown__backdrop {
		display: block;
		position: fixed;
		inset: 0;
		z-index: 1300;
		background: rgba(0, 0, 0, 0.45);
		opacity: 0;
		pointer-events: none;
		transition: opacity 0.2s ease;
	}

	.brands-dropdown__backdrop.active {
		opacity: 1;
		pointer-events: auto;
	}

	.brands-dropdown__content {
		position: fixed !important;
		left: 0 !important;
		right: 0 !important;
		bottom: 0 !important;
		top: auto !important;
		width: 100% !important;
		max-width: none !important;
		max-height: min(85vh, 680px) !important;
		margin: 0 !important;
		border: none !important;
		border-radius: 16px 16px 0 0 !important;
		box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.2) !important;
		z-index: 1301 !important;
		display: none;
		flex-direction: column;
		padding: 0;
		overflow: hidden;
		transform: translateY(12px);
		background: var(--body-bg-color, #fff);
	}

	.brands-dropdown__content.active {
		display: flex !important;
		opacity: 1 !important;
		transform: translateY(0) !important;
		padding-bottom: max(16px, env(safe-area-inset-bottom, 0px)) !important;
	}

	.brands-dropdown__sheet-head {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 12px;
		padding: 14px 16px 8px;
		flex: 0 0 auto;
	}

	.brands-dropdown__sheet-title {
		font-size: 16px;
		font-weight: 700;
		line-height: 1.2;
	}

	.brands-dropdown__sheet-close {
		appearance: none !important;
		-webkit-appearance: none !important;
		display: inline-flex !important;
		align-items: center !important;
		justify-content: center !important;
		box-sizing: border-box !important;
		flex: 0 0 40px !important;
		width: 40px !important;
		height: 40px !important;
		min-width: 40px !important;
		min-height: 40px !important;
		max-width: 40px !important;
		max-height: 40px !important;
		padding: 0 !important;
		margin: 0 !important;
		border: none !important;
		border-radius: 10px !important;
		background: rgba(0, 0, 0, 0.06) !important;
		box-shadow: none !important;
		font-size: 26px !important;
		font-weight: 400 !important;
		line-height: 1 !important;
		color: inherit !important;
		cursor: pointer;
		position: relative;
		z-index: 2;
		-webkit-tap-highlight-color: transparent;
	}

	.dark-theme .brands-dropdown__sheet-close {
		background: rgba(255, 255, 255, 0.12) !important;
	}

	.brands-dropdown__search-wrap {
		display: block;
		padding: 0 16px 10px;
		flex: 0 0 auto;
	}

	.brands-dropdown__search {
		width: 100%;
		height: 44px;
		border: 1px solid var(--input-border-color, #e0e0e0);
		border-radius: 10px;
		padding: 0 12px;
		font-size: 16px;
		background: var(--input-bg-color, #fff);
		color: inherit;
		box-sizing: border-box;
	}

	.brands-dropdown__section {
		flex: 1 1 auto;
		min-height: 0;
		overflow: auto;
		-webkit-overflow-scrolling: touch;
		display: block !important;
	}

	.brands-dropdown__content.active .brands-dropdown__section {
		display: block !important;
	}

	.brands-dropdown__list {
		display: flex !important;
		flex-direction: column !important;
		flex-wrap: nowrap !important;
		gap: 0 !important;
		/* запас снизу, чтобы последний бренд полностью влезал при скролле */
		padding: 0 8px 48px !important;
		justify-content: flex-start !important;
	}

	.brands-dropdown__item {
		display: block !important;
		width: 100% !important;
		min-width: 0 !important;
		max-width: none !important;
		flex: none !important;
		text-align: left !important;
		white-space: normal !important;
		overflow: visible !important;
		text-overflow: unset !important;
		padding: 14px 12px !important;
		border: none !important;
		border-bottom: 1px solid rgba(0, 0, 0, 0.08) !important;
		border-radius: 0 !important;
		background: transparent !important;
		font-size: 15px !important;
		line-height: 1.35 !important;
	}

	.dark-theme .brands-dropdown__item {
		border-bottom-color: rgba(255, 255, 255, 0.1) !important;
		background: transparent !important;
	}

	.dark-theme .brands-dropdown__search {
		background: var(--input-bg-color);
		border-color: var(--input-border-color);
		color: var(--body-text-color);
	}

	.brands-dropdown__empty {
		padding: 20px 12px;
		text-align: center;
	}
}
