.wp-block-wlc-algolia-autocomplete__editor {
	padding: 20px;
	border: 1px dashed #ddd;
	border-radius: 8px;
	background: #fafafa;

	h3 {
		margin: 0 0 16px;
		font-size: 18px;
		font-weight: 600;
	}

}

.wp-block-wlc-algolia-autocomplete__editor-header {
	margin-bottom: 24px;
}

.wp-block-wlc-algolia-autocomplete__editor-header-top {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px;
	flex-wrap: wrap;
}

.wp-block-wlc-algolia-autocomplete__template-switch {
	min-width: 260px;
	max-width: 360px;
	flex: 1 1 280px;

	.components-base-control {
		margin-bottom: 0 !important;
	}
}

.wp-block-wlc-algolia-autocomplete__editor-preview {
	margin-top: 16px;
}

.wp-block-wlc-algolia-autocomplete__editor-template-blocks {
	min-height: 40px;
	border-radius: 8px;
	background: #fafafa;
	padding: 16px;

	.block-editor-block-list__layout {
		display: flex;
		flex-direction: column;
		gap: 8px;
		padding-bottom: 8px;
	}

	// Hide actual rendered template blocks in the editor panel.
	// We control selection/order via custom list UI.
	.block-editor-block-list__layout > *:not(.block-list-appender) {
		display: none !important;
	}

	.block-editor-block-list__layout > .block-list-appender {
		display: block;
	}

	// Match Search Page appender behavior/appearance and avoid overflow.
	.block-list-appender {
		width: 100%;
		margin-top: 16px !important;
		position: relative;
		z-index: 0;

		.block-editor-button-block-appender {
			width: 100% !important;
			display: flex !important;
			justify-content: center !important;
			align-items: center !important;
			border: 2px dashed #0073aa !important;
			border-radius: 4px !important;
			padding: 16px !important;
			background: #fff !important;
			color: #0073aa !important;
			font-size: 14px !important;
			font-weight: 500 !important;
			cursor: pointer !important;
			transition: all 0.15s ease !important;
			min-height: 48px !important;
			position: relative !important;
			margin: 0 !important;
		}
	}
}

.wp-block-wlc-algolia-search-page-v2__editor-layout {
	display: grid;
	grid-template-columns: minmax(0, 340px) minmax(0, 1fr);
	gap: 20px;
	min-width: 0;
}

.wp-block-wlc-algolia-search-page-v2__editor-panel {
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	background: #fafafa;
	padding: 16px;
	min-width: 0;
	overflow: hidden;
}

.wp-block-wlc-algolia-search-page-v2__editor-panel-title {
	margin: 0 0 12px 0;
	font-size: 14px;
	font-weight: 600;
	color: #1e1e1e;
}

.wp-block-wlc-algolia-search-page-v2__editor-search {
	margin-bottom: 12px;
}

.wp-block-wlc-algolia-search-page-v2__editor-search-input {
	width: 100%;
	padding: 8px 12px;
	border: 1px solid #ddd;
	border-radius: 4px;
	font-size: 13px;
	background: #fff;
}

.wp-block-wlc-algolia-search-page-v2__editor-hint {
	font-size: 12px;
	color: #757575;
	margin-bottom: 12px;
	line-height: 1.5;
}

.wp-block-wlc-algolia-search-page-v2__editor-field-list {
	max-height: 400px;
	overflow-y: auto;
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding-right: 4px;
}

.wp-block-wlc-algolia-search-page-v2__editor-field-item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 10px 12px;
	border: 1px solid #e0e0e0;
	border-radius: 6px;
	background: #fff;
}

.wp-block-wlc-algolia-search-page-v2__editor-field-info {
	flex: 1;
	min-width: 0;
	overflow: hidden;
}

.wp-block-wlc-algolia-search-page-v2__editor-field-path {
	font-size: 12px;
	font-weight: 600;
	color: #1e1e1e;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace;
}

.wp-block-wlc-algolia-search-page-v2__editor-template-list {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-bottom: 12px;
}

.wp-block-wlc-algolia-search-page-v2__editor-template-item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 8px 10px;
	border: 1px solid #e0e0e0;
	border-radius: 6px;
	background: #fff;
	cursor: pointer;

	&.is-selected {
		border-color: #0073aa;
		background: #f0f6fc;
		box-shadow: 0 0 0 1px #0073aa;
	}
}

.wp-block-wlc-algolia-search-page-v2__editor-template-item-info {
	flex: 1;
	min-width: 0;
}

.wp-block-wlc-algolia-search-page-v2__editor-template-item-title {
	font-size: 12px;
	font-weight: 600;
	color: #1e1e1e;
}

.wp-block-wlc-algolia-search-page-v2__editor-template-item-meta {
	font-size: 11px;
	color: #757575;
	font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.wp-block-wlc-algolia-search-page-v2__editor-template-item-actions {
	display: flex;
	align-items: center;
	gap: 6px;
}
