/* =====================================================
   Update Plan Switcher – Frontend UI
   Price right-aligned, title single-line on desktop
   WordPress.org Ready
===================================================== */

/* Reset */
.ups-switcher,
.ups-switcher *,
.ups-switcher *::before,
.ups-switcher *::after {
	box-sizing: border-box;
}

.ups-switcher {
	margin: 20px 0;
	padding: 16px 18px;
	background: #fff;
	border: 1px solid #E5E7EB;
	border-radius: 14px;
	box-shadow: 0 1px 6px rgba(15, 23, 42, .05);
	overflow: hidden;
}

.ups-heading {
	margin: 0 0 14px;
	font-size: 18px;
	font-weight: 700;
	color: #111827;
	line-height: 1.3;
}

/* Grid – 2 columns on desktop */
.ups-row-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 10px;
	align-items: stretch;
}

/* Card */
.ups-card {
	position: relative;
	display: block;
	cursor: pointer;
	height: 100%;
}

.ups-plan-radio {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
	margin: 0;
	pointer-events: none;
}

.ups-card-inner {
	display: flex;
	align-items: flex-start;
	gap: 10px;

	min-height: 64px;
	padding: 12px 60px 12px 14px;

	border: 2px solid #E5E7EB;
	border-radius: 12px;
	background: #fff;

	transition: border-color .2s, background .2s, box-shadow .2s, transform .15s;
	box-shadow: 0 1px 2px rgba(15, 23, 42, .02);
}

@media (hover: hover) {
	.ups-card:hover .ups-card-inner {
		border-color: #2563EB;
		transform: translateY(-1px);
		box-shadow: 0 4px 14px rgba(37, 99, 235, .08);
	}
}

.ups-card.ups-active .ups-card-inner {
	border-color: #2563EB;
	background: #F8FAFF;
	box-shadow: 0 4px 14px rgba(37, 99, 235, .08);
}

/* Left side */
.ups-left {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	flex: 1;
	min-width: 0;
}

.ups-text {
	min-width: 0;
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

/* Title row: title + price on same line, price right-aligned */
.ups-title-row {
	display: flex;
	align-items: baseline;
	gap: 8px;
	width: 100%;
}

.ups-title {
	flex: 1 1 auto;
	min-width: 0;
	font-size: 15px;
	font-weight: 700;
	color: #111827;
	line-height: 1.2;

	/* Prevent title from wrapping on desktop */
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.ups-price {
	flex: 0 0 auto;
	margin-left: auto;
	text-align: right;
	font-size: 18px;
	font-weight: 800;
	color: #2563EB;
	white-space: nowrap;
}

/* Description – always visible below */
.ups-desc {
	display: block;
	font-size: 12px;
	line-height: 1.4;
	color: #6B7280;
	margin-top: 2px;
}

/* Radio */
.ups-radio {
	position: relative;
	width: 18px;
	height: 18px;
	border: 2px solid #D1D5DB;
	border-radius: 50%;
	background: #fff;
	flex-shrink: 0;
	margin-top: 2px;
	transition: border-color .2s, background .2s;
}

.ups-radio::after {
	content: "";
	position: absolute;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #2563EB;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%) scale(0);
	transition: transform .15s;
}

.ups-card.ups-active .ups-radio {
	border-color: #2563EB;
	background: #fff;
}

.ups-card.ups-active .ups-radio::after {
	transform: translate(-50%, -50%) scale(1);
}

/* Badge – compact, positioned top-right */
.ups-badge {
	position: absolute;
	top: -6px;
	right: 12px;
	background: #10B981;
	color: #fff;
	padding: 3px 12px;
	border-radius: 999px;
	font-size: 9px;
	font-weight: 700;
	line-height: 1.6;
	letter-spacing: .4px;
	text-transform: uppercase;
	box-shadow: 0 2px 8px rgba(16, 185, 129, .20);
	pointer-events: none;
	z-index: 1;
}

/* Footnote */
.ups-note {
	margin-top: 14px;
	padding-top: 12px;
	border-top: 1px solid #E5E7EB;
	color: #6B7280;
	font-size: 12px;
	line-height: 1.5;
}

/* Tablet (≤ 992px) */
@media (max-width: 992px) {
	.ups-switcher {
		padding: 14px 16px;
	}
	.ups-heading {
		font-size: 17px;
	}
	.ups-row-grid {
		gap: 8px;
	}
	.ups-card-inner {
		padding: 12px 56px 12px 14px;
	}
	.ups-title {
		font-size: 14px;
	}
	.ups-price {
		font-size: 17px;
	}
}

/* ===== Mobile (≤ 768px) – allow title to wrap if needed ===== */
@media (max-width: 768px) {
	.ups-switcher {
		padding: 12px 12px;
		margin: 12px 0;
	}

	.ups-heading {
		font-size: 16px;
		margin-bottom: 12px;
	}

	.ups-row-grid {
		grid-template-columns: 1fr;
		gap: 8px;
	}

	.ups-card-inner {
		padding: 10px 70px 10px 12px;
		min-height: auto;
	}

	.ups-left {
		gap: 8px;
	}

	.ups-text {
		gap: 2px;
	}

	.ups-title-row {
		gap: 6px;
	}

	.ups-title {
		font-size: 14px;
		/* Allow wrapping on mobile */
		white-space: normal;
		overflow: visible;
		text-overflow: clip;
		word-break: break-word;
	}

	.ups-price {
		font-size: 16px;
	}

	.ups-desc {
		font-size: 12px;
		margin-top: 2px;
	}

	.ups-radio {
		width: 18px;
		height: 18px;
		margin-top: 2px;
	}

	.ups-radio::after {
		width: 8px;
		height: 8px;
	}

	.ups-badge {
		top: -5px;
		right: 12px;
		font-size: 9px;
		padding: 3px 10px;
	}

	.ups-note {
		margin-top: 12px;
		padding-top: 10px;
		font-size: 12px;
	}
}

/* Very narrow (≤ 480px) */
@media (max-width: 480px) {
	.ups-card-inner {
		padding: 8px 60px 8px 10px;
	}
	.ups-title {
		font-size: 13px;
	}
	.ups-price {
		font-size: 15px;
	}
	.ups-desc {
		font-size: 11px;
	}
	.ups-badge {
		right: 10px;
		padding: 2px 8px;
		font-size: 8px;
	}
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
	.ups-card-inner {
		transition: none;
	}
	.ups-card:hover .ups-card-inner {
		transform: none;
	}
}