.jhim-marketplace {
	--jhim-brand: #145093;
	--jhim-navy: #145093;
	--jhim-green: #6cc24a;
	--jhim-orange: #e67e22;
	--jhim-red: #c0392b;
	--jhim-gray: #6b7280;
	--jhim-slate: #4b5563;
	--jhim-border: #d1d5db;
	--jhim-card-border: #b8bcc4;
	--jhim-card-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
	--jhim-card-shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.18);
	--jhim-surface: #f5f5f5;
	--jhim-grid-cols-large: 3;
	--jhim-bp-grid-1-max: 644px;
	--jhim-bp-grid-2-min: 645px;
	--jhim-bp-grid-2-max: 1030px;
	--jhim-bp-grid-large-min: 1031px;
	--jhim-bp-controls-min: 773px;
	--jhim-bp-card-compact-max: 644px;
	--jhim-bp-card-wide-min: 645px;
	container-type: inline-size;
	container-name: jhim-marketplace;
	margin: 2rem 0;
	font-family: inherit;
	max-width: 1200px;
	margin-left: auto;
	margin-right: auto;
	padding: 0 1rem;
}

.jhim-controls {
	display: grid;
	grid-template-columns: 1fr;
	gap: 1rem;
	margin-bottom: 0.75rem;
	align-items: end;
}

.jhim-results-header {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem 1rem;
	margin-bottom: 0.75rem;
}

.jhim-advanced-search {
	margin: 0;
	margin-left: auto;
	text-align: right;
	flex-shrink: 0;
}

.jhim-external-link {
	color: var(--jhim-brand);
	font-size: 0.875rem;
	font-weight: 600;
	text-decoration: none;
}

.jhim-external-link::after {
	content: "";
	display: inline-block;
	width: 0.8em;
	height: 0.8em;
	margin-left: 0.25em;
	vertical-align: -0.05em;
	background-color: currentColor;
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M14 3h7v7h-2V6.41l-9.3 9.3-1.4-1.42L17.59 5H14V3zM5 5v14h14v-7h2v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h9v2H5z'/%3E%3C/svg%3E");
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M14 3h7v7h-2V6.41l-9.3 9.3-1.4-1.42L17.59 5H14V3zM5 5v14h14v-7h2v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h9v2H5z'/%3E%3C/svg%3E");
	-webkit-mask-size: contain;
	mask-size: contain;
	-webkit-mask-repeat: no-repeat;
	mask-repeat: no-repeat;
	-webkit-mask-position: center;
	mask-position: center;
}

.jhim-external-link:hover,
.jhim-external-link:focus {
	color: #0f3d6e;
	text-decoration: underline;
}

.jhim-marketplace-cta {
	margin-top: 1.25rem;
	text-align: center;
}

.jhim-status {
	min-height: 1.25rem;
	margin: 0;
	color: var(--jhim-gray);
	font-size: 0.9rem;
	flex: 1 1 auto;
}

.jhim-control label {
	display: block;
	margin-bottom: 0.35rem;
	font: inherit;
	font-size: 0.75rem;
	font-weight: 600;
	color: var(--jhim-slate);
	letter-spacing: 0.02em;
}

.jhim-field {
	position: relative;
	display: block;
}

.jhim-control input[type="search"],
.jhim-control select {
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
	font: inherit;
	font-size: 0.9375rem;
	line-height: 1.4;
	padding: 0.75rem 0.875rem;
	border: 1px solid var(--jhim-border);
	border-radius: 4px;
	background: #fff;
	color: #111827;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
	appearance: none;
	-webkit-appearance: none;
}

.jhim-control select {
	padding-right: 2rem;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236b7280' d='M1.41 0L6 4.58 10.59 0 12 1.41l-6 6-6-6z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 0.75rem center;
	background-size: 12px 8px;
	cursor: pointer;
}

.jhim-control input[type="search"]:hover,
.jhim-control select:hover {
	border-color: #9ca3af;
}

.jhim-control input[type="search"]:focus,
.jhim-control select:focus {
	outline: none;
	border-color: var(--jhim-brand);
	box-shadow: 0 0 0 2px rgba(20, 80, 147, 0.2);
}

.jhim-control input[type="search"]::placeholder {
	color: #9ca3af;
}

.jhim-search-button {
	width: 100%;
	min-height: 2.75rem;
	padding: 0.625rem 1.25rem;
	border: none;
	border-radius: 4px;
	background: var(--jhim-brand);
	color: #fff;
	font: inherit;
	font-size: 0.875rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	cursor: pointer;
	box-shadow: 0 2px 4px rgba(20, 80, 147, 0.3);
	transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease;
}

.jhim-search-button:hover:not(:disabled) {
	background: #0f3d6e;
	box-shadow: 0 4px 8px rgba(20, 80, 147, 0.35);
}

