

.myp-search {
	position: relative;
	max-width: 640px;
}

.myp-search-form {
	position: relative;
	z-index: 10; /* acima de wrappers do tema */
}

.myp-search-input {
	width: 100%;
	padding: 10px 72px 10px 12px;
	border: 1px solid #d1d5db;
	border-radius: 6px;
	position: relative;
	z-index: 1; /* abaixo do botão */
	transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.myp-search-input:focus {
	border-color: #3b82f6;
	box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.myp-search-view-all {
	display: block;
	margin: 6px 8px 4px 56px; /* alinhado com itens (thumb 40 + gap 10 + padding) */
	color: #2563eb;
	text-decoration: none;
	font-size: 13px;
}

.myp-search-view-all:hover,
.myp-search-view-all:focus {
	text-decoration: underline;
}

.myp-search-spinner {
	position: absolute;
	right: 44px;
	top: 50%;
	transform: translateY(-50%);
	width: 16px;
	height: 16px;
	border-radius: 50%;
	border: 2px solid #d1d5db;
	border-top-color: #3b82f6;
	opacity: 0;
	pointer-events: none;
}

.myp-search-submit {
	position: absolute;
	top: 50%;
	right: 8px;
	transform: translateY(-50%);
	height: 32px;
	width: 32px;
	/* Reset robusto para evitar estilos globais de temas */
	-webkit-appearance: none;
	appearance: none;
	background-image: none;
	border: none;
	box-shadow: none;
	background: transparent !important;
	color: #4b5563 !important; /* cinza escuro */
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	z-index: 3;
	padding: 0;
	line-height: 0;
}

.myp-search-submit:hover,
.myp-search-submit:focus {
	color: #111827;
	outline: none;
}

/* Garante tamanho do ícone mesmo com CSS do tema */
.myp-search .myp-search-submit svg {
	width: 18px !important;
	height: 18px !important;
	display: block;
	min-width: 18px;
	min-height: 18px;
}

.myp-search-spinner.is-loading {
	opacity: 1;
	animation: myp-spin 0.8s linear infinite;
}

@keyframes myp-spin {
	from { transform: translateY(-50%) rotate(0); }
	to { transform: translateY(-50%) rotate(360deg); }
}

.myp-search-dropdown {
	position: absolute;
	top: calc(100% + 6px);
	left: 0;
	right: 0;
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	box-shadow: 0 8px 24px rgba(0,0,0,0.1);
	padding: 8px;
	z-index: 1000;
	display: none;
}

.myp-search-dropdown.is-open {
	display: block;
}

.myp-search-section + .myp-search-section {
	margin-top: 6px;
	padding-top: 6px;
	border-top: 1px solid #f3f4f6;
}

.myp-search-section-title {
	font-size: 12px;
	color: #6b7280;
	text-transform: uppercase;
	letter-spacing: .04em;
	margin: 4px 8px;
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.myp-search-close {
	appearance: none;
	border: none;
	background: transparent;
	color: #9ca3af;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	padding: 2px 4px;
}

.myp-search-close:hover,
.myp-search-close:focus {
	color: #6b7280;
}

.myp-search-item {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px;
	border-radius: 6px;
	text-decoration: none;
	color: inherit;
}

.myp-search-item:hover,
.myp-search-item:focus {
	background: #f3f4f6;
}

.myp-search-thumb {
	width: 40px;
	height: 40px;
	flex: 0 0 40px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	border-radius: 4px;
	background: #f9fafb;
}

.myp-search-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.myp-search-text {
	display: flex;
	flex-direction: column;
}

.myp-search-title {
	font-size: 14px;
	line-height: 1.2;
}

.myp-search-price {
	font-size: 12px;
	color: #10b981;
}

.myp-search-count {
	font-size: 12px;
	color: #6b7280;
}

@media (max-width: 480px) {
	.myp-search { max-width: 100%; }
	.myp-search-thumb { width: 36px; height: 36px; flex-basis: 36px; }
}

