/**
 * Gridowp — header quick-search modal.
 */

body.gw-search-modal-open {
	overflow: hidden;
}

.gw-search-modal {
	position: fixed;
	inset: 0;
	z-index: 9999;
	display: flex;
	align-items: flex-start;
	justify-content: center;
	padding-top: clamp(48px, 10vh, 120px);
	opacity: 0;
	pointer-events: none;
	transition: opacity 180ms ease;
}

.gw-search-modal.is-open {
	opacity: 1;
	pointer-events: auto;
}

.gw-search-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(33, 37, 41, .45);
}

.gw-search-modal__card {
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: 640px;
	background: var(--gw-bg, #fff);
	border: 1px solid var(--gw-line, #dee2e6);
	border-radius: 12px;
	box-shadow: 0 20px 48px rgba(33, 37, 41, .18);
	overflow: hidden;
	transform: scale(.96);
	transition: transform 180ms ease;
}

.gw-search-modal.is-open .gw-search-modal__card {
	transform: scale(1);
}

.gw-search-modal__head {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 12px 16px;
	border-bottom: 1px solid var(--gw-line, #dee2e6);
}

.gw-search-modal__input {
	flex: 1;
	background: transparent;
	border: none !important;
	outline: none;
	box-shadow: none !important;
	-webkit-appearance: none;
	appearance: none;
	color: var(--gw-ink, #212529);
	font-family: var(--gw-font, 'Cairo', system-ui, sans-serif);
	font-size: 1rem;
	padding: 6px 0;
	direction: rtl;
}

.gw-search-modal__input::placeholder {
	color: var(--gw-ink-dim, #6c757d);
}

.gw-search-modal__input::-webkit-search-cancel-button {
	display: none;
}

.gw-search-modal__close {
	flex-shrink: 0;
	background: transparent;
	border: none;
	cursor: pointer;
	color: var(--gw-ink-dim, #6c757d);
	font-size: 18px;
	line-height: 1;
	padding: 6px;
	border-radius: 6px;
	transition: background .15s, color .15s;
}

.gw-search-modal__close:hover,
.gw-search-modal__close:focus-visible {
	background: rgba(33, 37, 41, .06);
	color: var(--gw-ink, #212529);
}

.gw-search-modal__panel {
	max-height: 420px;
	overflow-y: auto;
}

.gsm-state {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 20px 16px;
	color: var(--gw-ink-dim, #6c757d);
	font-family: var(--gw-font, 'Cairo', system-ui, sans-serif);
	font-size: .9rem;
	direction: rtl;
}

.gsm-spinner {
	width: 18px;
	height: 18px;
	border: 2px solid var(--gw-line, #dee2e6);
	border-top-color: var(--gw-primary, #7dc246);
	border-radius: 50%;
	animation: gsm-spin .7s linear infinite;
	flex-shrink: 0;
}

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

.gsm-list {
	list-style: none;
	margin: 0;
	padding: 8px 0;
}

.gsm-hit {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 2px 8px;
	padding: 10px 12px;
	border-radius: 14px;
	text-decoration: none;
	color: var(--gw-ink, #212529);
	font-family: var(--gw-font, 'Cairo', system-ui, sans-serif);
	transition: background .18s ease, box-shadow .18s ease, transform .18s ease;
	direction: rtl;
}

.gsm-hit:hover,
.gsm-hit:focus-visible {
	background: rgba(125, 194, 70, .12);
	box-shadow: 0 10px 28px -12px rgba(95, 158, 54, .35);
	transform: translateY(-1px);
	outline: none;
}

.gsm-hit__thumb {
	width: 56px;
	height: 56px;
	border-radius: 14px;
	overflow: hidden;
	flex-shrink: 0;
	background: var(--gw-surface, #f8f9fa);
}

.gsm-hit__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.gsm-hit__body {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 3px;
}

.gsm-hit__title {
	font-size: .9rem;
	font-weight: 600;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	color: var(--gw-ink, #212529);
}

.gsm-hit__price {
	font-size: .82rem;
	color: var(--gw-primary-hover, #5f9e36);
	font-weight: 600;
}

.gsm-hit__price .woocommerce-Price-amount {
	color: inherit;
	direction: ltr;
	unicode-bidi: isolate;
}

.gsm-hit__go {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border-radius: 9999px;
	flex-shrink: 0;
	background: rgba(125, 194, 70, .1);
	color: var(--gw-primary-hover, #5f9e36);
	transition: background .18s ease, color .18s ease, transform .18s ease;
}

.gsm-hit__go .lucide {
	width: 18px;
	height: 18px;
}

.gsm-hit:hover .gsm-hit__go,
.gsm-hit:focus-visible .gsm-hit__go {
	background: var(--gw-primary-hover, #5f9e36);
	color: #fff;
	transform: scale(1.05);
}

.gsm-panel-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 14px 16px 10px;
	direction: rtl;
}

.gsm-panel-head-main {
	display: flex;
	align-items: center;
	gap: 6px;
}

.gsm-panel-head-ico {
	width: 18px;
	height: 18px;
	color: var(--gw-primary-hover, #5f9e36);
}

.gsm-panel-head-title {
	font-size: .8125rem;
	font-weight: 800;
	color: var(--gw-ink, #212529);
	font-family: var(--gw-font, 'Cairo', system-ui, sans-serif);
}

.gsm-panel-count {
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 26px;
	height: 26px;
	padding: 0 6px;
	border-radius: 9999px;
	background: linear-gradient(135deg, var(--gw-primary, #7dc246), var(--gw-primary-hover, #5f9e36));
	color: #fff;
	font-size: .75rem;
	font-weight: 800;
}

.gsm-footer {
	padding: 8px 10px 10px;
}

.gsm-view-all {
	display: flex;
	align-items: center;
	justify-content: center;
	background: linear-gradient(135deg, var(--gw-primary, #7dc246), var(--gw-primary-hover, #5f9e36));
	box-shadow: 0 6px 18px rgba(95, 158, 54, .28);
	border-radius: 1rem;
	padding: .8rem 1rem;
	font-family: var(--gw-font, 'Cairo', system-ui, sans-serif);
	font-size: .8125rem;
	font-weight: 800;
	color: #fff;
	text-decoration: none;
	direction: rtl;
	transition: box-shadow .18s ease, transform .18s ease;
}

.gsm-view-all:hover {
	box-shadow: 0 10px 24px rgba(95, 158, 54, .38);
	transform: translateY(-1px);
	color: #fff;
}

@media (max-width: 640px) {
	.gw-search-modal {
		padding-top: 0;
		align-items: flex-start;
	}

	.gw-search-modal__card {
		border-radius: 0 0 12px 12px;
		border-top: none;
	}
}
