/* ---- Trigger (magnifier button) ---- */
.aisp-pls-trigger {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: transparent;
	border: none;
	cursor: pointer;
	padding: 6px;
	color: inherit;
	line-height: 0;
}

.aisp-pls-trigger:hover {
	opacity: 0.7;
}

.aisp-pls-icon {
	display: block;
}

/* ---- Modal ---- */
.aisp-pls-modal[hidden] {
	display: none;
}

.aisp-pls-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: flex-start;
	justify-content: center;
}

.aisp-pls-modal-backdrop {
	position: absolute;
	inset: 0;
	background: rgba( 15, 23, 42, 0.55 );
	backdrop-filter: blur( 2px );
}

.aisp-pls-modal-panel {
	position: relative;
	width: 100%;
	max-width: 600px;
	margin: 10vh 16px 16px;
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 20px 60px rgba( 0, 0, 0, 0.3 );
	overflow: hidden;
	display: flex;
	flex-direction: column;
	max-height: 75vh;
	animation: aisp-modal-in 0.15s ease-out;
}

@keyframes aisp-modal-in {
	from {
		opacity: 0;
		transform: translateY( -8px );
	}
	to {
		opacity: 1;
		transform: translateY( 0 );
	}
}

.aisp-pls-modal-head {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 14px 16px;
	border-bottom: 1px solid #eee;
	flex: 0 0 auto;
}

.aisp-pls-modal-icon {
	color: #94a3b8;
	flex: 0 0 auto;
}

.aisp-pls-modal-input {
	flex: 1 1 auto;
	border: none;
	outline: none;
	font-size: 1.1em;
	background: transparent;
	color: #111;
	min-width: 0;
}

.aisp-pls-modal-close {
	flex: 0 0 auto;
	background: transparent;
	border: none;
	font-size: 1.6em;
	line-height: 1;
	cursor: pointer;
	color: #94a3b8;
	padding: 0 4px;
}

.aisp-pls-modal-close:hover {
	color: #111;
}

.aisp-pls-modal-results {
	overflow-y: auto;
	flex: 1 1 auto;
}

body.aisp-pls-modal-open {
	overflow: hidden;
}

/* ---- Result rows (shared) ---- */
.aisp-pls-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.aisp-pls-item a {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 16px;
	text-decoration: none;
	color: inherit;
	border-bottom: 1px solid #f0f0f0;
}

.aisp-pls-item a:hover {
	background: #f7f7f7;
}

.aisp-pls-modal .aisp-pls-img,
.aisp-pls-img {
	width: var( --aisp-img-size, 48px ) !important;
	height: var( --aisp-img-size, 48px ) !important;
	max-width: none !important;
	object-fit: cover;
	flex: 0 0 var( --aisp-img-size, 48px );
	border-radius: 4px;
}

.aisp-pls-meta {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.aisp-pls-title {
	font-weight: 600;
	line-height: 1.2;
}

.aisp-pls-sku {
	font-size: 0.75em;
	color: #888;
}

.aisp-pls-excerpt {
	font-size: 0.8em;
	color: #666;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.aisp-pls-cat {
	font-size: 0.75em;
	color: #999;
}

.aisp-pls-line {
	display: flex;
	gap: 10px;
	align-items: center;
	margin-top: 2px;
}

.aisp-pls-price {
	font-weight: 600;
	color: #1a1a1a;
}

.aisp-pls-stock {
	font-size: 0.75em;
	color: #2e7d32;
}

.aisp-pls-loading,
.aisp-pls-empty {
	padding: 18px 16px;
	color: #777;
	font-size: 0.9em;
}

.aisp-pls-viewall {
	display: block;
	text-align: center;
	padding: 12px;
	font-weight: 600;
	background: #fafafa;
	border-top: 1px solid #eee;
	text-decoration: none;
	position: sticky;
	bottom: 0;
}

.aisp-pls-viewall:hover {
	background: #f0f0f0;
}

/* ---- Results page ("View all") ---- */
.aisp-results-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 10px;
}

.aisp-results-item a {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 10px;
	border: 1px solid #eee;
	border-radius: 6px;
	text-decoration: none;
	color: inherit;
}

.aisp-results-img {
	width: 64px;
	height: 64px;
	object-fit: cover;
	border-radius: 4px;
}

.aisp-results-price {
	margin-left: auto;
	font-weight: 600;
}

/* ---- Mobile ---- */
@media ( max-width: 600px ) {
	.aisp-pls-modal-panel {
		margin: 0;
		max-width: none;
		height: 100%;
		max-height: 100%;
		border-radius: 0;
	}
}
