.mtg-fitment-finder,
.mtg-fitment-finder * {
	box-sizing: border-box;
}

.mtg-fitment-finder {
	--mtg-fitment-accent: #9a1f24;
	--mtg-fitment-text: #111;
	--mtg-fitment-muted: #5f6368;
	--mtg-fitment-border: #e5e5e5;
	--mtg-fitment-panel-bg: #fff;
	--mtg-fitment-image-ratio: 4 / 3;
	--mtg-fitment-image-max-height: 360px;
	width: 100%;
	color: var(--mtg-fitment-text);
	font-family: inherit;
}

.mtg-fitment-finder__body {
	display: grid;
	grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.45fr);
	gap: 24px;
	align-items: stretch;
	width: 100%;
}

.mtg-fitment-finder__selector-panel,
.mtg-fitment-finder__preview-panel {
	min-width: 0;
	padding: 26px;
	background: var(--mtg-fitment-panel-bg);
	border: 1px solid var(--mtg-fitment-border);
	border-radius: 8px;
}

.mtg-fitment-finder__selector-panel {
	position: relative;
}

.mtg-fitment-finder__level {
	position: relative;
	display: grid;
	grid-template-columns: 44px minmax(0, 1fr);
	gap: 16px;
	min-width: 0;
	padding-bottom: 28px;
}

.mtg-fitment-finder__level::before {
	content: "";
	position: absolute;
	top: 42px;
	bottom: 10px;
	left: 21px;
	width: 1px;
	background: var(--mtg-fitment-border);
}

.mtg-fitment-finder__level[data-mtg-fitment-level="capacity"] {
	padding-bottom: 0;
}

.mtg-fitment-finder__level[data-mtg-fitment-level="capacity"]::before {
	display: none;
}

.mtg-fitment-finder__step-number {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	margin-top: 1px;
	color: #fff;
	background: var(--mtg-fitment-accent);
	border-radius: 50%;
	font-size: 15px;
	font-weight: 700;
	line-height: 1;
}

.mtg-fitment-finder__level-content {
	min-width: 0;
}

.mtg-fitment-finder__level-title {
	margin-bottom: 14px;
	color: var(--mtg-fitment-text);
	font-size: 20px;
	font-weight: 750;
	line-height: 1.25;
}

.mtg-fitment-finder__options {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	min-width: 0;
}

.mtg-fitment-finder__option {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	min-height: 34px;
	padding: 7px 14px;
	color: var(--mtg-fitment-text);
	background: #fff;
	border: 1px solid #b8b8b8;
	border-radius: 5px;
	font: inherit;
	font-size: 15px;
	font-weight: 650;
	line-height: 1.2;
	text-align: center;
	cursor: pointer;
	transition: color 180ms ease, background-color 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.mtg-fitment-finder__option-count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 18px;
	height: 18px;
	padding: 0 6px;
	color: var(--mtg-fitment-accent);
	background: rgba(154, 31, 36, 0.09);
	border-radius: 999px;
	font-size: 11px;
	font-weight: 750;
	line-height: 1;
}

.mtg-fitment-finder__option.is-active .mtg-fitment-finder__option-count {
	color: var(--mtg-fitment-accent);
	background: #fff;
}

.mtg-fitment-finder__option:hover,
.mtg-fitment-finder__option:focus-visible {
	border-color: var(--mtg-fitment-accent);
	box-shadow: 0 0 0 3px rgba(154, 31, 36, 0.12);
	outline: 0;
}

.mtg-fitment-finder__option.is-active {
	color: #fff;
	background: var(--mtg-fitment-accent);
	border-color: var(--mtg-fitment-accent);
}

.mtg-fitment-finder__option:disabled {
	cursor: default;
	opacity: 0.55;
}

.mtg-fitment-finder__breadcrumb {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
	margin-top: 28px;
	padding-top: 22px;
	color: var(--mtg-fitment-accent);
	border-top: 1px solid var(--mtg-fitment-border);
	font-size: 15px;
	font-weight: 600;
	line-height: 1.4;
}

