/*
 * Front page, the category discovery (inc/site/home-kesif.php; preview ?onizleme=kesif). Cards of one fixed size: the
 * category's name and count, a square picture stage (the browser's scroll with snap, one product per stop), the product's
 * name and price on one line each, a thin progress line. Two columns on phones, three on tablets, four beside the big tile.
 */
.ck-x {
	--ckx-gold: var(--casetti-gold, #b8892a);
	--ckx-line: #e7e1d6;
	min-width: 0;
}

.ck-x__head {
	padding: 4px 0 18px;
}

.ck-x__eyebrow {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0 0 8px;
	color: var(--ckx-gold);
	font: 600 10.5px/1 var(--myco-font-sans);
	letter-spacing: 0.3em;
	text-transform: uppercase;
}

.ck-x__eyebrow::before {
	content: "";
	width: 30px;
	height: 1px;
	background: currentColor;
}

.ck-x__title {
	margin: 0;
	color: var(--casetti-ink);
	font: 400 clamp(28px, 3.2vw, 38px)/1.08 var(--casetti-font-display);
}

.ck-x__title em {
	color: var(--ckx-gold);
	font-style: italic;
}

.ck-x__lead {
	margin: 8px 0 0;
	color: #7a7068;
	font-size: 13px;
}

.ck-x__grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 14px;
}

.ck-x__card {
	position: relative;
	display: flex;
	flex-direction: column;
	min-width: 0;
	overflow: hidden;
	border: 1px solid var(--ckx-line);
	border-radius: 12px;
	background: #fff;
	transition: box-shadow 0.25s ease, transform 0.25s ease;
}

@media (hover: hover) {
	.ck-x__card:hover {
		box-shadow: 0 10px 26px -14px rgba(20, 15, 10, 0.35);
	}
}

/* The category: name and count, a link to the category */
.ck-x .ck-x__cat {
	display: flex;
	flex-direction: column;
	gap: 3px;
	padding: 12px 12px 10px;
	color: var(--casetti-ink);
	text-decoration: none;
}

.ck-x__name {
	overflow: hidden;
	font: 600 14px/1.25 var(--myco-font-sans);
	text-overflow: ellipsis;
	white-space: nowrap;
}

.ck-x__count {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	color: #8a8077;
	font: 500 10.5px/1 var(--myco-font-sans);
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

.ck-x__count .c-icon {
	width: 12px;
	height: 12px;
	transition: transform 0.2s ease;
}

@media (hover: hover) {
	.ck-x .ck-x__cat:hover .ck-x__name {
		text-decoration: underline;
		text-underline-offset: 3px;
	}

	.ck-x .ck-x__cat:hover .ck-x__count .c-icon {
		transform: translateX(3px);
	}
}

/* The stage: a square, the products side by side, one per stop */
.ck-x__stage {
	position: relative;
	margin: 0 10px;
	overflow: hidden;
	border-radius: 9px;
	background: #f7f5f1;
	aspect-ratio: 1 / 1;
}

.ck-x__track {
	display: flex;
	width: 100%;
	height: 100%;
	overflow-x: auto;
	overflow-y: hidden;
	overscroll-behavior-x: contain;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	scrollbar-width: none;
	touch-action: pan-x pan-y;
	-webkit-overflow-scrolling: touch;
	cursor: grab;
}

.ck-x__track::-webkit-scrollbar {
	display: none;
}

.ck-x__track.is-drag {
	scroll-snap-type: none;
	scroll-behavior: auto;
	cursor: grabbing;
}

.ck-x__track:focus-visible {
	outline: 2px solid var(--ckx-gold);
	outline-offset: -2px;
}

.ck-x .ck-x__slide {
	display: block;
	flex: 0 0 100%;
	width: 100%;
	height: 100%;
	scroll-snap-align: start;
	scroll-snap-stop: always;
}

.ck-x__slide img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
	padding: 6%;
	user-select: none;
	-webkit-user-drag: none;
}

