/*
 * ToolPoint Carousel. Theme it with the custom properties below; a theme sets
 * them on .tpc (or :root) and needs to override nothing else.
 */
.tpc {
	--tpc-gap: 20px;
	--tpc-card-w: 260px;
	--tpc-card-bg: #fff;
	--tpc-card-border: #e2e4e7;
	--tpc-text: inherit;
	--tpc-muted: #6b7280;
	--tpc-btn-bg: rgba(0, 0, 0, .55);
	--tpc-btn-fg: #fff;
	--tpc-photo-h: 260px;
	--tpc-radius: 10px;
	position: relative;
	margin: 0 0 40px;
	color: var(--tpc-text);
}

.tpc-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 16px;
	margin: 0 0 18px;
}
.tpc-title { margin: 0; }
.tpc-all { white-space: nowrap; }

.tpc-frame { position: relative; }

.tpc-viewport {
	overflow: hidden;
	touch-action: pan-y;
	cursor: grab;
}
.tpc-viewport:active { cursor: grabbing; }

.tpc-track {
	display: flex;
	gap: var(--tpc-gap);
	margin: 0;
	padding: 0;
	list-style: none;
	will-change: transform;
}
.tpc-item { flex: 0 0 auto; margin: 0; }

/* STILL mode: a strip you scroll yourself. */
.tpc--still .tpc-viewport {
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scrollbar-width: thin;
	cursor: auto;
}
.tpc--still .tpc-item { scroll-snap-align: start; }
.tpc--still .tpc-pause { display: none; }
.tpc--fits .tpc-btn { display: none; }

/* Arrows and the pause button. */
.tpc-btn {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 2;
	width: 42px;
	height: 42px;
	border: 0;
	border-radius: 50%;
	background: var(--tpc-btn-bg);
	color: var(--tpc-btn-fg);
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0 0 4px;
}
.tpc-prev { left: -8px; }
.tpc-next { right: -8px; }
.tpc-pause {
	position: absolute;
	right: 0;
	bottom: -30px;
	background: none;
	border: 0;
	padding: 2px 6px;
	font-size: 12px;
	color: var(--tpc-muted);
	cursor: pointer;
	text-decoration: underline;
}

/* Default product card. */
.tpc--products .tpc-item { width: var(--tpc-card-w); }
.tpc-card {
	height: 100%;
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 14px;
	background: var(--tpc-card-bg);
	border: 1px solid var(--tpc-card-border);
	border-radius: var(--tpc-radius);
	box-sizing: border-box;
}
.tpc-card__img img { width: 100%; aspect-ratio: 1 / 1; object-fit: contain; display: block; }
.tpc-card__name { font-size: 15px; margin: 0; }
.tpc-card__btn { margin-top: auto; text-align: center; }

/* Photos: one height, natural widths. */
.tpc-photo { margin: 0; position: relative; }
.tpc-photo img {
	height: var(--tpc-photo-h);
	width: auto;
	max-width: none;
	display: block;
	border-radius: var(--tpc-radius);
	user-select: none;
	-webkit-user-drag: none;
}
.tpc-photo figcaption {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	padding: 6px 10px;
	font-size: 13px;
	color: #fff;
	background: linear-gradient(transparent, rgba(0, 0, 0, .7));
	border-radius: 0 0 var(--tpc-radius) var(--tpc-radius);
}

@media (max-width: 600px) {
	.tpc { --tpc-card-w: 200px; --tpc-gap: 14px; }
	.tpc-btn { width: 36px; height: 36px; font-size: 24px; }
	.tpc-prev { left: -4px; }
	.tpc-next { right: -4px; }
}
