/**
 * DooFinder-Style Features CSS
 * Modern, clean search experience - Fixed Top Layout
 */

/* ========================================
   FIXED TOP OVERLAY (DooFinder Style)
   Base styles - Exact styles in doofinder-exact.css
======================================== */

/* Close Button - Top Right (Base, overridden by doofinder-exact.css) */
.codesws-mode-fullscreen .codesws-overlay-container.is-active .codesws-btn-close {
	position: absolute;
	z-index: 1000001;
}

/* Content Container */
.codesws-mode-fullscreen .codesws-overlay-container.is-active .codesws-suggestions-container {
	max-width: 1400px;
	margin: 0 auto;
	padding: 30px 20px;
	width: 100%;
}

/* Voice Search Button */
.codesws-btn-voice {
	padding: 8px 12px;
	background: transparent;
	border: none;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.2s ease;
	color: #666666;
}

.codesws-btn-voice:hover {
	background: #f5f5f5;
	color: var(--codesws-primary, #2196f3);
}

.codesws-btn-voice.is-listening {
	color: #f44336;
	animation: pulse 1.5s infinite;
}

.codesws-btn-voice .dashicons {
	width: 20px;
	height: 20px;
	font-size: 20px;
}

@keyframes pulse {
	0%, 100% {
		opacity: 1;
	}
	50% {
		opacity: 0.5;
	}
}

/* Suggestions Container - Base */
.codesws-suggestions-container {
	width: 100%;
	padding: 20px 0;
}

/* Modal mode removed */

/* Section Header */
.codesws-section-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 16px;
	padding: 0 4px;
}

.codesws-section-header h3 {
	font-size: 14px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: #666666;
	margin: 0;
}

.codesws-btn-clear-history {
	font-size: 12px;
	color: #f44336;
	background: none;
	border: none;
	cursor: pointer;
	padding: 4px 8px;
	transition: color 0.2s ease;
	text-decoration: none;
}

.codesws-btn-clear-history:hover {
	color: #d32f2f;
	text-decoration: underline;
}

/* Recent Searches - Base styles, exact in doofinder-exact.css */
.codesws-recent-searches {
	margin-bottom: 0;
}

/* Popular Searches - Base styles, exact in doofinder-exact.css */
.codesws-popular-searches {
	margin-bottom: 0;
}

/* Recommended Products - Base styles, exact in doofinder-exact.css */
.codesws-recommended-products {
	margin-bottom: 0;
}

/* Recommended item styles in doofinder-exact.css */

.codesws-rec-thumb {
	width: 100%;
	height: 150px;
	margin-bottom: 12px;
	border-radius: var(--codesws-radius, 4px);
	overflow: hidden;
	background: #f5f5f5;
}

.codesws-rec-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.codesws-rec-title {
	font-size: 13px;
	font-weight: 500;
	color: var(--codesws-text, #333333);
	margin-bottom: 8px;
	line-height: 1.4;
	overflow: hidden;
	text-overflow: ellipsis;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

.codesws-rec-price {
	font-size: 14px;
	font-weight: 600;
	color: var(--codesws-primary, #2196f3);
}

/* Fullscreen Mode Enhancements - Exact styles in doofinder-exact.css */

/* Responsive */
@media (max-width: 1024px) {
	.codesws-suggestions-container {
		grid-template-columns: 1fr;
		gap: 30px;
	}

	.codesws-recommended-item {
		width: 180px;
		min-width: 180px;
	}
}

@media (max-width: 768px) {
	.codesws-mode-fullscreen .codesws-overlay-container.is-active {
		padding: 0;
	}

	.codesws-mode-fullscreen .codesws-overlay-container.is-active .codesws-search-box {
		padding: 16px;
	}

	.codesws-mode-fullscreen .codesws-overlay-container.is-active .codesws-input-field {
		font-size: 16px;
		height: 48px;
		padding: 12px 16px;
	}

	.codesws-suggestions-container {
		padding: 20px 16px;
		grid-template-columns: 1fr;
		gap: 24px;
	}

	.codesws-recommended-item {
		width: 160px;
		min-width: 160px;
	}

	.codesws-rec-thumb {
		height: 120px;
	}

	.codesws-recent-item {
		font-size: 12px;
		padding: 5px 10px;
	}

	.codesws-popular-item {
		font-size: 13px;
		padding: 8px 10px;
	}
}

@media (max-width: 480px) {
	.codesws-recommended-item {
		width: 140px;
		min-width: 140px;
	}

	.codesws-rec-thumb {
		height: 100px;
	}
}

/* Hide suggestions when results are shown */
.codesws-results-wrapper.is-visible ~ .codesws-suggestions-container {
	display: none;
}

/* Animation for suggestions */
.codesws-suggestions-container {
	animation: codesws-fade-in 0.3s ease;
}

.codesws-recent-item,
.codesws-popular-tag,
.codesws-recommended-item {
	animation: codesws-slide-up 0.3s ease;
}

@keyframes codesws-slide-up {
	from {
		opacity: 0;
		transform: translateY(10px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* Loading State */
.codesws-suggestions-container.is-loading {
	opacity: 0.5;
	pointer-events: none;
}
