/* ==========================================================================
   Just S-Chassis — product cards  v1.3.0
   All colours and key dimensions come from custom properties. To restyle the
   whole site, override these once in Breakdance → Settings → Global Styles →
   Custom CSS.

   NOTE ON !important: a handful of colour declarations carry it. Page-builder
   themes set global heading and link colours at a specificity these cards
   can't beat, which makes card titles and CTA text render in the theme's
   colour instead of ours — invisible on a dark card. Those few rules are the
   fix. Everything else is normal specificity and freely overridable.
   ========================================================================== */

.jsc-row,
.jsc-list {
	--jsc-bg:        #ffffff;
	--jsc-bg-alt:    #f6f7f8;
	--jsc-fg:        #14171a;
	--jsc-muted:     #5c6570;
	--jsc-line:      #e3e6ea;
	--jsc-accent:    #d92b1f;      /* CTA / badge — swap for your brand red */
	--jsc-accent-fg: #ffffff;
	--jsc-pro:       #1c7c4a;
	--jsc-con:       #a8331f;
	--jsc-radius:    12px;
	--jsc-gap:       18px;

	/* Density knobs — raise or lower these to scale the whole card. */
	--jsc-max:       820px;        /* cap on a lone card, so it can't sprawl */
	--jsc-fs:        15px;         /* base font size inside cards */
	--jsc-pad:       16px;         /* internal padding */
	--jsc-img-max:   190px;        /* tallest a product image can render */

}

.jsc-row {
	display: grid;
	gap: var(--jsc-gap);
	grid-template-columns: 1fr;
	margin: 1.75rem 0;
	container-type: inline-size;
}

/* A single card is capped — on a wide content area it otherwise fills the
   viewport. Rows of 2+ still use the full width. */
.jsc-row--1 { max-width: var(--jsc-max); }

@media (prefers-color-scheme: dark) {
	.jsc-row:not([data-theme="light"]),
	.jsc-list:not([data-theme="light"]) {
		--jsc-bg:     #16191c;
		--jsc-bg-alt: #1d2125;
		--jsc-fg:     #f2f4f6;
		--jsc-muted:  #a3adb8;
		--jsc-line:   #2b3138;
		--jsc-pro:    #4ec27f;
		--jsc-con:    #ef7a63;
	}
}
.jsc-row[data-theme="dark"],
.jsc-list[data-theme="dark"] {
	--jsc-bg:     #16191c;
	--jsc-bg-alt: #1d2125;
	--jsc-fg:     #f2f4f6;
	--jsc-muted:  #a3adb8;
	--jsc-line:   #2b3138;
	--jsc-pro:    #4ec27f;
	--jsc-con:    #ef7a63;
}

/* --- Row layouts --------------------------------------------------------- */

@media (min-width: 720px) {
	.jsc-row--2 { grid-template-columns: repeat(2, 1fr); }
	.jsc-row--3 { grid-template-columns: repeat(3, 1fr); }
	.jsc-row--4 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1040px) {
	.jsc-row--4 { grid-template-columns: repeat(4, 1fr); }
}

/* --- Card ---------------------------------------------------------------- */

.jsc-row .jsc-card {
	display: flex;
	flex-direction: column;
	background: var(--jsc-bg);
	color: var(--jsc-fg);
	border: 1px solid var(--jsc-line);
	border-radius: var(--jsc-radius);
	overflow: hidden;
	height: 100%;
	font-size: var(--jsc-fs);
	line-height: 1.5;
}

.jsc-card--error {
	padding: 14px;
	border-style: dashed;
	color: var(--jsc-con);
	font-size: 13px;
}

/* Lone card with an image: image beside the text from 760px up. */
@media (min-width: 760px) {
	.jsc-row--1 .jsc-card:not(.jsc-card--compact):not(.jsc-card--noimg) {
		display: grid;
		grid-template-columns: minmax(150px, 26%) 1fr;
		grid-template-rows: 1fr auto;
	}
	.jsc-row--1 .jsc-card:not(.jsc-card--compact):not(.jsc-card--noimg) .jsc-card__media {
		grid-row: 1 / span 2;
		height: 100%;
	}
	.jsc-row--1 .jsc-card:not(.jsc-card--compact):not(.jsc-card--noimg) .jsc-card__foot {
		border-left: 1px solid var(--jsc-line);
	}
}

