/* =========================================================
   Utman Immigration Pricing Plugin
   All rules are scoped under .uip-wrap / .uip-modal-overlay
   so they cannot leak into or clash with theme styles.

   Palette (only these two brand colors are used):
     --uip-navy : #003557
     --uip-red  : #d22528
   ========================================================= */

.uip-wrap {
	--uip-navy: #003557;
	--uip-navy-soft: #04486f;
	--uip-red: #d22528;
	--uip-border: #e2e2e2;
	--uip-text: #1c1c1c;
	font-family: inherit;
	box-sizing: border-box;
	max-width: 100%;
}

.uip-wrap *,
.uip-wrap *::before,
.uip-wrap *::after,
.uip-modal-overlay *,
.uip-modal-overlay *::before,
.uip-modal-overlay *::after {
	box-sizing: border-box;
}

.uip-empty {
	padding: 20px;
	background: #f7f7f7;
	border: 1px dashed var(--uip-border);
	border-radius: 8px;
	color: #555;
}

/* ---------- Category pill heading ---------- */

.uip-category-pill {
	background: #fff;
	border: 2px solid var(--uip-navy);
	border-radius: 14px;
	color: var(--uip-navy);
	font-weight: 800;
	font-size: 22px;
	text-align: center;
	padding: 16px 20px;
	margin: 32px 0 18px;
}

.uip-category-pill:first-child {
	margin-top: 0;
}

/* ---------- Pricing table ---------- */

.uip-table-scroll {
	width: 100%;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	border: 1px solid var(--uip-border);
	border-radius: 4px;
}

.uip-pricing-table {
	width: 100%;
	border-collapse: collapse;
	table-layout: fixed;
	min-width: 640px;
	font-size: 15px;
	background: #fff;
}

/* Fixed column widths via <colgroup>, identical on every category
   table, so the "Compare Packages" button (and every other column)
   lines up at the exact same horizontal position in every section —
   regardless of how long that section's service names happen to be. */
.uip-col-g-service {
	width: 38%;
}

.uip-col-g-action {
	width: 24%;
}

.uip-col-g-price {
	width: 19%;
}

.uip-pricing-table tr.uip-row-subcat-header th {
	padding: 16px 20px;
	font-weight: 700;
	vertical-align: middle;
}

.uip-pricing-table tr.uip-row-subcat-header .uip-subcat-cell {
	background: var(--uip-navy);
	color: #fff;
	text-align: left;
	font-size: 16px;
}

.uip-pricing-table tr.uip-row-subcat-header .uip-price-head {
	background: #fff;
	color: var(--uip-text);
	text-align: center;
	font-size: 15px;
	border-bottom: 2px solid var(--uip-border);
}

.uip-pricing-table tbody tr.uip-row-service {
	border-bottom: 1px solid var(--uip-border);
}

.uip-pricing-table tbody tr.uip-row-service:hover {
	background: #f5f9fb;
}

.uip-pricing-table td {
	padding: 14px 20px;
	vertical-align: middle;
	color: var(--uip-text);
}

.uip-col-service {
	font-weight: 600;
	text-align: center;
	word-wrap: break-word;
	overflow-wrap: break-word;
}

.uip-col-price {
	text-align: center;
	font-weight: 700;
	color: var(--uip-navy);
	white-space: nowrap;
}

.uip-col-action {
	text-align: center;
	white-space: nowrap;
}

.uip-compare-btn {
	background: var(--uip-navy);
	color: #fff;
	border: none;
	padding: 10px 18px;
	border-radius: 6px;
	cursor: pointer;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.02em;
	transition: background 0.15s ease;
	white-space: nowrap;
}

.uip-compare-btn:hover,
.uip-compare-btn:focus {
	background: var(--uip-navy-soft);
}

/* ---------- Modal overlay ---------- */

.uip-modal-overlay {
	display: none;
	position: fixed;
	inset: 0;
	background: rgba(0, 20, 35, 0.65);
	z-index: 99999;
	align-items: flex-start;
	justify-content: center;
	padding: 40px 16px;
	overflow-y: auto;
}

.uip-modal-overlay.uip-open {
	display: flex;
}

