/* Soleman Popup Filter */

.spf-filter {
	position: relative;
	width: 100%;
}

.spf-filter__items {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.spf-layout-vertical .spf-filter__items {
	flex-direction: column;
	align-items: stretch;
}

.spf-layout-horizontal .spf-filter__items {
	flex-direction: row;
	align-items: center;
}

.spf-filter__item {
	position: relative;
}

.spf-filter__trigger {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 10px 16px;
	border: 1px solid #d0d5dd;
	border-radius: 6px;
	background: #fff;
	color: #344054;
	font-size: 14px;
	font-weight: 500;
	line-height: 1.4;
	cursor: pointer;
	transition: border-color 0.2s, box-shadow 0.2s, color 0.2s;
	white-space: nowrap;
}

.spf-filter__trigger:hover {
	border-color: #98a2b3;
}

.spf-filter__trigger--active,
.spf-filter__item--open .spf-filter__trigger {
	border-color: #1570ef;
	color: #1570ef;
	box-shadow: 0 0 0 3px rgba(21, 112, 239, 0.12);
}

.spf-filter__count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 20px;
	height: 20px;
	padding: 0 6px;
	border-radius: 10px;
	background: #1570ef;
	color: #fff;
	font-size: 12px;
	font-weight: 600;
	line-height: 1;
}

.spf-filter__count[hidden] {
	display: none !important;
}

.spf-filter__arrow {
	display: inline-block;
	width: 0;
	height: 0;
	margin-left: 2px;
	border-left: 4px solid transparent;
	border-right: 4px solid transparent;
	border-top: 5px solid currentColor;
	transition: transform 0.2s;
}

.spf-filter__item--open .spf-filter__arrow {
	transform: rotate(180deg);
}

.spf-filter__popup {
	position: absolute;
	top: calc(100% + 6px);
	left: 0;
	z-index: 100;
	min-width: 260px;
	max-width: 360px;
	max-height: 400px;
	border: 1px solid #e4e7ec;
	border-radius: 8px;
	background: #fff;
	box-shadow: 0 12px 16px -4px rgba(16, 24, 40, 0.08), 0 4px 6px -2px rgba(16, 24, 40, 0.03);
	overflow: hidden;
}

.spf-layout-vertical .spf-filter__popup {
	position: relative;
	top: 6px;
	width: 100%;
	max-width: none;
}

.spf-filter__popup-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 12px 16px;
	border-bottom: 1px solid #f2f4f7;
	background: #f9fafb;
}

.spf-filter__popup-title {
	font-size: 14px;
	font-weight: 600;
	color: #101828;
}

.spf-filter__clear {
	padding: 4px 10px;
	border: none;
	border-radius: 4px;
	background: transparent;
	color: #1570ef;
	font-size: 13px;
	font-weight: 500;
	cursor: pointer;
}

.spf-filter__clear:hover {
	background: rgba(21, 112, 239, 0.08);
}

.spf-filter__clear[hidden] {
	display: none !important;
}

.spf-filter__popup-body {
	max-height: 320px;
	overflow-y: auto;
	padding: 8px 0;
}

.spf-filter__terms {
	list-style: none;
	margin: 0;
	padding: 0;
}

.spf-filter__term {
	margin: 0;
	padding: 0;
}

.spf-filter__term-label {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 8px 16px 8px calc(16px + var(--spf-depth, 0) * 20px);
	cursor: pointer;
	font-size: 14px;
	color: #344054;
	transition: background 0.15s;
}

.spf-filter__term-label:hover {
	background: #f9fafb;
}

.spf-filter__checkbox {
	flex-shrink: 0;
	width: 16px;
	height: 16px;
	margin: 0;
	accent-color: #1570ef;
	cursor: pointer;
}

.spf-filter__term-name {
	flex: 1;
}

.spf-filter__term-count {
	color: #98a2b3;
	font-size: 12px;
}

.spf-filter__empty {
	margin: 0;
	padding: 16px;
	color: #667085;
	font-size: 14px;
	text-align: center;
}

.spf-filter__notice {
	padding: 16px;
	border: 1px dashed #d0d5dd;
	border-radius: 6px;
	color: #667085;
	font-size: 14px;
	text-align: center;
}

.spf-filter__overlay {
	display: none;
	position: fixed;
	inset: 0;
	z-index: 99;
	background: transparent;
}

.spf-filter__overlay--visible {
	display: block;
}

@media (max-width: 767px) {
	.spf-layout-horizontal .spf-filter__items {
		flex-wrap: nowrap;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: none;
	}

	.spf-layout-horizontal .spf-filter__items::-webkit-scrollbar {
		display: none;
	}

	.spf-filter__popup {
		position: fixed;
		top: auto;
		bottom: 0;
		left: 0;
		right: 0;
		max-width: none;
		max-height: 60vh;
		border-radius: 12px 12px 0 0;
	}
}

/* Debug panel */
.spf-debug__toggle {
	position: fixed;
	right: 16px;
	bottom: 16px;
	z-index: 99998;
	padding: 10px 14px;
	border: none;
	border-radius: 8px;
	background: #7f56d9;
	color: #fff;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.spf-debug {
	position: fixed;
	right: 16px;
	bottom: 64px;
	z-index: 99999;
	width: min(520px, calc(100vw - 32px));
	max-height: min(70vh, 640px);
	display: flex;
	flex-direction: column;
	border-radius: 10px;
	background: #101828;
	color: #e4e7ec;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
	overflow: hidden;
}

.spf-debug[hidden] {
	display: none !important;
}

.spf-debug__header {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 10px 12px;
	background: #1d2939;
	border-bottom: 1px solid #344054;
}

.spf-debug__badge {
	font-size: 11px;
	padding: 2px 6px;
	border-radius: 4px;
	background: #42307d;
	color: #d6bbfb;
}

.spf-debug__actions {
	margin-left: auto;
	display: flex;
	gap: 6px;
}

.spf-debug__btn {
	padding: 4px 8px;
	border: 1px solid #475467;
	border-radius: 6px;
	background: #344054;
	color: #f2f4f7;
	font-size: 12px;
	cursor: pointer;
}

.spf-debug__btn--close {
	font-size: 16px;
	line-height: 1;
	padding: 2px 8px;
}

.spf-debug__log {
	flex: 1;
	margin: 0;
	padding: 12px;
	overflow: auto;
	font-size: 11px;
	line-height: 1.45;
	white-space: pre-wrap;
	word-break: break-word;
	color: #d0d5dd;
}