/* --- Media --------------------------------------------------------------- */

.jsc-card__media {
	position: relative;
	background: var(--jsc-bg-alt);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 14px;
	min-height: 110px;
}

.jsc-card__img {
	display: block;
	width: 100%;
	height: auto;
	max-height: var(--jsc-img-max);
	object-fit: contain;
	mix-blend-mode: multiply;
}
@media (prefers-color-scheme: dark) {
	.jsc-row:not([data-theme="light"]) .jsc-card__img { mix-blend-mode: normal; }
}
.jsc-row[data-theme="dark"] .jsc-card__img { mix-blend-mode: normal; }

/* No featured image: no empty column, badge sits inline above the brand. */
.jsc-card--noimg .jsc-card__media {
	min-height: 0;
	padding: 12px var(--jsc-pad) 0;
	background: transparent;
	justify-content: flex-start;
}
.jsc-card--noimg .jsc-card__badge { position: static; }

.jsc-card__badge {
	position: absolute;
	top: 10px;
	left: 10px;
	background: var(--jsc-accent);
	color: var(--jsc-accent-fg) !important;
	font-size: 10.5px;
	font-weight: 700;
	letter-spacing: .06em;
	text-transform: uppercase;
	padding: 4px 9px;
	border-radius: 999px;
	line-height: 1.3;
}

/* --- Body ---------------------------------------------------------------- */

.jsc-card__body { padding: var(--jsc-pad); flex: 1 1 auto; }

.jsc-row .jsc-card__brand {
	margin: 0 0 2px;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--jsc-muted);
}

/* Colour forced: builder themes set a global heading colour that would
   otherwise win and render the title near-invisible on a dark card. */
.jsc-row .jsc-card__title {
	margin: 0 0 7px;
	font-size: 1.05rem;
	line-height: 1.25;
	font-weight: 700;
	color: var(--jsc-fg) !important;
}

.jsc-card__rating { display: flex; align-items: center; gap: 7px; margin: 0 0 8px; }
.jsc-stars {
	position: relative;
	display: inline-block;
	width: 78px;
	height: 14px;
	background: currentColor;
	color: var(--jsc-line);
	-webkit-mask: repeat left center/15.6px 14px url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 15'%3E%3Cpath d='M8 0l2.06 5.02L15.5 5.4l-4.2 3.5 1.34 5.3L8 11.3 3.36 14.2l1.34-5.3L.5 5.4l5.44-.38z'/%3E%3C/svg%3E");
	        mask: repeat left center/15.6px 14px url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 15'%3E%3Cpath d='M8 0l2.06 5.02L15.5 5.4l-4.2 3.5 1.34 5.3L8 11.3 3.36 14.2l1.34-5.3L.5 5.4l5.44-.38z'/%3E%3C/svg%3E");
}
.jsc-stars__fill { position: absolute; inset: 0 auto 0 0; background: var(--jsc-accent); }
.jsc-card__rating-num { font-size: 12.5px; font-weight: 700; }
.jsc-card__rating-lab { font-size: 11.5px; color: var(--jsc-muted); }

.jsc-row .jsc-card__fitment {
	display: flex;
	flex-wrap: wrap;
	gap: 5px;
	list-style: none;
	margin: 0 0 9px;
	padding: 0;
}
.jsc-row .jsc-card__fitment li {
	font-size: 10.5px;
	font-weight: 700;
	letter-spacing: .04em;
	padding: 3px 7px;
	margin: 0;
	border: 1px solid var(--jsc-line);
	border-radius: 5px;
	color: var(--jsc-muted);
	background: var(--jsc-bg-alt);
}

.jsc-row .jsc-card__verdict { margin: 0 0 12px; color: var(--jsc-fg); font-size: var(--jsc-fs); }

