/*
 * M/K Epicor Product Search — frontend styles.
 * Theme-neutral: relies on currentColor / generic grays so it drops into
 * any theme without a hard dependency on theme.json custom properties.
 */

/* Heading */
 

.mkeps-search {
	position: relative;
	width: 100%;
	max-width: 480px;
	font-size: 15px;
	line-height: 1.4;
	box-sizing: border-box;
}

/* Full-width variant, used on the Epicor Products admin screen. */
.mkeps-search.mkeps-search--full {
	max-width: 100%;
	margin-bottom: 14px !important;
}

.mkeps-search *,
.mkeps-search *::before,
.mkeps-search *::after {
	box-sizing: inherit;
}

.mkeps-search__field {
	position: relative;
	width: 100%;
}

.mkeps-search__input {
	width: 100%;
	padding: 0.6em 0.8em;
	border: 1px solid rgba(0, 0, 0, 0.25);
	border-radius: 4px;
	font-size: inherit;
	line-height: inherit;
	background: #fff;
	color: #1e1e1e;
}

.mkeps-search__input:focus {
	outline: 2px solid #2271b1;
	outline-offset: 1px;
	border-color: #2271b1;
}

.mkeps-search__listbox {
	position: absolute;
	z-index: 100;
	top: calc(100% + 4px);
	left: 0;
	right: 0;
	margin: 0;
	padding: 4px 0;
	list-style: none;
	background: #fff;
	border: 1px solid rgba(0, 0, 0, 0.2);
	border-radius: 4px;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
	max-height: 320px;
	overflow-y: auto;
}

.mkeps-search__option {
	display: flex;
	flex-wrap: wrap;
	gap: 0 0.6em;
	padding: 0.5em 0.8em;
	cursor: pointer;
	color: #1e1e1e;
}

.mkeps-search__option-sku {
	font-family: Consolas, Menlo, Monaco, "Courier New", monospace;
	font-weight: 600;
	white-space: nowrap;
}

.mkeps-search__option-label {
	color: #4a4a4a;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	flex: 1 1 auto;
	min-width: 0;
}

.mkeps-search__option:hover,
.mkeps-search__option.is-active {
	background: #f0f6fc;
}

.mkeps-search__option[aria-selected="true"] {
	background: #e5f1fb;
}

.mkeps-search__message {
	padding: 0.6em 0.8em;
	color: #6b6b6b;
	font-style: italic;
}

.mkeps-search mark {
	background: #fff2a8;
	color: inherit;
	padding: 0 0.05em;
	border-radius: 2px;
}

/* Detail card */

.mkeps-search__detail {
	margin-top: 10px;
}

.mkeps-detail-card {
	position: relative;
	border: 1px solid rgba(0, 0, 0, 0.15);
	border-radius: 6px;
	padding: 1em 1.1em;
	background: #fafafa;
	color: #1e1e1e;
}

.mkeps-detail-card__header {
	display: flex;
	align-items: center;
	gap: 0.6em;
	margin-bottom: 0.5em;
}

.mkeps-detail-card__sku {
	font-family: Consolas, Menlo, Monaco, "Courier New", monospace;
	font-weight: 700;
	font-size: 1.05em;
	flex: 1 1 auto;
}

.mkeps-detail-card__badge {
	display: inline-block;
	padding: 0.15em 0.6em;
	border-radius: 999px;
	background: #d63638;
	color: #fff;
	font-size: 0.75em;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.03em;
}

.mkeps-detail-card__close {
	background: transparent;
	border: none;
	cursor: pointer;
	font-size: 1.3em;
	line-height: 1;
	padding: 0.1em 0.3em;
	color: #6b6b6b;
}

.mkeps-detail-card__close:hover {
	color: #1e1e1e;
}

.mkeps-detail-card__description {
	white-space: pre-line;
	margin-bottom: 0.7em;
	color: #333;
}

.mkeps-detail-card__meta {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
	gap: 0.3em 1em;
	margin-bottom: 0.5em;
}

.mkeps-detail-card__row {
	display: flex;
	gap: 0.4em;
	font-size: 0.92em;
}

.mkeps-detail-card__label {
	color: #6b6b6b;
	flex-shrink: 0;
}

.mkeps-detail-card__value {
	color: #1e1e1e;
	font-weight: 500;
	overflow-wrap: anywhere;
}

