/**
 * Shop by Category — styles for the [labz_shop_categories] shortcode.
 * Enqueued via wp_enqueue_style() (see astra-child/functions.php).
 * Pure CSS, no framework. Colors driven by CSS variables.
 * White theme, boxed to the site content width (matches header/footer).
 * Inherits the theme's existing font (no extra web font loaded).
 */
.labz-cats,
.labz-cats * { box-sizing: border-box; }

.labz-cats {
	/* Colors */
	--section-bg: #f6f8fb;         /* light grey so white cards stand out */
	--card-bg: #ffffff;
	--card-border: #e7eaef;
	--accent: #2f7fc4;             /* "View All" + hover blue */
	--title: #0c2238;              /* dark navy headings */
	--label: #1c2b3a;              /* category labels */

	/* Layout */
	--labz-cats-cols: 4;
	--content-width: 1240px;       /* matches the site header/footer width */

	position: relative;
	max-width: var(--content-width);
	margin-left: auto;
	margin-right: auto;
	background: var(--section-bg);
	border-radius: 18px;
	padding: 54px clamp(20px, 5vw, 64px);
}

/* Header row: title | divider | view all */
.labz-cats__head {
	display: flex;
	align-items: center;
	gap: 22px;
	margin-bottom: 44px;
}
h2.labz-cats__title {
	margin: 0;
	color: var(--title);
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 1.5px;
	font-size: clamp(20px, 2.6vw, 30px);
	line-height: 1;
	white-space: nowrap;
}
.labz-cats__divider {
	flex: 1;
	height: 1px;
	background: linear-gradient(90deg, rgba(12, 34, 80, 0.18), rgba(12, 34, 80, 0.04));
}
.labz-cats__viewall {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin-left: auto;
	color: var(--accent);
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 1px;
	font-size: 14px;
	text-decoration: none;
	white-space: nowrap;
	transition: color 0.2s ease, gap 0.2s ease;
}
.labz-cats__viewall-text { line-height: 1; }
/* Real arrow icon, vertically centered with the text.
   Only the icon animates on hover — the text stays put. */
.labz-cats__arrow {
	display: block;
	flex: none;
	width: 16px;
	height: 16px;
	transition: transform 0.2s ease;
}
.labz-cats__viewall:hover .labz-cats__arrow { transform: translateX(4px); }

/* Category grid */
.labz-cats__grid {
	display: grid;
	grid-template-columns: repeat(var(--labz-cats-cols), 1fr);
	gap: clamp(16px, 2.4vw, 30px);
}
/* Rounded square card */
.labz-cats__item {
	display: flex;
	flex-direction: column;
	min-width: 0;            /* let the card shrink to its grid track (prevents overflow) */
	text-decoration: none;
	background: var(--card-bg);
	border: 1px solid var(--card-border);
	border-radius: 12px;
	overflow: hidden;
	box-shadow: 0 6px 18px rgba(12, 34, 80, 0.06);
	transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

/* Image area — grows to absorb any extra card height so the label
   always sits flush at the bottom (no gap below it on hover). */
.labz-cats__thumb {
	flex: 1 1 auto;
	display: grid;
	place-items: center;
	min-height: 0;
	padding: 22px 18px;
	background:
		radial-gradient(120% 80% at 50% 0%, #f4f9ff 0%, #ffffff 60%);
}
/* Every image occupies an identical fixed-height box and is fully
   contained (uniform size, never cropped at the bottom). */
.labz-cats__thumb img {
	width: 100%;
	height: 170px;
	object-fit: contain;
	object-position: center;
	transition: transform 0.28s ease;
}

/* Label row with a divider above it */
.labz-cats__label {
	border-top: 1px solid #eef1f5;
	padding: 15px 8px;
	text-align: center;
	color: var(--label);
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 1px;
	font-size: 13px;
	background: transparent;
	transition: color 0.25s ease, background-color 0.25s ease, border-color 0.25s ease;
}

/* Lift on hover */
.labz-cats__item:hover {
	transform: translateY(-6px);
	box-shadow: 0 18px 34px rgba(12, 34, 80, 0.14);
	border-color: #cfe0f2;
}
.labz-cats__item:hover .labz-cats__thumb img { transform: scale(1.05); }
.labz-cats__item:hover .labz-cats__label {
	background: linear-gradient(180deg, #0c2238 0%, #013851 100%);
	border-top-color: transparent;
	color: #ffffff;
}

/* Responsive: 3 cols tablet, 2 cols mobile.
   NB: set grid-template-columns directly (not the CSS var) so these win over
   the inline --labz-cats-cols the shortcode prints for the desktop count. */
@media (max-width: 1024px) {
	.labz-cats { padding: 44px clamp(18px, 4vw, 40px); }
	.labz-cats__grid { grid-template-columns: repeat(3, 1fr); row-gap: 28px; }
	.labz-cats__thumb img { height: 150px; }
}
@media (max-width: 600px) {
	/* Right padding removed so the slider runs to the edge; restored per-element. */
	.labz-cats { padding: 34px 0 34px 16px; border-radius: 14px; }
	/* Compact header: title + View All on one row, hide the long divider */
	.labz-cats__head { gap: 12px; margin-bottom: 24px; padding-right: 16px; }
	.labz-cats__divider { display: none; }
	.labz-cats__title { font-size: 18px; letter-spacing: 0.6px; white-space: normal; min-width: 0; }
	.labz-cats__viewall { font-size: 12px; flex: none; }

	/* Pure-CSS horizontal swipe slider (scroll-snap, no JS) */
	.labz-cats__grid {
		display: flex;
		grid-template-columns: none;
		gap: 14px;
		overflow-x: auto;
		scroll-snap-type: x mandatory;
		scroll-behavior: smooth;        /* tapping a dot animates to its card */
		scroll-padding-left: 0;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: none;          /* Firefox */
		padding: 4px 16px 4px 0;        /* last card not flush to the edge */
	}
	.labz-cats__grid::-webkit-scrollbar { display: none; } /* WebKit */
	.labz-cats__item {
		flex: 0 0 62%;                  /* ~1.6 cards visible, next one peeks */
		scroll-snap-align: start;
	}
	.labz-cats__thumb { padding: 16px 12px; }
	.labz-cats__thumb img { height: 140px; }
	.labz-cats__label { padding: 12px 6px; font-size: 12px; letter-spacing: 0.6px; }
}
@media (max-width: 380px) {
	.labz-cats__title { font-size: 17px; }
}
