/* RPF Tree Selector Styles */

body .rpf-tree-selector-wrap {
	margin-bottom: 16px;
	background-color: #fff;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
	max-width: 320px;
	position: relative;
}

body .rpf-field-label {
	display: block;
	margin-bottom: 8px;
	font-weight: 600;
	font-size: 13px;
	color: #1d2327;
}

body .rpf-tree-selector__field {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 10px;
	width: 100%;
	min-height: 36px;
	padding: 8px 12px;
	border: 1px solid #c3c4c7;
	border-radius: 10px;
	background: #fff;
	cursor: pointer;
	transition: border-color 0.2s, box-shadow 0.2s;
	box-sizing: border-box;
}

body .rpf-tree-selector__field:hover {
	border-color: var(--rpf-primary);
}

body .rpf-tree-selector__field:focus,
body .rpf-tree-selector__field.is-open {
	outline: none;
	border-color: var(--rpf-primary);
	box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.1);
}

body .rpf-tree-selector__chips {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px;
	min-height: 20px;
	flex: 1;
	row-gap: 12px;
}

body .rpf-tree-selector__placeholder {
	color: #6b7280;
	font-size: 13px;
}

body .rpf-tree-selector__chip {
	display: inline-flex;
	align-items: center;
	padding: 2px 8px;
	border-radius: 999px;
	font-size: 12px;
	line-height: 1.5;
	background: #e8f2fb;
	border: 1px solid #cfe4f8;
	color: #164c76;
	white-space: nowrap;
	flex-shrink: 0;
}

body .rpf-tree-selector__city-group {
	display: flex;
	flex-direction: column;
	gap: 4px;
	width: 100%;
	padding-left: 8px;
}

body .rpf-tree-selector__city-group-title {
	display: block;
	font-size: 11px;
	font-weight: 600;
	color: #50575e;
	text-transform: uppercase;
	letter-spacing: 0.3px;
	padding: 0;
	margin-top: 2px;
}

body .rpf-tree-selector__city-chips {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 6px;
}

body .rpf-tree-selector__country-group {
	display: flex;
	flex-direction: column;
	gap: 6px;
	width: 100%;
	padding: 8px;
	background: #f5f9ff;
}

body .rpf-tree-selector__country-group-title {
	display: block;
	font-size: 12px;
	font-weight: 700;
	color: #164c76;
	text-transform: uppercase;
	letter-spacing: 0.4px;
	padding: 0;
}

body .rpf-tree-selector__country-group-content {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

body .rpf-tree-selector__field-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 18px;
	height: 18px;
	margin-top: 3px;
	flex-shrink: 0;
	transition: transform 0.2s ease;
	position: relative;
}

body .rpf-tree-selector__field-toggle::after {
	content: '';
	width: 16px;
	height: 16px;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M5 8l5 5 5-5' stroke='%236b7280' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-size: contain;
	background-repeat: no-repeat;
	background-position: center;
	display: block;
}

body .rpf-tree-selector__field.is-open .rpf-tree-selector__field-toggle {
	transform: rotate(180deg);
}

body .rpf-tree-selector__dropdown {
	display: none;
	position: absolute;
	left: 0;
	right: 0;
	padding: 10px;
	border: 1px solid #dcdcde;
	border-radius: 10px;
	background: #fff;
	box-shadow: 0 8px 20px rgba(30, 30, 30, 0.08);
	z-index: 1000;
	height: 250px;
	overflow-y: auto;
}

body .rpf-tree-selector__dropdown.is-open {
	display: block;
}

body .rpf-tree-selector__search-wrap {
	margin-bottom: 10px;
	position: relative;
}

body .rpf-tree-selector__search-icon {
	position: absolute;
	left: 10px;
	top: 50%;
	transform: translateY(-50%);
	width: 18px;
	height: 18px;
	color: #949494;
	pointer-events: none;
	stroke-linecap: round;
	stroke-linejoin: round;
}

body .rpf-tree-selector__search-wrap .rpf-tree-selector__search {
	width: 100%;
	padding: 9px 12px 9px 36px;
	font-size: 14px;
	border: 1px solid #c3c4c7;
	border-radius: 10px;
	background-color: #fff;
	color: #1e1e1e;
	transition: border-color 0.2s, box-shadow 0.2s;
	box-sizing: border-box;
}

body .rpf-tree-selector__search-wrap .rpf-tree-selector__search:focus {
	outline: none;
	border-color: var(--rpf-primary);
	box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.1);
}

body .rpf-tree-selector__search-wrap .rpf-tree-selector__search::placeholder {
	color: #a0a0a0;
}

body .rpf-tree-selector__tree {
	max-height: 400px;
	overflow-y: auto;
	padding: 4px 0;
}

body .rpf-tree-node {
	margin: 0;
	padding: 0;
}

body .rpf-tree-node__header {
	display: flex;
	align-items: center;
	padding: 6px 4px;
	cursor: pointer;
	border-radius: 3px;
	transition: background-color 0.15s;
	user-select: none;
	gap: 8px;
}

