/* City Location — location chooser modal + trigger button
   ------------------------------------------------------------------ */

/* Scroll lock while the modal is open. */
html.cl-popup-open,
html.cl-popup-open body {
	overflow: hidden;
}

/* ---- Trigger button (shortcode mode="popup") ---- */

.citylocation-popup-trigger {
	display: inline-flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 14px;
	min-width: 200px;
	padding: 8px 14px;
	font-family: inherit;
	line-height: 1;
	color: #1e293b;
	background: #ffffff;
	border: 1.5px solid #e2e8f0;
	border-radius: 10px;
	cursor: pointer;
	text-align: left;
	transition: all ease-in-out .2s
}

.citylocation-popup-trigger__body {
	display: flex;
	flex-direction: column;
	gap: 3px;
	align-items: flex-start;
}

.citylocation-popup-trigger__label {
	font-size: 10px;
	font-weight: 600;
	letter-spacing: .03em;
	text-transform: uppercase;
	color: #94a3b8;
	transition: color ease-in-out .2s;
	margin-bottom: 3px;
    margin-left: 2px;
}

.citylocation-popup-trigger__current {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.citylocation-popup-trigger__name {
	font-size: 14px;
	font-weight: 700;
	color: #1e293b;
	transition: color ease-in-out .2s;
}

.citylocation-popup-trigger__chevron {
	display: inline-flex;
	color: #94a3b8;
	transition: transform ease-in-out .2s, color ease-in-out .2s;
}

/* Plain focus (after click / programmatic) keeps the base look and beats the
   theme's global button:focus rule via specificity. */
.citylocation-popup-trigger:focus {
	border-color: #e2e8f0;
	background: #ffffff;
	color: #1e293b;
	outline: none;
}

.citylocation-popup-trigger:hover,
.citylocation-popup-trigger:focus-visible {
	border-color: #3692ff;
	background: #3692ff;
	color: #ffffff;
	transform: translateY(-1px);
	outline: none;
}

.citylocation-popup-trigger__pin {
	display: inline-flex;
	color: #2563eb;
	transition: all ease-in-out .2s
}
.citylocation-popup-trigger:hover .citylocation-popup-trigger__pin,
.citylocation-popup-trigger:focus-visible .citylocation-popup-trigger__pin{
    color:white;
    transition: all ease-in-out .2s
}

.citylocation-popup-trigger:hover .citylocation-popup-trigger__label,
.citylocation-popup-trigger:hover .citylocation-popup-trigger__name,
.citylocation-popup-trigger:hover .citylocation-popup-trigger__chevron,
.citylocation-popup-trigger:focus-visible .citylocation-popup-trigger__label,
.citylocation-popup-trigger:focus-visible .citylocation-popup-trigger__name,
.citylocation-popup-trigger:focus-visible .citylocation-popup-trigger__chevron {
	color: #ffffff;
}

/* ---- Overlay ---- */

.cl-popup-overlay {
	display: none; /* shown via .is-open */
	position: fixed;
	inset: 0;
	z-index: 999999;
	align-items: center;
	justify-content: center;
	padding: 20px;
	background: rgba(15, 23, 42, 0.55);
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
	box-sizing: border-box;
}

.cl-popup-overlay.is-open {
	display: flex;
	animation: cl-fade-in 0.25s ease both;
}

.cl-popup-overlay *,
.cl-popup-overlay *::before,
.cl-popup-overlay *::after {
	box-sizing: border-box;
}

.cl-popup {
	position: relative;
	width: 100%;
	max-width: 460px;
	max-height: calc(100vh - 40px);
	overflow-y: auto;
	background: #ffffff;
	border-radius: 20px;
	padding: 32px 28px 28px;
	box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
	text-align: center;
}

.cl-popup-overlay.is-open .cl-popup {
	animation: cl-pop-in 0.32s cubic-bezier(0.18, 0.89, 0.32, 1.28) both;
}

/* The dialog receives focus on open — never show an outline on it. */
.cl-popup:focus {
	outline: none;
}

/* ---- Close button ---- */

.cl-popup__close {
	position: absolute;
	top: 14px;
	right: 14px;
	width: 32px;
	height: 32px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	font-size: 20px;
	line-height: 1;
	color: #475569;
	background: #f1f5f9;
	border: none;
	border-radius: 50%;
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease;
}

.cl-popup__close:focus {
	background: #f1f5f9;
	color: #475569;
	outline: none;
}

.cl-popup__close:hover,
.cl-popup__close:focus-visible {
	background: #e2e8f0;
	color: #0f172a;
	outline: none;
}

/* Forced (first-visit) mode hides the close button — a choice is required. */
.cl-popup-overlay.is-forced .cl-popup__close {
	display: none;
}

/* ---- Header ---- */

.cl-popup__head {
	margin-bottom: 22px;
}

.cl-popup__badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 60px;
	height: 60px;
	margin-bottom: 14px;
	color: #ffffff;
	background: #3692FF;
	border-radius: 50%;
	box-shadow: 0 8px 20px rgba(37, 99, 235, 0.35);
}

