/**
 * SMC shared accessory rail — `review/purchase-journey.html` §11 (rail + card).
 *
 * Every value is the prototype's. The only change is scope: the whole file
 * lives under `.smc-rail` (the rail root), so it can never touch the theme
 * header/footer, the PDP, the bag sheet or Woo admin. The tokens are defined
 * on `.smc-rail` itself so the rail is self-contained on any page.
 *
 * Consumed by `templates/parts/smc-rail.php` (smc_rail_render()).
 */

.smc-rail {
	--ink: #0a0a0a;
	--ink-2: #3d4046;
	--muted: #5f6368;
	--faint: #6b7280;
	--line: #e7e8ea;
	--line-2: #f1f2f4;
	--green: #047857;
	--green-2: #065f46;
	--wrap: 1240px;
	--gut: 28px;

	font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	color: var(--ink);
	-webkit-font-smoothing: antialiased;
}

.smc-rail *,
.smc-rail *::before,
.smc-rail *::after {
	box-sizing: border-box;
}

.smc-rail [hidden] {
	display: none !important;
}

.smc-rail h2,
.smc-rail h3,
.smc-rail p {
	margin: 0;
}

.smc-rail a {
	color: inherit;
}

/* ---------- rail chrome ---------- */

.smc-rail.rail-shell {
	margin-top: 72px;
}

.smc-rail .rail-head {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 20px;
	max-width: var(--wrap);
	margin: 0 auto;
	padding: 0 var(--gut);
}

.smc-rail .rail-head h2 {
	font-size: 28px;
	font-weight: 600;
	line-height: 1.15;
	letter-spacing: -.01em;
	color: var(--ink);
}

.smc-rail .rail-head h2 span {
	color: #737373;
}

.smc-rail .rail-head p {
	margin-top: 6px;
	font-size: 12px;
	color: var(--muted);
}

.smc-rail .rail-link {
	display: inline-flex;
	align-items: center;
	gap: 3px;
	font-size: 12px;
	font-weight: 500;
	color: var(--green);
	text-decoration: none;
	white-space: nowrap;
}

.smc-rail .rail-link:hover {
	text-decoration: underline;
	text-underline-offset: 3px;
}

.smc-rail .rail-track {
	display: flex;
	gap: 24px;
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
	padding: 16px max(var(--gut), calc((100vw - var(--wrap)) / 2 + var(--gut))) 24px;
	scroll-padding-left: max(var(--gut), calc((100vw - var(--wrap)) / 2 + var(--gut)));
}

.smc-rail .rail-track::-webkit-scrollbar {
	display: none;
}

.smc-rail .rail-foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 18px;
	max-width: var(--wrap);
	margin: 0 auto;
	padding: 0 var(--gut);
}

.smc-rail .rail-bar {
	flex: 0 0 180px;
	width: 180px;
	height: 2px;
	border-radius: 2px;
	background: #e9eaec;
	overflow: hidden;
}

.smc-rail .rail-bar i {
	display: block;
	height: 100%;
	width: 34%;
	border-radius: 2px;
	background: var(--ink);
	transition: width .18s ease;
}

.smc-rail .rail-arrows {
	display: flex;
	gap: 8px;
}

.smc-rail .rail-arrow {
	width: 32px;
	height: 32px;
	padding: 0;
	border: 1px solid #d9dce1;
	border-radius: 7px;
	background: #fff;
	color: var(--ink);
	display: grid;
	place-items: center;
	cursor: pointer;
	transition: background .15s ease, color .15s ease, border-color .15s ease;
}

.smc-rail .rail-arrow svg {
	width: 13px;
	height: 13px;
}

.smc-rail .rail-arrow:hover {
	background: #111113;
	border-color: #111113;
	color: #fff;
}

.smc-rail .rail-arrow[disabled] {
	opacity: .35;
	cursor: default;
}

.smc-rail .rail-arrow[disabled]:hover {
	background: #fff;
	border-color: #d9dce1;
	color: var(--ink);
}

/* ---------- card ---------- */

.smc-rail .pcard {
	flex: 0 0 300px;
	scroll-snap-align: start;
	display: flex;
	flex-direction: column;
	min-width: 0;
	background: #fff;
	border: 1px solid var(--line);
	border-radius: 18px;
	transition: transform .24s ease, box-shadow .24s ease, border-color .24s ease;
}