.jhim-search-button:active:not(:disabled) {
	transform: translateY(1px);
	box-shadow: 0 1px 2px rgba(20, 80, 147, 0.3);
}

.jhim-search-button:focus-visible {
	outline: 2px solid var(--jhim-brand);
	outline-offset: 2px;
}

.jhim-search-button:disabled {
	cursor: not-allowed;
	opacity: 0.65;
	box-shadow: none;
}

.jhim-loading .jhim-search-button:disabled {
	position: relative;
	color: transparent;
}

.jhim-loading .jhim-search-button:disabled::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 1.125rem;
	height: 1.125rem;
	margin: -0.5625rem 0 0 -0.5625rem;
	border: 2px solid rgba(255, 255, 255, 0.35);
	border-top-color: #fff;
	border-radius: 50%;
	animation: jhim-spin 0.7s linear infinite;
}

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


.jhim-status.is-error {
	color: var(--jhim-red);
}

.jhim-grid {
	display: grid;
	gap: 1rem;
	grid-template-columns: 1fr;
}

@container jhim-marketplace (min-width: 645px) {
	/* sync: --jhim-bp-grid-2-min */
	.jhim-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@container jhim-marketplace (min-width: 1031px) {
	/* sync: --jhim-bp-grid-large-min */
	.jhim-grid {
		grid-template-columns: repeat(var(--jhim-grid-cols-large), minmax(0, 1fr));
	}
}

.jhim-card {
	display: flex;
	flex-direction: column;
	border: 1px solid var(--jhim-card-border);
	border-radius: 8px;
	overflow: hidden;
	background: #fff;
	box-shadow: var(--jhim-card-shadow);
	min-height: 100%;
	text-decoration: none;
	color: inherit;
}

.jhim-card--clickable {
	cursor: pointer;
	transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.jhim-card--clickable:hover {
	box-shadow: var(--jhim-card-shadow-hover);
	transform: translateY(-1px);
}

.jhim-card--clickable:focus-visible {
	outline: 2px solid var(--jhim-brand);
	outline-offset: 2px;
}

.jhim-card-body {
	display: grid;
	grid-template-columns: 88px minmax(0, 1fr) auto;
	grid-template-areas:
		"media main metrics"
		"media type type";
	row-gap: 0.25rem;
	column-gap: 0.75rem;
	padding: 0.75rem;
	align-items: start;
	min-height: 0;
}

.jhim-card-media {
	grid-area: media;
	position: relative;
	width: 88px;
	align-self: stretch;
	min-height: 72px;
	border: 1px solid var(--jhim-card-border);
	border-radius: 4px;
	overflow: hidden;
	background: var(--jhim-surface);
	flex-shrink: 0;
}

.jhim-card-image {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.25s ease;
}

.jhim-card-media:hover .jhim-card-image {
	transform: scale(1.05);
}

.jhim-card-placeholder {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #9ca3af;
	font-size: 0.65rem;
	font-weight: 600;
	text-align: center;
	padding: 0.25rem;
}

.jhim-card-badge {
	position: absolute;
	top: 0.25rem;
	left: 0.25rem;
	padding: 0.1rem 0.35rem;
	border-radius: 2px;
	color: #fff;
	font-size: 0.55rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	line-height: 1.3;
}

.jhim-card-badge--for-sale {
	background: var(--jhim-green);
}

.jhim-card-badge--pending {
	background: var(--jhim-orange);
}

.jhim-card-badge--sold {
	background: var(--jhim-red);
}

.jhim-card-main {
	grid-area: main;
	display: flex;
	flex-direction: column;
	gap: 0.125rem;
	min-width: 0;
}

.jhim-card-details {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
	min-width: 0;
}

.jhim-marketplace .jhim-card-details .jhim-card-specs,
.jhim-marketplace .jhim-card-details .jhim-card-location {
	margin: 0;
}

.jhim-marketplace .jhim-card-details .jhim-card-specs + .jhim-card-location {
	margin-top: 0;
}

.jhim-card-price {
	margin: 0;
	font-size: 0.875rem;
	font-weight: 700;
	color: var(--jhim-brand);
	line-height: 1.2;
}

.jhim-card-specs,
.jhim-card-location {
	margin: 0;
	color: var(--jhim-slate);
	font-size: 0.75rem;
	font-weight: 400;
	line-height: 1.25;
}

.jhim-card-type {
	grid-area: type;
	margin: 0;
	color: var(--jhim-gray);
	font-size: 0.7rem;
	font-weight: 400;
	line-height: 1.3;
	white-space: normal;
	overflow: visible;
	align-self: start;
}

.jhim-card-metrics {
	grid-area: metrics;
	display: flex;
	flex-direction: column;
	gap: 0.375rem;
	text-align: right;
	flex-shrink: 0;
}

.jhim-card-metric {
	display: flex;
	flex-direction: column;
	gap: 0.05rem;
}

.jhim-metric-label {
	display: block;
	font-size: 0.6rem;
	color: var(--jhim-gray);
	text-transform: capitalize;
	letter-spacing: 0.02em;
	line-height: 1.2;
	white-space: nowrap;
}

.jhim-metric-value {
	font-size: 0.875rem;
	font-weight: 700;
	color: #111827;
	line-height: 1.2;
}

.jhim-card-footer {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.5rem;
	align-items: center;
	padding: 0.625rem 0.75rem;
	background: var(--jhim-brand);
	color: #fff;
	margin-top: auto;
}

.jhim-footer-stat {
	text-align: left;
}

.jhim-footer-stat:last-child {
	text-align: right;
}

.jhim-footer-value {
	display: block;
	font-size: 1rem;
	font-weight: 700;
	line-height: 1.2;
}

.jhim-footer-label {
	display: block;
	font-size: 0.55rem;
	text-transform: capitalize;
	letter-spacing: 0.02em;
	opacity: 0.92;
	margin-top: 0.1rem;
	line-height: 1.2;
}

.jhim-pagination {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 0.75rem;
	margin-top: 1.5rem;
}

.jhim-pagination button {
	min-height: 2.5rem;
	padding: 0.5rem 1rem;
	border: 1px solid var(--jhim-border);
	border-radius: 4px;
	background: #fff;
	color: var(--jhim-brand);
	font: inherit;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.2s ease, border-color 0.2s ease;
}

.jhim-pagination button:hover:not(:disabled) {
	background: var(--jhim-surface);
	border-color: var(--jhim-brand);
}

.jhim-pagination button:disabled {
	cursor: not-allowed;
	opacity: 0.5;
}

.jhim-pagination-info {
	font: inherit;
	color: var(--jhim-slate);
}

/* Skeleton loading */
.jhim-card--skeleton {
	pointer-events: none;
}

.jhim-skeleton-block {
	background: linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%);
	background-size: 200% 100%;
	animation: jhim-shimmer 1.4s ease-in-out infinite;
	border-radius: 4px;
}

.jhim-skeleton-media {
	width: 100%;
	height: 100%;
	min-height: 72px;
}

.jhim-skeleton-main {
	display: flex;
	flex-direction: column;
	gap: 0.375rem;
}

.jhim-skeleton-metrics {
	display: flex;
	flex-direction: column;
	gap: 0.375rem;
	min-width: 4.5rem;
}

.jhim-skeleton-line {
	height: 0.75rem;
	width: 100%;
}

.jhim-skeleton-line--lg {
	height: 1.125rem;
	width: 70%;
}

.jhim-skeleton-line--sm {
	width: 55%;
}

.jhim-skeleton-line--footer {
	height: 1rem;
	width: 60%;
	margin: 0 auto;
}

.jhim-card-footer--skeleton {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.5rem;
	background: rgba(20, 80, 147, 0.15);
}

.jhim-card-footer--skeleton .jhim-skeleton-block {
	background: linear-gradient(90deg, rgba(20, 80, 147, 0.2) 25%, rgba(20, 80, 147, 0.35) 50%, rgba(20, 80, 147, 0.2) 75%);
	background-size: 200% 100%;
}

@keyframes jhim-shimmer {
	0% {
		background-position: 200% 0;
	}

	100% {
		background-position: -200% 0;
	}
}

@media (prefers-reduced-motion: reduce) {
	.jhim-skeleton-block,
	.jhim-loading .jhim-search-button:disabled::after {
		animation: none;
	}

	.jhim-card--clickable {
		transition: none;
	}

	.jhim-card-image {
		transition: none;
	}

	.jhim-card-media:hover .jhim-card-image {
		transform: none;
	}
}

@container jhim-marketplace (min-width: 773px) {
	/* sync: --jhim-bp-controls-min */
	.jhim-controls {
		grid-template-columns: 2fr 1fr 1fr auto;
	}
}

@container jhim-marketplace (min-width: 645px) {
	/* sync: --jhim-bp-card-wide-min */
	.jhim-card-body {
		grid-template-columns: 100px minmax(0, 1fr) auto;
		padding: 0.75rem 0.875rem;
	}

	.jhim-card-media {
		width: 100px;
		min-height: 80px;
	}
}

@container jhim-marketplace (max-width: 644px) {
	/* sync: --jhim-bp-card-compact-max, --jhim-bp-grid-1-max */
	.jhim-card-body {
		grid-template-columns: 80px minmax(0, 1fr);
		grid-template-areas:
			"media main"
			"metrics metrics"
			"type type";
		row-gap: 0.25rem;
		column-gap: 0.625rem;
	}

	.jhim-card-media {
		width: 80px;
		height: 64px;
		align-self: start;
	}

	.jhim-card-metrics {
		flex-direction: row;
		justify-content: flex-start;
		gap: 1.5rem;
		text-align: left;
	}
}
