/* MegaStore76 Smart Search */

:root {
	--mss-primary: #111827;
	--mss-accent: #2563eb;
}

.mss-fab {
	position: fixed;
	z-index: 100000;
	width: 56px;
	height: 56px;
	border-radius: 50%;
	border: none;
	background: var(--mss-primary);
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
	transition: transform 0.15s ease, background 0.15s ease;
}

.mss-fab:hover,
.mss-fab:focus-visible {
	background: var(--mss-accent);
	transform: scale(1.06);
}

.mss-pos-bottom-right { right: 20px; bottom: 20px; }
.mss-pos-bottom-left  { left: 20px; bottom: 20px; }
.mss-pos-top-right    { right: 20px; top: 20px; }
.mss-pos-top-left     { left: 20px; top: 20px; }

.mss-modal {
	position: fixed;
	inset: 0;
	z-index: 100001;
	display: flex;
	align-items: flex-start;
	justify-content: center;
}

.mss-modal[hidden] { display: none; }

.mss-modal-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(17, 24, 39, 0.55);
}

.mss-modal-panel {
	position: relative;
	background: #fff;
	color: #111827;
	width: 92%;
	max-width: 640px;
	margin-top: 8vh;
	border-radius: 10px;
	padding: 20px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
	max-height: 80vh;
	overflow: hidden;
	display: flex;
	flex-direction: column;
}

.mss-modal-close {
	position: absolute;
	top: 10px;
	right: 12px;
	background: none;
	border: none;
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
	color: #6b7280;
	padding: 4px 8px;
}

.mss-modal-close:hover { color: #111827; }

.mss-search-box {
	width: 100%;
}

.mss-input-wrap {
	position: relative;
}

.mss-input {
	width: 100%;
	box-sizing: border-box;
	font-size: 16px;
	padding: 12px 40px 12px 14px;
	border: 2px solid #e5e7eb;
	border-radius: 8px;
	outline: none;
}

.mss-input:focus {
	border-color: var(--mss-accent);
}

.mss-spinner {
	position: absolute;
	right: 12px;
	top: 50%;
	width: 16px;
	height: 16px;
	margin-top: -8px;
	border: 2px solid #e5e7eb;
	border-top-color: var(--mss-accent);
	border-radius: 50%;
	animation: mss-spin 0.7s linear infinite;
}

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

.mss-results {
	margin-top: 12px;
	overflow-y: auto;
	max-height: 60vh;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.mss-result {
	display: flex;
	gap: 12px;
	align-items: flex-start;
	padding: 10px;
	border-radius: 8px;
	text-decoration: none;
	color: inherit;
}

.mss-result:hover,
.mss-result:focus-visible {
	background: #f3f4f6;
	outline: none;
}

.mss-result-thumb {
	width: 48px;
	height: 48px;
	object-fit: cover;
	border-radius: 6px;
	flex-shrink: 0;
	background: #f3f4f6;
}

.mss-result-thumb-empty {
	display: inline-block;
}

.mss-result-body {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.mss-result-top {
	display: flex;
	align-items: center;
	gap: 8px;
}

.mss-result-title {
	font-weight: 600;
	font-size: 14px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.mss-badge {
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	padding: 2px 7px;
	border-radius: 999px;
	background: #e5e7eb;
	color: #374151;
	flex-shrink: 0;
}

.mss-badge-product {
	background: var(--mss-accent);
	color: #fff;
}

.mss-result-excerpt {
	font-size: 13px;
	color: #6b7280;
	overflow: hidden;
	text-overflow: ellipsis;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

.mss-result-price {
	font-size: 13px;
	font-weight: 600;
	color: var(--mss-primary);
}

.mss-empty {
	padding: 16px 10px;
	color: #6b7280;
	font-size: 14px;
}

body.mss-modal-open {
	overflow: hidden;
}

@media (max-width: 480px) {
	.mss-fab { width: 50px; height: 50px; }
	.mss-modal-panel { margin-top: 4vh; max-height: 88vh; }
}
