/*!
 * Ultimate Ajax Search Box - Frontend Styles
 * https://www.tarakvora.in
 */

.uasb-wrap {
	display: inline-block;
	max-width: 100%;
}

.uasb-trigger {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: transparent;
	border: none;
	cursor: pointer;
	padding: 12px;
	margin: 0;
	line-height: 1;
	min-width: 44px;
	min-height: 44px;
	box-sizing: border-box;
	transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.uasb-trigger:focus-visible {
	outline: 2px solid #0073aa;
	outline-offset: 2px;
}

.uasb-trigger-icon,
.uasb-submit,
.uasb-close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
}

.uasb-trigger-icon i,
.uasb-submit i,
.uasb-close i {
	line-height: 1;
}

/* Overlay */
.uasb-overlay {
	position: fixed;
	inset: 0;
	width: 100%;
	height: 100%;
	background-color: rgba(0, 0, 0, 0.5);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 999999;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity 0.3s ease, visibility 0.3s ease;
	padding: 20px;
	box-sizing: border-box;
	/* Lets the box scroll into view instead of being clipped when a mobile
	   on-screen keyboard shrinks the visible viewport height. */
	overflow-y: auto;
}

.uasb-overlay.uasb-is-open {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
}

body.uasb-lock-scroll {
	overflow: hidden;
}

/* Overlay animations affect the inner box */
.uasb-box {
	position: relative;
	width: 60%;
	max-width: 100%;
	box-sizing: border-box;
	background: #ffffff;
	padding: 20px 30px;
	border-radius: 6px;
	transition: opacity 0.3s ease, transform 0.3s ease;
	opacity: 0;
}

.uasb-overlay.uasb-is-open .uasb-box {
	opacity: 1;
}

/* Fade (default): box just fades with overlay */
.uasb-anim-fade .uasb-box {
	transform: none;
}

/* Slide down */
.uasb-anim-slide-down .uasb-box {
	transform: translateY(-40px);
}

.uasb-anim-slide-down.uasb-is-open .uasb-box {
	transform: translateY(0);
}

/* Zoom */
.uasb-anim-zoom .uasb-box {
	transform: scale(0.85);
}

.uasb-anim-zoom.uasb-is-open .uasb-box {
	transform: scale(1);
}

.uasb-form {
	display: flex;
	align-items: center;
	gap: 12px;
	width: 100%;
}

.uasb-input {
	flex: 1 1 auto;
	width: 100%;
	height: 56px;
	border: none;
	border-bottom: 2px solid #dddddd;
	background: transparent;
	color: #222222;
	font-size: 20px;
	padding: 8px 4px;
	box-sizing: border-box;
	outline: none;
	-webkit-appearance: none;
	appearance: none;
}

.uasb-input::-webkit-search-decoration,
.uasb-input::-webkit-search-cancel-button,
.uasb-input::-webkit-search-results-button,
.uasb-input::-webkit-search-results-decoration {
	-webkit-appearance: none;
}

.uasb-input::placeholder {
	color: #999999;
}

.uasb-submit {
	flex: 0 0 auto;
	background: transparent;
	border: none;
	cursor: pointer;
	padding: 8px;
	color: #222222;
	min-width: 40px;
	min-height: 40px;
	box-sizing: border-box;
}

.uasb-close {
	position: absolute;
	top: 30px;
	right: 30px;
	background: transparent;
	border: none;
	cursor: pointer;
	padding: 8px;
	color: #ffffff;
	z-index: 1;
	min-width: 40px;
	min-height: 40px;
	box-sizing: border-box;
}

/* Live results */
.uasb-live-results {
	width: 100%;
	margin-top: 16px;
	max-height: 400px;
	overflow-y: auto;
	background: #ffffff;
	text-align: left;
}

.uasb-live-results[hidden] {
	display: none;
}

.uasb-result-item {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	padding: 10px 6px;
	text-decoration: none;
	border-bottom: 1px solid rgba(0, 0, 0, 0.06);
	transition: background-color 0.15s ease;
}

.uasb-result-item:last-child {
	border-bottom: none;
}

.uasb-result-item:hover {
	background-color: #f5f5f5;
}

.uasb-result-thumb {
	flex: 0 0 auto;
	width: 48px;
	height: 48px;
	object-fit: cover;
	border-radius: 4px;
}

.uasb-result-body {
	flex: 1 1 auto;
	min-width: 0;
}

.uasb-result-title {
	display: block;
	font-size: 15px;
	font-weight: 600;
	color: #222222;
	margin: 0 0 4px;
}

.uasb-result-excerpt {
	display: block;
	font-size: 13px;
	color: #666666;
	margin: 0;
	line-height: 1.4;
}

.uasb-no-results {
	padding: 16px 6px;
	color: #666666;
	font-size: 14px;
}

.uasb-view-all {
	display: inline-block;
	margin-top: 10px;
	padding: 6px;
	font-size: 14px;
	font-weight: 600;
	color: #0073aa;
	text-decoration: underline;
}

.uasb-live-loading {
	padding: 16px 6px;
	color: #666666;
	font-size: 14px;
}

/* Responsive
 * Sizing controlled from the Elementor Style tab (icon size/padding, box
 * width/padding, input height, close position, etc.) already ships with its
 * own sensible tablet/mobile defaults out of the box — these rules cover
 * everything else: structural layout that has no Style control, and a
 * fallback for sites where the per-breakpoint Elementor CSS hasn't been
 * regenerated yet after updating the plugin.
 */

/* Tablet */
@media (max-width: 1024px) {
	.uasb-box {
		width: 80%;
	}

	.uasb-form {
		gap: 10px;
	}
}

/* Mobile */
@media (max-width: 767px) {
	.uasb-overlay {
		padding: 16px;
	}

	.uasb-box {
		width: 100%;
		padding: 16px 18px;
	}

	.uasb-input {
		font-size: 17px; /* stays >=16px so iOS Safari does not zoom in on focus */
		height: 48px;
	}

	.uasb-form {
		gap: 8px;
	}

	.uasb-close {
		top: 16px;
		right: 16px;
	}

	.uasb-result-thumb {
		width: 40px;
		height: 40px;
	}
}

/* Small phones */
@media (max-width: 380px) {
	.uasb-box {
		padding: 14px;
	}

	.uasb-input {
		font-size: 16px;
		height: 44px;
	}

	.uasb-result-title {
		font-size: 14px;
	}

	.uasb-result-excerpt {
		font-size: 12px;
	}
}

/* Short / landscape viewports: an on-screen keyboard or a short landscape
 * phone can leave too little vertical room to center the box without
 * clipping it, so align to the top instead and let the overlay scroll. */
@media (max-height: 480px) {
	.uasb-overlay {
		align-items: flex-start;
		padding-top: 12px;
	}

	.uasb-close {
		position: fixed;
	}
}
