/**
 * United Location Picker — styles.
 *
 * Scoped to .ut-lp-* to avoid conflicts with Kadence Theme.
 *
 * @package UnitedTech\LocationPicker
 * @since   2.0.0
 */

/* -------------------------------------------------- */
/*  Wrapper                                            */
/* -------------------------------------------------- */

.ut-lp-wrapper {
	position: relative;
	display: inline-block;
	font-family: inherit;
	line-height: 1.4;
}

/* -------------------------------------------------- */
/*  Button                                             */
/* -------------------------------------------------- */

.ut-lp-button {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 12px;
	border: 1px solid rgba( 255, 255, 255, 0.3 );
	border-radius: 8px;
	background: transparent;
	color: rgba( 255, 255, 255, 0.85 );
	font-size: 14px;
	font-weight: 500;
	font-family: inherit;
	cursor: pointer;
	transition: border-color 0.15s ease, background-color 0.15s ease;
	white-space: nowrap;
	line-height: 1;
}

.ut-lp-button:hover {
	border-color: rgba( 255, 255, 255, 0.6 );
	background-color: rgba( 255, 255, 255, 0.08 );
	color: #fff;
}

.ut-lp-button:focus-visible {
	outline: 2px solid rgba( 255, 255, 255, 0.7 );
	outline-offset: 2px;
}

.ut-lp-button[aria-expanded="true"] {
	border-color: rgba( 255, 255, 255, 0.6 );
	background-color: rgba( 255, 255, 255, 0.1 );
	color: #fff;
}

.ut-lp-button[aria-expanded="true"] .ut-lp-chevron {
	transform: rotate( 180deg );
}

/* Selection indicator on button */
.ut-lp-wrapper--has-selection .ut-lp-button {
	border-color: rgba( 255, 255, 255, 0.6 );
	color: #fff;
}

.ut-lp-wrapper--has-selection .ut-lp-icon {
	color: #fff;
}

/* -------------------------------------------------- */
/*  Icon & chevron                                     */
/* -------------------------------------------------- */

.ut-lp-icon {
	flex-shrink: 0;
	color: rgba( 255, 255, 255, 0.85 );
}

.ut-lp-chevron {
	flex-shrink: 0;
	color: rgba( 255, 255, 255, 0.5 );
	transition: transform 0.2s ease;
}

/* -------------------------------------------------- */
/*  Light theme override                               */
/* -------------------------------------------------- */

.ut-lp-wrapper--light .ut-lp-button {
	border-color: #d4d4d4;
	color: #404040;
}

.ut-lp-wrapper--light .ut-lp-button:hover {
	border-color: #0177c4;
	background-color: rgba( 1, 119, 196, 0.04 );
	color: #404040;
}

.ut-lp-wrapper--light .ut-lp-button:focus-visible {
	outline-color: #0177c4;
}

.ut-lp-wrapper--light .ut-lp-button[aria-expanded="true"] {
	border-color: #0177c4;
	background-color: rgba( 1, 119, 196, 0.06 );
	color: #404040;
}

.ut-lp-wrapper--light.ut-lp-wrapper--has-selection .ut-lp-button {
	border-color: #0177c4;
	color: #015f9f;
}

.ut-lp-wrapper--light.ut-lp-wrapper--has-selection .ut-lp-icon {
	color: #0177c4;
}

.ut-lp-wrapper--light .ut-lp-icon {
	color: #0177c4;
}

.ut-lp-wrapper--light .ut-lp-chevron {
	color: #a3a3a3;
}

/* -------------------------------------------------- */
/*  Dropdown panel                                     */
/* -------------------------------------------------- */

.ut-lp-panel {
	position: absolute;
	top: 100%;
	right: 0;
	z-index: 100;
	margin-top: 6px;
	min-width: 220px;
	max-width: 280px;
	max-height: 72vh;
	overflow-y: auto;
	background: #fff;
	border: 1px solid #e5e5e5;
	border-radius: 12px;
	box-shadow: 0 10px 40px rgba( 0, 0, 0, 0.12 ), 0 2px 8px rgba( 0, 0, 0, 0.06 );
}

/* -------------------------------------------------- */
/*  List                                               */
/* -------------------------------------------------- */

.ut-lp-list {
	list-style: none;
	margin: 0;
	padding: 6px 0;
}

.ut-lp-item {
	margin: 0;
	padding: 0;
}

/* -------------------------------------------------- */
/*  Place link                                         */
/* -------------------------------------------------- */

.ut-lp-place-link {
	display: block;
	padding: 8px 16px;
	color: #404040;
	font-size: 14px;
	font-weight: 400;
	text-decoration: none;
	transition: background-color 0.1s ease, color 0.1s ease;
}

.ut-lp-place-link:hover,
.ut-lp-place-link:focus-visible {
	background-color: #f0f7ff;
	color: #015f9f;
}

.ut-lp-place-link:focus-visible {
	outline: 2px solid #0177c4;
	outline-offset: -2px;
}

/* Child items — indented */
.ut-lp-item--child .ut-lp-place-link {
	padding-left: 32px;
	font-size: 13px;
	color: #525252;
}

/* Active state */
.ut-lp-place-link--active {
	font-weight: 600;
	color: #015f9f;
	background-color: #f0f7ff;
}

/* -------------------------------------------------- */
/*  Footer                                             */
/* -------------------------------------------------- */

.ut-lp-footer {
	border-top: 1px solid #e5e5e5;
	padding: 8px 16px;
}

.ut-lp-reset-link {
	display: block;
	color: #737373;
	font-size: 13px;
	text-decoration: none;
	transition: color 0.1s ease;
}

.ut-lp-reset-link:hover,
.ut-lp-reset-link:focus-visible {
	color: #0177c4;
}

.ut-lp-reset-link:focus-visible {
	outline: 2px solid #0177c4;
	outline-offset: 2px;
}

/* -------------------------------------------------- */
/*  Responsive — mobile                                */
/* -------------------------------------------------- */

@media ( max-width: 767px ) {

	.ut-lp-panel {
		position: fixed;
		top: 0;
		right: 0;
		bottom: auto;
		left: 0;
		z-index: 9999;
		max-width: none;
		max-height: 70vh;
		margin-top: 0;
		border-radius: 0 0 16px 16px;
		box-shadow: 0 4px 24px rgba( 0, 0, 0, 0.15 );
	}

	.ut-lp-place-link {
		padding: 12px 16px;
		min-height: 44px;
	}

	.ut-lp-item--child .ut-lp-place-link {
		padding-left: 32px;
		min-height: 44px;
	}

	.ut-lp-reset-link {
		padding: 12px 0;
		min-height: 44px;
		display: flex;
		align-items: center;
	}

	.ut-lp-footer {
		padding: 8px 16px 16px;
	}
}

/* -------------------------------------------------- */
/*  Reduced motion                                     */
/* -------------------------------------------------- */

@media ( prefers-reduced-motion: reduce ) {

	.ut-lp-button,
	.ut-lp-chevron,
	.ut-lp-place-link,
	.ut-lp-reset-link {
		transition: none;
	}
}
