/* Related Products Carousel */

.rpc {
	--rpc-accent: #ef4714;
	--rpc-accent-hover: #d23a0c;
	--rpc-ink: #041827;
	--rpc-muted: #6b7684;
	--rpc-line: #e3e8ef;
	--rpc-radius: 14px;
	--rpc-gap: 24px;
	--rpc-per: var(--rpc-per-d, 4);
	position: relative;
	width: 100%;
}

@media (max-width: 1024px) {
	.rpc { --rpc-per: var(--rpc-per-t, 2); }
}

@media (max-width: 767px) {
	.rpc { --rpc-per: var(--rpc-per-m, 1); }
}

/* ---------- Header: heading + arrows ---------- */
.rpc__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 20px;
}

.rpc__heading {
	margin: 0;
	font-size: clamp(20px, 2.4vw, 28px);
	font-weight: 700;
	line-height: 1.2;
	color: var(--rpc-ink);
}

.rpc__nav {
	display: flex;
	gap: 8px;
	margin-left: auto;
	flex: 0 0 auto;
}

.rpc .rpc__arrow {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	margin: 0;
	border: 1px solid var(--rpc-line);
	border-radius: 50%;
	background: #fff;
	color: var(--rpc-ink);
	cursor: pointer;
	box-shadow: none;
	transition: background .2s ease, color .2s ease, border-color .2s ease, opacity .2s ease;
}

.rpc .rpc__arrow svg {
	width: 20px;
	height: 20px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2.2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.rpc .rpc__arrow:hover:not(:disabled),
.rpc .rpc__arrow:focus-visible {
	background: var(--rpc-accent);
	border-color: var(--rpc-accent);
	color: #fff;
}

.rpc .rpc__arrow:disabled {
	opacity: .35;
	cursor: default;
}

.rpc.rpc--static .rpc__nav,
.rpc.rpc--static .rpc__dots {
	display: none;
}

/* ---------- Track ---------- */
.rpc__viewport {
	overflow-x: auto;
	overflow-y: hidden;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
	outline: none;
	/* Room for card shadows without clipping. */
	padding: 6px 4px 18px;
	margin: -6px -4px -18px;
	scroll-padding-inline: 4px;
}

.rpc__viewport::-webkit-scrollbar {
	display: none;
}

.rpc__viewport:focus-visible {
	box-shadow: 0 0 0 2px var(--rpc-accent);
	border-radius: var(--rpc-radius);
}

.rpc .rpc__track {
	display: flex;
	gap: var(--rpc-gap);
	list-style: none;
	margin: 0;
	padding: 0;
}

.rpc .rpc__slide {
	flex: 0 0 calc((100% - (var(--rpc-per) - 1) * var(--rpc-gap)) / var(--rpc-per));
	min-width: 0;
	margin: 0;
	padding: 0;
	list-style: none;
	scroll-snap-align: start;
	display: flex;
}

.rpc .rpc__slide::before,
.rpc .rpc__slide::marker {
	content: none;
}

/* ---------- Card ---------- */
.rpc-card {
	display: flex;
	flex-direction: column;
	width: 100%;
	background: #fff;
	border: 1px solid var(--rpc-line);
	border-radius: var(--rpc-radius);
	overflow: hidden;
	box-shadow: 0 10px 30px -22px rgba(1, 18, 39, .45);
	transition: transform .3s ease, box-shadow .3s ease;
}

.rpc-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 22px 40px -24px rgba(1, 18, 39, .55);
}

.rpc-card__media {
	position: relative;
	display: block;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	background: #eef2f6;
}

.rpc-card__media img,
.rpc-card .rpc-card__img {
	position: absolute;
	inset: 0;
	width: 100% !important;
	height: 100% !important;
	max-width: none;
	object-fit: cover;
	border-radius: 0;
	margin: 0;
	transition: transform .6s ease;
}

.rpc-card:hover .rpc-card__media img {
	transform: scale(1.05);
}

.rpc-card__badge {
	position: absolute;
	left: 12px;
	top: 12px;
	z-index: 1;
	max-width: calc(100% - 24px);
	padding: 5px 11px;
	border-radius: 999px;
	background: rgba(4, 24, 39, .82);
	color: #fff;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: .06em;
	line-height: 1.4;
	text-transform: uppercase;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	backdrop-filter: blur(4px);
}

.rpc-card__badge--inline {
	position: static;
	align-self: flex-start;
	margin-bottom: 10px;
}

.rpc-card__body {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	padding: 18px 20px 20px;
}

.rpc .rpc-card__title {
	margin: 0 0 12px;
	font-size: 16px;
	font-weight: 600;
	line-height: 1.4;
	/* Keep cards even: two lines max. */
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.rpc .rpc-card__title a {
	color: var(--rpc-ink);
	text-decoration: none;
}

.rpc .rpc-card__title a:hover {
	color: var(--rpc-accent);
}

.rpc-card__price {
	display: flex;
	align-items: baseline;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: auto;
	margin-bottom: 16px;
}

.rpc-card__from {
	font-size: 12px;
	font-weight: 500;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--rpc-muted);
}

.rpc-card__amount,
.rpc-card__amount .amount {
	font-size: 20px;
	font-weight: 700;
	color: var(--rpc-accent);
}

.rpc-card__amount del {
	font-size: 14px;
	font-weight: 500;
	opacity: .55;
}

.rpc-card__amount ins {
	text-decoration: none;
}

.rpc .rpc-card__btn {
	display: block;
	padding: 12px 16px;
	border-radius: 10px;
	background: var(--rpc-accent);
	color: #fff;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: .06em;
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
	text-transform: uppercase;
	transition: background .2s ease;
}

.rpc .rpc-card__btn:hover,
.rpc .rpc-card__btn:focus-visible {
	background: var(--rpc-accent-hover);
	color: #fff;
}

.rpc-card__price + .rpc-card__btn,
.rpc-card__title + .rpc-card__btn {
	margin-top: auto;
}

/* ---------- Dots ---------- */
.rpc__dots {
	display: flex;
	justify-content: center;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 22px;
}

.rpc .rpc__dot {
	width: 9px;
	height: 9px;
	padding: 0;
	margin: 0;
	border: 0;
	border-radius: 999px;
	background: var(--rpc-ink);
	opacity: .2;
	cursor: pointer;
	box-shadow: none;
	transition: width .25s ease, opacity .25s ease, background .25s ease;
}

.rpc .rpc__dot[aria-selected="true"] {
	width: 26px;
	opacity: 1;
	background: var(--rpc-accent);
}

.rpc-empty {
	color: var(--rpc-muted, #6b7684);
}

@media (prefers-reduced-motion: reduce) {
	.rpc__viewport { scroll-behavior: auto; }
	.rpc-card,
	.rpc-card__media img { transition: none; }
	.rpc-card:hover { transform: none; }
	.rpc-card:hover .rpc-card__media img { transform: none; }
}
