/**
 * Global Search Overlay Styles
 *
 * @package MyBestClinicShop
 */

/* Search Icon Trigger (Shortcode) */
.mbcs-search-icon-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: inherit;
	text-decoration: none;
}

.mbcs-search-icon-link svg {
	width: 24px;
	height: 24px;
}

/* Overlay Container */
.mbcs-global-search-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.95);
	z-index: 999999;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.4s ease, visibility 0.4s ease;
	overflow-y: auto;
}

.mbcs-global-search-overlay.active {
	opacity: 1;
	visibility: visible;
}

.mbcs-global-search-container {
	position: relative;
	max-width: 1400px;
	margin: 0 auto;
	padding: 60px 20px;
	min-height: 100vh;
}

/* Search Box */
.mbcs-global-search-box {
	margin-bottom: 40px;
	transform: translateY(-30px);
	opacity: 0;
	transition: transform 0.5s ease 0.2s, opacity 0.5s ease 0.2s;
}

.mbcs-global-search-overlay.active .mbcs-global-search-box {
	transform: translateY(0);
	opacity: 1;
}

.mbcs-global-search-inner {
	position: relative;
	max-width: 800px;
	margin: 0 auto;
}

.mbcs-global-search-inner form {
	position: relative;
	width: 100%;
}

#mbcs-global-search-input {
	width: 100%;
	padding: 24px 70px 24px 24px;
	font-size: 28px;
	font-weight: 300;
	color: #fff;
	background: rgba(255, 255, 255, 0.1);
	border: 2px solid rgba(255, 255, 255, 0.2);
	border-radius: 8px;
	outline: none;
	transition: all 0.3s ease;
}

#mbcs-global-search-input::placeholder {
	color: rgba(255, 255, 255, 0.5);
}

#mbcs-global-search-input:focus {
	background: rgba(255, 255, 255, 0.15);
	border-color: rgba(255, 255, 255, 0.4);
}

.mbcs-global-search-icon {
	position: absolute;
	right: 24px;
	top: 50%;
	transform: translateY(-50%);
	color: rgba(255, 255, 255, 0.6);
	pointer-events: none;
}

/* Close Button */
.mbcs-global-search-close {
	position: absolute;
	top: 30px;
	right: 30px;
	z-index: 10;
}

.mbcs-global-search-close a {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 50px;
	height: 50px;
	background: rgba(255, 255, 255, 0.1);
	border-radius: 50%;
	transition: all 0.3s ease;
}

.mbcs-global-search-close a:hover {
	background: rgba(255, 255, 255, 0.2);
	transform: rotate(90deg);
}

.mbcs-close-wrap {
	position: relative;
	width: 24px;
	height: 24px;
}

.mbcs-close-line {
	position: absolute;
	top: 50%;
	left: 0;
	width: 100%;
	height: 2px;
	background: #fff;
	transform-origin: center;
}

.mbcs-close-line1 {
	transform: translateY(-50%) rotate(45deg);
}

.mbcs-close-line2 {
	transform: translateY(-50%) rotate(-45deg);
}

/* Results Container */
.mbcs-global-search-results {
	transform: translateY(-20px);
	opacity: 0;
	transition: transform 0.5s ease 0.3s, opacity 0.5s ease 0.3s;
}

.mbcs-global-search-overlay.active .mbcs-global-search-results {
	transform: translateY(0);
	opacity: 1;
}

.mbcs-global-search-results-inner {
	max-width: 1200px;
	margin: 0 auto;
}

/* Products Grid */
.mbcs-global-search-products-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
	gap: 30px;
}

/* Product Card */
.mbcs-global-search-product-card {
	background: rgba(255, 255, 255, 0.05);
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 8px;
	padding: 20px;
	transition: all 0.3s ease;
	text-decoration: none;
	color: #fff;
	display: flex;
	flex-direction: column;
}

.mbcs-global-search-product-card:hover {
	background: rgba(255, 255, 255, 0.1);
	border-color: rgba(255, 255, 255, 0.3);
	transform: translateY(-5px);
}

.mbcs-global-search-product-image {
	position: relative;
	width: 100%;
	padding-bottom: 100%; /* 1:1 aspect ratio */
	margin-bottom: 15px;
	border-radius: 6px;
	overflow: hidden;
	background: rgba(255, 255, 255, 0.05);
}

.mbcs-global-search-product-image img {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.3s ease;
}

.mbcs-global-search-product-card:hover .mbcs-global-search-product-image img {
	transform: scale(1.05);
}

.mbcs-global-search-product-title {
	font-size: 16px;
	font-weight: 600;
	margin-bottom: 8px;
	color: #fff;
	line-height: 1.4;
}

.mbcs-global-search-product-sku {
	font-size: 12px;
	color: rgba(255, 255, 255, 0.6);
	margin-bottom: 10px;
}

.mbcs-global-search-product-price {
	font-size: 18px;
	font-weight: 700;
	color: #4CAF50;
	margin-top: auto;
}

/* No Results */
.mbcs-global-search-no-results {
	text-align: center;
	padding: 60px 20px;
	color: rgba(255, 255, 255, 0.7);
	font-size: 18px;
}

/* Loading State */
.mbcs-global-search-loading {
	display: flex;
	justify-content: center;
	align-items: center;
	padding: 60px 20px;
}

.mbcs-global-search-spinner {
	width: 50px;
	height: 50px;
	border: 4px solid rgba(255, 255, 255, 0.1);
	border-top-color: #fff;
	border-radius: 50%;
	animation: mbcs-spin 0.8s linear infinite;
}

@keyframes mbcs-spin {
	to {
		transform: rotate(360deg);
	}
}

/* Responsive */
@media (max-width: 768px) {
	.mbcs-global-search-container {
		padding: 40px 15px;
	}

	#mbcs-global-search-input {
		font-size: 20px;
		padding: 18px 60px 18px 18px;
	}

	.mbcs-global-search-close {
		top: 15px;
		right: 15px;
	}

	.mbcs-global-search-products-grid {
		grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
		gap: 15px;
	}

	.mbcs-global-search-product-card {
		padding: 15px;
	}

	.mbcs-global-search-product-title {
		font-size: 14px;
	}

	.mbcs-global-search-product-price {
		font-size: 16px;
	}
}

/* Prevent body scroll when overlay is active */
body.mbcs-global-search-active {
	overflow: hidden;
}