/* --- Specs --------------------------------------------------------------- */

.jsc-card__specs { margin: 0 0 12px; padding: 0; border-top: 1px solid var(--jsc-line); }

/* Two spec columns on a wide lone card — halves the vertical run. */
@media (min-width: 900px) {
	.jsc-row--1 .jsc-card__specs {
		display: grid;
		grid-template-columns: 1fr 1fr;
		column-gap: 22px;
	}
}

.jsc-spec {
	display: grid;
	grid-template-columns: minmax(80px, 42%) 1fr;
	gap: 8px;
	padding: 5px 0;
	border-bottom: 1px solid var(--jsc-line);
	font-size: 13px;
}
.jsc-spec dt { margin: 0; color: var(--jsc-muted); }
.jsc-spec dd { margin: 0; font-weight: 600; }
.jsc-spec--plain { grid-template-columns: 1fr; }
.jsc-spec--plain dd { font-weight: 400; }

/* --- Pros / cons --------------------------------------------------------- */

.jsc-card__pc { display: grid; gap: 10px; margin: 0 0 12px; }
@container (min-width: 400px) { .jsc-card__pc { grid-template-columns: 1fr 1fr; } }

.jsc-pc__h {
	margin: 0 0 3px;
	font-size: 10.5px;
	font-weight: 700;
	letter-spacing: .08em;
	text-transform: uppercase;
}
.jsc-pc--pro .jsc-pc__h { color: var(--jsc-pro); }
.jsc-pc--con .jsc-pc__h { color: var(--jsc-con); }
.jsc-row .jsc-pc ul { margin: 0; padding: 0; list-style: none; font-size: 13px; }
.jsc-row .jsc-pc li { position: relative; padding-left: 15px; margin: 0 0 2px; }
.jsc-pc li::before { position: absolute; left: 0; font-weight: 700; }
.jsc-pc--pro li::before { content: "+"; color: var(--jsc-pro); }
.jsc-pc--con li::before { content: "–"; color: var(--jsc-con); }

.jsc-row .jsc-card__note {
	margin: 0;
	padding: 9px 11px;
	background: var(--jsc-bg-alt);
	border-left: 3px solid var(--jsc-accent);
	border-radius: 0 6px 6px 0;
	font-size: 12.5px;
	line-height: 1.45;
	color: var(--jsc-fg);
}

/* --- Foot / CTA ---------------------------------------------------------- */

.jsc-card__foot {
	padding: 13px var(--jsc-pad);
	border-top: 1px solid var(--jsc-line);
	background: var(--jsc-bg-alt);
	margin-top: auto;
}

/* On a lone card the button sits beside its micro-disclosure instead of
   spanning the full width like a hero CTA. */
@media (min-width: 760px) {
	.jsc-row--1 .jsc-card__foot {
		display: flex;
		align-items: center;
		gap: 14px;
		flex-wrap: wrap;
	}
	.jsc-row--1 .jsc-card__cta { width: auto; min-width: 240px; }
	.jsc-row--1 .jsc-card__micro { margin: 0; text-align: left; flex: 1 1 160px; }
}

/* Colour forced: themes set a global link colour that would otherwise make
   the button label unreadable against the accent fill. */
.jsc-row .jsc-card__cta {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 7px;
	width: 100%;
	padding: 11px 18px;
	background: var(--jsc-accent) !important;
	color: var(--jsc-accent-fg) !important;
	font-size: 14.5px;
	font-weight: 700;
	line-height: 1.2;
	text-align: center;
	text-decoration: none !important;
	border: 0;
	border-radius: 8px;
	box-shadow: none;
	transition: filter .12s ease, transform .12s ease;
}
.jsc-row .jsc-card__cta:hover,
.jsc-row .jsc-card__cta:focus-visible {
	color: var(--jsc-accent-fg) !important;
	filter: brightness(1.09);
	transform: translateY(-1px);
}
.jsc-row .jsc-card__cta:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
.jsc-card__cta-icon { width: 13px; height: 13px; flex: none; }

.jsc-row .jsc-card__cta--broken { background: var(--jsc-con) !important; }