.smc-rail .pcard:hover {
	transform: translateY(-3px);
	border-color: #dcdce0;
	box-shadow: 0 1px 2px rgba(17, 18, 20, .03), 0 18px 40px -30px rgba(17, 18, 20, .3);
}

.smc-rail .pcard-media-wrap {
	position: relative;
	margin: 10px 10px 0;
}

.smc-rail .pcard-media {
	position: relative;
	display: block;
	aspect-ratio: 1 / 1;
	border-radius: 14px;
	overflow: hidden;
	background: radial-gradient(95% 70% at 50% 8%, #fff 0%, rgba(255, 255, 255, 0) 62%), linear-gradient(165deg, #f5f5f7, #ececef);
}

.smc-rail .pcard-media img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	padding: 7%;
	transition: transform .5s cubic-bezier(.22, .61, .36, 1);
}

.smc-rail .pcard:hover .pcard-media img {
	transform: scale(1.05);
}

.smc-rail .pcard-body {
	display: flex;
	flex-direction: column;
	flex: 1;
	padding: 0 20px 20px;
}

.smc-rail .pcard-name {
	margin: 16px 0 6px;
	font-size: 17px;
	font-weight: 600;
	line-height: 1.25;
	letter-spacing: -.018em;
	color: var(--ink);
}

.smc-rail .pcard-name a {
	text-decoration: none;
}

.smc-rail .pcard-name a:hover {
	text-decoration: underline;
	text-underline-offset: 3px;
}

.smc-rail .pcard-desc {
	font-size: 12.5px;
	line-height: 1.5;
	color: var(--muted);
	min-height: 2.8em;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.smc-rail .pcard-rule {
	margin-top: auto;
	border-top: 1px solid var(--line-2);
}

.smc-rail .pcard-buy {
	display: flex;
	align-items: baseline;
	gap: 6px;
	padding-top: 16px;
}

.smc-rail .pcard-buy .from {
	font-size: 10px;
	font-weight: 500;
	color: #a1a1aa;
}

.smc-rail .pcard-buy .price {
	font-size: 15.5px;
	font-weight: 600;
	letter-spacing: -.02em;
	color: var(--ink);
	font-variant-numeric: tabular-nums;
}

.smc-rail .pcard-actions {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-top: 14px;
}

.smc-rail .pcard-buy-btn {
	flex: 1;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 42px;
	border: 0;
	border-radius: 8px;
	background: var(--ink);
	color: #fff;
	font-size: 12.5px;
	font-weight: 600;
	text-decoration: none;
	transition: background .14s ease;
}

.smc-rail .pcard-buy-btn:hover {
	background: #000;
	color: #fff;
}

.smc-rail .pcard-learn {
	flex: none;
	padding: 0 4px;
	font-size: 12px;
	font-weight: 600;
	color: var(--green);
	text-decoration: none;
	line-height: 42px;
}

.smc-rail .pcard-learn:hover {
	text-decoration: underline;
	text-underline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
	.smc-rail .rail-bar i,
	.smc-rail .pcard,
	.smc-rail .pcard-media img,
	.smc-rail .rail-arrow {
		transition: none;
	}

	.smc-rail .pcard:hover {
		transform: none;
	}

	.smc-rail .pcard:hover .pcard-media img {
		transform: none;
	}
}

/* ---------- responsive (prototype 954-956, 1041-1045, 1097-1100) ---------- */

@media (max-width: 980px) {
	.smc-rail.rail-shell {
		margin-top: 56px;
	}

	.smc-rail .rail-head h2 {
		font-size: 26px;
	}

	.smc-rail .pcard {
		flex-basis: 280px;
	}
}

@media (max-width: 760px) {
	.smc-rail {
		--gut: 20px;
	}

	.smc-rail .rail-head {
		flex-wrap: wrap;
		align-items: flex-start;
	}

	.smc-rail .rail-head h2 {
		font-size: 23px;
	}

	.smc-rail .rail-track {
		gap: 12px;
		padding-left: 20px;
		padding-right: 20px;
		scroll-padding-left: 20px;
	}

	.smc-rail .pcard {
		flex-basis: 82%;
	}

	.smc-rail .rail-foot {
		gap: 14px;
		padding: 0 20px;
	}

	.smc-rail .rail-head {
		padding: 0 20px;
	}

	.smc-rail .rail-bar {
		flex-basis: 120px;
		width: 120px;
	}
}
