/* ============================================================================
   CAPTAIN PIPE 2.0 — HOME SECTIONS 03–06  (FASE 2)
   Loaded on the front page only. Uses the FASE 1 design-system tokens.
   White / off-white · editorial · product-first · minimal cards · subtle hover.
   ========================================================================== */

:root {
	--cs-narrow: 46rem; /* editorial text measure */
}

/* ---- Shared section scaffolding ------------------------------------ */
.cs-section {
	padding-block: var(--cs-space-section);
}
.cs-section + .cs-section {
	padding-top: 0;
}
.cs-eyebrow {
	margin: 0 0 0.75rem;
	font-family: var(--cs-font-sans);
	font-size: var(--cs-fs-eyebrow);
	font-weight: 600;
	letter-spacing: var(--cs-tracking-cap);
	text-transform: uppercase;
	color: var(--cs-muted);
}
.cs-section__head {
	margin-bottom: clamp(1.75rem, 4vw, 3rem);
}
.cs-section__head--row {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 1rem 2rem;
	flex-wrap: wrap;
}
.cs-section__title {
	margin: 0;
	font-size: var(--cs-fs-h2);
	line-height: var(--cs-lh-snug);
}
.cs-link {
	font-family: var(--cs-font-sans);
	font-size: var(--cs-fs-nav);
	font-weight: 500;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	text-decoration: none;
	color: var(--cs-ink);
	border-bottom: 1px solid var(--cs-ink);
	padding-bottom: 2px;
	transition: color var(--cs-dur) var(--cs-ease),
	            border-color var(--cs-dur) var(--cs-ease);
	white-space: nowrap;
}
.cs-link:hover,
.cs-link:focus-visible {
	color: var(--cs-ink-soft);
	border-color: var(--cs-ink-soft);
}

/* ============================================================
   04 — FEATURED PRODUCTS  (horizontal carousel, live cards)
   Native overflow-x + scroll-snap + scroll-behavior:smooth. JS only drives
   the two arrow buttons (step + enable/disable at the ends, no loop).
   Card design (.cs-card*) is unchanged from the FASE 2 grid.
   ============================================================ */
.cs-carousel {
	position: relative;
}
.cs-carousel__viewport {
	overflow-x: auto;
	overflow-y: hidden;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	scroll-padding-inline: var(--cs-container-pad);
	-webkit-overflow-scrolling: touch;
	max-width: var(--cs-container-max);
	margin-inline: auto;
	padding-inline: var(--cs-container-pad);
	/* Hide the scrollbar visually only; scrolling stays fully usable via
	   touch, trackpad, mouse wheel, the arrow buttons and, once focused
	   (tabindex="0" below), the keyboard. */
	scrollbar-width: none;
	-ms-overflow-style: none;
}
.cs-carousel__viewport::-webkit-scrollbar {
	display: none;
}
.cs-featured__track {
	--cs-fgap: clamp(1.25rem, 3vw, 2rem); /* single source of truth for the gap,
	                                         reused by every flex-basis below so
	                                         "N visible" stays exact, not approximate */
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	gap: var(--cs-fgap);
}
.cs-featured__item {
	/* Mobile: ~1.1 cards visible (a sliver of the next hints continuation). */
	flex: 0 0 calc(88% - var(--cs-fgap) * 0.5);
	min-width: 0;
	scroll-snap-align: start;
}
@media (min-width: 768px) and (max-width: 899.98px) {
	.cs-featured__item {
		flex-basis: calc((100% - var(--cs-fgap)) / 2); /* 2 visible */
	}
}
@media (min-width: 900px) and (max-width: 1023.98px) {
	.cs-featured__item {
		flex-basis: calc((100% - var(--cs-fgap) * 2) / 3); /* 3 visible */
	}
}
@media (min-width: 1024px) {
	.cs-featured__item {
		flex-basis: calc((100% - var(--cs-fgap) * 3) / 4); /* 4 visible */
	}
}

/* ---- Arrows: discrete, minimal, disable at the ends (no loop) ---- */
.cs-carousel__arrow {
	position: absolute;
	top: 38%;
	transform: translateY(-50%);
	z-index: 2;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.75rem;
	height: 2.75rem;
	padding: 0;
	background: var(--cs-bg);
	border: 1px solid var(--cs-line);
	border-radius: 999px;
	color: var(--cs-ink);
	cursor: pointer;
	box-shadow: 0 2px 10px rgba(22, 21, 15, 0.07);
	transition: background var(--cs-dur) var(--cs-ease),
	            border-color var(--cs-dur) var(--cs-ease),
	            opacity var(--cs-dur) var(--cs-ease);
}
.cs-carousel__arrow--prev {
	left: clamp(0.25rem, 1.5vw, 1.25rem);
}
.cs-carousel__arrow--next {
	right: clamp(0.25rem, 1.5vw, 1.25rem);
}
.cs-carousel__arrow svg {
	width: 18px;
	height: 18px;
}
.cs-carousel__arrow:hover,
.cs-carousel__arrow:focus-visible {
	background: var(--cs-surface);
	border-color: var(--cs-ink);
}
.cs-carousel__arrow:disabled {
	opacity: 0.32;
	cursor: default;
	box-shadow: none;
}
@media (max-width: 599.98px) {
	.cs-carousel__arrow {
		width: 2.25rem;
		height: 2.25rem;
	}
}

