@import url('categories-no-image.css');

/* Categories V3 — split cards; 1 per view mobile, 3 per view desktop; flat edges */

.cat-v3-section {
	padding: 3.5rem 0 4rem;
	position: relative;
	/* Two horizontal bands: ~60% top tone / ~40% primary */
	background: linear-gradient(
		to bottom,
		color-mix(in srgb, var(--tertiary-background-color) 45%, var(--primary-background-color)) 0,
		color-mix(in srgb, var(--tertiary-background-color) 45%, var(--primary-background-color)) 60%,
		var(--primary-background-color) 60%,
		var(--primary-background-color) 100%
	);
}

@media (min-width: 768px) {
	.cat-v3-section {
		padding: 4.5rem 0 5rem;
	}
}

.cat-v3-header {
	text-align: center;
	margin-bottom: 2rem;
	max-width: 40rem;
	margin-inline: auto;
}

.cat-v3-header h2 {
	margin: 0 0 1rem;
	font-size: clamp(1.5rem, 3.5vw, 2rem);
	font-weight: 300;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--sc-categories-v3-cat-v3-header-heading-text, var(--primary-title-color));
	line-height: 1.3;
}

.cat-v3-header h2::after {
	content: '';
	display: block;
	width: 64px;
	height: 1px;
	background: var(--sc-categories-v3-cat-v3-header-heading-after-bg, var(--primary-brand-color));
	margin: 1rem auto 0;
}

.cat-v3-sub {
	margin: 0;
	font-size: 0.9375rem;
	font-weight: 300;
	letter-spacing: 0.04em;
	line-height: 1.65;
	color: var(--sc-categories-v3-cat-v3-sub-text, var(--primary-text-color));
	opacity: 0.82;
}

.cat-v3-strip-wrap {
	position: relative;
	padding: 0 2.75rem;
	isolation: isolate;
}

.cat-v3-strip-btn {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 20;
	pointer-events: auto;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	border: none;
	background: var(--sc-categories-v3-cat-v3-strip-btn-bg, var(--primary-brand-color));
	color: var(--sc-categories-v3-cat-v3-strip-btn-text, var(--primary-button-text-color));
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 0.8rem;
	box-shadow: 0 6px 20px color-mix(in srgb, var(--primary-brand-color) 35%, transparent);
	transition: transform 0.2s ease, opacity 0.2s ease, background 0.2s ease;
}

