/**
 * CLP — Category Landing Page (WOMEN / MEN).
 *
 * Figma: "VATALY — CLP" → Desktop (1440) + Mobile (402). Spec notes:
 * Figma_design/CLP-Desktop.md, Figma_design/CLP-Mobile.md.
 *
 * Tokens only (style.css :root): Ink var(--ink_text) · Paper var(--bg_clr1) ·
 * Stone var(--bg_clr2) · Sand var(--b_clr) · Taupe var(--h_clr) ·
 * Title var(--font1) · Manrope var(--font2) · var(--space_*).
 * Buttons are the shared Form/Button (.vco-btn, css/bag.css). Breadcrumb and
 * dividers are the PLP's own (css/plp.css).
 *
 * Breakpoints (content-driven, aligned with css/plp.css):
 *   ≤ 767.98px      mobile + folded cover screens — Figma Mobile (402)
 *   768 – 1023.98px tablets + unfolded foldables  — 3 tiles a row
 *   ≥ 1024px        desktop — Figma Desktop (1440), fluid full-bleed
 */

.vataly-clp {
	display: block;
	width: 100%;
	background-color: var(--bg_clr1);
}

/* Shop All is followed directly by the newsletter divider (Figma) — no
   Konte 60px breathing room at the bottom of the content area. */
.vataly-clp-page .site-content {
	padding-bottom: 0;
}

/* =========================================================================
   Content/Hero Banner — hero (h1 + CTA) and Editorial Feature.
   Image ratio is fixed per breakpoint; the caption below it sizes to its
   content (228px with a one-line tagline, +21px per extra line).
   ========================================================================= */

.vataly-clp-banner {
	display: flex;
	flex-direction: column;
	align-items: center;
	width: 100%;
	background-color: var(--bg_clr1);
}

.vataly-clp-banner__media {
	width: 100%;
	aspect-ratio: 2.25 / 1; /* 1440 × 640 */
	background-color: var(--bg_clr2);
	overflow: hidden;
}

.vataly-clp-banner--editorial .vataly-clp-banner__media {
	aspect-ratio: 3 / 1; /* 1440 × 480 */
}

.vataly-clp-banner__picture,
.vataly-clp-banner__img {
	display: block;
	width: 100%;
	height: 100%;
}

.vataly-clp-banner__img {
	max-width: none;
	object-fit: cover;
	object-position: 50% 50%;
}

.vataly-clp-banner__caption {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: var(--space_16);
	width: 100%;
	padding: var(--space_32) var(--space_20);
	box-sizing: border-box;
	text-align: center;
}

/* Title 40 — Cormorant Garamond Medium 40, line box 48 (Figma "normal"). */
.vataly-clp-banner__title {
	margin: 0;
	padding: 0;
	font-family: var(--font1);
	font-weight: 500;
	font-size: 40px;
	line-height: 1.2;
	letter-spacing: 0;
	text-transform: uppercase;
	color: var(--ink_text);
}

/* Body 14 Relaxed. */
.vataly-clp-banner__tagline {
	max-width: 723px;
	margin: 0;
	font-family: var(--font2);
	font-weight: 300;
	font-size: 14px;
	line-height: 21px;
	color: var(--ink_text);
}

.vataly-clp-banner__cta {
	display: flex;
	justify-content: center;
	width: 100%;
	padding-top: var(--space_8);
}

/* Form/Button rendered as a link. */
.vataly-clp-btn,
.vataly-clp-btn:hover,
.vataly-clp-btn:focus,
.vataly-clp-btn:visited {
	text-decoration: none;
}

/* =========================================================================
   Section wrapper — Shop by Category / New Arrivals.
   ========================================================================= */

.vataly-clp-section {
	display: flex;
	flex-direction: column;
	gap: var(--space_24);
	padding: var(--space_32) 0 var(--space_48);
}

.vataly-clp-section__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--space_16);
	padding: 0 var(--space_32);
}

/* Header 16. Manrope, not the Cormorant every heading gets with !important
   in css/typography.css (same override as css/plp-catrail.css). */