/* The "more" hint: a soft edge on the right while there is more */
.ck-x__stage::after {
	content: "";
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	width: 22px;
	background: linear-gradient(to left, rgba(247, 245, 241, 0.9), rgba(247, 245, 241, 0));
	pointer-events: none;
	transition: opacity 0.2s ease;
}

.ck-x__card.is-end .ck-x__stage::after {
	opacity: 0;
}

/* Arrows: round, small, on the picture's sides */
.ck-x__nav {
	position: absolute;
	top: 50%;
	z-index: 2;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	margin: -15px 0 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.92);
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
	color: var(--casetti-ink);
	cursor: pointer;
	transition: opacity 0.2s ease, transform 0.2s ease;
}

.ck-x__nav[hidden] {
	display: none;
}

.ck-x__nav--prev { left: 6px; }
.ck-x__nav--next { right: 6px; }

.ck-x__nav .c-icon {
	width: 15px;
	height: 15px;
}

.ck-x__nav:active {
	transform: scale(0.92);
}

/* The counter: bottom left of the picture */
.ck-x__pos {
	position: absolute;
	bottom: 7px;
	left: 7px;
	padding: 3px 7px;
	border-radius: 999px;
	background: rgba(20, 18, 16, 0.6);
	color: #fff;
	font: 500 10px/1.2 var(--myco-font-sans);
	letter-spacing: 0.04em;
	pointer-events: none;
}

.ck-x__pos b {
	font-weight: 700;
}

/* The product: name and price, one line each (the card never changes size) */
.ck-x__info {
	display: flex;
	flex-direction: column;
	gap: 3px;
	padding: 9px 12px 10px;
}

.ck-x__pname {
	overflow: hidden;
	min-height: 1.3em;
	color: #4b4540;
	font: 400 12.5px/1.3 var(--myco-font-sans);
	text-overflow: ellipsis;
	white-space: nowrap;
}

.ck-x__price {
	display: flex;
	align-items: baseline;
	gap: 6px;
	min-height: 1.3em;
	font: 600 13px/1.3 var(--myco-font-sans);
	color: var(--casetti-ink);
}

.ck-x__price del {
	color: #9a918a;
	font-size: 11.5px;
	font-weight: 400;
}

.ck-x__price del:empty {
	display: none;
}

.ck-x__info.is-swap .ck-x__pname,
.ck-x__info.is-swap .ck-x__price {
	animation: ckx-in 0.28s ease;
}

@keyframes ckx-in {
	from { opacity: 0; transform: translateY(4px); }
	to { opacity: 1; transform: none; }
}

/* Progress: a thin line at the card's foot */
.ck-x__bar {
	display: block;
	height: 2px;
	margin-top: auto;
	background: #f0ebe2;
}

.ck-x__bar i {
	display: block;
	height: 100%;
	background: var(--ckx-gold);
	transition: width 0.3s ease;
}

/* The first-sight nudge: the picture moves a little to the left and back */
.ck-x__card.is-nudge .ck-x__track {
	animation: ckx-nudge 1.1s ease-in-out 1;
}

@keyframes ckx-nudge {
	0%, 100% { transform: none; }
	35% { transform: translateX(-16%); }
	65% { transform: translateX(-16%); }
}

/* Mobile first: two columns, smaller words */
@media (max-width: 767px) {
	.ck-x__head {
		padding: 22px 0 14px;
	}

	.ck-x__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 10px;
	}

	.ck-x .ck-x__cat {
		padding: 10px 10px 8px;
	}

	.ck-x__name {
		font-size: 13px;
	}

	.ck-x__stage {
		margin: 0 8px;
	}

	.ck-x__info {
		padding: 8px 10px 9px;
	}

	.ck-x__pname {
		font-size: 12px;
	}

	/* Phones: no arrows over the picture (the finger swipes); the counter and the edge show there is more */
	.ck-x__nav {
		display: none;
	}
}

