/* #######################################################################
 * 🐢 TRTL UI — Outlined Split-Notch Select & Elevation Menu (trtl-select)
 * Mirrors Google Material 3 Outlined Select (md-outlined-select / md-menu)
 * Version: v1.2.1-TRTL | Standalone Pure CSS (Zero Frameworks, Zero PHP)
 * ####################################################################### */
.trtl-select {
	--trtl-sel-accent: #1a8f3d;
	--trtl-sel-ink: #1f1f1f;
	--trtl-sel-muted: #444746;
	--trtl-sel-outline: #747775;
	--trtl-sel-surface: #ffffff;
	--trtl-sel-menu-bg: #f3f6f4;
	--trtl-sel-radius: 4px;
	--trtl-sel-ease: cubic-bezier(0.2, 0, 0, 1);
	position: relative;
	width: 100%;
	max-width: 280px;
	margin: 0 auto 22px;
	text-align: left;
	font-family: inherit;
	user-select: none;
}

.trtl-select-trigger {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	height: 56px;
	padding: 0 12px 0 16px;
	background: transparent;
	border: 0;
	border-radius: var(--trtl-sel-radius);
	color: var(--trtl-sel-ink);
	font-size: 16px;
	font-weight: 400;
	line-height: 24px;
	letter-spacing: 0.5px;
	cursor: pointer;
	box-sizing: border-box;
}

.trtl-select-trigger:focus {
	outline: none;
}

/* Google M3 3-Segment Split-Notch Outline */
.trtl-select-outline {
	position: absolute;
	inset: 0;
	display: flex;
	pointer-events: none;
	border-radius: var(--trtl-sel-radius);
}

.trtl-select-outline-start,
.trtl-select-outline-notch,
.trtl-select-outline-end {
	box-sizing: border-box;
	border-color: var(--trtl-sel-outline);
	border-style: solid;
	transition: border-color 0.15s var(--trtl-sel-ease), border-width 0.15s var(--trtl-sel-ease);
}

.trtl-select-outline-start {
	width: 12px;
	border-width: 1px 0 1px 1px;
	border-radius: var(--trtl-sel-radius) 0 0 var(--trtl-sel-radius);
}

.trtl-select-outline-notch {
	position: relative;
	flex: 0 0 auto;
	padding: 0 4px;
	border-width: 1px 0 1px 0;
}

.trtl-select-outline-end {
	flex: 1 1 auto;
	border-width: 1px 1px 1px 0;
	border-radius: 0 var(--trtl-sel-radius) var(--trtl-sel-radius) 0;
}

.trtl-select-trigger:hover .trtl-select-outline-start,
.trtl-select-trigger:hover .trtl-select-outline-notch,
.trtl-select-trigger:hover .trtl-select-outline-end {
	border-color: var(--trtl-sel-ink);
}

.trtl-select-trigger:focus-visible .trtl-select-outline-start,
.trtl-select[data-open="true"] .trtl-select-outline-start {
	border-width: 2px 0 2px 2px;
	border-color: var(--trtl-sel-accent);
}

.trtl-select-trigger:focus-visible .trtl-select-outline-notch,
.trtl-select[data-open="true"] .trtl-select-outline-notch {
	border-width: 2px 0 2px 0;
	border-color: var(--trtl-sel-accent);
}

.trtl-select-trigger:focus-visible .trtl-select-outline-end,
.trtl-select[data-open="true"] .trtl-select-outline-end {
	border-width: 2px 2px 2px 0;
	border-color: var(--trtl-sel-accent);
}

/* True Notch Cutout When Open or Populated */
.trtl-select[data-open="true"] .trtl-select-outline-notch,
.trtl-select[data-has-value="true"] .trtl-select-outline-notch {
	border-top-color: transparent !important;
}

.trtl-select-label {
	position: relative;
	display: inline-block;
	top: 50%;
	transform: translateY(-50%);
	color: var(--trtl-sel-muted);
	font-size: 16px;
	font-weight: 400;
	line-height: 16px;
	letter-spacing: 0.4px;
	white-space: nowrap;
	transition: top 0.15s var(--trtl-sel-ease), transform 0.15s var(--trtl-sel-ease), font-size 0.15s var(--trtl-sel-ease), color 0.15s var(--trtl-sel-ease);
}

.trtl-select[data-open="true"] .trtl-select-label,
.trtl-select[data-has-value="true"] .trtl-select-label {
	top: 0;
	transform: translateY(-50%);
	font-size: 12px;
	font-weight: 500;
}

.trtl-select[data-open="true"] .trtl-select-label {
	color: var(--trtl-sel-accent);
}

.trtl-select-value {
	display: block;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	color: var(--trtl-sel-ink);
}

.trtl-select-chevron {
	flex: 0 0 auto;
	width: 24px;
	height: 24px;
	color: var(--trtl-sel-muted);
	transition: transform 0.2s var(--trtl-sel-ease), color 0.15s var(--trtl-sel-ease);
}

.trtl-select[data-open="true"] .trtl-select-chevron {
	transform: rotate(180deg);
	color: var(--trtl-sel-accent);
}

/* Google M3 Level-2 Elevation Popover Menu */
.trtl-select-menu {
	position: absolute;
	top: calc(100% + 4px);
	left: 0;
	right: 0;
	z-index: 999;
	margin: 0;
	padding: 8px 0;
	list-style: none;
	background: var(--trtl-sel-menu-bg);
	border-radius: var(--trtl-sel-radius);
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.30), 0 2px 6px 2px rgba(0, 0, 0, 0.15);
	max-height: 256px;
	overflow-y: auto;
	transform-origin: top center;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transform: scaleY(0.92) translateY(-6px);
	transition: opacity 0.16s var(--trtl-sel-ease), transform 0.18s var(--trtl-sel-ease), visibility 0.16s ease;
}

.trtl-select[data-open="true"] .trtl-select-menu {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	transform: scaleY(1) translateY(0);
}

.trtl-select-option {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: space-between;
	height: 48px;
	padding: 0 16px;
	margin: 0;
	font-size: 16px;
	font-weight: 400;
	line-height: 24px;
	letter-spacing: 0.5px;
	color: var(--trtl-sel-ink);
	cursor: pointer;
	box-sizing: border-box;
	overflow: hidden;
}

/* M3 State Layer (8% Hover, 12% Selected) */
.trtl-select-option::before {
	content: '';
	position: absolute;
	inset: 0;
	background: var(--trtl-sel-accent);
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.12s var(--trtl-sel-ease);
}

.trtl-select-option:hover::before,
.trtl-select-option[data-focused="true"]::before {
	opacity: 0.08;
}

.trtl-select-option[aria-selected="true"] {
	color: var(--trtl-sel-accent);
	font-weight: 500;
}

.trtl-select-option[aria-selected="true"]::before {
	opacity: 0.12;
}

.trtl-select-check {
	position: relative;
	flex: 0 0 auto;
	width: 20px;
	height: 20px;
	opacity: 0;
	color: var(--trtl-sel-accent);
	transition: opacity 0.12s var(--trtl-sel-ease);
}

.trtl-select-option[aria-selected="true"] .trtl-select-check {
	opacity: 1;
}