.cs-card {
	display: flex;
	flex-direction: column;
	text-decoration: none;
	color: var(--cs-ink);
}
.cs-card__media {
	display: grid;
	place-items: center;
	aspect-ratio: 4 / 5;
	/* PRODUCT-IMAGE-TRANSPARENCY-01: transparent, not --cs-surface — the
	   product photos are now real cutouts (no more baked-in white canvas),
	   so the card lets the page's own background show straight through
	   instead of framing the product in a separate grey box. */
	background: transparent;
	overflow: visible; /* the drop-shadow filter must not get clipped */
	margin-bottom: 1.15rem;
}
.cs-card__img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	padding: 9%;
	/* Very light, premium studio-style shadow — replaces whatever soft
	   shadow used to be baked into the old white-background photos. */
	filter: drop-shadow(0 10px 14px rgba(22, 21, 15, 0.12));
	transition: transform 0.25s var(--cs-ease);
}
.cs-card:hover .cs-card__img,
.cs-card:focus-visible .cs-card__img {
	transform: scale(1.03);
}
.cs-card__eyebrow {
	font-family: var(--cs-font-sans);
	font-size: 0.6875rem;
	font-weight: 600;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--cs-muted);
	margin-bottom: 0.4rem;
}
.cs-card__name {
	font-family: var(--cs-font-serif);
	font-size: 1.0625rem;
	line-height: 1.3;
	margin-bottom: 0.4rem;
}
.cs-card:hover .cs-card__name,
.cs-card:focus-visible .cs-card__name {
	text-decoration: underline;
	text-underline-offset: 3px;
}
.cs-card__price {
	font-family: var(--cs-font-sans);
	font-size: 0.9375rem;
	font-weight: 600;
	color: var(--cs-ink);
}
.cs-card__price del {
	color: var(--cs-muted);
	font-weight: 400;
	margin-right: 0.4em;
}
.cs-card__cta {
	margin-top: 0.85rem;
	font-family: var(--cs-font-sans);
	font-size: 0.75rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--cs-muted);
	opacity: 0;
	transform: translateY(4px);
	transition: opacity var(--cs-dur) var(--cs-ease),
	            transform var(--cs-dur) var(--cs-ease);
}
.cs-card:hover .cs-card__cta,
.cs-card:focus-visible .cs-card__cta {
	opacity: 1;
	transform: none;
}


/* ============================================================
   05 — BRAND / CAPTAIN PIPE STORY  (single subtle band)
   ============================================================ */
.cs-story {
	background: var(--cs-surface);
	padding-block: clamp(3.5rem, 8vw, 7rem);
	overflow: hidden; /* the map's own edges never cause horizontal scroll */
}
/* HOME-STORY-SPACING-01: removed the old `.cs-section.cs-story + .cs-section
   { padding-top: var(--cs-space-section); }` override. It was RE-ADDING a
   full --cs-space-section top padding to Collections on top of Story's own
   (larger) padding-bottom, doubling the gap instead of collapsing it like
   every other section-to-section transition on the page (the general
   `.cs-section + .cs-section { padding-top: 0; }` rule above now applies
   here too, same as everywhere else) - cuts the empty space ~46% across the
   full responsive range while still leaving Story's own padding-bottom
   (clamp(3.5rem, 8vw, 7rem)) as real, deliberate editorial air. */
.cs-story__grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	align-items: center;
	gap: 2.5rem;
}
.cs-story__inner {
	max-width: var(--cs-narrow);
}
.cs-story__media {
	margin: 0;
	min-width: 0;
}
.cs-story__map {
	display: block;
	width: 100%;
	height: auto;
	object-fit: contain; /* never cropped/deformed, parchment silhouette stays whole */
	/* CAPTAIN-03: ~25% dimmer than a plain photo - reads as a soft editorial
	   illustration integrated into the background rather than a product
	   shot, while the ship/compass/route/X/location label stay legible. */
	opacity: 0.78;
}
.cs-story__title {
	margin: 0 0 1.1rem;
	font-size: var(--cs-fs-h2);
	line-height: var(--cs-lh-snug);
}
.cs-story__body {
	margin: 0 0 1.75rem;
	font-size: var(--cs-fs-lede);
	line-height: 1.55;
	color: var(--cs-ink-soft);
	max-width: 60ch;
}
.cs-story__actions {
	margin: 0 0 1.5rem;
}
.cs-placeholder-note {
	margin: 0;
	font-family: var(--cs-font-sans);
	font-size: 0.6875rem;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--cs-muted);
}

