/**
 * WooCommerce product search styles.
 */

.depilart-search {
	width: 100%;
	margin: 0 auto;
	font-family: var(--global-font-family);
}

.depilart-search *,
.depilart-search *::before,
.depilart-search *::after {
	box-sizing: border-box;
}

/* Wrapper that anchors the dropdown panel */
.depilart-search__wrapper {
	position: relative;
	width: 100%;
}

/* Input + button row */
.depilart-search__field {
	position: relative;
	display: flex;
	align-items: center;
	width: 100%;
	background: #ffffff;
	border: 1px solid #e5e7eb;
	border-radius: 9999px;
	transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.depilart-search__field:hover {
	border-color: #d1d5db;
}

.depilart-search__field:focus-within {
	border-color: var(--wp--preset--color--primary, #614d76);
	box-shadow: 0 0 0 6px rgba(97, 77, 118, 0.08);
}

/* Text input */
.depilart-search__input {
	flex: 1 1 auto;
	min-width: 0;
	height: 48px;
	padding: 0 12px 0 22px;
	font-size: 15px;
	line-height: 1.4;
	color: #111827;
	background: transparent;
	border: 0;
	outline: none;
	border-radius: 9999px;
	-webkit-appearance: none;
	appearance: none;
}

.depilart-search__input::placeholder {
	color: #9ca3af;
}

/* Remove native clear button on some browsers */
.depilart-search__input::-webkit-search-decoration,
.depilart-search__input::-webkit-search-cancel-button,
.depilart-search__input::-webkit-search-results-button,
.depilart-search__input::-webkit-search-results-decoration {
	-webkit-appearance: none;
}

/* Magnifier button (right side) */
.depilart-search__button {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	margin-right: 4px;
	padding: 0;
	color: #ffffff;
	background: var(--wp--preset--color--primary, #614d76);
	border: 0;
	border-radius: 9999px;
	cursor: pointer;
	transition: background-color 0.18s ease, transform 0.18s ease;
}

.depilart-search__button:hover {
	filter: brightness(0.95);
}

.depilart-search__button:active {
	transform: scale(0.96);
}

.depilart-search__button:focus-visible {
	outline: none;
	box-shadow: 0 0 0 4px rgba(97,77,118,0.12);
}

.depilart-search__icon,
.depilart-search__spinner {
	display: block;
}

.depilart-search__spinner {
	display: none;
	animation: depilart-search-spin 0.9s linear infinite;
}

.depilart-search.is-loading .depilart-search__icon {
	display: none;
}

.depilart-search.is-loading .depilart-search__spinner {
	display: block;
}

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

/* Dropdown panel */
.depilart-search__panel {
	position: absolute;
	top: calc(100% + 8px);
	left: 0;
	right: 0;
	z-index: 50;
	background: #ffffff;
	border: 1px solid #e5e7eb;
	border-radius: 16px;
	box-shadow: 0 12px 32px rgba(17, 24, 39, 0.08);
	overflow: hidden;
	opacity: 0;
	transform: translateY(-4px);
	transition: opacity 0.16s ease, transform 0.16s ease;
}

.depilart-search__panel[hidden] {
	display: none;
}

.depilart-search__panel.is-open {
	opacity: 1;
	transform: translateY(0);
}

.depilart-search__panel-header {
	padding: 14px 18px 6px;
	color: #6b7280;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.depilart-search__list {
	list-style: none;
	margin: 0;
	padding: 6px;
	max-height: 360px;
	overflow-y: auto;
}

.depilart-search__item {
	margin: 0;
}

.depilart-search__link {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 12px;
	color: #111827;
	text-decoration: none;
	border-radius: 12px;
	transition: background-color 0.14s ease;
}

.depilart-search__link:hover,
.depilart-search__link:focus-visible,
.depilart-search__item.is-active .depilart-search__link {
	background: #f3f4f6;
	outline: none;
}

.depilart-search__thumb {
	flex: 0 0 auto;
	width: 44px;
	height: 44px;
	border-radius: 8px;
	background: #f3f4f6 center/cover no-repeat;
}

.depilart-search__meta {
	display: flex;
	flex-direction: column;
	min-width: 0;
	flex: 1 1 auto;
}

.depilart-search__name {
	font-size: 14px;
	font-weight: 500;
	color: #111827;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.depilart-search__price {
	font-size: 13px;
	color: #6b7280;
	margin-top: 2px;
}

.depilart-search__price ins {
	text-decoration: none;
	color: #111827;
	font-weight: 600;
}

.depilart-search__price del {
	color: #9ca3af;
	margin-right: 6px;
}

.depilart-search__empty,
.depilart-search__loading {
	padding: 18px;
	text-align: center;
	color: #6b7280;
	font-size: 14px;
}

/* Mobile */
@media (max-width: 480px) {
	.depilart-search__input {
		height: 44px;
		font-size: 14px;
		padding-left: 18px;
	}

	.depilart-search__button {
		width: 36px;
		height: 36px;
	}

	.depilart-search__panel {
		border-radius: 14px;
	}

	.depilart-search__list {
		max-height: 60vh;
	}

	.depilart-search__thumb {
		width: 40px;
		height: 40px;
	}
}

/* Dark color scheme fallback (respects theme tokens when present) */
@media (prefers-color-scheme: dark) {
	.depilart-search__field {
		background: #ffffff;
	}
}