@media (min-width: 768px) and (max-width: 1024px) {
	.ck-x__grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media (prefers-reduced-motion: reduce) {
	.ck-x__track { scroll-behavior: auto; }
	.ck-x__card.is-nudge .ck-x__track { animation: none; }
	.ck-x__info.is-swap .ck-x__pname,
	.ck-x__info.is-swap .ck-x__price { animation: none; }
}

/* The section around it: the old favourites' head is not shown in the preview */
.ck-x ~ .ch-favs__head { display: none; }

/* The loaded products must never widen a card: the grid cells and the stage keep their own width */
.ck-x, .ck-x__grid, .ck-x__card, .ck-x__stage, .ck-x__track { min-width: 0; max-width: 100%; }
.ck-x__card { overflow: hidden; }
.ck-x__stage { contain: inline-size; }

/* Owner's request (2026-11-26): bigger products, no prices */
.ck-x__price { display: none; }
.ck-x__stage { margin: 0 6px; }
.ck-x__slide img { padding: 0; transform: scale(1.06); }
.ck-x__info { padding-bottom: 12px; }
@media (max-width: 767px) {
	.ck-x__grid { gap: 10px; }
	.ck-x__stage { margin: 0 4px; border-radius: 8px; }
	.ck-x__info { padding: 7px 8px 10px; }
}

@media (hover: hover) { .ck-x__info { cursor: grab; user-select: none; } }

/* "Tümünü gör (N)": the category link as a visible call (owner's request, 2026-11-26) */
.ck-x .ck-x__cat { gap: 7px; }
.ck-x__count {
	align-self: flex-start;
	padding: 5px 9px 5px 10px;
	border: 1px solid rgba(184, 137, 42, 0.45);
	border-radius: 999px;
	background: #faf5ea;
	color: #8a6418;
	font: 600 10.5px/1 var(--myco-font-sans);
	letter-spacing: 0.04em;
	text-transform: none;
	white-space: nowrap;
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.ck-x__count .c-icon { width: 13px; height: 13px; }
.ck-x .ck-x__cat:active .ck-x__count { background: #1c1612; border-color: #1c1612; color: #fff; }
@media (hover: hover) {
	.ck-x .ck-x__cat:hover .ck-x__name { text-decoration: none; }
	.ck-x .ck-x__cat:hover .ck-x__count { background: #1c1612; border-color: #1c1612; color: #fff; }
}

/* Owner's layout (2026-11-26): category, the product's name, the picture; at the bottom "Tümünü gör" with the counter */
.ck-x .ck-x__cat { padding: 12px 12px 2px; }
.ck-x .ck-x__info { padding: 0 12px 9px; }
.ck-x__pname { color: #6f655c; font-size: 12.5px; }
.ck-x__all {
	display: flex;
	align-items: center;
	gap: 6px;
	margin: 10px 10px 12px;
	padding: 9px 12px;
	border: 1px solid rgba(184, 137, 42, 0.45);
	border-radius: 999px;
	background: #faf5ea;
	color: #8a6418;
	font: 600 12px/1 var(--myco-font-sans);
	text-decoration: none;
	white-space: nowrap;
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.ck-x__all-txt { flex: 1 1 auto; }
.ck-x__all .ck-x__pos {
	position: static;
	padding: 0;
	background: none;
	color: inherit;
	font: 500 11px/1 var(--myco-font-sans);
	opacity: 0.8;
	font-variant-numeric: tabular-nums;
}
.ck-x__all .c-icon { flex: none; width: 14px; height: 14px; transition: transform 0.2s ease; }
.ck-x__all:active { background: #1c1612; border-color: #1c1612; color: #fff; }
@media (hover: hover) {
	.ck-x__all:hover { background: #1c1612; border-color: #1c1612; color: #fff; }
	.ck-x__all:hover .c-icon { transform: translateX(3px); }
}
@media (max-width: 767px) {
	.ck-x .ck-x__cat { padding: 10px 9px 2px; }
	.ck-x .ck-x__info { padding: 0 9px 8px; }
	.ck-x__all { margin: 8px 6px 9px; padding: 8px 10px; font-size: 11.5px; gap: 4px; }
	.ck-x__all .ck-x__pos { font-size: 10.5px; }
}
