/* ==========================================================================
   DTP Live Search — fully scoped under .dtp-live-search-wrapper
   No global tags, no IDs, no bleed into theme/Elementor styles.
   ========================================================================== */

.dtp-live-search-wrapper {
	--dtp-radius: 6px;
	--dtp-border: #ddd;
	--dtp-bg: #fff;
	--dtp-text: #222;
	--dtp-muted: #777;
	--dtp-accent: #c8102e;

	position: relative;
	width: 420px;
	max-width: 100%;
	font-family: inherit;
	isolation: isolate;
	z-index: 100;
}

.dtp-live-search-wrapper *,
.dtp-live-search-wrapper *::before,
.dtp-live-search-wrapper *::after {
	box-sizing: border-box;
}

.dtp-live-search-form {
	position: relative;
	display: flex;
	align-items: center;
	width: 100%;
	margin: 0;
}

.dtp-live-search-input {
	width: 100%;
	padding: 10px 70px 10px 14px;
	font-size: 14px;
	line-height: 1.4;
	border: 1px solid var(--dtp-border);
	border-radius: var(--dtp-radius);
	background: var(--dtp-bg);
	color: var(--dtp-text);
	outline: none;
	transition: border-color 0.15s ease;
	-webkit-appearance: none;
	appearance: none;
}

.dtp-live-search-input:focus {
	border-color: var(--dtp-accent);
}

.dtp-live-search-submit,
.dtp-live-search-clear {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	background: transparent;
	border: none;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 4px;
	line-height: 0;
}

.dtp-live-search-submit {
	right: 8px;
	color: var(--dtp-accent);
}

.dtp-live-search-clear {
	right: 34px;
	font-size: 18px;
	color: var(--dtp-muted);
}

.dtp-live-search-results {
	--dtp-radius: 6px;
	--dtp-border: #ddd;
	--dtp-bg: #fff;
	--dtp-text: #222;
	--dtp-muted: #777;
	--dtp-accent: #c8102e;

	display: none;
	max-height: 420px;
	overflow-y: auto;
	background: var(--dtp-bg);
	border: 1px solid var(--dtp-border);
	border-radius: var(--dtp-radius);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
	z-index: 2147483647;
	box-sizing: border-box;
}

.dtp-live-search-results.is-open {
	display: block;
}

.dtp-live-search-list {
	list-style: none;
	margin: 0;
	padding: 4px 0;
}

.dtp-live-search-item {
	margin: 0;
	padding: 0;
}

.dtp-live-search-result {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px 12px;
	text-decoration: none;
	color: var(--dtp-text);
	transition: background-color 0.12s ease;
}

.dtp-live-search-result:hover,
.dtp-live-search-result.is-active {
	background-color: rgba(200, 16, 46, 0.08);
}

.dtp-live-search-thumb {
	flex: 0 0 auto;
	width: 40px;
	height: 40px;
	border-radius: 4px;
	overflow: hidden;
	background: #f2f2f2;
}

.dtp-live-search-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.dtp-live-search-info {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.dtp-live-search-title {
	font-size: 13px;
	font-weight: 500;
	line-height: 1.3;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.dtp-live-search-sku {
	font-size: 11px;
	color: var(--dtp-muted);
}

.dtp-live-search-stock {
	font-size: 11px;
	color: #b3261e;
}

.dtp-live-search-price {
	flex: 0 0 auto;
	font-size: 13px;
	font-weight: 600;
	color: var(--dtp-accent);
	white-space: nowrap;
}

.dtp-live-search-viewall {
	display: block;
	text-align: center;
	padding: 10px 12px;
	font-size: 12px;
	font-weight: 600;
	color: var(--dtp-accent);
	text-decoration: none;
	border-top: 1px solid var(--dtp-border);
}

.dtp-live-search-viewall:hover {
	text-decoration: underline;
}

.dtp-live-search-loading {
	display: flex;
	justify-content: center;
	padding: 20px;
}

.dtp-live-search-spinner {
	width: 18px;
	height: 18px;
	border: 2px solid var(--dtp-border);
	border-top-color: var(--dtp-accent);
	border-radius: 50%;
	animation: dtp-spin 0.6s linear infinite;
}

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

.dtp-live-search-empty {
	padding: 16px 12px;
	font-size: 13px;
	color: var(--dtp-muted);
	text-align: center;
}