.uip-modal {
	position: relative;
	background: #f7f7f7;
	width: 100%;
	max-width: 1000px;
	border-radius: 10px;
	padding: 32px 28px 28px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.uip-modal-close {
	position: absolute;
	top: -14px;
	right: -14px;
	width: 40px;
	height: 40px;
	background: var(--uip-red);
	color: #fff;
	border: 3px solid #fff;
	border-radius: 6px;
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
}

.uip-modal-title {
	text-align: center;
	text-transform: uppercase;
	font-weight: 800;
	letter-spacing: 0.02em;
	color: var(--uip-navy);
	margin: 0 0 24px;
	font-size: 26px;
}

.uip-modal-cards {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
	gap: 24px;
	align-items: start;
}

/* When only one package exists for a service, force a single column so
   that one card renders at full modal width with no empty slot. */
.uip-modal-cards.uip-single-card {
	grid-template-columns: 1fr;
	max-width: 480px;
	margin: 0 auto;
}

/* ---------- Package card ---------- */

.uip-card {
	background: #fff;
	border-radius: 10px;
	overflow: hidden;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
	display: flex;
	flex-direction: column;
}

.uip-card-full {
	width: 100%;
}

.uip-card-header {
	background: var(--uip-navy);
	color: #fff;
	padding: 22px 22px 18px;
	border-bottom: 3px solid var(--uip-red);
}

.uip-card-title {
	margin: 0 0 8px;
	font-size: 20px;
	font-weight: 800;
}

.uip-card-desc {
	margin: 0;
	font-size: 13px;
	line-height: 1.5;
	opacity: 0.92;
}

.uip-card-price {
	text-align: center;
	font-size: 34px;
	font-weight: 800;
	color: var(--uip-navy);
	padding: 20px 22px 6px;
}

.uip-card-features {
	max-height: 320px;
	overflow-y: auto;
	padding: 6px 22px 10px;
	flex: 1;
}

.uip-feature-row {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	padding: 10px 0;
	border-bottom: 1px solid #eee;
	font-size: 14.5px;
	line-height: 1.4;
}

.uip-feature-row:last-child {
	border-bottom: none;
}

.uip-feature-icon {
	flex: 0 0 18px;
	font-weight: 800;
	margin-top: 1px;
}

.uip-feature-icon.uip-yes {
	color: var(--uip-navy);
}

.uip-feature-icon.uip-no {
	color: var(--uip-red);
}

.uip-card-footer {
	padding: 18px 22px 22px;
}

.uip-book-btn {
	display: block;
	width: 100%;
	text-align: center;
	background: var(--uip-red);
	color: #fff;
	font-weight: 800;
	letter-spacing: 0.03em;
	text-transform: uppercase;
	text-decoration: none;
	padding: 14px 18px;
	border-radius: 8px;
	font-size: 14px;
	transition: filter 0.15s ease;
}

.uip-book-btn:hover,
.uip-book-btn:focus {
	filter: brightness(1.1);
	color: #fff;
}

/* ---------- Fallback "no package at all" panel (rare edge case only) ---------- */

.uip-no-package {
	background: #fff;
	border: 2px dashed var(--uip-border);
	border-radius: 10px;
	padding: 30px 22px;
	text-align: center;
	color: #777;
	font-weight: 600;
	grid-column: 1 / -1;
}

/* =========================================================
   Responsive
   Tablet (782px) just tightens the existing scrollable table.
   Below 640px (phones), the pricing table stops being a
   horizontally-scrolling table altogether and becomes a
   stacked "card" per service — service name on top, the two
   prices side by side, and a full-width action button below.
   This is what removes the cramped/cut-off columns on phones.
   Every rule stays scoped under .uip-wrap / .uip-modal-overlay
   so nothing here can leak into the theme or another plugin.
   ========================================================= */

/* ---- Tablet / small laptop ---- */
@media (max-width: 782px) {
	.uip-category-pill {
		font-size: 20px;
		padding: 14px 18px;
		margin: 26px 0 16px;
	}

	.uip-pricing-table {
		min-width: 560px;
		font-size: 14px;
	}

	.uip-pricing-table td,
	.uip-pricing-table tr.uip-row-subcat-header th {
		padding: 12px 14px;
	}

	.uip-modal {
		max-width: 92%;
	}

	.uip-modal-cards {
		grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
		gap: 18px;
	}
}

/* ---- Phones: table becomes a stacked card list ---- */
@media (max-width: 640px) {
	.uip-table-scroll {
		overflow-x: visible;
		border-radius: 8px;
	}

	.uip-pricing-table {
		display: block;
		width: 100%;
		min-width: 0;
		table-layout: auto;
		font-size: 14px;
	}

	.uip-pricing-table tbody {
		display: block;
		width: 100%;
	}

	/* Header row: category label full-width on its own line, then
	   the two price-column labels side by side underneath — all on
	   navy, matching a clear "table header" band. */
	.uip-pricing-table tr.uip-row-subcat-header {
		display: flex;
		flex-wrap: wrap;
	}

	.uip-pricing-table tr.uip-row-subcat-header th {
		padding: 12px 14px;
	}

	.uip-pricing-table tr.uip-row-subcat-header .uip-subcat-cell {
		flex: 1 0 100%;
		text-align: center;
	}

	.uip-pricing-table tr.uip-row-subcat-header .uip-price-head {
		flex: 1 0 50%;
		background: var(--uip-navy-soft);
		color: #fff;
		font-size: 12.5px;
		border-bottom: none;
	}

	.uip-pricing-table tr.uip-row-subcat-header .uip-price-head:first-of-type {
		border-right: 1px solid rgba(255, 255, 255, 0.25);
	}

	/* Each service row becomes a card: name on top, then the two
	   prices side by side, then the action button full-width. */
	.uip-pricing-table tbody tr.uip-row-service {
		display: flex;
		flex-wrap: wrap;
		padding: 12px 0 14px;
	}

	.uip-pricing-table tbody tr.uip-row-service td {
		padding: 4px 14px;
	}

	.uip-pricing-table tr.uip-row-service td.uip-col-service {
		order: 1;
		flex: 1 0 100%;
		padding-bottom: 8px;
		font-size: 14.5px;
	}

	.uip-pricing-table tr.uip-row-service td.uip-col-price {
		order: 2;
		flex: 1 0 50%;
		white-space: normal;
	}

	.uip-pricing-table tr.uip-row-service td.uip-col-price:first-of-type {
		border-right: 1px solid var(--uip-border);
	}

	.uip-pricing-table tr.uip-row-service td.uip-col-action {
		order: 3;
		flex: 1 0 100%;
		padding-top: 10px;
	}

	.uip-compare-btn {
		width: 100%;
		padding: 10px 14px;
		font-size: 13px;
	}
}

/* ---- Large phones / small tablets (portrait): modal + card sizing ---- */
@media (max-width: 600px) {
	.uip-modal-overlay {
		padding: 24px 10px;
	}

	.uip-modal {
		padding: 30px 16px 20px;
		border-radius: 8px;
	}

	.uip-modal-close {
		top: 8px;
		right: 8px;
		width: 36px;
		height: 36px;
		font-size: 20px;
		border-width: 2px;
	}

	.uip-modal-title {
		font-size: 19px;
		margin: 0 0 18px;
		padding-right: 34px;
	}

	.uip-card-price {
		font-size: 26px;
		padding: 18px 18px 4px;
	}

	.uip-card-header {
		padding: 18px 18px 14px;
	}

	.uip-card-title {
		font-size: 18px;
	}

	.uip-card-desc {
		font-size: 12.5px;
	}

	.uip-card-features {
		padding: 4px 18px 8px;
		max-height: none;
	}

	.uip-feature-row {
		font-size: 14px;
	}

	.uip-card-footer {
		padding: 14px 18px 18px;
	}

	.uip-category-pill {
		font-size: 17px;
		padding: 12px 14px;
		margin: 20px 0 14px;
		border-radius: 10px;
	}
}

/* ---- Small phones ---- */
@media (max-width: 420px) {
	.uip-modal-overlay {
		padding: 16px 6px;
	}

	.uip-modal {
		padding: 26px 12px 16px;
	}

	.uip-modal-cards {
		grid-template-columns: 1fr;
		gap: 16px;
	}

	.uip-modal-cards.uip-single-card {
		max-width: 100%;
	}

	.uip-card-price {
		font-size: 24px;
	}

	.uip-category-pill {
		font-size: 15px;
		padding: 10px 12px;
	}

	.uip-pricing-table {
		font-size: 13px;
	}

	.uip-pricing-table tbody tr.uip-row-service td {
		padding: 4px 10px;
	}

	.uip-pricing-table tr.uip-row-subcat-header th {
		padding: 10px 10px;
	}

	.uip-pricing-table tr.uip-row-subcat-header .uip-price-head {
		font-size: 11.5px;
	}

	.uip-compare-btn {
		padding: 9px 10px;
		font-size: 12px;
	}
}

/* ---- Touch-target and text-wrap safety across all screen sizes ---- */
@media (max-width: 782px) {
	.uip-compare-btn,
	.uip-book-btn,
	.uip-modal-close {
		min-height: 40px;
		-webkit-tap-highlight-color: transparent;
	}

	.uip-feature-row span:last-child,
	.uip-card-desc {
		word-break: break-word;
		overflow-wrap: anywhere;
	}
}
