/* PK Live Search Express - Custom Styles */
/* Highlight color for search terms - different from title */
mark {
	border: none !important;
	background: 0 0 !important;
	font-weight: 700;
	color: #ff6b35; /* Orange/red for search terms */
}

/* Bold title */
.pk-search-title {
	font-weight: 700 !important;
	color: #333;
}

.pk-search-title mark {
	color: #ff6b35 !important; /* Different color for highlighted terms */
	font-weight: 700;
}

/* High z-index for Flatsome compatibility */
.ui-autocomplete {
	z-index: 999999999 !important;
}

/* Flatsome search overlay compatibility */
.search-overlay .ui-autocomplete,
.header-search .ui-autocomplete {
	z-index: 999999 !important;
	position: relative !important;
}

.ui-autocomplete img,
.pk-search-thumb {
	width: 50px;
	height: 50px;
	aspect-ratio: 1/1;
	object-fit: cover;
	border-radius: 3px;
	margin-right: 10px;
	flex-shrink: 0;
}

.ui-widget.ui-widget-content {
	max-height: 80vh;
	max-width: 600px; /* Default, can be overridden by admin setting */
	overflow: auto;
	margin-top: 5px !important;
	border-radius: 5px;
	border: none;
	box-shadow: 0 8px 10px -5px rgb(0 0 0 / 20%), 0 16px 24px 2px rgb(0 0 0 / 14%), 0 6px 30px 5px rgb(0 0 0 / 10%);
	background: #fff;
	width: 100%;
	box-sizing: border-box;
}

/* Flatsome style compatibility */
.search-overlay .ui-widget.ui-widget-content,
.header-search .ui-widget.ui-widget-content {
	box-shadow: 0 4px 20px rgba(0,0,0,0.15);
	border: 1px solid rgba(0,0,0,0.1);
}

.ui-menu-item:hover .ui-menu-item-wrapper,
.ui-state-active,
.pk-search-item.ui-state-active {
	background: #538ebb !important;
	border: none !important;
}

.ui-menu-item-wrapper,
.pk-search-item-content {
	text-overflow: ellipsis;
	white-space: nowrap;
	display: flex;
	align-items: center;
	overflow: hidden;
	padding: 10px 15px !important;
	cursor: pointer;
}

/* Section header styling */
.pk-search-section-header {
	background: #f5f5f5 !important;
	border-bottom: 2px solid #ddd !important;
	cursor: default !important;
	padding: 0 !important;
}

.pk-search-section-header:hover {
	background: #f5f5f5 !important;
}

.pk-search-section-title {
	font-weight: 700 !important;
	font-size: 12px !important;
	text-transform: uppercase;
	color: #666 !important;
	padding: 8px 15px !important;
	letter-spacing: 0.5px;
	border-bottom: 1px solid #e0e0e0;
}

/* Disable hover for section headers */
.pk-search-section-header .ui-menu-item-wrapper,
.pk-search-section-header .pk-search-section-title {
	cursor: default !important;
}

/* Ensure section headers are not clickable */
.pk-search-section-header.ui-state-active,
.pk-search-section-header:hover {
	background: #f5f5f5 !important;
}

.pk-search-item-content {
	width: 100%;
}

.ui-menu .ui-menu-item-wrapper {
	padding: 10px 15px !important;
}

/* Text wrapper for title and price */
.pk-search-text-wrapper {
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: space-between;
	min-width: 0; /* Allow flex items to shrink */
	gap: 10px;
}

.pk-search-title {
	flex: 1;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	text-align: left;
	min-width: 0; /* Allow text to truncate */
}

/* Price styling - aligned right */
.pk-search-price {
	font-weight: 600;
	color: #2c5aa0;
	font-size: 14px;
	white-space: nowrap;
	flex-shrink: 0;
	text-align: right;
	margin-left: auto;
}

/* Responsive for mobile */
@media (max-width: 768px) {
	.ui-widget.ui-widget-content {
		max-height: 60vh;
		font-size: 14px;
	}
	
	.ui-autocomplete img,
	.pk-search-thumb {
		width: 40px;
		height: 40px;
	}
	
	.ui-menu-item-wrapper,
	.pk-search-item-content {
		padding: 8px 12px !important;
	}
	
	.pk-search-text-wrapper {
		flex-direction: column;
		align-items: flex-start;
		gap: 5px;
	}
	
	.pk-search-price {
		font-size: 13px;
		margin-left: 0;
		align-self: flex-end;
	}
}

/* Scrollbar styling */
.ui-widget.ui-widget-content::-webkit-scrollbar-track {
	-webkit-box-shadow: inset 0 0 6px rgba(0,0,0,.3);
	background-color: #f5f5f5;
	border-radius: 10px;
}

.ui-widget.ui-widget-content::-webkit-scrollbar {
	width: 5px;
	height: 0;
	background-color: #f5f5f5;
}

.ui-widget.ui-widget-content::-webkit-scrollbar-thumb {
	background-color: #aaa;
	border-radius: 10px;
	background-image: -webkit-linear-gradient(90deg, rgba(0,0,0,.2) 25%, transparent 25%, transparent 50%, rgba(0,0,0,.2) 50%, rgba(0,0,0,.2) 75%, transparent 75%, transparent);
}

