/* WC Subcategory Cards */

.wcsc-wrap {
	--wcsc-cols-d: 4;
	--wcsc-cols-t: 2;
	--wcsc-cols-m: 1;
	--wcsc-cols: var(--wcsc-cols-d);
	--wcsc-min-d: 1;
	--wcsc-min-t: 1;
	--wcsc-min-m: 1;
	--wcsc-min: var(--wcsc-min-d);
	--wcsc-head-color: #1b1b1b;
	--wcsc-group-gap: 40px;
	--wcsc-gap: 20px;
	--wcsc-bg: #ffffff;
	--wcsc-border: #ececec;
	--wcsc-radius: 12px;
	--wcsc-img-h: 230px;
	--wcsc-align: center;
	--wcsc-title-color: #1b1b1b;
	--wcsc-title-hover: #b07d2b;
	--wcsc-count-color: #7a7a7a;
	--wcsc-title-size: 18px;
	--wcsc-title-weight: 600;
	--wcsc-accent: #b07d2b;
	width: 100%;
	box-sizing: border-box;
}

@media (max-width: 1024px) {
	.wcsc-wrap { --wcsc-cols: var(--wcsc-cols-t); --wcsc-min: var(--wcsc-min-t); }
}
@media (max-width: 767px) {
	.wcsc-wrap { --wcsc-cols: var(--wcsc-cols-m); --wcsc-min: var(--wcsc-min-m); }
}

.wcsc-wrap *,
.wcsc-wrap *::before,
.wcsc-wrap *::after {
	box-sizing: border-box;
}

/* ---- grid: max N per row, leftover cards stretch / center / align left ---- */
.wcsc-wrap .wcsc-grid {
	display: flex;
	flex-wrap: wrap;
	gap: var(--wcsc-gap);
	width: 100%;
	margin: 0;
	padding: 0;
}

.wcsc-wrap .wcsc-card {
	flex: 1 1 calc((100% - (var(--wcsc-cols) - 1) * var(--wcsc-gap)) / var(--wcsc-cols) - 0.5px);
	min-width: 0;
}

.wcsc-wrap.wcsc-last-center .wcsc-grid { justify-content: center; }
.wcsc-wrap.wcsc-last-center .wcsc-card {
	flex: 0 1 calc((100% - (var(--wcsc-cols) - 1) * var(--wcsc-gap)) / var(--wcsc-cols) - 0.5px);
}

.wcsc-wrap.wcsc-last-left .wcsc-grid { justify-content: flex-start; }
.wcsc-wrap.wcsc-last-left .wcsc-card {
	flex: 0 1 calc((100% - (var(--wcsc-cols) - 1) * var(--wcsc-gap)) / var(--wcsc-cols) - 0.5px);
}

/* ---- card ---- */
.wcsc-wrap .wcsc-card {
	display: flex;
	flex-direction: column;
	position: relative;
	overflow: hidden;
	background: var(--wcsc-bg);
	border: 1px solid var(--wcsc-border);
	border-radius: var(--wcsc-radius);
	color: inherit;
	transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
}
.wcsc-wrap .wcsc-card,
.wcsc-wrap .wcsc-card:hover,
.wcsc-wrap .wcsc-card:focus {
	text-decoration: none;
}

.wcsc-wrap .wcsc-img {
	display: block;
	width: 100%;
	aspect-ratio: var(--wcsc-ratio, 4 / 3);
	overflow: hidden;
	background: #f3f3f3;
	line-height: 0;
}
.wcsc-wrap .wcsc-img img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	margin: 0;
	object-fit: cover;
	border-radius: 0;
	transition: transform .5s ease;
}

.wcsc-wrap .wcsc-body {
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding: 16px 14px;
	text-align: var(--wcsc-align);
}
.wcsc-wrap .wcsc-title {
	display: block;
	font-family: var(--wcsc-font, inherit);
	font-size: var(--wcsc-title-size);
	font-weight: var(--wcsc-title-weight);
	line-height: 1.3;
	color: var(--wcsc-title-color);
	transition: color .25s ease;
}
.wcsc-wrap .wcsc-card:hover .wcsc-title {
	color: var(--wcsc-title-hover);
}
.wcsc-wrap .wcsc-count {
	display: block;
	font-size: 13px;
	line-height: 1.3;
	color: var(--wcsc-count-color);
}

/* ---- hover effects ---- */
.wcsc-wrap.wcsc-hz .wcsc-card:hover .wcsc-img img { transform: scale(1.08); }
.wcsc-wrap.wcsc-hl .wcsc-card:hover { transform: translateY(-6px); }