.mkeps-detail-card__section-title {
	font-size: 0.85em;
	font-weight: 600;
	color: #4a4a4a;
	margin: 0.6em 0 0.35em;
	padding-top: 0.5em;
	border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.mkeps-detail-card__section-title--empty {
	font-weight: 400;
	font-style: italic;
	color: #6b6b6b;
	margin-bottom: 0;
}

.mkeps-detail-card__specs {
	margin-bottom: 0.5em;
}

.mkeps-detail-card__stock .mkeps-detail-card__section-title {
	margin-top: 0.6em;
}

.mkeps-detail-card__stock-scroll {
	max-height: 260px;
	overflow-y: auto;
	border: 1px solid rgba(0, 0, 0, 0.08);
	border-radius: 4px;
	background: #fff;
}

.mkeps-detail-card__stock-table {
	width: 100%;
	margin: 0;
	border-collapse: collapse;
	font-size: 0.9em;
}

.mkeps-detail-card__stock-table th,
.mkeps-detail-card__stock-table td {
	padding: 0.35em 0.6em;
	text-align: left;
	border: none;
}

.mkeps-detail-card__stock-table thead th {
	position: sticky;
	top: 0;
	background: #f0f0f0;
	font-weight: 600;
	color: #4a4a4a;
	z-index: 1;
}

.mkeps-detail-card__stock-table tbody tr:nth-child(even) {
	background: rgba(0, 0, 0, 0.03);
}

.mkeps-detail-card__stock-num {
	text-align: right !important;
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
}

.mkeps-detail-card__prices {
	margin-top: 0.6em;
	padding-top: 0.5em;
	border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.mkeps-detail-card__prices-title {
	font-size: 0.85em;
	font-weight: 600;
	color: #4a4a4a;
	margin-bottom: 0.35em;
}

.mkeps-detail-card__prices-title--empty {
	font-weight: 400;
	font-style: italic;
	color: #6b6b6b;
	margin-bottom: 0;
}

.mkeps-detail-card__price-list {
	margin: 0;
	padding: 0;
	list-style: none;
	max-height: 220px;
	overflow-y: auto;
	border: 1px solid rgba(0, 0, 0, 0.08);
	border-radius: 4px;
	background: #fff;
}

.mkeps-detail-card__price-row {
	display: flex;
	justify-content: space-between;
	gap: 0.8em;
	padding: 0.35em 0.6em;
	font-size: 0.9em;
}

.mkeps-detail-card__price-row:nth-child(even) {
	background: rgba(0, 0, 0, 0.03);
}

.mkeps-detail-card__price-listname {
	color: #4a4a4a;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	min-width: 0;
}

.mkeps-detail-card__price-value {
	font-weight: 600;
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
}

.mkeps-detail-card__footer {
	margin-top: 0.6em;
	padding-top: 0.5em;
	border-top: 1px solid rgba(0, 0, 0, 0.08);
	font-size: 0.8em;
	color: #8a8a8a;
}

/* Empty-state notice (catalog not yet synced) */

.mkeps-empty-notice {
	color: #6b6b6b;
	font-style: italic;
}

.mkeps-empty-notice--admin {
	font-style: normal;
	font-size: 0.9em;
}

@media (prefers-color-scheme: dark) {
	.mkeps-search__input {
		background: #1e1e1e;
		color: #f0f0f0;
		border-color: rgba(255, 255, 255, 0.25);
	}

	.mkeps-search__listbox {
		background: #242424;
		border-color: rgba(255, 255, 255, 0.15);
		box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
	}

	.mkeps-search__option {
		color: #f0f0f0;
	}

	.mkeps-search__option-label {
		color: #b8b8b8;
	}

	.mkeps-search__option:hover,
	.mkeps-search__option.is-active,
	.mkeps-search__option[aria-selected="true"] {
		background: #2f3a44;
	}

	.mkeps-search__message {
		color: #9a9a9a;
	}

	.mkeps-search mark {
		background: #6b5c00;
		color: #fff;
	}

	.mkeps-detail-card {
		background: #242424;
		border-color: rgba(255, 255, 255, 0.15);
		color: #f0f0f0;
	}

	.mkeps-detail-card__description {
		color: #d5d5d5;
	}

	.mkeps-detail-card__label {
		color: #9a9a9a;
	}

	.mkeps-detail-card__value {
		color: #f0f0f0;
	}

	.mkeps-detail-card__footer {
		border-top-color: rgba(255, 255, 255, 0.1);
		color: #8a8a8a;
	}

	.mkeps-detail-card__prices {
		border-top-color: rgba(255, 255, 255, 0.1);
	}

	.mkeps-detail-card__prices-title {
		color: #b8b8b8;
	}

	.mkeps-detail-card__prices-title--empty {
		color: #9a9a9a;
	}

	.mkeps-detail-card__price-list {
		background: #1e1e1e;
		border-color: rgba(255, 255, 255, 0.1);
	}

	.mkeps-detail-card__price-row:nth-child(even) {
		background: rgba(255, 255, 255, 0.04);
	}

	.mkeps-detail-card__price-listname {
		color: #b8b8b8;
	}

	.mkeps-detail-card__section-title {
		color: #b8b8b8;
		border-top-color: rgba(255, 255, 255, 0.1);
	}

	.mkeps-detail-card__section-title--empty {
		color: #9a9a9a;
	}

	.mkeps-detail-card__stock-scroll {
		background: #1e1e1e;
		border-color: rgba(255, 255, 255, 0.1);
	}

	.mkeps-detail-card__stock-table thead th {
		background: #2c2c2c;
		color: #b8b8b8;
	}

	.mkeps-detail-card__stock-table tbody tr:nth-child(even) {
		background: rgba(255, 255, 255, 0.04);
	}

	.mkeps-detail-card__close {
		color: #9a9a9a;
	}

	.mkeps-detail-card__close:hover {
		color: #f0f0f0;
	}
}

@media (max-width: 480px) {
	.mkeps-search {
		max-width: 100%;
	}

	.mkeps-detail-card__meta {
		grid-template-columns: 1fr;
	}
}