/* Match UnitControl / .bm-field-input height (40px). */

.bm-searchable-select {
	position: relative;
	width: 100%;
	z-index: 0;
}

.bm-searchable-select:focus-within,
.bm-searchable-select.is-open {
	z-index: 20;
}

.bm-searchable-select-wrap {
	width: 100%;
}

/* Portaled menus — always on document.body via createPortal */
.bm-select-menu--fixed,
.bm-styled-select__list--portal {
	position: fixed !important;
	right: auto !important;
	min-width: 0 !important;
	visibility: visible !important;
	pointer-events: auto !important;
	z-index: 1000500 !important;
	margin: 0 !important;
	padding: 0 !important;
	overflow: hidden !important;
	list-style: none !important;
	box-sizing: border-box !important;
	border: 1px solid #d7d7e0 !important;
	border-radius: 8px !important;
	background: #fff !important;
	box-shadow: 0 8px 24px rgba(19, 27, 46, 0.12) !important;
	display: flex !important;
	flex-direction: column !important;
}

.bm-select-menu--fixed.is-drop-up,
.bm-styled-select__list--portal.is-drop-up {
	box-shadow: 0 -8px 24px rgba(19, 27, 46, 0.12) !important;
}

.bm-styled-select__search {
	flex: 0 0 auto;
	padding: 8px 8px 4px;
	border-bottom: 1px solid #e8e8ef;
	background: #fff;
}

.bm-styled-select__search-input {
	box-sizing: border-box !important;
	width: 100% !important;
	min-height: 36px !important;
	height: 36px !important;
	margin: 0 !important;
	padding: 0 10px !important;
	border: 1px solid #d7d7e0 !important;
	border-radius: 6px !important;
	background: #fff !important;
	box-shadow: none !important;
	font-size: 13px !important;
	line-height: 36px !important;
	color: #131b2e !important;
}

.bm-styled-select__search-input:focus {
	border-color: #3525cd !important;
	box-shadow: 0 0 0 1px #3525cd !important;
	outline: none !important;
}

.bm-styled-select__options {
	flex: 1 1 auto;
	min-height: 0;
	margin: 0 !important;
	padding: 4px 0 !important;
	overflow-x: hidden !important;
	overflow-y: auto !important;
	list-style: none !important;
}

.bm-styled-select__option {
	display: block;
	padding: 8px 12px !important;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	cursor: pointer;
	color: #131b2e;
}

.bm-styled-select__option:hover,
.bm-styled-select__option.is-selected {
	background: #eaedff !important;
	color: #131b2e !important;
}

.bm-styled-select__option.is-empty {
	cursor: default;
	color: #757575;
	font-style: italic;
}

.bm-styled-select__option.is-empty:hover {
	background: transparent !important;
}

.bm-styled-select__option.is-font-preview,
.bm-styled-select__value.is-font-preview {
	font-family: var(--bm-option-font-family, inherit) !important;
	font-size: 14px;
	letter-spacing: normal;
	text-transform: none;
}

/* Custom stylized select — same shell height as UnitControl */
.bm-searchable-select.is-styled-select {
	display: flex;
	flex-direction: column;
	gap: 0;
}

.bm-searchable-select.is-styled-select .components-base-control__label {
	display: inline-block;
	margin-bottom: 0;
	font-size: 11px;
	font-weight: 500;
	line-height: 1.4;
	text-transform: uppercase;
}

.bm-searchable-select.is-styled-select .bm-styled-select__shell {
	position: relative;
	width: 100%;
	z-index: 0;
	overflow: visible;
}

.bm-searchable-select.is-styled-select.is-open .bm-styled-select__shell {
	z-index: 30;
}

