/**
 * RD Taxonomy Dropdown Filter for Elementor
 * Only applies to widgets with class rd_custom_selectfilter
 * Colors: field bg #FFFFFF, border/divider #DDDDDD, text #444444, hover/active #B08D57
 * Item normal: bg #FFFFFF, text #444444. Item hover/active: bg #B08D57 (transparent), text #111111
 * No border-radius anywhere.
 */

/* Reset default taxonomy filter layout when using custom dropdown */
.rd_custom_selectfilter .e-filter {
	--e-filter-display: block;
	--e-filter-direction: column;
	--e-filter-wrap: nowrap;
	--e-filter-space-between: 0;
	display: block;
	position: relative;
	width: 100%;
}

/* Trigger bar (main field) */
.rd_custom_selectfilter .rd-dropdown-trigger {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	min-height: 44px;
	padding: 10px 14px;
	background-color: #FFFFFF;
	border: 1px solid #DDDDDD;
	color: #444444;
	cursor: pointer;
	box-sizing: border-box;
	border-radius: 0;
}

.rd_custom_selectfilter .rd-dropdown-trigger .rd-dropdown-label {
	flex: 1;
	text-align: left;
}

/* Icon (arrow) - class for custom styling */
.rd_custom_selectfilter .rd_custom_selectfilter_icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 20px;
	height: 20px;
	margin-left: 8px;
	flex-shrink: 0;
	color: #444444;
	transition: transform 0.2s ease;
}

.rd_custom_selectfilter.rd-dropdown-open .rd_custom_selectfilter_icon {
	transform: rotate(180deg);
}

/* Panel (dropdown content) */
.rd_custom_selectfilter .rd-dropdown-panel {
	display: none;
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	margin-top: 0;
	background: #FFFFFF;
	border: 1px solid #DDDDDD;
	border-top: none;
	max-height: 320px;
	overflow-y: auto;
	z-index: 1000;
	box-sizing: border-box;
	border-radius: 0;
}

.rd_custom_selectfilter.rd-dropdown-open .rd-dropdown-panel {
	display: block;
}

/* Original e-filter items: hidden from view when custom dropdown is active; we use them only for behavior */
.rd_custom_selectfilter .e-filter.rd-dropdown-items-source {
	position: absolute;
	left: -9999px;
	opacity: 0;
	pointer-events: none;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* Items in our dropdown (desktop: list; mobile: accordion) */
.rd_custom_selectfilter .rd-dropdown-item,
.rd_custom_selectfilter .rd-dropdown-item-parent {
	display: block;
	width: 100%;
	padding: 10px 14px;
	background-color: #FFFFFF;
	color: #444444;
	text-align: left;
	cursor: pointer;
	border: none;
	border-bottom: 1px solid #DDDDDD;
	box-sizing: border-box;
	transition: background-color 0.15s ease, color 0.15s ease;
	border-radius: 0;
}

.rd_custom_selectfilter .rd-dropdown-item:last-child,
.rd_custom_selectfilter .rd-dropdown-item-parent:last-child {
	border-bottom: none;
}

.rd_custom_selectfilter .rd-dropdown-item:hover,
.rd_custom_selectfilter .rd-dropdown-item-parent:hover,
.rd_custom_selectfilter .rd-dropdown-item.rd-active,
.rd_custom_selectfilter .rd-dropdown-item-parent.rd-active {
	background-color: rgba(176, 141, 87, 0.2);
	color: #111111;
}

/* Typography classes - default inherit, allow custom override */
.rd_custom_selectfilter .rd_custom_selectfilter_parenttxt {
	/* Inherit site typography by default */
}

.rd_custom_selectfilter .rd_custom_selectfilter_childtxt {
	/* Inherit site typography by default */
}

/* All devices: accordion only (no flyout submenu) */
.rd_custom_selectfilter .rd-dropdown-submenu {
	display: none !important;
}

.rd_custom_selectfilter .rd-dropdown-accordion-item {
		border-bottom: 1px solid #DDDDDD;
	}

	.rd_custom_selectfilter .rd-dropdown-accordion-header,
	.rd_custom_selectfilter .rd-dropdown-parent-inner {
		display: flex;
		align-items: center;
		justify-content: space-between;
		width: 100%;
		padding: 10px 14px;
		background: #FFFFFF;
		color: #444444;
		border: none;
		cursor: pointer;
		text-align: left;
		box-sizing: border-box;
		border-radius: 0;
	}

	.rd_custom_selectfilter .rd-dropdown-accordion-header:hover,
	.rd_custom_selectfilter .rd-dropdown-accordion-header.rd-active,
	.rd_custom_selectfilter .rd-dropdown-parent-inner:hover {
		background-color: rgba(176, 141, 87, 0.2);
		color: #111111;
	}

	.rd_custom_selectfilter .rd-dropdown-accordion-children {
		display: none;
		background: #FFFFFF;
		border-top: 1px solid #DDDDDD;
	}

	.rd_custom_selectfilter .rd-dropdown-accordion-item.rd-open .rd-dropdown-accordion-children {
		display: block !important;
	}

	.rd_custom_selectfilter .rd-dropdown-accordion-children .rd-dropdown-item {
		padding-left: 24px;
		border-radius: 0;
	}

	.rd_custom_selectfilter .rd-dropdown-accordion-arrow {
		color: #444444;
		transition: transform 0.2s ease;
	}

	.rd_custom_selectfilter .rd-dropdown-accordion-item.rd-open .rd-dropdown-accordion-arrow {
		transform: rotate(180deg);
	}

/* Ensure no border-radius anywhere in this widget */
.rd_custom_selectfilter,
.rd_custom_selectfilter * {
	border-radius: 0 !important;
}
