/* Live Search Styles - Desktop */
/* Normal header search - fixed position so it stays visible when scrolling */
#live_search_results {
	position: fixed;
	top: 130px;
	left: 50%;
	transform: translateX(-50%);
	width: 600px;
	max-width: calc(100% - 40px);
	background: white;
	border: 1px solid #ddd;
	border-radius: 8px;
	box-shadow: 0 4px 16px rgba(0,0,0,0.15);
	z-index: 10000;
	max-height: 600px;
	overflow-y: auto;
	display: none;
}

/* Sticky header search - absolute position relative to parent */
#live_search_results_sticky {
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	background: white;
	border: 1px solid #ddd;
	border-top: none;
	border-radius: 0 0 8px 8px;
	box-shadow: 0 4px 16px rgba(0,0,0,0.15);
	z-index: 10000;
	max-height: 600px;
	overflow-y: auto;
	display: none;
}

/* Live Search Styles - Mobile */
#live_search_results_mobile,
#live_search_results_mobile_sticky {
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	background: white;
	border: 1px solid #ddd;
	border-top: none;
	border-radius: 0 0 8px 8px;
	box-shadow: 0 4px 16px rgba(0,0,0,0.15);
	z-index: 10000;
	max-height: 600px;
	min-height: 80px;
	overflow-y: auto;
	display: none;
	visibility: hidden;
	opacity: 0;
}

/* Mobile Search Form Container needs relative positioning */
#search_shop_form_mobile,
#search_shop_form_mobile_sticky,
#search_shop_form_top,
#search_shop_form_sticky,
#search_shop_form_mobile .position-relative,
#search_shop_form_mobile_sticky .position-relative,
#search_shop_form_top .position-relative,
#search_shop_form_sticky .position-relative {
	position: relative;
}

/* Mobile backdrop - nicht mehr benötigt */
.mobile-search-backdrop,
.mobile-search-backdrop-mobile {
	display: none !important;
}

/* Mobile optimizations */
@media (max-width: 767px) {
	#live_search_results_mobile,
	#live_search_results_mobile_sticky {
		position: fixed;
		top: auto;
		bottom: 0;
		left: 0;
		right: 0;
		max-height: 80vh;
		height: 80vh;
		border-radius: 8px 8px 0 0;
		border: 1px solid #ddd;
		border-bottom: none;
	}
	
	.live-search-content {
		padding: 15px;
		height: 100%;
		overflow-y: auto;
	}
	
	.search-loading {
		padding: 40px 20px;
		font-size: 18px;
		min-height: 120px;
	}
	
	/* Desktop Live Search kann für fixed Modal verwendet werden */
	#live_search_results {
		position: fixed;
		top: 200px;
		left: 10px;
		right: 10px;
		bottom: 20px;
		max-height: none;
		border-radius: 8px;
		border: 1px solid #ddd;
		z-index: 9998;
	}
}

.live-search-content {
	padding: 10px;
}

.search-loading {
	text-align: center;
	padding: 20px;
	color: #666;
	min-height: 60px;
	display: none;
}

.search-results-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 15px;
	margin-top: 10px;
}

/* Ultra Wide Desktop: 4 Cards */
@media (min-width: 2048px) {
	.search-results-grid {
		grid-template-columns: repeat(4, 1fr);
		gap: 15px;
	}
}

/* Very small mobile */
@media (max-width: 480px) {
	.search-results-grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 6px;
	}
	
	#live_search_results,
	#live_search_results_mobile {
		left: 5px;
		right: 5px;
		top: 180px;
		bottom: 15px;
	}
}

.search-result-item {
	display: flex;
	flex-direction: column;
	background: white;
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	text-decoration: none;
	color: inherit;
	cursor: pointer;
	transition: all 0.2s ease;
	overflow: hidden;
	height: 100%;
}

.search-result-item:hover {
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(0,0,0,0.15);
	text-decoration: none;
	color: inherit;
}

.search-result-image {
	width: 100%;
	aspect-ratio: 1;
	object-fit: cover;
	background-color: #f0f0f0;
	display: block;
}

.search-result-content {
	padding: 10px 12px 12px 12px;
	position: relative;
	display: flex;
	flex-direction: column;
	flex: 1;
	min-height: 0;
}

.search-result-type-badge {
	display: inline-block;
	background: #007bff;
	color: white;
	font-size: 10px;
	font-weight: bold;
	padding: 3px 8px;
	border-radius: 12px;
	text-transform: uppercase;
	margin-bottom: 8px;
	text-align: center;
}

.search-result-item.special-offer .search-result-type-badge {
	background: #28a745;
}

.search-result-title {
	font-weight: bold;
	font-size: 14px;
	margin-bottom: 6px;
	line-height: 1.3;
	color: #000;
	overflow: hidden;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

.search-result-description {
	font-size: 12px;
	color: #666;
	margin-bottom: 8px;
	line-height: 1.4;
	overflow: hidden;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	flex: 1;
}

.search-result-meta {
	font-size: 11px;
	color: #888;
	margin-bottom: 4px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.search-result-debug {
	font-size: 10px;
	color: red;
	font-weight: bold;
	margin-top: 4px;
}

/* Mobile card optimizations */
@media (max-width: 767px) {
	.search-result-content {
		padding: 8px;
	}
	
	.search-result-title {
		font-size: 13px;
		margin-bottom: 4px;
	}
	
	.search-result-description {
		font-size: 11px;
		margin-bottom: 6px;
		-webkit-line-clamp: 1;
	}
	
	.search-result-meta {
		font-size: 10px;
		margin-bottom: 2px;
	}
	
	.search-result-type-badge {
		font-size: 9px;
		padding: 2px 6px;
		margin-bottom: 6px;
	}
	
	.search-result-price {
		padding-top: 6px;
	}
	
	.search-result-price-current {
		font-size: 12px;
	}
	
	.search-result-price-offer {
		font-size: 12px;
	}
	
	.search-result-price-regular {
		font-size: 10px;
	}
}

.search-result-item.special-offer {
	background: linear-gradient(90deg, #fff3cd 0%, #ffffff 100%);
	border-left: 3px solid #ff6b35;
}

.search-result-item.special-offer:hover {
	background: linear-gradient(90deg, #fff3cd 0%, #f8f9fa 100%);
}

.search-result-price {
	margin-top: auto;
	padding-top: 8px;
	border-top: 1px solid #f0f0f0;
	flex-shrink: 0;
}

.search-result-price-current {
	font-weight: bold;
	color: #000;
	font-size: 14px;
}

.search-result-price-regular {
	font-size: 12px;
	color: #999;
	text-decoration: line-through;
	margin-bottom: 2px;
}

.search-result-price-offer {
	color: #ff6b35;
	font-weight: bold;
	font-size: 14px;
}

.search-result-special-badge {
	display: inline-block;
	background-color: #ff6b35;
	color: white;
	font-size: 8px;
	padding: 1px 3px;
	border-radius: 6px;
	margin-left: 4px;
	font-weight: bold;
	vertical-align: middle;
}

.search-section-title {
	font-weight: bold;
	color: #007bff;
	margin: 10px 0 5px 0;
	padding-bottom: 3px;
	border-bottom: 1px solid #e0e0e0;
	font-size: 13px;
}

.search-no-results {
	text-align: center;
	padding: 20px;
	color: #666;
	font-style: italic;
}

/* Mobile search button fix */
#submit_search_mobile {
	height: auto;
}