/* =============================================================================
   Collections Carousel Block
   BEM namespace: .collections-carousel
   ============================================================================= */

/* Block wrapper */
.collections-carousel {
	padding: 60px 0;
	overflow: hidden; /* prevent horizontal page scroll from track overflow */
}

/* ── Heading ─────────────────────────────────────────────────────────────── */

.collections-carousel__heading {
	text-align: center;
	color: #e74111;
	font-family: 'HelveticaNowDisplay', Helvetica, Arial, sans-serif;
	font-size: 34px;
	font-weight: bold;
	line-height: 1.2;
	letter-spacing: 0.5px;
	margin-bottom: 32px;
}

/* ── Outer container (positions nav absolutely relative to self) ─────────── */

.collections-carousel__outer {
	position: relative;
	width: 100%;
	max-width: 1440px;
	margin: 0 auto;
}

/* ── Scrollable track ────────────────────────────────────────────────────── */

.collections-carousel__track {
	display: flex;
	gap: 16px;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;        /* Firefox: hide native scrollbar */
	-ms-overflow-style: none;     /* IE / legacy Edge */
	padding: 0 0 8px 15px;        /* left-pad aligns with .grid-container; bottom pad for thumb comfort */
	cursor: grab;
}

.collections-carousel__track::-webkit-scrollbar {
	display: none; /* Chrome / Safari: hide native scrollbar */
}

.collections-carousel__track.is-dragging {
	cursor: grabbing;
	scroll-snap-type: none; /* release snap while mouse-dragging */
	user-select: none;
}

/* ── Cards ───────────────────────────────────────────────────────────────── */

/* Mobile first: show ~1.2 cards (peek of 2nd) */
.collections-carousel__card {
	flex: 0 0 83vw;
	scroll-snap-align: start;
	display: block;
	text-decoration: none;
	position: relative;
	overflow: hidden;
	background: #f0f0f0; /* shown while image loads */
}

/* Tablet (≥ 640px): ~2.2 cards */
@media (min-width: 640px) {
	.collections-carousel__card {
		flex: 0 0 calc(44vw - 8px);
	}
}

/* Desktop (≥ 960px): ~4.2 cards */
@media (min-width: 960px) {
	.collections-carousel__card {
		flex: 0 0 calc(23vw - 14px);
	}

	.collections-carousel__heading {
		font-size: 40px;
	}
}

/* Large screens (≥ 1440px): fixed width so cards don't grow beyond grid */
@media (min-width: 1440px) {
	.collections-carousel__card {
		flex: 0 0 316px;
	}
}

/* Card image */
.collections-carousel__card-image {
	position: relative;
	width: 100%;
	aspect-ratio: 3 / 4;
	overflow: hidden;
}

.collections-carousel__card-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.45s ease;
}

/* Hover: scale image inside the card (card itself stays same size) */
.collections-carousel__card:hover .collections-carousel__card-image img,
.collections-carousel__card:focus-within .collections-carousel__card-image img {
	transform: scale(1.06);
}

/* Dark gradient + text overlay */
.collections-carousel__card-overlay {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	padding: 40px 18px 18px;
	background: linear-gradient(to top, rgba(0, 0, 0, 0.62) 0%, rgba(0, 0, 0, 0) 100%);
	color: #ffffff;
}

.collections-carousel__card-title {
	font-family: 'HelveticaNowDisplay', Helvetica, Arial, sans-serif;
	font-size: 17px;
	font-weight: bold;
	line-height: 1.25;
	margin: 0 0 5px;
	color: #ffffff;
}

.collections-carousel__card-cta {
	display: block;
	font-size: 12px;
	color: #ffffff;
	text-decoration: underline;
	letter-spacing: 0.2px;
}

/* ── Footer: scrollbar + nav ─────────────────────────────────────────────── */

.collections-carousel__footer {
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 16px 15px 0;
}

/* Scrollbar */
.collections-carousel__scrollbar-wrap {
	flex: 1 1 auto;
	min-width: 0;
}

.collections-carousel__scrollbar-track {
	height: 3px;
	background: #dfdfdf;
	border-radius: 2px;
	position: relative;
	cursor: pointer;
}

.collections-carousel__scrollbar-thumb {
	position: absolute;
	top: 0;
	left: 0;
	height: 100%;
	background: #333333;
	border-radius: 2px;
	min-width: 24px;
	cursor: grab;
	transition: left 0.06s linear;
}

.collections-carousel__scrollbar-thumb:active {
	cursor: grabbing;
}

/* Nav buttons */
.collections-carousel__nav {
	display: flex;
	gap: 4px;
	flex-shrink: 0;
}

.collections-carousel__btn {
	width: 38px;
	height: 38px;
	border: 1px solid #cfcfcf;
	background: #ffffff;
	cursor: pointer;
	font-size: 22px;
	line-height: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	color: #444444;
	transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.collections-carousel__btn:hover {
	background-color: #e74111;
	border-color: #e74111;
	color: #ffffff;
}

.collections-carousel__btn:disabled {
	opacity: 0.35;
	cursor: not-allowed;
	pointer-events: none;
}

/* ── Editor preview adjustments ──────────────────────────────────────────── */

.block-editor .collections-carousel {
	overflow: visible;
}