.vataly-clp-section__title {
	margin: 0;
	padding: 0;
	font-family: var(--font2) !important;
	font-weight: 700;
	font-size: 16px;
	line-height: normal;
	letter-spacing: 0;
	text-transform: uppercase;
	color: var(--ink_text);
}

/* =========================================================================
   Shop by Category — Content/Category Tile.
   One row; six tiles per view at the Figma width (three on tablet).
   Fewer categories stay that width, left-aligned, rather than
   stretching; more scroll sideways with the PLP category rail's thin ink
   scrollbar (css/plp-catrail.css). Bottom 4px is room for that scrollbar.
   Mobile: a two-column grid instead, no scroll (rules further down).
   ========================================================================= */

/* The list's 4px scrollbar room is part of the 48px tile -> divider gap. */
.vataly-clp-categories {
	padding-bottom: calc(var(--space_48) - 4px);
}

.vataly-clp-tiles {
	display: flex;
	gap: var(--space_4);
	margin: 0;
	padding: 0 1px 4px;
	scroll-padding-inline: 1px;
	list-style: none;
	overflow-x: auto;
	overflow-y: hidden;
	overscroll-behavior-x: contain;
	scroll-snap-type: x proximity;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: thin;
	scrollbar-color: var(--ink_text) transparent;
}

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

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

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

.vataly-clp-tile {
	flex: 0 0 calc((100% - 5 * var(--space_4)) / 6);
	margin: 0;
	padding: 0;
	min-width: 0;
	scroll-snap-align: start;
}

.vataly-clp-tile__link {
	display: flex;
	flex-direction: column;
	gap: var(--space_12);
	color: var(--ink_text);
	text-decoration: none;
}

.vataly-clp-tile__link:hover,
.vataly-clp-tile__link:focus {
	color: var(--ink_text);
	text-decoration: none;
}

/* Focus ring around the whole tile, inside it so the 4px gap never clips it. */
.vataly-clp-tile__link:focus-visible {
	outline: 2px solid var(--ink_text);
	outline-offset: -2px;
}

.vataly-clp-tile__image {
	display: block;
	position: relative;
	aspect-ratio: 5 / 7;
	background-color: var(--bg_clr2);
	overflow: hidden;
}

.vataly-clp-tile__image img,
.vataly-clp-tile__image .vataly-catrail__image--empty {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	object-position: 50% 50%;
	outline: 0;
	background-color: var(--bg_clr2);
}

/* Hairline (0.5px) in border/subtle, drawn over the image. */
.vataly-clp-tile__image::after {
	content: '';
	position: absolute;
	inset: 0;
	border: 0.5px solid var(--b_clr);
	pointer-events: none;
}

/* Header 14. */
.vataly-clp-tile__label {
	display: block;
	padding-left: var(--space_12);
	font-family: var(--font2);
	font-weight: 700;
	font-size: 14px;
	line-height: normal;
	text-transform: uppercase;
	text-underline-offset: 3px;
}

.vataly-clp-tile__link:hover .vataly-clp-tile__label {
	text-decoration: underline;
}

/* =========================================================================
   New Arrivals — section header action + rail of PLP cards.
   The cards are the PLP's own (css/plp.css); only the row around them is
   set here. Desktop: one row, four cards per view, 2px apart, 1px from the
   edges (Figma 7:624) — fewer cards keep that width, left-aligned; more
   scroll sideways with the same thin ink scrollbar as Shop by Category.
   Below 1024px the row swipes (rules further down).
   ========================================================================= */

/* VIEW ALL — Header 14. */
.vataly-clp-section__action,
.vataly-clp-section__action:visited {
	flex-shrink: 0;
	font-family: var(--font2);
	font-weight: 700;
	font-size: 14px;
	line-height: normal;
	text-transform: uppercase;
	text-decoration: none;
	text-underline-offset: 3px;
	color: var(--ink_text);
}

.vataly-clp-section__action:hover,
.vataly-clp-section__action:focus-visible {
	text-decoration: underline;
	color: var(--ink_text);
}

