/* Rivmedia Table Products Carousel
 * All sizing/colours are CSS variables so the theme can override them, e.g.
 *   .riv-tpc { --riv-tpc-accent: #d4632a; }
 */
.riv-tpc {
	--riv-cols: 4;
	--riv-gap: 20px;
	--riv-tpc-accent: #d4632a;
	--riv-tpc-card-bg: #fff;
	--riv-tpc-border: #e6e6e6;
	--riv-tpc-name: #1f2d3d;
	--riv-tpc-radius: 10px;
	position: relative;
	margin: 0 0 1.5em;
}

.riv-tpc *,
.riv-tpc *::before,
.riv-tpc *::after {
	box-sizing: border-box;
}

.riv-tpc__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 14px;
}

.riv-tpc__title {
	margin: 0;
	font-size: 1.4em;
	line-height: 1.2;
	color: var(--riv-tpc-name);
}

/* If there's no title, push the arrows to the right. */
.riv-tpc__head:not(:has(.riv-tpc__title)) {
	justify-content: flex-end;
}

.riv-tpc__nav {
	display: flex;
	gap: 8px;
	flex: 0 0 auto;
}

.riv-tpc__btn {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	border: 1px solid var(--riv-tpc-border);
	background: #fff;
	color: var(--riv-tpc-name);
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}

.riv-tpc__btn:hover:not(:disabled) {
	background: var(--riv-tpc-accent);
	border-color: var(--riv-tpc-accent);
	color: #fff;
}

.riv-tpc__btn:disabled {
	opacity: 0.35;
	cursor: default;
}

.riv-tpc__viewport {
	overflow-x: auto;
	overflow-y: hidden;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none; /* Firefox */
}

.riv-tpc__viewport::-webkit-scrollbar {
	display: none; /* WebKit */
}

.riv-tpc__track {
	display: flex;
	gap: var(--riv-gap);
	margin: 0;
	padding: 4px;
	list-style: none;
}

.riv-tpc__slide {
	flex: 0 0 calc((100% - (var(--riv-cols) - 1) * var(--riv-gap)) / var(--riv-cols));
	scroll-snap-align: start;
	margin: 0;
	list-style: none;
}

.riv-tpc__card {
	display: flex;
	flex-direction: column;
	height: 100%;
	background: var(--riv-tpc-card-bg);
	border: 1px solid var(--riv-tpc-border);
	border-radius: var(--riv-tpc-radius);
	overflow: hidden;
	text-decoration: none;
	color: inherit;
	transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.riv-tpc__card:hover,
.riv-tpc__card:focus-visible {
	transform: translateY(-4px);
	box-shadow: 0 10px 24px rgba(0, 0, 0, 0.1);
	border-color: var(--riv-tpc-accent);
	outline: none;
}

.riv-tpc__media {
	display: block;
	aspect-ratio: 1 / 1;
	background: #fafafa;
	padding: 14px;
}

.riv-tpc__media img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	display: block;
}

.riv-tpc__body {
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 14px 16px 18px;
	flex: 1 1 auto;
}

.riv-tpc__name {
	font-weight: 600;
	font-size: 1em;
	line-height: 1.3;
	color: var(--riv-tpc-name);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.riv-tpc__price {
	font-size: 1.05em;
	color: var(--riv-tpc-name);
}

.riv-tpc__price .amount {
	font-weight: 700;
}

.riv-tpc__cta {
	margin-top: auto;
	padding-top: 8px;
	font-size: 0.85em;
	font-weight: 600;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	color: var(--riv-tpc-accent);
}

.riv-tpc__card:hover .riv-tpc__cta {
	text-decoration: underline;
}
