/**
 * GMG Produktų paieška – stiliai
 * Naudoja kintamuosius iš temos: dt-the7-child/css/01-variables.css
 */

.gmg-product-search-wrap {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 0;
	position: relative;
}

/* Ikonėlė – pradinė būsena */
.gmg-product-search-trigger {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: none;
	background: transparent;
	color: var(--primary-color);
	cursor: pointer;
	transition: color var(--transition-default);
	flex-shrink: 0;
}

.gmg-product-search-trigger:hover,
.gmg-product-search-trigger:focus {
	color: var(--white-color);
	outline: none;
}

.gmg-product-search-trigger[aria-expanded="true"] {
	color: var(--accent-blue);
}

/* Slėpti trigerį, kai paieškos laukelis atidarytas */
.gmg-product-search.is-search-expanded .gmg-product-search-trigger,
.gmg-product-search-wrap:has(.gmg-product-search-input-wrap.is-expanded) .gmg-product-search-trigger {
	display: none;
}

.gmg-product-search-icon {
	width: 24px;
	height: 24px;
	flex-shrink: 0;
}

/* Paieškos laukelis – išsitraukia į kairę */
.gmg-product-search-input-wrap {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	width: 0;
	max-width: 0;
	overflow: visible;
	opacity: 0;
	transition: max-width var(--transition-default), opacity var(--transition-default), margin var(--transition-default);
	margin-right: 0;
	position: relative;
}

.gmg-product-search-input-wrap.is-expanded {
	width: 100%;
	max-width: 521px;
	opacity: 1;
	margin-right: 12px;
}

/* Forma ir input – pill shape */
.gmg-product-search-form {
	position: relative;
	z-index: 20;
	display: flex;
	align-items: center;
	background: var(--white-color);
	border: 2px solid transparent;
	border-radius: var(--border-radius-pill);
	box-shadow: 0 3px 6px 0 rgba(0, 0, 0, 0.09);
	transition: box-shadow var(--transition-default), border-color var(--transition-default);
	min-height: 50px;
}

.gmg-product-search-input {
	flex: 1;
	min-width: 0;
	padding: 12px 24px 12px 24px !important;
	border: none !important;
	background: transparent !important;
	font-size: 20px !important;
	line-height: 27px !important;
	color: var(--grey-text-color) !important;
	border-radius: var(--border-radius-pill) !important;
	margin: 0 !important;
}

.gmg-product-search-input::placeholder {
	color: var(--grey-placeholder);
}

.gmg-product-search-input:focus {
	outline: none;
}

.gmg-product-search-submit {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	padding: 0;
	border: none;
	background: transparent;
	color: var(--primary-color-muted);
	cursor: pointer;
	flex-shrink: 0;
	transition: color var(--transition-default);
}

.gmg-product-search-submit:hover,
.gmg-product-search-submit:focus {
	color: var(--primary-color);
	outline: none;
}

/* Rezultatų dropdown */
.gmg-product-search-results {
	position: absolute;
	top: 100%;
	right: 0;
	left: auto;
	min-width: 100%;
	max-width: 420px;
	margin-top: -55px;
	padding-top: 55px;
	background: var(--bg-grey-results);
	border-radius: 30px;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
	max-height: 360px;
	overflow-x: hidden;
	overflow-y: auto;
	z-index: 19;
}

.gmg-product-search-results:empty,
.gmg-product-search-results[hidden] {
	display: none !important;
}

.gmg-product-search-results::-webkit-scrollbar {
	width: 8px;
}

.gmg-product-search-results::-webkit-scrollbar-track {
	background: var(--bg-grey-placeholder);
	border-radius: 4px;
}

.gmg-product-search-results::-webkit-scrollbar-thumb {
	background: var(--primary-color-muted);
	border-radius: 4px;
}

.gmg-product-search-results::-webkit-scrollbar-thumb:hover {
	background: var(--primary-color);
}

.gmg-product-search-result-item {
	display: block;
	overflow-wrap: break-word;
	word-wrap: break-word;
	min-width: 0;
	width: 100%;
	padding: 12px 20px;
	text-align: left;
	background: transparent;
	border: none;
	cursor: pointer;
	transition: background var(--transition-default);
	text-decoration: none;
	color: var(--text-color-medium);
	font-size: 15px;
	line-height: 1.4;
	border-radius: 8px;
	margin: 2px 4px;
}

.gmg-product-search-result-item:hover,
.gmg-product-search-result-item:focus {
	background: var(--bg-grey-color);
	color: var(--primary-color);
	outline: none;
}

.gmg-product-search-result-item .gmg-product-search-result-name {
	color: inherit;
	overflow-wrap: break-word;
	word-wrap: break-word;
}

.gmg-product-search-result-item .gmg-product-search-result-name mark {
	background: transparent;
	color: var(--primary-color);
	font-weight: 600;
}

.gmg-product-search-result-item .gmg-product-search-result-price {
	display: block;
	margin-top: 4px;
	font-size: 13px;
	color: var(--grey-placeholder);
	overflow-wrap: break-word;
	word-wrap: break-word;
}

.gmg-product-search-result-item .gmg-product-search-result-price .amount {
	color: var(--primary-color);
}

.gmg-product-search-no-results {
	padding: 20px;
	text-align: center;
	color: var(--grey-placeholder);
	font-size: 14px;
}

.gmg-product-search-loading {
	padding: 20px;
	text-align: center;
	color: var(--grey-placeholder);
	font-size: 14px;
}

.gmg-product-search-loading::after {
	content: '';
	display: inline-block;
	width: 20px;
	height: 20px;
	margin-left: 8px;
	vertical-align: middle;
	border: 2px solid var(--primary-color-muted);
	border-top-color: transparent;
	border-radius: 50%;
	animation: gmg-search-spin 0.8s linear infinite;
}

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

/* RTL palaikymas */
[dir="rtl"] .gmg-product-search-input-wrap.is-expanded {
	margin-right: 0;
	margin-left: 12px;
}

[dir="rtl"] .gmg-product-search-results {
	right: auto;
	left: 0;
}
