/* ── Search results page ─────────────────────────────────────────────────── */
.ioc-search-page {
	max-width: 1200px;
	margin: 0 auto;
	padding: 28px 24px 60px;
	font-family: var(--sans);
	color: var(--text);
}

.ioc-search-page-head { margin-bottom: 24px; }
.ioc-search-page-title {
	font-family: var(--serif);
	font-size: 30px; font-weight: 500; margin: 0 0 14px;
}

.ioc-search-page-form {
	position: relative;
	display: flex; align-items: center; gap: 10px;
	max-width: 520px; height: 44px; padding: 0 16px;
	background: var(--bg-elev); border: 1px solid var(--line);
	border-radius: var(--radius-md); color: var(--text-dim);
	transition: border-color .15s, box-shadow .15s;
}
.ioc-search-page-dropdown { width: 100%; }
.ioc-search-page-form:focus-within {
	border-color: var(--accent);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}
.ioc-search-page-input {
	flex: 1; min-width: 0; height: 100%;
	border: none; background: transparent; outline: none;
	font-family: var(--sans); font-size: 15px; color: var(--text);
}
.ioc-search-page-input::placeholder { color: var(--text-dim); }

.ioc-search-page-count {
	margin: 14px 0 0; font-size: 13px; color: var(--text-dim);
}

.ioc-search-page-empty {
	padding: 60px 20px; text-align: center;
	color: var(--text-dim); font-size: 15px;
}

.ioc-search-page-section { margin-top: 28px; }
.ioc-search-page-section-title {
	font-size: 11px; font-weight: 600; letter-spacing: .08em;
	text-transform: uppercase; color: var(--text-dim);
	margin: 0 0 14px;
}

/* Collection matches */
.ioc-search-coll-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 10px;
}
.ioc-search-coll {
	display: flex; align-items: center; gap: 10px;
	padding: 10px 12px;
	background: var(--bg-elev); border: 1px solid var(--line);
	border-radius: var(--radius-md);
	text-decoration: none; color: var(--text);
	transition: border-color .15s, transform .1s;
}
.ioc-search-coll:hover { border-color: var(--accent); transform: translateY(-1px); }
.ioc-search-coll-icon {
	width: 34px; height: 34px; flex-shrink: 0;
	display: grid; place-items: center;
	background: var(--bg-card); border: 1px solid var(--line); border-radius: 6px;
}
.ioc-search-coll-icon img { max-width: 26px; max-height: 26px; }
[data-theme="dark"] .ioc-search-coll-icon img { filter: brightness(0) invert(1); opacity: .85; }
.ioc-search-coll-name {
	font-size: 13px; font-weight: 500;
	white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Card matches */
.ioc-search-card-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
	gap: 16px;
}
.ioc-search-card {
	display: flex; flex-direction: column;
	background: var(--bg-elev); border: 1px solid var(--line);
	border-left: 3px solid var(--line);
	border-radius: var(--radius-md); overflow: hidden;
	text-decoration: none; color: var(--text);
	transition: border-color .15s, transform .1s, box-shadow .15s;
}
.ioc-search-card:hover {
	transform: translateY(-2px);
	box-shadow: 0 8px 22px rgba(0,0,0,.14);
}
.ioc-search-card.is-owned { background: color-mix(in srgb, var(--accent) 6%, var(--bg-elev)); }

