/* Panel wyszukiwarki pod nagłówkiem */
.wdj-search[hidden] {
	display: none;
}

.wdj-search {
	position: fixed;
	inset: 0;
	z-index: 99990;
	pointer-events: none;
}

.wdj-search__backdrop {
	position: absolute;
	inset: var(--wdj-search-top, 90px) 0 0 0;
	pointer-events: auto;
}

/* Wygląd wg makiety (Figma 139:1902): karta 560 px, 8 px pod nagłówkiem, sekcje co 20 px. */
.wdj-search__panel {
	position: absolute;
	top: calc(var(--wdj-search-top, 90px) + 8px);
	right: var(--wdj-search-right, 16px);
	display: flex;
	flex-direction: column;
	gap: 20px;
	width: min(560px, calc(100vw - 32px));
	max-height: calc(100vh - var(--wdj-search-top, 90px) - 24px);
	max-height: calc(100dvh - var(--wdj-search-top, 90px) - 24px);
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: 24px;
	background: var(--wdj-white);
	border: 1px solid var(--wdj-line);
	border-radius: 4px;
	color: var(--wdj-ink);
	pointer-events: auto;
}

.wdj-search__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
}

.wdj-search .wdj-search__title {
	margin: 0;
	font-size: 20px;
	line-height: 26px;
	font-weight: 700;
	color: var(--wdj-ink);
}

.wdj-search .wdj-search__close {
	display: inline-flex;
	flex: 0 0 44px;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: 3px;
	background: transparent;
	color: var(--wdj-ink);
	box-shadow: none;
	cursor: pointer;
}

.wdj-search .wdj-search__close:hover,
.wdj-search .wdj-search__close:focus-visible {
	background: var(--wdj-bg);
	color: var(--wdj-ink);
}

.wdj-search__form {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin: 0;
}

.wdj-search__label {
	display: block;
	margin: 0;
	font-size: 13px;
	line-height: 16.9px;
	font-weight: 400;
	color: var(--wdj-ink);
}

.wdj-search input.wdj-search__input {
	width: 100%;
	height: auto;
	min-height: 0;
	padding: 12px;
	border: 1px solid var(--wdj-line);
	border-radius: 3px;
	background: var(--wdj-white);
	color: var(--wdj-ink);
	font-size: 14.4px;
	line-height: 23px;
	box-shadow: none;
	-webkit-appearance: none;
	appearance: none;
}

.wdj-search input.wdj-search__input::placeholder {
	color: var(--wdj-ink);
	opacity: 1;
}

.wdj-search input.wdj-search__input::-webkit-search-cancel-button {
	-webkit-appearance: none;
	display: none;
}

.wdj-search input.wdj-search__input:focus {
	border-color: var(--wdj-gold);
	box-shadow: 0 0 0 2px rgba(210, 162, 62, .25);
	outline: none;
}

.wdj-search__body {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.wdj-search__body > [hidden] {
	display: none;
}

.wdj-search__body p,
.wdj-search__body h3 {
	margin: 0;
}

.wdj-search__intro,
.wdj-search__empty {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.wdj-search__intro p,
.wdj-search__empty p,
.wdj-search__status,
.wdj-search__hint {
	font-size: 12px;
	line-height: 24px;
	font-weight: 400;
	color: var(--wdj-muted);
}

.wdj-search__intro .wdj-search__intro-title {
	font-size: 13px;
	line-height: 16.9px;
	color: var(--wdj-ink);
}

.wdj-search__empty h3 {
	font-size: 20px;
	line-height: 26px;
	font-weight: 700;
	color: var(--wdj-ink);
}

.wdj-search__results {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.wdj-search__results li {
	margin: 0;
}

.wdj-search__item {
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 12px;
	background: var(--wdj-bg);
	color: var(--wdj-ink);
	text-decoration: none;
}

.wdj-search__item:hover,
.wdj-search__item:focus-visible {
	background: var(--wdj-line);
	color: var(--wdj-ink);
}

.wdj-search__item img {
	flex: 0 0 64px;
	width: 64px;
	height: 72px;
	object-fit: cover;
	border-radius: 6px;
	background: var(--wdj-white);
}

.wdj-search__item-text {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
}

.wdj-search__item-name,
.wdj-search__item-price {
	font-size: 13px;
	line-height: 16.9px;
	font-weight: 400;
	color: var(--wdj-ink);
}

.wdj-search__item-type {
	font-size: 12px;
	line-height: 24px;
	color: var(--wdj-muted);
}

.wdj-search__item-price del {
	margin-right: 6px;
	color: var(--wdj-muted);
}

.wdj-search__item-price ins {
	text-decoration: none;
}

.wdj-search__item-price .wdj-price-range {
	display: inline;
}

.wdj-search__item-price .woocommerce-price-suffix,
.wdj-search__item-price .wdj-price-note,
.wdj-search__item-price .screen-reader-text {
	display: none;
}

.wdj-search .wdj-search__clear {
	min-height: 48px;
	margin-top: 10px;
	padding: 9px 24px;
	border-radius: 3px;
	font-size: 14px;
	line-height: 28px;
	font-weight: 600;
}

.wdj-search .wdj-search__clear[hidden] {
	display: none;
}

@media (max-width: 720px) {
	.wdj-search__panel {
		right: 16px;
		left: 16px;
		width: auto;
		padding: 20px 16px;
	}

	/* Poniżej 16 px iOS przybliża stronę po wejściu w pole. */
	.wdj-search input.wdj-search__input {
		font-size: 16px;
	}
}
