/* PD Suche */
.pds, .pds-panel, .pds-overlay {
	--pds-accent: #d88301;
	--pds-accent-dark: #b86e00;
	--pds-text: #252e32;
	--pds-muted: #5d6b73;
	--pds-line: #e3e9ee;
	--pds-soft: #f3f6f8;
	--pds-hover: #edf2f5;
	--pds-ok: #1e7a3c;
	--pds-radius: 10px;
}

/* ---------- Suchfeld ---------- */
.pds { position: relative; width: 100%; max-width: 400px; margin-left: auto; text-align: left; }
.pds .pds-form { margin: 0; padding: 0; }
.ts-th-search form.pds-form > .pds-field { float: none; display: flex; margin: 0; width: 100%; }
.pds .pds-field {
	display: flex; align-items: center; gap: 4px;
	height: 44px; padding: 0 4px 0 18px;
	background: #f1f4f6; border: 1px solid #f1f4f6; border-radius: 999px;
	transition: border-color .15s, box-shadow .15s;
}
.pds .pds-field:hover { border-color: #dde4ea; }
.pds .pds-field:focus-within { background: #fff; border-color: var(--pds-accent); box-shadow: 0 0 0 3px rgba(216, 131, 1, .15); }
.pds .pds-field > .pds-ico { display: none; }
.pds input.pds-input,
.ts-th-search .pds input.pds-input {
	flex: 1 1 auto; min-width: 0; width: auto; height: 40px; margin: 0; padding: 0 4px 0 0;
	border: 0 !important; background: transparent !important; box-shadow: none !important; outline: none;
	font: inherit; font-size: 14px !important; line-height: 40px; color: var(--pds-text);
	-webkit-appearance: none; appearance: none; border-radius: 0;
}
.pds input.pds-input::-webkit-search-cancel-button,
.pds input.pds-input::-webkit-search-decoration { -webkit-appearance: none; display: none; }
.pds input.pds-input::placeholder { color: #8a979f; opacity: 1; }
.pds button.pds-clear,
.ts-th-search .pds button.pds-clear {
	flex: 0 0 32px; width: 32px; height: 32px; padding: 7px; margin: 0;
	border: 0; border-radius: 50%; background: transparent; color: var(--pds-muted); cursor: pointer;
}
.pds button.pds-clear:hover { background: var(--pds-soft); color: var(--pds-text); }
.pds button.pds-clear[hidden] { display: none; }
.pds button.pds-clear svg { display: block; width: 18px; height: 18px; }
.pds button.pds-submit,
.ts-th-search .pds button.pds-submit {
	flex: 0 0 36px; width: 36px; height: 36px; margin: 0; padding: 0;
	display: flex; align-items: center; justify-content: center;
	border: 0; border-radius: 50%; background: var(--pds-accent); color: #fff; cursor: pointer;
	transition: background .15s;
}
.pds button.pds-submit svg { display: block; width: 17px; height: 17px; }
.pds button.pds-submit:hover { background: var(--pds-accent-dark); }

/* Theme setzt min-height:40px auf alle Buttons → hier neutralisieren, sonst wird der runde Knopf oval */
.pds button, .pds-panel button, .pds-overlay button { min-height: 0 !important; min-width: 0 !important; box-sizing: border-box; aspect-ratio: auto; }
.pds button.pds-submit, .pds button.pds-clear, .pds-overlay button.pds-back { aspect-ratio: 1 / 1; }

/* ---------- Ergebnis-Panel ---------- */
.pds-panel {
	z-index: 100000; overflow-y: auto; overscroll-behavior: contain;
	background: #fff; border: 1px solid var(--pds-line); border-radius: 14px;
	box-shadow: 0 18px 48px rgba(37, 46, 50, .18), 0 2px 6px rgba(37, 46, 50, .06);
	color: var(--pds-text); font-size: 14px; line-height: 1.4; text-align: left;
	animation: pds-in .14s ease-out;
}
.pds-panel[hidden] { display: none !important; }
@keyframes pds-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.pds-panel * { box-sizing: border-box; }
.pds-panel ul { list-style: none; margin: 0; padding: 0; }
.pds-panel li { margin: 0; padding: 0; }
.pds-panel a { text-decoration: none; color: inherit; }
.pds-panel mark { background: none; color: inherit; font-weight: 700; padding: 0; }

.pds-grid { display: grid; grid-template-columns: 250px 1fr; }
.pds-grid.no-aside { grid-template-columns: 1fr; }
.pds-aside { padding: 16px 12px 16px 16px; background: var(--pds-soft); border-right: 1px solid var(--pds-line); }
.pds-main { padding: 12px 12px 8px; min-width: 0; }
.pds-sec + .pds-sec { margin-top: 18px; }
.pds-h {
	display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
	margin: 0 0 8px; padding: 0 6px; font-size: 13px; font-weight: 600; color: var(--pds-muted);
}
.pds-main > .pds-h { padding: 4px 8px 6px; }
.pds-total { font-weight: 500; color: var(--pds-muted); }

.pds-note {
	padding: 12px 18px; background: #fff8ec; border-bottom: 1px solid #f3dfbd;
	font-size: 14px; color: #6a4500;
}
.pds-panel button.pds-link {
	display: inline; padding: 0; margin: 0; border: 0; background: none; font: inherit;
	color: var(--pds-accent-dark); font-weight: 600; text-decoration: underline; cursor: pointer;
}
.pds-panel .pds-h button.pds-link { font-weight: 500; font-size: 12px; color: var(--pds-muted); }

/* Vorschläge & Kategorien */
.pds-terms button, .pds-cats a {
	display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%;
	padding: 7px 8px; margin: 0; border: 0; border-radius: 8px; background: none;
	font: inherit; font-size: 14px; color: var(--pds-text); text-align: left; cursor: pointer;
}
.pds-terms button mark { font-weight: 400; }
.pds-terms button { font-weight: 600; }
.pds-terms button.is-active, .pds-cats a.is-active { background: #fff; box-shadow: 0 0 0 1px var(--pds-line); }
.pds-count {
	flex: 0 0 auto; min-width: 24px; padding: 1px 7px; border-radius: 999px;
	background: #fff; border: 1px solid var(--pds-line); font-size: 12px; color: var(--pds-muted); text-align: center;
}
.pds-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 4px; }
.pds-panel button.pds-chip {
	padding: 6px 12px; margin: 0; border: 1px solid var(--pds-line); border-radius: 999px;
	background: #fff; font: inherit; font-size: 13px; color: var(--pds-text); cursor: pointer; line-height: 1.3;
}
.pds-panel button.pds-chip.is-active { border-color: var(--pds-accent); color: var(--pds-accent-dark); }

/* Produktzeilen */
.pds-prod {
	display: grid; grid-template-columns: 60px 1fr auto; align-items: center; gap: 14px;
	padding: 8px; border-radius: 10px;
}
.pds-prod.is-active { background: var(--pds-hover); }
.pds-thumb {
	position: relative; display: block; width: 60px; height: 60px; border-radius: 8px; overflow: hidden;
	background: #fff; border: 1px solid var(--pds-line);
}
.pds-thumb img { display: block; width: 100%; height: 100%; object-fit: contain; margin: 0; }
.pds-badge {
	position: absolute; left: 3px; bottom: 3px; padding: 1px 5px; border-radius: 4px;
	background: var(--pds-accent); color: #fff; font-size: 10px; font-weight: 700; line-height: 1.4;
}
.pds-prod-body { min-width: 0; }
.pds-prod-name {
	display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
	font-size: 14.5px; font-weight: 500; color: var(--pds-text);
}
.pds-prod-name mark { color: var(--pds-text); }
.pds-prod-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 3px; font-size: 12.5px; color: var(--pds-muted); }
.pds-stock::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 50%; background: currentColor; vertical-align: 1px; }
.pds-stock.is-in { color: var(--pds-ok); }
.pds-stock.is-out { color: #8a979f; }
.pds-price { min-width: 70px; text-align: right; font-weight: 700; font-size: 15px; color: var(--pds-text); white-space: nowrap; }
.pds-price del { display: block; font-weight: 400; font-size: 12px; color: var(--pds-muted); }
.pds-price ins { text-decoration: none; color: var(--pds-accent-dark); }
.pds-price .woocommerce-price-suffix, .pds-price small { display: none; }
.pds-price.is-loading::after {
	content: ""; display: inline-block; width: 56px; height: 14px; border-radius: 4px;
	background: linear-gradient(90deg, #eef2f5 0%, #f8fafb 50%, #eef2f5 100%); background-size: 200% 100%;
	animation: pds-shimmer 1.1s linear infinite;
}
@keyframes pds-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

.pds-all {
	display: flex; align-items: center; justify-content: center; gap: 8px;
	margin: 0; padding: 13px 16px; border-top: 1px solid var(--pds-line);
	font-weight: 600; color: var(--pds-accent-dark) !important; background: #fff;
	position: sticky; bottom: 0;
}
.pds-all svg { width: 18px; height: 18px; }
.pds-all:hover, .pds-all.is-active { background: #fff8ec; }

.pds-state { display: flex; align-items: center; gap: 10px; padding: 22px 20px; color: var(--pds-muted); }
.pds-spin {
	width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--pds-line); border-top-color: var(--pds-accent);
	animation: pds-rot .7s linear infinite;
}
@keyframes pds-rot { to { transform: rotate(360deg); } }

/* ---------- Handy: Vollbild ---------- */
html.pds-lock, html.pds-lock body { overflow: hidden !important; }
.pds-overlay {
	position: fixed; inset: 0; z-index: 100001; display: flex; flex-direction: column; background: #fff;
	animation: pds-in .14s ease-out;
}
.pds-overlay-bar { display: flex; align-items: center; gap: 6px; padding: 10px 12px; border-bottom: 1px solid var(--pds-line); }
.pds-overlay .pds { max-width: none; flex: 1 1 auto; margin: 0; }
.pds-overlay button.pds-back {
	flex: 0 0 40px; width: 40px; height: 40px; padding: 8px; margin: 0; border: 0; border-radius: 50%;
	background: none; color: var(--pds-text); cursor: pointer;
}
.pds-overlay button.pds-back svg { display: block; width: 24px; height: 24px; }
.pds-overlay .pds-submit { display: none; }
.pds-overlay .pds-input { font-size: 16px !important; }
.pds-overlay .pds-panel {
	position: static !important; flex: 1 1 auto; width: auto !important; max-height: none !important;
	border: 0; border-radius: 0; box-shadow: none; animation: none;
}
@media (max-width: 767px) {
	.pds-grid { grid-template-columns: 1fr; }
	.pds-aside { order: 2; border-right: 0; border-top: 1px solid var(--pds-line); background: #fff; padding: 14px 12px; }
	.pds-main { order: 1; padding: 8px 6px; }
	.pds-prod { grid-template-columns: 52px 1fr auto; gap: 12px; }
	.pds-thumb { width: 52px; height: 52px; }
}
/* Header des Themes: Feld rechtsbündig, nie breiter als die Spalte */
#topheader .ts-th-search { text-align: right; }
#topheader .pds { margin-top: -4px; }

/* ---------- Ergebnisseite ---------- */
.pds-notice {
	clear: both; margin: 0 0 24px; padding: 14px 18px; border-radius: 10px;
	background: #fff8ec; border: 1px solid #f3dfbd; color: #6a4500; font-size: 15px;
}
.pds-notice a { color: #b86e00; font-weight: 600; }

/* Schmaler Theme-Header (Tablet/Handy): nur eine Lupe, Antippen öffnet die Vollbildsuche */
@media (max-width: 900px) {
	#topheader .pds { width: 42px; max-width: 42px; margin: 0; }
	#topheader .pds .pds-field { height: 42px; padding: 0; background: transparent; border-color: transparent; justify-content: center; }
	#topheader .pds .pds-field:focus-within { box-shadow: none; border-color: transparent; background: transparent; }
	#topheader .pds input.pds-input { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; opacity: 0; z-index: 2; cursor: pointer; }
	#topheader .pds button.pds-clear { display: none; }
	#topheader .pds button.pds-submit { flex-basis: 40px; width: 40px; height: 40px; pointer-events: none; }
	#topheader .pds button.pds-submit svg { width: 19px; height: 19px; }
}

/* Fokus: Seite rundum ganz leicht abdunkeln (Desktop), Suchfeld bleibt hell */
.pds-dim {
	position: fixed; z-index: 99999; pointer-events: none; opacity: 0; visibility: hidden;
	box-shadow: 0 0 0 200vmax rgba(18, 28, 34, .14); transition: opacity .18s ease, visibility 0s linear .18s;
}
.pds-dim.is-on { opacity: 1; visibility: visible; transition: opacity .18s ease, visibility 0s; }
@media (prefers-reduced-motion: reduce) { .pds-dim, .pds-dim.is-on { transition: none; } }

/* Lagerstatus vorerst ausgeblendet (Verfügbarkeit aus Dynamics noch offen) */
.pds-stock { display: none !important; }