.ioc-search-card-img {
	position: relative;
	aspect-ratio: 488 / 680;
	background: var(--bg-card);
	display: grid; place-items: center;
}
.ioc-search-card-img img { width: 100%; height: 100%; object-fit: contain; }
.ioc-search-card-owned {
	position: absolute; top: 8px; right: 8px;
	font-size: 10px; font-weight: 600;
	padding: 3px 8px; border-radius: 999px;
	background: var(--accent); color: var(--bg);
}
[data-theme="dark"] .ioc-search-card-owned { color: #14131A; }

.ioc-search-card-info { padding: 9px 11px 11px; }
.ioc-search-card-name {
	font-size: 13px; font-weight: 600; line-height: 1.25;
	margin-bottom: 3px;
}
.ioc-search-card-meta {
	font-size: 11px; color: var(--text-dim); line-height: 1.3;
}

/* Rarity accent (left border) */
.ioc-search-card.rarity-mythic   { border-left-color: #E36B00; }
.ioc-search-card.rarity-rare     { border-left-color: #D4AF37; }
.ioc-search-card.rarity-uncommon { border-left-color: #8B9BB4; }
.ioc-search-card.rarity-common   { border-left-color: #494949; }
.ioc-search-card.rarity-special,
.ioc-search-card.rarity-bonus    { border-left-color: #9B71E0; }

@media (max-width: 640px) {
	.ioc-search-page { padding: 20px 14px 48px; }
	.ioc-search-card-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
}

/* ── Results filter bar ──────────────────────────────────────────────────── */
.ioc-sf-bar {
	/* Stick below the fixed navbar (60px) + sticky breadcrumbs (40px). */
	position: sticky;
	top: 100px;
	z-index: 90;
	display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
	margin: 0 0 18px;
	padding: 10px 0;
	background: var(--bg);
	border-bottom: 1px solid var(--line-soft);
}
.ioc-sf-group { position: relative; }
.ioc-sf-btn {
	display: inline-flex; align-items: center; gap: 6px;
	height: 32px; padding: 0 12px;
	background: var(--bg-elev); border: 1px solid var(--line);
	border-radius: var(--radius-md); cursor: pointer;
	font-family: var(--sans); font-size: 12px; font-weight: 500; color: var(--text);
	transition: border-color .15s, background .15s;
}
.ioc-sf-btn:hover { border-color: var(--accent); }
.ioc-sf-btn.is-open { border-color: var(--accent); background: var(--bg-card); }
.ioc-sf-badge {
	min-width: 16px; height: 16px; padding: 0 4px;
	display: inline-grid; place-items: center;
	background: var(--accent); color: var(--bg);
	border-radius: 999px; font-size: 10px; font-weight: 700; line-height: 1;
}
[data-theme="dark"] .ioc-sf-badge { color: #14131A; }
.ioc-sf-chev { font-size: 10px; opacity: .6; }

.ioc-sf-panel {
	position: absolute; top: calc(100% + 6px); left: 0; z-index: 50;
	min-width: 180px; max-width: 320px; max-height: 320px; overflow-y: auto;
	display: flex; flex-wrap: wrap; gap: 6px;
	padding: 10px;
	background: var(--bg-elev); border: 1px solid var(--line);
	border-radius: var(--radius-md); box-shadow: 0 12px 32px rgba(0,0,0,.18);
}
/* `display:flex/inline-grid` above outranks the UA [hidden] rule, so restore it */
.ioc-sf-panel[hidden],
.ioc-sf-badge[hidden] { display: none; }
.ioc-sf-chip {
	padding: 5px 10px;
	background: var(--bg-card); border: 1px solid var(--line);
	border-radius: 999px; cursor: pointer;
	font-family: var(--sans); font-size: 12px; color: var(--text-dim);
	transition: border-color .15s, color .15s, background .15s;
}
.ioc-sf-chip:hover { color: var(--text); border-color: var(--accent); }
.ioc-sf-chip.is-active {
	background: var(--accent); border-color: var(--accent); color: var(--bg);
}
[data-theme="dark"] .ioc-sf-chip.is-active { color: #14131A; }

.ioc-sf-clear {
	height: 32px; padding: 0 12px;
	background: none; border: 1px solid transparent;
	border-radius: var(--radius-md); cursor: pointer;
	font-family: var(--sans); font-size: 12px; font-weight: 500; color: var(--accent);
}
.ioc-sf-clear:hover { border-color: var(--line); }
.ioc-sf-count {
	margin-left: auto; font-size: 12px; color: var(--text-dim);
}