/* ---- style 1: classic card ---- */
.wcsc-style-1 .wcsc-card { box-shadow: 0 6px 20px rgba(0, 0, 0, .08); border-color: transparent; }
.wcsc-style-1.wcsc-hl .wcsc-card:hover { box-shadow: 0 14px 30px rgba(0, 0, 0, .14); }

/* ---- style 2: bordered + accent line ---- */
.wcsc-style-2 .wcsc-card { border-width: 2px; box-shadow: none; }
.wcsc-style-2 .wcsc-card:hover { border-color: var(--wcsc-accent); }
.wcsc-style-2 .wcsc-title::after {
	content: "";
	display: block;
	width: 36px;
	height: 3px;
	margin: 10px auto 0;
	background: var(--wcsc-accent);
	transition: width .3s ease;
}
.wcsc-style-2.wcsc-al-left .wcsc-title::after  { margin-left: 0; }
.wcsc-style-2.wcsc-al-right .wcsc-title::after { margin-right: 0; margin-left: auto; }
.wcsc-style-2 .wcsc-card:hover .wcsc-title::after { width: 64px; }

/* ---- style 3: name over image ---- */
.wcsc-style-3 {
	--wcsc-title-color: #ffffff;
	--wcsc-title-hover: #ffd27a;
	--wcsc-count-color: rgba(255, 255, 255, .8);
	--wcsc-bg: #000000;
}
.wcsc-style-3 .wcsc-card { border: 0; }
.wcsc-style-3 .wcsc-body {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	padding: 48px 16px 18px;
	background: linear-gradient(to top, rgba(0, 0, 0, .82), rgba(0, 0, 0, 0));
}

/* ---- style 4: round image ---- */
.wcsc-style-4 { --wcsc-bg: transparent; }
.wcsc-style-4 .wcsc-card {
	align-items: center;
	padding: 10px;
	border: 0;
	overflow: visible;
}
.wcsc-style-4 .wcsc-img {
	width: min(var(--wcsc-img-h), 100%);
	height: auto;
	aspect-ratio: 1 / 1;
	border-radius: 50%;
	border: 4px solid var(--wcsc-border);
	transition: border-color .3s ease;
}
.wcsc-style-4 .wcsc-card:hover .wcsc-img { border-color: var(--wcsc-accent); }
.wcsc-style-4 .wcsc-body { width: 100%; padding: 14px 6px 4px; }

/* ---- style 5: dark card ---- */
.wcsc-style-5 {
	--wcsc-bg: #141414;
	--wcsc-border: #141414;
	--wcsc-title-color: #ffffff;
	--wcsc-title-hover: #e3b04b;
	--wcsc-count-color: #a9a9a9;
}
.wcsc-style-5 .wcsc-card { box-shadow: 0 8px 24px rgba(0, 0, 0, .25); }

/* ---- admin-only notice ---- */
.wcsc-admin-notice {
	padding: 12px 16px;
	border: 1px dashed #d63638;
	border-radius: 6px;
	background: #fff4f4;
	color: #8a1f1f;
	font-size: 14px;
	line-height: 1.5;
}

/* ---- image box: absolute img so the ratio box always fills exactly ---- */
.wcsc-wrap .wcsc-img { position: relative; }
.wcsc-wrap .wcsc-img img { position: absolute; top: 0; left: 0; }

/* ---- fixed-height mode (optional) ---- */
.wcsc-wrap.wcsc-img-fixed .wcsc-img {
	aspect-ratio: auto;
	height: var(--wcsc-img-h);
}
.wcsc-style-4.wcsc-img-fixed .wcsc-img {
	aspect-ratio: 1 / 1;
	height: auto;
}

/* ---- min cards per row: a card never gets wider than 1/min of the row ---- */
.wcsc-wrap .wcsc-card {
	max-width: calc((100% - (var(--wcsc-min) - 1) * var(--wcsc-gap)) / var(--wcsc-min));
}
/* leftover cards (fewer than the max per row) sit in the middle */
.wcsc-wrap.wcsc-has-min.wcsc-last-stretch .wcsc-grid { justify-content: center; }

/* ---- main + sub groups ---- */
.wcsc-wrap .wcsc-group + .wcsc-group { margin-top: var(--wcsc-group-gap); }
.wcsc-wrap .wcsc-group-head { margin: 0 0 16px; text-align: left; }
.wcsc-wrap .wcsc-group-title {
	font-family: var(--wcsc-font, inherit);
	font-size: 26px;
	font-weight: 700;
	line-height: 1.25;
	color: var(--wcsc-head-color);
	text-decoration: none;
	transition: color .25s ease;
}
.wcsc-wrap .wcsc-group-title:hover { color: var(--wcsc-title-hover); }
