/**
 * PLP-CATRAIL — "Shop New Arrivals & More" category rail.
 *
 * Spec: VATALY PLP Design Spec V4 §8 + the PLP Category Rail requirements.
 * Horizontal scroller, same pattern as the Recently viewed rail
 * (css/plp-recent.css): no arrows — swipe / trackpad / a thin scrollbar.
 * Unlike Recently viewed, the heading is left-aligned.
 *
 * Figma spacing (supplied with the requirements):
 *                          Desktop 1440   Mobile 402
 *   heading left inset          42px         25px
 *   heading -> image            48px         23px
 *   card image               358x503       200x274
 *   image -> label              12px         10px
 *   label -> next divider       70px         33px
 *   gap between cards            2px         20px
 * Desktop cards sit at x1 (1px outer margin, doc §8); mobile at x10 (doc §9).
 *
 * Tokens only — Ink var(--ink_text) · Stone var(--bg_clr2) · Manrope var(--font2).
 */

/* Fidelity pass: the divider above is printed as its own markup
   (vataly_plp_divider(), see inc/plp-catrail.php). Top padding is the
   existing divider -> heading gap; bottom padding (66) + the list's 4px
   scrollbar room make the 70px label -> next divider. Scrollbars overlay
   (macOS, iOS, Android, Chromium default) and take no height; a classic
   always-visible scrollbar (Windows) adds its own few pixels on top. */
.vataly-catrail {
	padding: 52px 0 70px;
}

/* Fix (geometry audit sibling sweep): this is an <h2>, so Konte's
   typography.css h1-h6{font-family:"Cormorant Garamond" !important} was
   silently winning on font-family alone (size/weight already resolved
   correctly, which is what masked it). Matching !important, scoped to this
   selector only — nothing in Konte's own CSS is touched. */
.vataly-catrail__heading {
	margin: 0 0 48px;
	padding: 0 42px;
	font-family: var(--font2) !important;
	font-weight: 700;
	font-size: 18px;
	line-height: normal; /* Figma: Header 18, lineHeight 100% */
	color: var(--ink_text);
	text-align: left;
	font-style: normal;
}

.vataly-catrail__list {
	display: flex;
	gap: 2px;
	margin: 0;
	/* 1px outer margin (cards x1..x1439). Bottom 4px is room for the
	   scrollbar, part of the 70px label -> divider. */
	padding: 0 1px 4px;
	scroll-padding-left: 1px;
	list-style: none;
	overflow-x: auto;
	overflow-y: hidden;
	scroll-snap-type: x proximity;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: thin;
	scrollbar-color: var(--ink_text) transparent;
}

.vataly-catrail__list::-webkit-scrollbar {
	height: 2px;
}

.vataly-catrail__list::-webkit-scrollbar-track {
	background: transparent;
}

.vataly-catrail__list::-webkit-scrollbar-thumb {
	background: var(--ink_text);
}

/* Four full cards per view: (1438 - 3 x 2px) / 4 = 358px at 1440. */
.vataly-catrail__item {
	flex: 0 0 calc((100% - 6px) / 4);
	min-width: 0;
	scroll-snap-align: start;
}

.vataly-catrail__item a {
	display: block;
	color: inherit;
	text-decoration: none;
}

.vataly-catrail__image {
	display: block;
	position: relative;
	padding-bottom: 140.503%; /* 503 / 358 */
	background-color: var(--bg_clr2);
	overflow: hidden;
}

.vataly-catrail__image img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: 50% 50%;
}

.vataly-catrail__image--empty {
	position: absolute;
	inset: 0;
	background-color: var(--bg_clr2);
}

/* Figma: 0.1px INSIDE stroke, Ink. An inset outline on the image itself (as
   css/plp-recent.css does): a 0.1px border on the wrapper rounds up to 1px
   per side and would add 2px to the 503px height, and an outline on the
   wrapper is painted over by the absolutely positioned image. */
.vataly-catrail__image img,
.vataly-catrail__image--empty {
	outline: 0.1px solid var(--ink_text);
	outline-offset: -0.1px;
}

.vataly-catrail__label {
	display: block;
	margin-top: 12px;
	font-family: var(--font2);
	font-weight: 700;
	font-size: 14px;
	line-height: normal; /* Figma: Header 14, lineHeight 100% */
	color: var(--ink_text);
	font-style: normal;
}

/* =========================================================================
   Mobile — one full 200px card, the next one peeking at the edge.
   ========================================================================= */

@media (max-width: 767px) {
	.vataly-catrail {
		/* Figma: 27px divider -> heading; 29 + the list's 4px = 33px label -> divider. */
		padding: 33px 0 33px;
	}

	.vataly-catrail__heading {
		margin-bottom: 23px;
		padding: 0 25px;
		font-size: 14px; /* Header 14: the doc's 197x19 heading box. */
		font-family: var(--font2);
		font-style: normal;
		font-weight: 700;
		line-height: normal;
	}

	.vataly-catrail__list {
		gap: 20px;
		padding-left: 10px;
		padding-right: 10px;
		scroll-padding-left: 10px;
	}

	.vataly-catrail__item {
		flex: 0 0 200px;
	}

	.vataly-catrail__image {
		height: 274px;
		padding-bottom: 0;
	}

	.vataly-catrail__label {
		margin-top: 10px;
		font-family: var(--font2);
	font-size: 12px;
	font-style: normal;
	font-weight: 700;
	line-height: normal;
	}
}