/* ---- Story + map: 2 columns from tablet up. The map dissolves into the
   section's own background on its left edge via REAL alpha transparency
   baked into the v2 asset itself (confirmed: fades from fully transparent
   to fully opaque across roughly the first 25% of its width) - no card, no
   border, no box, no shadow, no frame, and (CAPTAIN-03) no CSS mask-image
   stacked on top of that, which would only double/muddy the same fade the
   PNG already does natively. Mobile keeps the original single column
   (text, then the full-width map below, in natural DOM order). --------- */
@media (min-width: 768px) {
	.cs-story--with-map .cs-story__grid {
		max-width: 1560px; /* wider than the site's usual 1320px container, as requested */
		grid-template-columns: minmax(0, 0.7fr) minmax(0, 1fr); /* ~41% / ~59% - map has more presence, CAPTAIN-03 */
		gap: clamp(1rem, 2vw, 1.5rem); /* CAPTAIN-03: tighter, map starts closer to the copy */
	}
}
@media (min-width: 1024px) {
	.cs-story--with-map .cs-story__grid {
		gap: clamp(1.25rem, 2.5vw, 2.25rem);
	}
}

/* ============================================================
   06 — PRODUCT SHOWCASE / COLLECTIONS  ("Cuatro formas de disfrutar")
   Editorial cards: image (unchanged artwork, exact 1231x1277 ratio, never
   cropped/distorted) + real HTML title/description/link below it. CSS Grid,
   1/2/4 columns; each card is a flex column with the description set to
   flex:1 1 auto so every "Ver productos" link lands on the same baseline
   regardless of how long each description is — no JS, no fixed heights,
   same technique already used on the Shop grid (shop.css).
   ============================================================ */
.cs-collections__intro {
	max-width: 40rem;
	margin: 0.75rem 0 0;
	font-size: var(--cs-fs-lede);
	color: var(--cs-ink-soft);
}

.cs-collections__grid {
	--cs-gold: #a9793e; /* warm bronze accent, sampled from the crest/hero palette */
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 2.5rem 1.5rem;
	margin: clamp(2rem, 4vw, 3rem) 0 0;
	padding: 0;
	list-style: none;
}
.cs-collection-card {
	display: flex;
	flex-direction: column;
	padding-bottom: clamp(1.5rem, 3vw, 2rem);
	border-bottom: 1px solid var(--cs-line);
}
.cs-collection-card__media {
	display: block;
	aspect-ratio: 1231 / 1277; /* matches the four source images exactly — no crop, no distortion */
	margin: 0 0 1.25rem;
	background: var(--cs-surface);
	overflow: hidden;
	border-radius: 2px;
}
.cs-collection-card__img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover; /* box ratio == image ratio, so this never actually crops */
	transition: transform 0.4s var(--cs-ease);
}
.cs-collection-card:hover .cs-collection-card__img {
	transform: scale(1.015);
}
.cs-collection-card__body {
	flex: 1 1 auto;
}
.cs-collection-card__title {
	margin: 0;
	min-height: 2.4em; /* reserves 2 lines so every description starts level, even if a title wraps */
	font-size: 1.125rem;
	line-height: 1.2;
}
.cs-collection-card__desc {
	margin: 0.6rem 0 0;
	font-size: 0.9375rem;
	line-height: 1.55;
	color: var(--cs-ink-soft);
}
.cs-collection-card__link {
	display: inline-flex;
	align-items: center;
	gap: 0.4em;
	margin-top: 1.25rem;
	font-family: var(--cs-font-sans);
	font-size: 0.8125rem;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	text-decoration: none;
	color: var(--cs-gold);
}
.cs-collection-card__link span {
	transition: transform var(--cs-dur) var(--cs-ease);
}
.cs-collection-card__link:hover,
.cs-collection-card__link:focus-visible {
	color: var(--cs-ink);
}
.cs-collection-card__link:hover span,
.cs-collection-card__link:focus-visible span {
	transform: translateX(3px);
}

/* Tablet: 2 columns. */
@media (min-width: 640px) {
	.cs-collections__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		column-gap: clamp(1.5rem, 3vw, 2.5rem);
	}
}

/* Desktop: 4 columns, thin vertical rules between (in addition to the
   bottom rule) so the row reads as one coherent editorial grid. */
@media (min-width: 1024px) {
	.cs-collections__grid {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
	.cs-collection-card {
		padding-inline-start: clamp(1.25rem, 2vw, 1.75rem);
		border-inline-start: 1px solid var(--cs-line);
	}
	.cs-collection-card:first-child {
		padding-inline-start: 0;
		border-inline-start: 0;
	}
}

/* ---- Motion preference ---------------------------------------- */
@media (prefers-reduced-motion: reduce) {
	.cs-card__img,
	.cs-card__cta,
	.cs-collection-card__img,
	.cs-collection-card__link span,
	.cs-carousel__arrow {
		transition: none;
	}
	.cs-carousel__viewport {
		scroll-behavior: auto;
	}
}