.vataly-clp-section__action:focus-visible {
	outline: 2px solid var(--ink_text);
	outline-offset: 2px;
}

/* The rail's 4px scrollbar room is part of the 48px card -> divider gap. */
.vataly-clp-new-arrivals {
	padding-bottom: calc(var(--space_48) - 4px);
}

.vataly-clp-rail {
	padding-bottom: 4px;
	overflow-x: auto;
	overflow-y: hidden;
	overscroll-behavior-x: contain;
	scroll-snap-type: x proximity;
	scroll-padding-inline: 1px;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: thin;
	scrollbar-color: var(--ink_text) transparent;
}

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

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

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

.vataly-clp-rail:focus {
	outline: 0;
}

.vataly-clp-rail:focus-visible {
	outline: 2px solid var(--ink_text);
	outline-offset: -2px;
}

/* Same specificity as css/plp.css's grid rules, loaded after them. */
.woocommerce-archive .vataly-clp-rail ul.products {
	display: flex;
	gap: 2px;
	margin: 0 1px;
}

/* Four per view — the old four-column grid width: (1438 - 3 x 2px) / 4. */
.woocommerce-archive .vataly-clp-rail ul.products li.product {
	flex: 0 0 calc((100% - 6px) / 4);
	scroll-snap-align: start;
}

/* =========================================================================
   Shop All — centred Form/Button Primary, 48px above and below.
   ========================================================================= */

.vataly-clp-shop-all {
	display: flex;
	justify-content: center;
	padding: var(--space_48) var(--space_20);
}

/* =========================================================================
   Tablet + unfolded foldables.
   ========================================================================= */

@media (min-width: 768px) and (max-width: 1023.98px) {
	.vataly-clp-tile {
		flex-basis: calc((100% - 2 * var(--space_4)) / 3);
	}

	/* About three cards in view, the next one peeking. */
	.woocommerce-archive .vataly-clp-rail ul.products li.product {
		flex-basis: calc((100vw - 2 * var(--space_16)) / 3.2);
	}
}

/* =========================================================================
   New Arrivals rail — swipe below 1024px (Figma 11:556): a horizontal
   scroll row with snap, 16px in from the left; the card after the last
   fully visible one is cut off by the screen edge as the swipe cue, with
   the thin scrollbar set above.
   ========================================================================= */

@media (max-width: 1023.98px) {
	.vataly-clp-rail {
		scroll-snap-type: x mandatory;
		scroll-padding-inline: var(--space_16);
	}

	/* max-content: the row is as wide as its cards, so its right padding
	   is part of the scroll width and the last card does not touch the edge. */
	.woocommerce-archive .vataly-clp-rail ul.products {
		display: flex;
		gap: var(--space_8);
		width: max-content;
		margin: 0;
		padding: 0 var(--space_16);
	}

	.woocommerce-archive .vataly-clp-rail ul.products li.product {
		flex-grow: 0;
		flex-shrink: 0;
		scroll-snap-align: start;
	}
}

/* =========================================================================
   Mobile + folded cover screens — Figma Mobile (402).
   ========================================================================= */

@media (max-width: 767.98px) {
	.vataly-clp-banner--hero .vataly-clp-banner__media {
		aspect-ratio: 5 / 6; /* 402 × 482 */
	}

	.vataly-clp-banner--editorial .vataly-clp-banner__media {
		aspect-ratio: 402 / 360;
	}

	.vataly-clp-section__header {
		padding: 0 var(--space_20);
	}

	/* Shop by Category (Figma 11:516): two-column grid, 4px apart, edge to
	   edge — no scroll, so no scrollbar room under it. */
	.vataly-clp-categories {
		padding-bottom: var(--space_48);
	}

	.vataly-clp-tiles {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: var(--space_4);
		padding: 0;
		overflow: visible;
		scroll-snap-type: none;
	}

	/* 199 / 402 — about two cards in view, the second cut off. */
	.woocommerce-archive .vataly-clp-rail ul.products li.product {
		flex-basis: 49.5vw;
	}
}