.cl-popup__head h2 {
	margin: 0 0 8px;
	font-size: 22px;
	line-height: 1.25;
	font-weight: 700;
	color: #0f172a;
}

.cl-popup__head p {
	margin: 0;
	font-size: 14px;
	line-height: 1.5;
	color: #64748b;
}

/* ---- Choices ---- */

.cl-popup__grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
}

.cl-popup__choice {
	display: flex;
	align-items: center;
	gap: 10px;
	width: 100%;
	padding: 14px 16px;
	font-size: 15px;
	font-weight: 600;
	color: #1e293b;
	text-align: left;
	background: #f8fafc;
	border: 1.5px solid #e2e8f0;
	border-radius: 12px;
	cursor: pointer;
	transition: border-color 0.18s ease, background 0.18s ease,
		transform 0.18s ease, box-shadow 0.18s ease;
	text-transform: capitalize;
}

/* Plain focus (the auto-focus / click case) keeps the base look so nothing
   appears pre-selected when the popup opens, and overrides the theme's
   global button:focus rule via higher specificity. */
.cl-popup__choice:focus {
	background: #f8fafc;
	color: #1e293b;
	border-color: #e2e8f0;
	transform: none;
	box-shadow: none;
	outline: none;
}

/* Lifted highlight only on hover or real keyboard navigation. */
.cl-popup__choice:hover,
.cl-popup__choice:focus-visible {
	background: #eff6ff;
	color: #253360;
	border-color: #253360;
	transform: translateY(-2px);
	box-shadow: 0 8px 18px rgba(37, 99, 235, 0.18);
	outline: none;
}

.cl-popup__choice-pin {
	display: inline-flex;
	color: #253360;
	flex-shrink: 0;
}

.cl-popup__choice-name {
	flex: 1;
}

.cl-popup__choice-arrow {
	color: #94a3b8;
	font-size: 16px;
	transition: transform 0.18s ease, color 0.18s ease;
}

.cl-popup__choice:hover .cl-popup__choice-arrow,
.cl-popup__choice:focus-visible .cl-popup__choice-arrow {
	color: #253360;
	transform: translateX(3px);
}

/* Odd last item spans the full row so the grid stays balanced. */
.cl-popup__choice:last-child:nth-child(odd) {
	grid-column: 1 / -1;
}

/* ---- Mobile ---- */

@media (max-width: 480px) {
	.cl-popup {
		padding: 26px 20px 22px;
		border-radius: 18px;
	}
	.cl-popup__grid {
		grid-template-columns: 1fr;
	}
	.cl-popup__head h2 {
		font-size: 20px;
	}
}

/* ---- Animations ---- */

@keyframes cl-fade-in {
	from { opacity: 0; }
	to   { opacity: 1; }
}

@keyframes cl-pop-in {
	from { opacity: 0; transform: translateY(16px) scale(0.96); }
	to   { opacity: 1; transform: translateY(0) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
	.cl-popup-overlay.is-open,
	.cl-popup-overlay.is-open .cl-popup {
		animation: none;
	}
	.cl-popup__choice,
	.citylocation-popup-trigger {
		transition: none;
	}
}