.jsc-row .jsc-card__micro {
	margin: 8px 0 0;
	font-size: 11.5px;
	line-height: 1.4;
	color: var(--jsc-muted);
	text-align: center;
}

/* --- Compact variant ----------------------------------------------------- */

.jsc-card--compact { flex-direction: row; align-items: stretch; }
.jsc-card--compact .jsc-card__media { flex: 0 0 96px; min-height: 0; padding: 9px; }
.jsc-card--compact .jsc-card__img { max-height: 96px; }
.jsc-card--compact .jsc-card__body { padding: 12px 14px; }
.jsc-card--compact .jsc-card__foot {
	border-top: 0;
	border-left: 1px solid var(--jsc-line);
	display: flex;
	flex-direction: column;
	justify-content: center;
	flex: 0 0 190px;
	margin-top: 0;
}
.jsc-row--1 .jsc-card--compact .jsc-card__cta { width: 100%; min-width: 0; }
.jsc-row--1 .jsc-card--compact .jsc-card__micro { text-align: center; }
@media (max-width: 599px) {
	.jsc-card--compact { flex-direction: column; }
	.jsc-card--compact .jsc-card__media { flex: none; }
	.jsc-card--compact .jsc-card__foot { flex: none; border-left: 0; border-top: 1px solid var(--jsc-line); }
}

/* --- Disclosure notice --------------------------------------------------- */

.jsc-affiliate-notice {
	border-left: 3px solid currentColor;
	padding: 11px 15px;
	margin: 0 0 1.5rem;
	font-size: .95em;
	line-height: 1.5;
	opacity: .9;
}

@media (prefers-reduced-motion: reduce) {
	.jsc-row .jsc-card__cta { transition: none; }
	.jsc-row .jsc-card__cta:hover { transform: none; }
}

/* An empty disclosure option must not render as a bare border. */
.jsc-affiliate-notice:empty { display: none; }

/* --- Minimal layout ------------------------------------------------------
   Image, name, button. Nothing else. Built for rows of 2–4 where the detail
   lives in your article text instead of in every tile. */

.jsc-card--minimal { text-align: center; }

.jsc-card--minimal .jsc-card__media {
	min-height: 0;
	padding: 16px 16px 6px;
	background: transparent;
}
.jsc-card--minimal .jsc-card__img { max-height: 150px; mix-blend-mode: normal; }

.jsc-card--minimal .jsc-card__body { padding: 10px 16px 14px; }

