/* =========================================================
   eh-kategori.css  —  Kategori Utama Section
   BEM: .eh-kategori / .eh-kat__*
   ========================================================= */

/* ── CSS Variables ────────────────────────────────────── */
.eh-kategori-block {
	--kat-blue:      #1565C0;
	--kat-text-dark: #1A2332;
	--kat-text-mid:  #546E7A;
	--kat-bg:        #FFFFFF;
	--kat-radius:    10px;
	--kat-gap:       12px;
	--kat-card-min:  148px;  /* min card width */
}

/* ── Section wrapper ──────────────────────────────────── */
.eh-kategori-block {
	display: block;
	width: 100%;
	background: var(--kat-bg);
	padding: 20px 0 24px;
	box-sizing: border-box;
}

/* ── Inner container ──────────────────────────────────── */
.eh-kat__inner {
	max-width: 1200px;
	margin: 0 auto;
	padding: 0 24px;
}

/* ── Header row ───────────────────────────────────────── */
.eh-kat__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 14px;
}

.eh-kat__heading {
	font-size: 15px;
	font-weight: 700;
	color: var(--kat-text-dark);
	margin: 0;
	line-height: 1.2;
}

.eh-kat__view-all {
	font-size: 12.5px;
	font-weight: 500;
	color: var(--kat-blue);
	text-decoration: none;
	white-space: nowrap;
	display: inline-flex;
	align-items: center;
	gap: 3px;
	transition: opacity 0.15s ease;
}

.eh-kat__view-all:hover {
	opacity: 0.75;
	text-decoration: underline;
}

.eh-kat__view-all-arrow {
	font-size: 13px;
	line-height: 1;
}

/* ── Carousel wrapper ─────────────────────────────────── */
.eh-kat__carousel-wrap {
	position: relative;
}

/* ── Scrollable track ─────────────────────────────────── */
.eh-kat__track {
	display: flex;
	gap: var(--kat-gap);
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
	padding-bottom: 4px; /* prevent scroll-shadow clip */
	list-style: none;
	margin: 0;
	padding-left: 0;
}

.eh-kat__track::-webkit-scrollbar {
	display: none;
}

/* ── Prev / Next arrow buttons ────────────────────────── */
.eh-kat__arrow {
	display: none; /* shown via JS when overflow detected */
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 10;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	border: 1.5px solid #D0D7DE;
	background: #ffffff;
	box-shadow: 0 2px 8px rgba(0,0,0,0.10);
	cursor: pointer;
	align-items: center;
	justify-content: center;
	transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.eh-kat__arrow:hover {
	border-color: var(--kat-blue);
	box-shadow: 0 4px 12px rgba(21,101,192,0.15);
}

.eh-kat__arrow svg {
	width: 14px;
	height: 14px;
	fill: none;
	stroke: var(--kat-text-dark);
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.eh-kat__arrow--prev { left: -16px; }
.eh-kat__arrow--next { right: -16px; }

.eh-kat__arrow.is-visible { display: flex; }
.eh-kat__arrow.is-hidden  { opacity: 0.35; cursor: default; pointer-events: none; }

/* ── Single card ──────────────────────────────────────── */
.eh-kat__item {
	flex: 0 0 auto;
	width: calc((100% - 5 * var(--kat-gap)) / 6);
	min-width: var(--kat-card-min);
	scroll-snap-align: start;
}

.eh-kat__card {
	display: block;
	text-decoration: none;
	color: inherit;
}

.eh-kat__card:focus-visible {
	outline: 2px solid var(--kat-blue);
	outline-offset: 3px;
	border-radius: var(--kat-radius);
}

/* ── Card image ───────────────────────────────────────── */
.eh-kat__img-wrap {
	position: relative;
	width: 100%;
	aspect-ratio: 1 / 1;
	border-radius: var(--kat-radius);
	overflow: hidden;
	background: #EEF0F2;
}

.eh-kat__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.35s ease;
}

.eh-kat__card:hover .eh-kat__img {
	transform: scale(1.04);
}

/* placeholder when no image */
.eh-kat__img-wrap--empty {
	display: flex;
	align-items: center;
	justify-content: center;
	color: #90A4AE;
	font-size: 11px;
}

/* ── Card label ───────────────────────────────────────── */
.eh-kat__label {
	display: block;
	margin-top: 8px;
	font-size: 12.5px;
	font-weight: 500;
	color: var(--kat-text-dark);
	text-align: center;
	line-height: 1.3;
	word-break: break-word;
}

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 900px) {
	.eh-kategori-block {
		--kat-card-min: 130px;
	}

	.eh-kat__item {
		width: calc((100% - 4 * var(--kat-gap)) / 5);
	}
}

@media (max-width: 640px) {
	.eh-kat__inner { padding: 0 16px; }

	.eh-kat__heading { font-size: 14px; }

	.eh-kategori-block {
		--kat-card-min: 120px;
	}

	.eh-kat__item {
		width: calc((100% - 2 * var(--kat-gap)) / 3);
	}
}

@media (max-width: 400px) {
	.eh-kat__item {
		width: calc((100% - var(--kat-gap)) / 2.3);
	}
}