body .rpf-tree-node__header:hover {
	background-color: #f5f5f5;
}

body .rpf-tree-node__checkbox {
	margin: 0;
	cursor: pointer;
	width: 20px;
	height: 20px;
	min-width: 20px;
	accent-color: var(--rpf-primary);
	flex-shrink: 0;
	appearance: none;
	-webkit-appearance: none;
	-moz-appearance: none;
	border: 2px solid #c3c4c7;
	border-radius: 4px;
	background: #fff;
	transition: all 0.2s ease;
	position: relative;
	box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
	order: 1;
}

body .rpf-tree-node__checkbox:hover {
	border-color: var(--rpf-primary);
	box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.1), inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

body .rpf-tree-node__checkbox:checked {
	background: var(--rpf-primary);
	border-color: var(--rpf-primary);
	box-shadow: 0 2px 4px rgba(34, 113, 177, 0.25);
}

body .rpf-tree-node__checkbox:checked::after {
	content: '✓';
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	color: #fff;
	font-size: 14px;
	font-weight: bold;
	line-height: 1;
}

body .rpf-tree-node__checkbox[data-partial="true"] {
	background: var(--rpf-primary);
	border-color: var(--rpf-primary);
	box-shadow: 0 2px 4px rgba(34, 113, 177, 0.15);
	opacity: 1;
}

body .rpf-tree-node__checkbox[data-partial="true"]::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 10px;
	height: 2px;
	background-color: #fff;
	border-radius: 999px;
}

body .rpf-tree-node__label {
	display: flex;
	align-items: center;
	cursor: pointer;
	user-select: none;
	gap: 8px;
	margin-bottom: 0 !important;
	order: 2;
}

body .rpf-tree-node__label-text {
	font-size: 13px;
	color: #1e1e1e;
}

body .rpf-tree-node__toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 18px;
	height: 20px;
	color: #2c3338;
	transition: transform 0.2s, color 0.2s;
	user-select: none;
	cursor: pointer;
	flex-shrink: 0;
	position: relative;
	font-size: 18px;
	font-weight: bold;
	line-height: 1;
	order: 0;
}

body .rpf-tree-node__toggle::after {
	content: '';
	position: absolute;
	width: 16px;
	height: 16px;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M5 8l5 5 5-5' stroke='%236b7280' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-size: contain;
	background-repeat: no-repeat;
	background-position: center;
	display: block;
	transition: transform 0.2s;
	transform: rotate(-90deg);
}

body .rpf-tree-node__toggle:hover {
	color: var(--rpf-primary);
}

body .rpf-tree-node--expanded .rpf-tree-node__toggle::after {
	transform: rotate(0deg);
}

body .rpf-tree-node:not(.rpf-tree-node--country):not(.rpf-tree-node--state) .rpf-tree-node__toggle {
	visibility: hidden;
	width: 0;
	margin: 0;
}

body .rpf-tree-node__children {
	display: none;
	padding-left: 28px;
}

body .rpf-tree-node--expanded .rpf-tree-node__children {
	display: block;
}

body .rpf-tree-node--country .rpf-tree-node__label-text {
	font-weight: 600;
	color: #1e1e1e;
	font-size: 14px;
}

body .rpf-tree-node--state .rpf-tree-node__label-text {
	font-weight: 500;
	color: #2c3338;
	font-size: 13px;
}

body .rpf-tree-node--city .rpf-tree-node__label-text {
	font-weight: 400;
	color: #50575e;
	font-size: 12px;
	padding-left: 4px;
}

body .rpf-tree-node--country .rpf-tree-node__header:hover {
	background-color: #f0f4f8;
}

body .rpf-tree-node--state .rpf-tree-node__header:hover {
	background-color: #f9f9f9;
}

body .rpf-tree-node--city .rpf-tree-node__header:hover {
	background-color: #fcfcfc;
}

body .rpf-tree-node__checkbox:focus {
	outline: 2px solid var(--rpf-primary);
	outline-offset: 2px;
}

body .rpf-tree-selector__error {
	padding: 12px;
	color: #d63638;
	background-color: #fcf0f1;
	border: 1px solid #d63638;
	border-radius: 4px;
	font-size: 13px;
	margin: 0;
}

body .rpf-tree-selector__tree::-webkit-scrollbar {
	width: 6px;
}

body .rpf-tree-selector__tree::-webkit-scrollbar-track {
	background: transparent;
}

body .rpf-tree-selector__tree::-webkit-scrollbar-thumb {
	background: #ddd;
	border-radius: 3px;
}

body .rpf-tree-selector__tree::-webkit-scrollbar-thumb:hover {
	background: #b0b0b0;
}

@media (max-width: 600px) {
	body .rpf-tree-selector-wrap {
		padding: 12px;
	}

	body .rpf-tree-selector__tree {
		max-height: 300px;
	}

	body .rpf-tree-node__label-text {
		font-size: 12px;
	}

	body .rpf-tree-node__children {
		padding-left: 16px;
	}
}
