/**
 * Search Modal Styles
 * Professional search modal with autocomplete suggestions
 */

/* Search Toggle Button in Header */
.search-toggle {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 2.5rem;
	height: 2.5rem;
	color: #2c2824;
	background: transparent;
	border: none;
	cursor: pointer;
	margin-right: 0.75rem;
	transition: all 0.3s ease;
	border-radius: 50%;
	padding: 0;
}

.search-toggle:hover {
	color: #8B7355;
	background: rgba(139, 115, 85, 0.1);
}

.search-toggle i {
	font-size: 1.125rem;
}

/* Search Modal Overlay */
.search-modal-overlay {
	position: fixed;
	inset: 0;
	background: rgba(44, 40, 36, 0.7);
	backdrop-filter: blur(0.25rem);
	z-index: 9998;
	opacity: 0;
	visibility: hidden;
	transition: all 0.3s ease;
}

.search-modal-overlay.active {
	opacity: 1;
	visibility: visible;
}

/* Search Modal */
.search-modal {
	position: fixed;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%) scale(0.95);
	max-width: 42rem;
	width: 90%;
	max-height: 80vh;
	background: #ffffff;
	border-radius: 1rem;
	box-shadow: 0 1.25rem 3.75rem rgba(44, 40, 36, 0.3);
	z-index: 9999;
	opacity: 0;
	visibility: hidden;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.search-modal.active {
	opacity: 1;
	visibility: visible;
	transform: translate(-50%, -50%) scale(1);
}

/* Search Modal Content */
.search-modal-content {
	display: flex;
	flex-direction: column;
	height: 100%;
}

/* Search Modal Header */
.search-modal-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 1.5rem 2rem;
	border-bottom: 0.0625rem solid #e0ddd9;
	background: #f8f7f5;
}

.search-modal-title {
	font-family: "Cormorant Garamond", Georgia, serif;
	font-size: 1.75rem;
	font-weight: 400;
	color: #2c2824;
	margin: 0;
}

.search-modal-close {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 2rem;
	height: 2rem;
	background: transparent;
	border: none;
	color: #6b5f52;
	cursor: pointer;
	border-radius: 0.25rem;
	transition: all 0.3s ease;
	padding: 0;
}

.search-modal-close:hover {
	color: #2c2824;
	background: rgba(44, 40, 36, 0.1);
}

.search-modal-close i {
	font-size: 1.125rem;
}

/* Search Modal Body */
.search-modal-body {
	flex: 1;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	padding: 2rem;
}

/* Search Input Wrapper */
.search-input-wrapper {
	position: relative;
	margin-bottom: 1.5rem;
}

.search-icon {
	position: absolute;
	left: 1rem;
	top: 50%;
	transform: translateY(-50%);
	color: #6b5f52;
	font-size: 1.125rem;
	pointer-events: none;
	z-index: 1;
}

.product-search-input {
	width: 100%;
	padding: 1rem 1rem 1rem 3rem;
	border: 0.125rem solid #e0ddd9;
	border-radius: 0.5rem;
	font-family: "Lato", sans-serif;
	font-size: 1rem;
	color: #2c2824;
	background: #ffffff;
	transition: all 0.3s ease;
}

.product-search-input:focus {
	outline: none;
	border-color: #8B7355;
	box-shadow: 0 0 0 0.1875rem rgba(139, 115, 85, 0.1);
}

.product-search-input::placeholder {
	color: #9a8f85;
}

.search-loading {
	position: absolute;
	right: 1rem;
	top: 50%;
	transform: translateY(-50%);
	color: #8B7355;
	display: none;
}

.search-loading.active {
	display: block;
}

.search-loading i {
	font-size: 1.125rem;
}

/* Search Results */
.search-results {
	flex: 1;
	overflow-y: auto;
	min-height: 0;
}

.search-placeholder {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 3rem 2rem;
	text-align: center;
	color: #9a8f85;
}

.search-placeholder i {
	font-size: 3rem;
	margin-bottom: 1rem;
	opacity: 0.5;
}

.search-placeholder p {
	font-family: "Lato", sans-serif;
	font-size: 1rem;
	margin: 0;
}

/* Search Results List */
.search-results-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.search-result-item {
	display: flex;
	align-items: center;
	padding: 1rem;
	border-bottom: 0.0625rem solid #f8f7f5;
	transition: all 0.2s ease;
	cursor: pointer;
	text-decoration: none;
	color: inherit;
}

.search-result-item:hover {
	background: #f8f7f5;
	border-left: 0.25rem solid #8B7355;
	padding-left: 0.75rem;
}

.search-result-item:last-child {
	border-bottom: none;
}

.search-result-image {
	width: 4rem;
	height: 4rem;
	object-fit: cover;
	border-radius: 0.375rem;
	margin-right: 1rem;
	flex-shrink: 0;
	background: #f8f7f5;
}

.search-result-content {
	flex: 1;
	min-width: 0;
}

.search-result-title {
	font-family: "Lato", sans-serif;
	font-size: 1rem;
	font-weight: 600;
	color: #2c2824;
	margin: 0 0 0.25rem 0;
	line-height: 1.4;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.search-result-meta {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	flex-wrap: wrap;
	margin-top: 0.5rem;
}

.search-result-sku {
	font-family: "Lato", sans-serif;
	font-size: 0.875rem;
	color: #6b5f52;
}

.search-result-price {
	font-family: "Lato", sans-serif;
	font-size: 1rem;
	font-weight: 600;
	color: #8B7355;
	margin-left: auto;
}

.search-result-excerpt {
	font-family: "Lato", sans-serif;
	font-size: 0.875rem;
	color: #6b5f52;
	line-height: 1.5;
	margin-top: 0.5rem;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* Highlight matching text */
.search-highlight {
	background: rgba(139, 115, 85, 0.15);
	font-weight: 600;
	color: #8B7355;
	padding: 0 0.125rem;
	border-radius: 0.125rem;
}

/* No Results */
.search-no-results {
	padding: 3rem 2rem;
	text-align: center;
	color: #6b5f52;
}

.search-no-results i {
	font-size: 3rem;
	margin-bottom: 1rem;
	opacity: 0.5;
	color: #9a8f85;
}

.search-no-results p {
	font-family: "Lato", sans-serif;
	font-size: 1rem;
	margin: 0;
}

/* View All Results Link */
.search-view-all {
	display: block;
	padding: 1rem;
	text-align: center;
	border-top: 0.0625rem solid #e0ddd9;
	background: #f8f7f5;
	color: #8B7355;
	text-decoration: none;
	font-family: "Lato", sans-serif;
	font-size: 1rem;
	font-weight: 600;
	transition: all 0.3s ease;
}

.search-view-all:hover {
	background: #8B7355;
	color: #ffffff;
}

/* Responsive */
@media (max-width: 768px) {
	.search-modal {
		width: 95%;
		max-height: 90vh;
		border-radius: 0.75rem;
	}

	.search-modal-header {
		padding: 1.25rem 1.5rem;
	}

	.search-modal-title {
		font-size: 1.5rem;
	}

	.search-modal-body {
		padding: 1.5rem;
	}

	.search-result-item {
		padding: 0.875rem;
	}

	.search-result-image {
		width: 3.5rem;
		height: 3.5rem;
	}
}