.mtg-fitment-finder__breadcrumb::before {
	content: "›";
	font-size: 26px;
	font-weight: 400;
	line-height: 1;
}

.mtg-fitment-finder__preview-panel {
	display: flex;
	flex-direction: column;
	align-items: center;
}

.mtg-fitment-finder__image-wrap {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	max-width: calc(var(--mtg-fitment-image-max-height) * 4 / 3);
	max-height: var(--mtg-fitment-image-max-height);
	height: auto !important;
	min-height: 0;
	aspect-ratio: var(--mtg-fitment-image-ratio);
	overflow: hidden;
	background: #fff;
	border-radius: 6px;
}

.mtg-fitment-finder__image {
	display: block;
	width: 100%;
	height: 100%;
	max-height: var(--mtg-fitment-image-max-height);
	object-fit: contain;
	object-position: center;
}

.mtg-fitment-finder__meta {
	display: grid;
	grid-template-columns: repeat(5, minmax(0, 1fr));
	width: 100%;
	margin-top: 22px;
	border: 1px solid var(--mtg-fitment-border);
	border-radius: 6px;
	overflow: hidden;
}

.mtg-fitment-finder__meta-item {
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 7px;
	min-width: 0;
	min-height: 78px;
	padding: 14px 12px;
	text-align: center;
	border-right: 1px solid var(--mtg-fitment-border);
}

.mtg-fitment-finder__meta-item:last-child {
	border-right: 0;
}

.mtg-fitment-finder__meta-item span {
	color: var(--mtg-fitment-muted);
	font-size: 12px;
	font-weight: 600;
	line-height: 1.2;
	text-transform: uppercase;
}

.mtg-fitment-finder__meta-item strong {
	min-width: 0;
	color: var(--mtg-fitment-text);
	font-size: 19px;
	font-weight: 750;
	line-height: 1.25;
	overflow-wrap: anywhere;
}

.mtg-fitment-finder__meta-item:first-child strong {
	color: var(--mtg-fitment-accent);
}

.mtg-fitment-finder__warning {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	width: 100%;
	margin-top: 18px;
	padding: 12px 14px;
	color: var(--mtg-fitment-muted);
	background: #fff7f7;
	border: 1px solid rgba(154, 31, 36, 0.22);
	border-radius: 6px;
	font-size: 14px;
	line-height: 1.45;
	text-align: left;
}

.mtg-fitment-finder__warning-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 22px;
	height: 22px;
	color: #fff;
	background: var(--mtg-fitment-accent);
	border-radius: 50%;
	font-size: 14px;
	font-weight: 800;
	line-height: 1;
}

.mtg-fitment-finder__note {
	width: 100%;
	margin-top: 14px;
	color: var(--mtg-fitment-muted);
	font-size: 14px;
	line-height: 1.5;
	text-align: center;
}

.mtg-fitment-finder__note:empty {
	display: none;
}

@media (max-width: 1024px) {
	.mtg-fitment-finder__body {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 767px) {
	.mtg-fitment-finder__selector-panel,
	.mtg-fitment-finder__preview-panel {
		padding: 18px;
	}

	.mtg-fitment-finder__level {
		grid-template-columns: 36px minmax(0, 1fr);
		gap: 12px;
		padding-bottom: 24px;
	}

	.mtg-fitment-finder__level::before {
		left: 17px;
	}

	.mtg-fitment-finder__step-number {
		width: 30px;
		height: 30px;
		font-size: 13px;
	}

	.mtg-fitment-finder__level-title {
		font-size: 17px;
	}

	.mtg-fitment-finder__option {
		width: 100%;
		min-height: 38px;
		font-size: 14px;
	}

	.mtg-fitment-finder__image-wrap {
		height: auto !important;
	}

	.mtg-fitment-finder__meta {
		grid-template-columns: 1fr;
	}

	.mtg-fitment-finder__meta-item {
		border-right: 0;
	}

	.mtg-fitment-finder__meta-item:not(:last-child) {
		border-bottom: 1px solid var(--mtg-fitment-border);
	}
}

@media (prefers-reduced-motion: reduce) {
	.mtg-fitment-finder__option {
		transition: none;
	}
}