.bm-searchable-select.is-styled-select .bm-styled-select__toggle,
.joc-blockora-morph-app .bm-searchable-select.is-styled-select .bm-styled-select__toggle,
.bm-element-toolbar .bm-searchable-select.is-styled-select .bm-styled-select__toggle {
	position: relative !important;
	box-sizing: border-box !important;
	display: flex !important;
	align-items: center !important;
	width: 100% !important;
	min-width: 0 !important;
	min-height: 40px !important;
	height: 40px !important;
	max-height: 40px !important;
	margin: 0 !important;
	padding: 0 28px 0 12px !important;
	border: 1px solid #d7d7e0 !important;
	border-radius: 6px !important;
	background: #fff !important;
	background-image: none !important;
	box-shadow: none !important;
	font: inherit !important;
	font-size: 13px !important;
	font-weight: 400 !important;
	line-height: 1.25 !important;
	color: #131b2e !important;
	text-align: left !important;
	text-decoration: none !important;
	text-shadow: none !important;
	cursor: pointer !important;
	appearance: none !important;
	-webkit-appearance: none !important;
}

.bm-searchable-select.is-styled-select .bm-styled-select__toggle::after {
	content: '';
	position: absolute;
	top: 50%;
	right: 14px;
	width: 7px;
	height: 7px;
	margin-top: -5px;
	border-right: 2px solid #757575;
	border-bottom: 2px solid #757575;
	transform: rotate(45deg);
	pointer-events: none;
	transition: transform 0.15s ease, margin-top 0.15s ease, border-color 0.15s ease;
}

.bm-searchable-select.is-styled-select.is-open .bm-styled-select__toggle,
.bm-searchable-select.is-styled-select .bm-styled-select__toggle:focus {
	border-color: #3525cd !important;
	box-shadow: 0 0 0 1px #3525cd !important;
	outline: none !important;
}

.bm-searchable-select.is-styled-select.is-open .bm-styled-select__toggle::after {
	border-color: #3525cd;
	margin-top: -1px;
	transform: rotate(225deg);
}

.bm-searchable-select.is-styled-select.is-drop-up.is-open .bm-styled-select__toggle::after {
	margin-top: -5px;
	transform: rotate(45deg);
}

.bm-searchable-select.is-styled-select .bm-styled-select__value {
	display: block;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	min-width: 0;
	flex: 1 1 auto;
}

.bm-searchable-select.is-styled-select .components-base-control__help {
	margin-top: 4px;
	margin-bottom: 8px;
	font-size: 12px;
	color: #757575;
}

/* ---------- Spacing row: preset Select + UnitControl, same 40px baseline ---------- */

.bm-style-field__spacing-row {
	display: grid;
	grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
	gap: 8px;
	align-items: flex-start;
}

.bm-style-field__spacing-col {
	min-width: 0;
	display: flex;
	flex-direction: column;
	justify-content: center;
}

.bm-style-field__spacing-col .components-base-control,
.bm-style-field__spacing-col .components-base-control__field,
.bm-style-field__spacing-col .bm-searchable-select {
	margin-bottom: 0 !important;
}

.bm-style-field__spacing-col .components-base-control__label,
.bm-style-field__spacing-col .components-input-control__label,
.bm-style-field__spacing-col label:not(.components-a11y-text):not(.screen-reader-text) {
	display: none !important;
}

.bm-style-field__spacing-col--preset .bm-searchable-select {
	width: 100%;
}

.bm-style-field__spacing-col--unit .components-unit-control-wrapper,
.bm-style-field__spacing-col--unit .components-input-control,
.bm-style-field__spacing-col--unit .components-input-control__container {
	width: 100%;
	min-height: 40px !important;
	height: 40px !important;
}

.bm-style-field__spacing-col--unit .components-input-control__backdrop {
	border-radius: 6px !important;
}

.bm-box-spacing__row {
	display: grid;
	grid-template-columns: 28px minmax(0, 1fr);
	gap: 8px;
	align-items: center;
}

.bm-box-spacing__axis-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 40px;
	min-height: 40px;
	margin-bottom: 0;
	color: #50575e;
}
