/*
 * Category Carousel block.
 *
 * .coastal-cat-carousel  — full-width section, carries the editor-controlled
 *                          background color.
 * .coastal-cat-carousel__panel — white panel inside, capped at 1440px,
 *                                border-radius 16px. Both the header zone and
 *                                carousel zone live inside this panel.
 *
 * Cards have no card chrome — they are separated by 2px vertical lines
 * (#DCE9F5). Desktop shows 4 full cards + ~20% peek of the 5th to signal
 * scrollability. Arrows float absolutely over the track. Touch/swipe works
 * natively via CSS scroll-snap.
 */

.coastal-cat-carousel {
	width: 100%;
	padding: 40px 0;
}

/* ── Panel ──────────────────────────────────────────────────────────────── */

.coastal-cat-carousel__panel {
	box-sizing: border-box;
	width: 100%;
	max-width: 1440px !important;
	margin-inline: auto;
	background: #ffffff;
	border-radius: 16px;
	overflow: hidden;
}

/* ── Header zone ────────────────────────────────────────────────────────── */

.coastal-cat-carousel__header-zone {
	padding: 40px 48px 28px;
	font-family: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
}

.coastal-cat-carousel__heading {
	margin: 0 0 8px;
	font-family: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
	font-weight: 700;
	font-size: 24px;
	line-height: 1.2;
	color: #000000;
}

.coastal-cat-carousel__subheading {
	margin: 0;
	font-family: "Source Sans 3", "Source Sans Pro", system-ui, -apple-system, sans-serif;
	font-weight: 400;
	font-size: 16px;
	line-height: 1.5;
	color: #000000;
}

/* ── Carousel zone ──────────────────────────────────────────────────────── */

.coastal-cat-carousel__carousel-inner {
	padding: 0 48px 40px;
}

/* ── Stage: positions arrows absolutely over the track ──────────────────── */

.coastal-cat-carousel__stage {
	position: relative;
}

/* ── Track ──────────────────────────────────────────────────────────────── */

.coastal-cat-carousel__track {
	display: flex;
	gap: 0;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
	list-style: none;
	margin: 0;
	padding: 0;
}

.coastal-cat-carousel__track::-webkit-scrollbar {
	display: none;
}

/* ── Card ───────────────────────────────────────────────────────────────── */

.coastal-cat-carousel__card {
	/*
	 * 4.2 cards visible on desktop: 4 full + ~20% peek.
	 * flex-basis = 100% / 4.2. No gap, border-right creates the separator.
	 */
	flex: 0 0 calc(100% / 4.2);
	box-sizing: border-box;
	scroll-snap-align: start;
	padding: 32px 24px;
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	border-right: 2px solid #DCE9F5;
}

.coastal-cat-carousel__image-wrap {
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	margin-bottom: 20px;
	min-height: 160px;
}

.coastal-cat-carousel__image-wrap--placeholder {
	background: rgba(0, 0, 0, 0.04);
	border-radius: 8px;
}

.coastal-cat-carousel__image {
	display: block;
	max-width: 100%;
	max-height: 180px;
	width: auto;
	height: auto;
	object-fit: contain;
}

.coastal-cat-carousel__name {
	font-family: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
	font-weight: 700;
	font-size: 24px;
	line-height: 1.2;
	color: #000000;
	margin: 0 0 12px;
}

.coastal-cat-carousel__desc {
	font-family: "Source Sans 3", "Source Sans Pro", system-ui, -apple-system, sans-serif;
	font-weight: 400;
	font-size: 16px;
	line-height: 1.6;
	color: #000000;
	margin: 0 0 40px;
	flex-grow: 1;
}

.coastal-cat-carousel__btn {
	display: inline-block;
	padding: 8px 16px;
	background-color: #2c2c75;
	color: #ffffff !important;
	font-family: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
	font-weight: 600;
	font-size: 16px;
	line-height: 1.5;
	border-radius: 999px;
	text-decoration: none !important;
	transition: background-color 150ms ease-in-out;
	white-space: nowrap;
	margin-top: 20px;
}

.coastal-cat-carousel__btn:hover,
.coastal-cat-carousel__btn:focus-visible {
	background-color: #565691;
	color: #ffffff !important;
}

/* ── Arrows (floating over the track) ──────────────────────────────────── */

.coastal-cat-carousel__arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 10;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	border: 2px solid #2c2c75;
	background: #ffffff;
	color: #2c2c75;
	cursor: pointer;
	padding: 0;
	transition: background-color 150ms ease-in-out, color 150ms ease-in-out;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.coastal-cat-carousel__arrow--prev {
	left: 8px;
}

.coastal-cat-carousel__arrow--next {
	right: 8px;
}

.coastal-cat-carousel__arrow:hover,
.coastal-cat-carousel__arrow:focus-visible {
	background-color: #2c2c75;
	color: #ffffff;
}

.coastal-cat-carousel__arrow:focus-visible {
	outline: 2px solid #2c2c75;
	outline-offset: 3px;
}

.coastal-cat-carousel__arrow span {
	display: block;
	width: 10px;
	height: 10px;
	border-top: 2px solid currentColor;
	border-right: 2px solid currentColor;
}

.coastal-cat-carousel__arrow--prev span {
	transform: rotate(-135deg) translate(-1px, 1px);
}

.coastal-cat-carousel__arrow--next span {
	transform: rotate(45deg) translate(-1px, 1px);
}

/* ── Placeholder ────────────────────────────────────────────────────────── */

.coastal-cat-carousel__placeholder {
	margin: 0;
	padding: 32px;
	background: rgba(0, 0, 0, 0.04);
	color: #555;
	font-style: italic;
	border-radius: 8px;
}

/* ── Responsive ─────────────────────────────────────────────────────────── */

@media (max-width: 1200px) {
	.coastal-cat-carousel__card {
		flex: 0 0 calc(100% / 3.2); /* 3 full + ~20% peek */
	}
}

@media (max-width: 1024px) {
	.coastal-cat-carousel__card {
		flex: 0 0 calc(100% / 2.2); /* 2 full + ~20% peek */
	}
}

@media (max-width: 640px) {
	.coastal-cat-carousel {
		padding: 24px 16px;
	}

	.coastal-cat-carousel__header-zone {
		padding: 28px 24px 20px;
	}

	.coastal-cat-carousel__carousel-inner {
		padding: 0 24px 28px;
	}

	.coastal-cat-carousel__heading {
		font-size: 20px;
	}

	.coastal-cat-carousel__card {
		flex: 0 0 calc(100% / 1.15); /* 1 full + ~15% peek */
	}

	/* Hide arrows on mobile — swipe is the primary interaction */
	.coastal-cat-carousel__arrow {
		display: none;
	}
}
