/* TZR Course Finder — modal overlay + finder panel, adapted from
   __example/guided-search_1.html's <style> block (design tokens swapped
   for this theme's own --legacy-orange / --legacy-dark-blue variables). */

/* ---------- Trigger button (.tz-cta-strip#tzOpen) ----------
   Markup, CSS and behaviour are all owned by this plugin (see
   tzr_finder_render_trigger() in tzr-course-finder.php) — the theme only
   fires the tzr_course_finder_trigger action where it wants the button to
   appear. When the finder is switched off, the callback simply doesn't
   print anything, so no CSS-based hiding is needed. */
.tz-cta-strip {
	display: flex;
	width: 100%;
	align-items: flex-start;
	justify-content: space-between;
	gap: .75rem;
	margin-top: 1.15rem;
	border-radius: .6rem;
	cursor: pointer;
}

.tz-cta-strip:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

.tz-cta-text {
	margin: 0;
	overflow: hidden;
	min-width: 0;
	flex: 1 1 auto;
	color: #fff;
	font-size: 1.55rem;
	font-weight: 700;
	line-height: 1.25;
	white-space: nowrap;
	text-overflow: ellipsis;
	background: linear-gradient(135deg, #fff 34%, rgba(255, 255, 255, .6) 50%, #fff 66%);
	background-repeat: no-repeat;
	background-size: 300% 300%;
	background-position: 0 0;
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
	animation: tz-cta-shine 3.5s ease-in-out infinite;
}

@keyframes tz-cta-shine {
	0% { background-position: 0 0; }
	43% { background-position: 100% 0; }
	100% { background-position: 100% 0; }
}

.tz-cta-strip .arrow {
	display: grid;
	flex: 0 0 1.6rem;
	width: 1.6rem;
	height: 1.6rem;
	place-items: center;
	border-radius: 50%;
	background: transparent;
	color: #fff;
	border: 1px solid white;
}

.tz-cta-strip .arrow svg {
	width: .9rem;
	height: .9rem;
}

@media (max-width: 48rem) {
	.tz-cta-strip {
		justify-content: center;
	}

	.tz-cta-text {
		flex: 0 1 auto;
		font-size: 1rem;
	}
}

.tzr-finder-overlay {
	--tzf-navy: var(--legacy-dark-blue, #142c63);
	--tzf-navy-3: #0f1838;
	--tzf-orange: var(--legacy-orange, #e77b1b);
	--tzf-grey: #6b7280;
	--tzf-grey-2: #374151;
	--tzf-border: #e6e2d8;
	--tzf-success: #16a34a;
	--tzf-shadow-lg: 0 24px 60px -20px rgba(15, 24, 56, .35);
	--tzf-radius-lg: 22px;
	--tzf-radius-md: 14px;
	--tzf-ease: cubic-bezier(.2, .7, .2, 1);

	position: fixed;
	inset: 0;
	z-index: 100000;
	background: rgba(0, 0, 0, .6);
	display: none;
	align-items: center;
	justify-content: center;
	padding: 24px;
}

.tzr-finder-overlay.open {
	display: flex;
}

body.tzr-finder-lock {
	overflow: hidden;
}

.tzr-finder-overlay .tz-finder {
	position: relative;
	background: #fff;
	border-radius: var(--tzf-radius-lg);
	box-shadow: var(--tzf-shadow-lg);
	overflow: hidden;
	width: 100%;
	max-width: 560px;
	max-height: 90vh;
	display: flex;
	flex-direction: column;
	font-family: inherit;
	color: var(--tzf-navy);
}

.tzr-finder-overlay .tz-finder.open {
	animation: tzrFinderFadeIn .35s var(--tzf-ease);
}

@keyframes tzrFinderFadeIn {
	from { opacity: 0; transform: translateY(6px); }
	to { opacity: 1; transform: none; }
}

.tz-finder-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 18px 22px;
	border-bottom: 1px solid #f1ecdf;
	background: linear-gradient(180deg, #fff 0%, #fbf7ed 100%);
	flex-shrink: 0;
}

.tz-finder-back {
	width: 38px;
	height: 38px;
	border-radius: 50%;
	background: var(--tzf-navy);
	color: #fff;
	border: none;
	cursor: pointer;
	display: grid;
	place-items: center;
	transition: background .2s var(--tzf-ease);
}
.tz-finder-back svg { width: 16px; height: 16px; }
.tz-finder-back:hover { background: var(--tzf-navy-3); }
.tz-finder-back:disabled { opacity: .3; cursor: not-allowed; }

.tz-finder-progress { display: flex; align-items: center; gap: 8px; }
.tz-finder-progress .step {
	width: 30px;
	height: 30px;
	border-radius: 50%;
	border: 2px solid #e3decd;
	background: #fff;
	display: grid;
	place-items: center;
	font-size: 13px;
	font-weight: 700;
	color: var(--tzf-grey);
	transition: all .25s var(--tzf-ease);
}
.tz-finder-progress .step.is-active { background: var(--tzf-navy); color: #fff; border-color: var(--tzf-navy); transform: scale(1.08); }
.tz-finder-progress .step.is-done { background: var(--tzf-success); color: #fff; border-color: var(--tzf-success); }

.tz-finder-close { background: transparent; border: none; cursor: pointer; color: var(--tzf-grey); padding: 6px 10px; display: grid; place-items: center; }
.tz-finder-close svg { width: 18px; height: 18px; }
.tz-finder-close:hover { color: var(--tzf-navy); }

.tz-finder-body { padding: 24px 22px 26px; overflow-y: auto; }
.tz-step-label { display: inline-block; font-size: 11px; letter-spacing: 1.5px; font-weight: 700; color: var(--tzf-orange); text-transform: uppercase; margin-bottom: 6px; }
.tz-step-q { font-size: 22px; font-weight: 700; line-height: 1.25; margin: 0 0 4px; color: var(--tzf-navy); }
.tz-step-hint { font-size: 13px; color: var(--tzf-grey); margin: 0 0 18px; }

.tz-options { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tz-options.cols-3 { grid-template-columns: repeat(3, 1fr); }
.tz-option {
	text-align: left;
	background: #fff;
	border: 1.5px solid #e5dfce;
	border-radius: var(--tzf-radius-md);
	padding: 14px 14px 14px 16px;
	cursor: pointer;
	font-family: inherit;
	display: flex;
	flex-direction: column;
	gap: 4px;
	transition: all .2s var(--tzf-ease);
	position: relative;
}
.tz-option .ico { width: 36px; height: 36px; border-radius: 10px; background: var(--tzf-navy); color: #fff; display: grid; place-items: center; margin-bottom: 8px; transition: background .2s var(--tzf-ease); }
.tz-option .ico svg { width: 20px; height: 20px; stroke: #fff; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.tz-option .ttl { font-weight: 700; font-size: 15px; line-height: 1.25; color: var(--tzf-navy); }
.tz-option .sub { font-size: 12.5px; color: var(--tzf-grey); line-height: 1.4; }
.tz-option:hover { border-color: var(--tzf-orange); background: #fffaf3; transform: translateY(-2px); box-shadow: 0 6px 18px -8px rgba(231, 123, 27, .35); }
.tz-option:hover .ttl { color: var(--tzf-orange); }
.tz-option:hover .ico { background: var(--tzf-orange); }

.tz-finder-search { display: flex; align-items: center; gap: 10px; background: #fbf6ea; border: 1.5px solid #ebe2c9; border-radius: var(--tzf-radius-md); padding: 10px 14px; margin-bottom: 16px; }
.tz-finder-search input { flex: 1; border: none; background: transparent; font-size: 15px; outline: none; font-family: inherit; color: var(--tzf-navy); }
.tz-finder-search input::placeholder { color: #a89978; }
.tz-finder-search .ico { color: var(--tzf-orange); display: grid; place-items: center; }
.tz-finder-search .ico svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 2; fill: none; }

.tz-results-intro { background: #fffaf0; border: 1px dashed #f3d8a5; border-radius: var(--tzf-radius-md); padding: 12px 14px; margin-bottom: 14px; font-size: 13.5px; line-height: 1.45; color: var(--tzf-navy); }
.tz-results-intro strong { color: var(--tzf-navy); font-weight: 600; }

.tz-result-stack { display: flex; flex-direction: column; gap: 10px; }
.tz-result {
	display: flex;
	align-items: stretch;
	gap: 14px;
	background: #fff;
	border: 1.5px solid #ece4d2;
	border-radius: var(--tzf-radius-md);
	padding: 14px 16px;
	text-decoration: none;
	color: inherit;
	transition: all .2s var(--tzf-ease);
	position: relative;
}
.tz-result:hover { border-color: var(--tzf-orange); background: #fffaf3; transform: translateY(-2px); box-shadow: 0 8px 22px -10px rgba(231, 123, 27, .35); }
.tz-result.is-primary { border-color: var(--tzf-orange); background: #fffaf3; box-shadow: 0 4px 18px -8px rgba(231, 123, 27, .25); }
.tz-result.is-primary::after {
	content: "BEST MATCH";
	position: absolute;
	top: -10px;
	left: 14px;
	background: var(--tzf-orange);
	color: #fff;
	font-size: 10px;
	letter-spacing: 1.2px;
	font-weight: 800;
	padding: 3px 8px;
	border-radius: 6px;
}
.tz-result .r-body { flex: 1; }
.tz-result .r-name { font-weight: 700; font-size: 16px; line-height: 1.2; color: var(--tzf-navy); }
.tz-result .r-meta { font-size: 12.5px; color: var(--tzf-grey); margin-top: 3px; line-height: 1.4; }
.tz-result .r-why { font-size: 12.5px; color: var(--tzf-grey-2); margin-top: 6px; background: rgba(231, 123, 27, .07); border-radius: 6px; padding: 5px 8px; display: inline-block; }
.tz-result .r-right { display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; min-width: 120px; text-align: right; }
.tz-result .r-price { font-weight: 700; font-size: 15px; color: var(--tzf-navy); white-space: nowrap; }
.tz-result .r-price small { display: block; font-size: 10.5px; color: var(--tzf-grey); font-weight: 500; }
.tz-result .r-go { background: var(--tzf-orange); color: #fff; border-radius: 8px; font-size: 11.5px; font-weight: 700; padding: 6px 10px; display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.tz-result .r-go svg { width: 12px; height: 12px; stroke: currentColor; stroke-width: 2.5; fill: none; }

.tz-result-group { font-size: 11px; font-weight: 800; letter-spacing: 1.4px; color: var(--tzf-grey); text-transform: uppercase; margin: 20px 4px 10px; display: flex; align-items: center; gap: 8px; }
.tz-result-group::after { content: ""; flex: 1; height: 1px; background: #ece4d2; }

.tz-bottom-ctas { display: flex; gap: 10px; margin-top: 14px; }
.tz-bottom-ctas a, .tz-bottom-ctas button {
	flex: 1;
	text-align: center;
	border-radius: var(--tzf-radius-md);
	padding: 12px 14px;
	font-weight: 700;
	font-size: 13.5px;
	text-decoration: none;
	cursor: pointer;
	border: none;
	font-family: inherit;
	transition: all .2s var(--tzf-ease);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
}
.tz-bottom-ctas svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 2; fill: none; }
.tz-talk { background: var(--tzf-navy); color: #fff; }
.tz-talk:hover { background: var(--tzf-navy-3); }
.tz-talk-text { display: flex; flex-direction: column; align-items: center; line-height: 1.3; }
.tz-callback { background: transparent; color: var(--tzf-navy); border: 1.5px solid var(--tzf-navy) !important; }
.tz-callback:hover { background: var(--tzf-navy); color: #fff; }

.tz-nvq-finder { background: #fbf6ea; border: 1px solid #ece2c4; border-radius: var(--tzf-radius-md); padding: 14px; margin-top: 6px; }
.tz-nvq-finder h4 { margin: 0 0 8px; font-size: 14px; color: var(--tzf-navy); font-weight: 800; }
.tz-nvq-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.tz-nvq-chip {
	background: #fff;
	border: 1.5px solid #e5dfce;
	border-radius: 8px;
	padding: 6px 12px;
	font-size: 12.5px;
	font-weight: 700;
	cursor: pointer;
	color: var(--tzf-navy);
	text-decoration: none;
	display: inline-block;
	font-family: inherit;
}
.tz-nvq-chip:hover { border-color: var(--tzf-orange); color: var(--tzf-orange); }

@media (max-width: 680px) {
	.tz-options { grid-template-columns: 1fr; }
	.tz-options.cols-3 { grid-template-columns: 1fr; }
	.tz-result { flex-direction: column; }
	.tz-result .r-right { align-items: flex-start; text-align: left; flex-direction: row; justify-content: space-between; width: 100%; }
	.tz-bottom-ctas { flex-direction: column; }
	.tzr-finder-overlay { padding: 12px; }
}