.cat-v3-strip-btn:hover:not(:disabled) {
	transform: translateY(-50%) scale(1.05);
	background: var(--sc-categories-v3-cat-v3-strip-btn-hover-bg, color-mix(in srgb, var(--primary-brand-color) 88%, #000));
}

.cat-v3-strip-btn:disabled {
	opacity: 0.25;
	cursor: not-allowed;
	pointer-events: none;
}

.cat-v3-strip-btn--prev {
	left: 4px;
}

.cat-v3-strip-btn--next {
	right: 4px;
}

.cat-v3-strip {
	--cat-v3-gap: 14px;
	--cat-v3-visible: 1;
	display: flex;
	position: relative;
	z-index: 0;
	gap: var(--cat-v3-gap);
	overflow-x: auto;
	overflow-y: hidden;
	scroll-snap-type: x mandatory;
	scroll-padding-inline: 0;
	padding: 4px 0;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
	-ms-overflow-style: none;
}

/* RTL: first category on the right. JS uses scrollBy + Firefox vs WebKit edge rules (do not clamp scrollLeft to ≥0 here). */
html[dir="rtl"] .cat-v3-strip {
	direction: rtl;
}

.cat-v3-strip::-webkit-scrollbar {
	display: none;
}

@media (min-width: 768px) {
	.cat-v3-strip {
		--cat-v3-visible: 3;
		--cat-v3-gap: 20px;
	}
}

.cat-v3-card {
	--cat-v3-slot: calc((100% - (var(--cat-v3-visible) - 1) * var(--cat-v3-gap)) / var(--cat-v3-visible));
	--cat-v3-inner-gap: 12px;
	flex: 0 0 var(--cat-v3-slot);
	width: var(--cat-v3-slot);
	max-width: var(--cat-v3-slot);
	scroll-snap-align: start;
	scroll-snap-stop: always;
	box-sizing: border-box;
	/* A bit taller than wide so top/bottom areas read slightly larger */
	aspect-ratio: 1 / 1.12;
	position: relative;
	overflow: hidden;
	text-decoration: none;
	color: inherit;
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	grid-template-rows: 1fr 1fr;
	gap: var(--cat-v3-inner-gap);
	padding: 14px 14px 16px;
	border: none;
	border-radius: 0;
	background: var(--sc-categories-v3-cat-v3-card-bg, var(--primary-background-color));
	transition: box-shadow 0.25s ease;
}

@media (min-width: 768px) {
	.cat-v3-card {
		--cat-v3-inner-gap: 16px;
		padding: 20px 20px 22px;
		aspect-ratio: 1 / 1.08;
	}
}

.cat-v3-card:hover {
	box-shadow: 0 12px 32px -8px rgba(0, 0, 0, 0.12);
}

/* Stack order: text-top vs image-top — grid rows keep 50/50 track sizes */
.cat-v3-card--text-first .cat-v3-card-panel--text {
	grid-row: 1;
}

.cat-v3-card--text-first .cat-v3-card-panel--image {
	grid-row: 2;
}

.cat-v3-card--image-first .cat-v3-card-panel--image {
	grid-row: 1;
}

.cat-v3-card--image-first .cat-v3-card-panel--text {
	grid-row: 2;
}

/* Halves fill their grid row (equal 1fr each) */
.cat-v3-card-panel {
	min-height: 0;
	min-width: 0;
	border-radius: 0;
	overflow: hidden;
	align-self: stretch;
}

/* ——— Text half ——— */
.cat-v3-card-panel--text {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: space-between;
	text-align: center;
	padding: 8% 0.5rem 10%;
	box-sizing: border-box;
	background: var(--sc-categories-v3-cat-v3-card-panel-text-bg, color-mix(in srgb, var(--secondary-background-color) 55%, #f5f5f5));
	border: none;
}

.cat-v3-card-copy {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.35rem;
	flex: 1;
	justify-content: center;
	min-height: 0;
}

.cat-v3-card-title {
	font-size: clamp(0.95rem, 2.8vw, 1.35rem);
	font-weight: 700;
	line-height: 1.2;
	color: var(--sc-categories-v3-cat-v3-card-title-text, var(--primary-title-color));
	letter-spacing: -0.02em;
}

.cat-v3-card-desc {
	font-size: clamp(0.62rem, 1.8vw, 0.75rem);
	line-height: 1.4;
	color: var(--sc-categories-v3-cat-v3-card-desc-text, color-mix(in srgb, var(--primary-text-color) 76%, transparent));
	max-width: 22ch;
}

.cat-v3-card-fab {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	flex-shrink: 0;
	border-radius: 50%;
	background: var(--sc-categories-v3-cat-v3-card-fab-bg, var(--primary-brand-color));
	color: var(--sc-categories-v3-cat-v3-card-fab-text, var(--primary-button-text-color));
	font-size: 0.85rem;
	box-shadow: 0 6px 16px color-mix(in srgb, var(--primary-brand-color) 35%, transparent);
	transition: transform 0.25s ease;
}

.cat-v3-card:hover .cat-v3-card-fab {
	transform: scale(1.06);
}

/* ——— Image half ——— */
.cat-v3-card-panel--image {
	position: relative;
	overflow: hidden;
	background: var(--sc-categories-v3-cat-v3-card-panel-image-bg, color-mix(in srgb, var(--secondary-background-color) 35%, var(--primary-background-color)));
	border: none;
}

.cat-v3-card-bg {
	position: absolute;
	inset: 0;
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
	transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.cat-v3-card:hover .cat-v3-card-bg {
	transform: scale(1.05);
}

.cat-v3-card:focus-visible {
	outline: 3px solid var(--sc-categories-v3-cat-v3-card-focus-outline, var(--primary-brand-color));
	outline-offset: 2px;
}

[dir="rtl"] .cat-v3-strip-btn--prev,
html[dir="rtl"] .cat-v3-strip-btn--prev {
	left: auto;
	right: 4px;
}

[dir="rtl"] .cat-v3-strip-btn--next,
html[dir="rtl"] .cat-v3-strip-btn--next {
	right: auto;
	left: 4px;
}

@media (max-width: 767px) {
	.cat-v3-header h2 {
		font-size: 1.375rem;
	}

	.cat-v3-card-title {
		font-size: 0.9375rem;
	}

	.cat-v3-strip-wrap {
		padding: 0 0.25rem;
	}

	.cat-v3-strip-btn {
		display: none;
	}
}

/* === theme colour controls: inherited values (generated) === */
.cat-v3-card-copy {
	color: var(--sc-categories-v3-cat-v3-card-copy-text, inherit);
}
/* === end theme colour controls === */