.jsc-row .jsc-card--minimal .jsc-card__title {
	margin: 0;
	font-size: 0.98rem;
	line-height: 1.3;
	/* Two lines maximum, so one long product name can't make a tile taller
	   than the ones beside it. */
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.jsc-card--minimal .jsc-card__foot {
	padding: 0 16px 16px;
	border-top: 0;
	background: transparent;
}
.jsc-row .jsc-card--minimal .jsc-card__cta {
	width: 100%;
	min-width: 0;
	padding: 10px 14px;
	font-size: 14px;
}
.jsc-row .jsc-card--minimal .jsc-card__micro {
	margin: 7px 0 0;
	text-align: center;
	font-size: 11px;
}

/* A lone minimal tile has no reason to be page-width. */
.jsc-row--1 .jsc-card--minimal { max-width: 320px; }

/* No image: keep the tile tidy rather than leaving a gap. */
.jsc-card--minimal.jsc-card--noimg .jsc-card__media { padding: 16px 16px 0; }
.jsc-card--minimal.jsc-card--noimg .jsc-card__badge { position: static; }

/* Minimal tiles override the lone-card grid split from the full layout. */
@media (min-width: 760px) {
	.jsc-row--1 .jsc-card--minimal {
		display: flex;
		flex-direction: column;
	}
	.jsc-row--1 .jsc-card--minimal .jsc-card__foot { border-left: 0; }
}

/* --- Retailer hooks -------------------------------------------------------
   Every card carries .jsc-card--amazon or .jsc-card--ebay and a
   data-retailer attribute. Cards look identical by default; uncomment to
   give eBay cards their own accent so readers can tell at a glance where a
   button is sending them.

.jsc-card--ebay { --jsc-accent: #0064d2; }
*/

/* ==========================================================================
   Parts list — [jsc_product_list]

   For an article that mentions a dozen parts. One block, one row per part,
   one disclosure line. Scans top to bottom like the list it is, instead of
   breaking the article into a grid of boxes.
   ========================================================================== */

.jsc-list {
	margin: 1.75rem 0;
	padding: 4px 0 0;
	background: var(--jsc-bg);
	border: 1px solid var(--jsc-line);
	border-radius: var(--jsc-radius);
	overflow: hidden;
	font-size: var(--jsc-fs);
	line-height: 1.45;
	color: var(--jsc-fg);
}

.jsc-list__title {
	margin: 0;
	padding: 14px var(--jsc-pad) 0;
	font-size: 0.95rem;
	font-weight: 700;
	color: var(--jsc-fg);
}

.jsc-list__note {
	margin: 4px 0 0;
	padding: 0 var(--jsc-pad) 12px;
	font-size: 11.5px;
	color: var(--jsc-muted);
}
.jsc-list__title + .jsc-list__note { padding-top: 2px; }

.jsc-list__items {
	margin: 0;
	padding: 0;
	list-style: none;
	border-top: 1px solid var(--jsc-line);
}

.jsc-row .jsc-list__items li,
.jsc-list__item {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 0;
	padding: 10px var(--jsc-pad);
	border-bottom: 1px solid var(--jsc-line);
}
.jsc-list__item:last-child { border-bottom: 0; }
.jsc-list__item:hover { background: var(--jsc-bg-alt); }

.jsc-list__item--error { color: var(--jsc-con); font-size: 13px; }

/* Thumbnail is a scanning aid, not a feature — small and square. */
.jsc-list__thumb {
	flex: 0 0 40px;
	width: 40px;
	height: 40px;
	border-radius: 6px;
	overflow: hidden;
	background: var(--jsc-bg-alt);
	display: flex;
	align-items: center;
	justify-content: center;
}
.jsc-list__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.jsc-list__text {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 1px;
}

.jsc-list__name {
	font-weight: 600;
	color: var(--jsc-fg);
}

.jsc-list__meta {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 12px;
	color: var(--jsc-muted);
}

.jsc-list__badge {
	font-size: 10px;
	font-weight: 700;
	letter-spacing: .05em;
	text-transform: uppercase;
	padding: 2px 6px;
	border-radius: 4px;
	background: var(--jsc-accent);
	color: var(--jsc-accent-fg) !important;
}

.jsc-list .jsc-list__cta {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 7px 14px;
	border-radius: 7px;
	border: 1px solid var(--jsc-accent);
	background: transparent;
	color: var(--jsc-accent) !important;
	font-size: 13px;
	font-weight: 700;
	line-height: 1.2;
	text-decoration: none !important;
	white-space: nowrap;
	transition: background-color .12s ease, color .12s ease;
}
.jsc-list .jsc-list__cta:hover,
.jsc-list .jsc-list__cta:focus-visible {
	background: var(--jsc-accent);
	color: var(--jsc-accent-fg) !important;
}
.jsc-list .jsc-list__cta:focus-visible { outline: 2px solid var(--jsc-accent); outline-offset: 2px; }

.jsc-list__icon { width: 12px; height: 12px; flex: none; }

.jsc-list .jsc-list__cta--broken {
	border-color: var(--jsc-con);
	color: var(--jsc-con) !important;
	cursor: default;
}

/* Narrow columns: the link drops under the name rather than squeezing it. */
@media (max-width: 480px) {
	.jsc-list__item { flex-wrap: wrap; }
	.jsc-list__text { flex: 1 1 100%; order: 2; }
	.jsc-list__thumb { order: 1; }
	.jsc-list .jsc-list__cta { order: 3; margin-left: auto; }
}

@media (prefers-reduced-motion: reduce) {
	.jsc-list .jsc-list__cta { transition: none; }
}
