/*
 * "Handles that fit this blade" / "Blades that fit this handle".
 *
 * The shop's main upsell, so it is deliberately the loudest block below the
 * fold. Design tokens are read from the theme with fallbacks, so this still
 * looks deliberate if the theme is ever changed — which is the whole reason
 * the compatibility feature lives in a plugin.
 */

.sb-compat {
	--c-blue: var(--sb-blue, #0b4ea2);
	--c-ink: var(--sb-ink, #16202b);
	--c-muted: var(--sb-muted, #6b7a89);
	--c-line: var(--sb-card-border, #d3dae1);
	--c-radius: var(--sb-radius-lg, 16px);

	/* Dark brand-blue surface, the same pairing the footer and hero use, so the
	   upsell reads as a band of the site rather than a panel on the page. The
	   product cards stay white — the packshots are silver on white and vanish
	   on anything darker. */
	--c-panel: var(--sb-blue, #0b4ea2);
	--c-on-panel: var(--sb-on-blue, #cfe0f2);
	--c-on-panel-strong: #ffffff;
	--c-on-panel-rule: rgba(255, 255, 255, .22);

	clear: both;
	margin: 44px 0 0;
	padding: 34px 34px 36px;
	background: var(--c-panel);
	border: 1px solid var(--sb-blue-dark, #073771);
	border-radius: var(--c-radius);
}
.sb-compat + .sb-compat { margin-top: 26px; }

.sb-compat__head {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 20px;
	padding-bottom: 20px;
	border-bottom: 1px solid var(--c-on-panel-rule);
	margin-bottom: 26px;
}

.sb-compat__eyebrow {
	margin: 0 0 6px;
	color: var(--sb-on-blue-muted, #dbe9f8);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .14em;
	line-height: 1.3;
	text-transform: uppercase;
}

.sb-compat__heading {
	margin: 0;
	color: var(--c-on-panel-strong);
	font-family: var(--sb-font-head, inherit);
	font-size: clamp(1.3rem, 2.2vw, 1.65rem);
	font-weight: 700;
	line-height: 1.14;
}

.sb-compat__lede {
	margin: 8px 0 0;
	color: var(--c-on-panel);
	font-size: 14.5px;
	line-height: 1.5;
}

.sb-compat__count {
	flex: 0 0 auto;
	margin: 0;
	color: var(--c-on-panel);
	font-size: 14px;
	font-weight: 600;
	white-space: nowrap;
}

.sb-compat__grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(212px, 1fr));
	gap: 20px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.sb-compat__item {
	display: flex;
	flex-direction: column;
	margin: 0;
	padding: 0;
	background: #fff;
	border: 1px solid transparent;
	border-radius: var(--sb-radius, 12px);
	overflow: hidden;
	transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.sb-compat__item::before { content: none; }
/* An author-level `display: flex` beats the user agent's [hidden] rule, so the
   collapsed cards would stay on screen without this. */
.sb-compat__item[hidden] { display: none; }
.sb-compat__item:hover {
	border-color: var(--sb-hover-border, #a8c6e6);
	/* A light-grey shadow disappears on the blue, so lift with a darker one. */
	box-shadow: 0 18px 40px rgba(4, 28, 60, .38);
	transform: translateY(-3px);
}

/* woocommerce_thumbnail is uncropped on this site, so a blade arrives ~3.7:1
   and a carded packshot nearly square. Fixing the box and containing the image
   is what keeps a row of cards level. */
.sb-compat__media {
	display: block;
	border-bottom: 1px solid var(--sb-divider, #f1f4f7);
	background: #fff;
}
.sb-compat__media img {
	display: block;
	width: 100%;
	height: 108px;
	object-fit: contain;
	object-position: center;
	margin: 0;
	padding: 12px 14px;
	box-shadow: none;
}

.sb-compat__body {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	gap: 8px;
	padding: 16px 16px 18px;
}

.sb-compat__title {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 3;
	line-clamp: 3;
	overflow: hidden;
	margin: 0;
	font-family: var(--sb-font, inherit);
	font-size: 14px;
	font-weight: 700;
	line-height: 1.4;
	text-wrap: pretty;
}
.sb-compat__title a { color: var(--c-ink); text-decoration: none; }
.sb-compat__title a:hover { color: var(--c-blue); }

.sb-compat__price {
	margin: 0;
	color: var(--c-blue);
	font-family: var(--sb-font-head, inherit);
	font-size: 17px;
	font-weight: 700;
	line-height: 1.2;
}
.sb-compat__price del { margin-right: 5px; opacity: .55; font-weight: 600; }
.sb-compat__price ins { text-decoration: none; }
.sb-compat__price small { display: block; margin-top: 2px; color: var(--c-muted); font-size: 11.5px; }

.sb-compat__actions { margin-top: auto; padding-top: 12px; }
.woocommerce .sb-compat__actions .button,
.woocommerce .sb-compat__actions .added_to_cart {
	display: inline-block;
	margin: 0;
	padding: 10px 18px;
	font-size: 12.5px;
}
.woocommerce .sb-compat__actions .added_to_cart { margin-left: 8px; }

.sb-compat__more { margin: 26px 0 0; text-align: center; }

.sb-compat__toggle {
	padding: 12px 26px;
	background: transparent;
	border: 2px solid var(--c-on-panel-strong);
	border-radius: 999px;
	color: var(--c-on-panel-strong);
	cursor: pointer;
	font-family: var(--sb-font, inherit);
	font-size: 13px;
	font-weight: 700;
	letter-spacing: .06em;
	text-transform: uppercase;
	transition: background-color .18s ease, color .18s ease;
}
.sb-compat__toggle:hover { background: var(--c-on-panel-strong); color: var(--c-blue); }
.sb-compat__toggle:focus-visible { outline: 3px solid var(--sb-blue-light, #3f8fd6); outline-offset: 3px; }

@media (max-width: 640px) {
	.sb-compat { padding: 24px 20px 26px; }
	.sb-compat__head { flex-direction: column; align-items: flex-start; gap: 10px; }
	.sb-compat__grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
	.sb-compat__media img { height: 84px; }
	.sb-compat__body { padding: 13px 13px 15px; }
}
