.trf-search-widget,
.trf-search-widget * {
	box-sizing: border-box;
}

.trf-search-trigger {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 10px;
	color: inherit;
	background: transparent;
	border: 0;
	cursor: pointer;
	transition: color .3s ease, transform .3s ease;
}

.trf-search-trigger:hover {
	transform: scale(1.06);
}

.trf-search-trigger svg {
	display: block;
	width: 20px;
	height: 20px;
}

.trf-search-overlay {
	position: fixed;
	top: 0;
	left: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100vw;
	height: 60vh;
	min-height: 350px;
	padding: 70px 20px 40px;
	visibility: hidden;
	opacity: 0;
	transform: translateY(-100%);
	transition: transform .6s cubic-bezier(.77, 0, .175, 1), opacity .3s ease, visibility .6s;
}

.trf-search-overlay.active {
	visibility: visible;
	opacity: 1;
	transform: translateY(0);
}

.trf-search-is-open {
	overflow: hidden;
}

.trf-preview-active {
	position: relative !important;
	width: 100% !important;
	height: auto !important;
	min-height: 320px !important;
	margin-top: 20px;
	visibility: visible !important;
	opacity: 1 !important;
	transform: none !important;
	border-radius: 8px;
}

.trf-preview-active .trf-close-btn {
	display: none !important;
}

.trf-close-btn {
	position: absolute;
	top: 0;
	right: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 52px;
	height: 52px;
	padding: 0;
	color: #fff;
	border: 0;
	cursor: pointer;
	transition: filter .25s ease;
}

.trf-close-btn:hover {
	filter: brightness(.88);
}

.trf-close-btn svg {
	width: 24px;
	height: 24px;
}

.trf-search-container {
	position: relative;
	width: 100%;
	max-width: 900px;
}

.trf-search-form {
	position: relative;
	z-index: 2;
	display: flex;
	width: 100%;
	overflow: hidden;
	border: 1px solid transparent;
	transition: box-shadow .3s ease;
}

.trf-search-form:focus-within {
	box-shadow: 0 12px 35px rgba(0, 0, 0, .22);
}

.trf-search-input {
	flex: 1 1 auto;
	min-width: 0;
	padding: 18px 25px !important;
	font-family: inherit;
	background: transparent !important;
	border: 0 !important;
	outline: 0 !important;
	box-shadow: none !important;
	-webkit-appearance: none;
}

.trf-search-input::-webkit-search-cancel-button {
	cursor: pointer;
}

.trf-search-submit {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 58px;
	font-family: inherit;
	font-weight: 800;
	text-transform: uppercase;
	border: 0;
	cursor: pointer;
	transition: filter .25s ease;
}

.trf-search-submit:hover {
	filter: brightness(.88);
}

.trf-search-results {
	position: absolute;
	top: calc(100% + 8px);
	left: 0;
	z-index: 3;
	width: 100%;
	max-height: min(48vh, 480px);
	overflow-x: hidden;
	overflow-y: auto;
	border: 1px solid rgba(0, 0, 0, .1);
	box-shadow: 0 18px 45px rgba(0, 0, 0, .25);
}

.trf-search-results[hidden] {
	display: none !important;
}

.trf-result-link {
	display: flex;
	align-items: center;
	gap: 16px;
	width: 100%;
	padding: 14px 18px;
	text-decoration: none !important;
	border-bottom: 1px solid rgba(0, 0, 0, .08);
	outline: 0;
	transition: background-color .2s ease;
}

.trf-result-link:last-child {
	border-bottom: 0;
}

.trf-result-thumbnail {
	flex: 0 0 68px;
	width: 68px;
	height: 68px;
	object-fit: cover;
	border-radius: 5px;
}

.trf-result-content {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	min-width: 0;
}

.trf-result-type {
	margin-bottom: 3px;
	font-size: 11px;
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: .08em;
	text-transform: uppercase;
	opacity: .75;
}

.trf-result-title {
	font-size: 16px;
	font-weight: 800;
	line-height: 1.35;
}

.trf-result-excerpt {
	margin-top: 4px;
	font-size: 13px;
	line-height: 1.45;
}

.trf-search-message {
	position: relative;
	padding: 22px 24px;
	font-size: 15px;
	line-height: 1.5;
	text-align: center;
}

.trf-search-message.is-loading {
	padding-left: 48px;
}

.trf-search-message.is-loading::before {
	position: absolute;
	top: 50%;
	left: 22px;
	width: 16px;
	height: 16px;
	margin-top: -8px;
	content: '';
	border: 2px solid currentColor;
	border-right-color: transparent;
	border-radius: 50%;
	animation: trf-search-spin .7s linear infinite;
}

@keyframes trf-search-spin {
	to { transform: rotate(360deg); }
}

@media (max-width: 767px) {
	.trf-search-overlay {
		height: 72vh;
		min-height: 420px;
		padding: 72px 14px 30px;
	}

	.trf-search-form {
		flex-wrap: nowrap;
	}

	.trf-search-input {
		padding: 15px 16px !important;
	}

	.trf-search-submit {
		min-height: 52px;
		padding-right: 18px !important;
		padding-left: 18px !important;
		font-size: 12px;
	}

	.trf-search-results {
		max-height: 44vh;
	}

	.trf-result-link {
		gap: 12px;
		padding: 12px;
	}

	.trf-result-thumbnail {
		flex-basis: 56px;
		width: 56px;
		height: 56px;
	}

	.trf-result-excerpt {
		display: none;
	}
}
