/**
 * CrossIC Product Categories page (/functions/), scoped to body.cic-cats-page.
 * Restyles the crossic-customization plugin's [my_function_list] markup
 * (enhanced by inc/crossic-product-categories.php) to the new card grid design.
 * Uses the shared --cic-* design tokens from crossic-home.css.
 * Selectors are deliberately specific (and !important where the plugin's
 * CustomCss.css uses !important) so the plugin's old card rules don't leak through.
 */

/* ---------- Page frame ---------- */
.cic-cats-page .site-main { padding: 0 !important; }
.cic-cats-page .entry-header { display: none; } /* replaced by the hero <h1> */
.cic-cats-page .entry-content { margin: 0; }
.cic-cats-page .cic-cats-hero,
.cic-cats-page .cic-cats { font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; color: var(--cic-text); -webkit-font-smoothing: antialiased; margin: 0; } /* Electro gives every <section> a bottom margin */
.cic-cats-page .cic-cats-hero *,
.cic-cats-page .cic-cats * { box-sizing: border-box; }
.cic-cats-page .cic-container { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 24px; }

/* ---------- Hero ---------- */
.cic-cats-hero {
	background: radial-gradient(900px 320px at 85% 0%, rgba(127, 181, 57, .08), transparent 60%), linear-gradient(180deg, #f3f8ef 0%, #f7faf4 100%);
	border-bottom: 1px solid #edf2e8;
	padding: 44px 0 50px;
}
.cic-cats-hero__inner { display: flex; align-items: center; justify-content: space-between; gap: 40px; }
.cic-cats-hero__copy { flex: 1 1 auto; min-width: 0; padding-right: 44px; border-right: 1px solid #dfe6dc; }
.cic-cats-hero__eyebrow { display: block; font-family: "Poppins", "Inter", sans-serif; font-size: 13px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: var(--cic-green-d); margin-bottom: 10px; }
.cic-cats-hero__eyebrow strong { font-weight: 700; }
.cic-cats-page h1.cic-cats-hero__title { font-family: "Poppins", "Inter", sans-serif; font-size: clamp(30px, 3.6vw, 44px); font-weight: 700; line-height: 1.12; letter-spacing: -0.02em; color: var(--cic-heading); margin: 0 0 16px; }
.cic-cats-hero__title span { color: var(--cic-green-d); }
.cic-cats-hero__intro { font-size: 15px; line-height: 1.65; color: var(--cic-text); margin: 0; max-width: 520px; }

.cic-cats-page .cic-cats-hero__badges { display: flex; flex: 0 0 auto; gap: 32px; list-style: none; margin: 0; padding: 0; }
.cic-cats-badge { display: flex; align-items: center; gap: 13px; }
.cic-cats-badge__ico { display: inline-flex; align-items: center; justify-content: center; width: 52px; height: 52px; border-radius: 50%; background: rgba(127, 181, 57, .14); color: var(--cic-heading); flex: none; }
.cic-cats-badge__ico svg { width: 26px; height: 26px; margin: 0; }
.cic-cats-badge__txt { display: flex; flex-direction: column; gap: 2px; font-size: 12.5px; line-height: 1.35; color: var(--cic-muted); white-space: nowrap; }
.cic-cats-badge__txt strong { font-size: 14px; font-weight: 600; color: var(--cic-heading); }

/* ---------- Card grid ---------- */
.cic-cats { padding: 30px 0 64px; }
.cic-cats-page .cic-cats ul.cic-cats__grid {
	display: grid !important;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 16px;
	list-style: none;
	margin: 0;
	padding: 0;
	font-size: 14px;
}
.cic-cats-page .cic-cats ul.cic-cats__grid > li.cic-cat {
	position: relative;
	display: flex;
	align-items: center;
	gap: 14px;
	width: auto !important;
	min-height: 66px;
	margin: 0 !important;
	padding: 12px 14px !important;
	background: #fff;
	border: 1px solid var(--cic-border);
	border-radius: 10px;
	box-shadow: var(--cic-shadow-sm);
	font-family: "Inter", system-ui, sans-serif;
	font-size: 14px !important;
	text-align: left !important;
	color: var(--cic-heading);
	list-style: none;
	transition: border-color .18s ease, box-shadow .18s ease;
}
/* No transform on hover: it would trap open dropdowns under later cards. */
.cic-cats-page .cic-cats ul.cic-cats__grid > li.cic-cat:hover,
.cic-cats-page .cic-cats ul.cic-cats__grid > li.cic-cat:focus-within { border-color: var(--cic-green); box-shadow: var(--cic-shadow); }
.cic-cats-page .cic-cats ul.cic-cats__grid > li.cic-cat.is-open { z-index: 30; border-color: var(--cic-green); }

.cic-cat__ico { display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; border-radius: 10px; background: rgba(127, 181, 57, .13); color: var(--cic-heading); flex: none; }
.cic-cats-page .cic-cat__ico svg { width: 24px; height: 24px; margin: 0; }

.cic-cats-page .cic-cats li.cic-cat > a.cic-cat__link {
	flex: 1 1 auto;
	min-width: 0;
	font-size: 13.5px !important;
	font-weight: 500;
	line-height: 1.4;
	color: var(--cic-heading);
	text-decoration: none;
	margin: 0;
}
.cic-cats-page .cic-cats li.cic-cat > a.cic-cat__link:hover { color: var(--cic-green-dd); }
/* Whole card is clickable via the category link. */
.cic-cats-page .cic-cats li.cic-cat > a.cic-cat__link::after { content: ""; position: absolute; inset: 0; border-radius: 10px; }
.cic-cats-page .cic-cats li.cic-cat > a.cic-cat__link:focus-visible { outline: none; }
.cic-cats-page .cic-cats li.cic-cat > a.cic-cat__link:focus-visible::after { box-shadow: var(--cic-ring); }
.cic-cat__count { color: var(--cic-muted); font-weight: 400; white-space: nowrap; }

.cic-cat__chev { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; background: #f2f5f8; color: var(--cic-text); flex: none; transition: background .18s ease, color .18s ease, transform .2s ease; }
.cic-cats-page .cic-cat__chev svg { width: 15px; height: 15px; margin: 0; }
.cic-cats-page .cic-cats li.cic-cat:hover .cic-cat__chev { background: var(--cic-green); color: #fff; }

/* ---------- Parent categories: subcategory dropdown ----------
   The plugin's toggle <img> (custom.js toggles the list) sits invisibly on
   top of the chevron, above the stretched card link, so a click on the
   chevron opens the subcategories while the rest of the card opens the
   category page, as before. */
.cic-cats-page .cic-cats li.cic-cat--parent .cic-cat__chev svg { transform: rotate(90deg); transition: transform .2s ease; }
.cic-cats-page .cic-cats li.cic-cat--parent.is-open .cic-cat__chev svg { transform: rotate(-90deg); }
.cic-cats-page .cic-cats li.cic-cat--parent > img.cic-cat__toggle {
	position: absolute !important;
	right: 10px;
	top: 50%;
	width: 34px !important;
	height: 34px !important;
	margin: -17px 0 0 0 !important;
	opacity: 0;
	cursor: pointer;
	z-index: 2;
	border-radius: 50%;
}
.cic-cats-page .cic-cats li.cic-cat--parent > img.cic-cat__toggle:focus-visible { outline: none; }
.cic-cats-page .cic-cats li.cic-cat--parent:has(> img.cic-cat__toggle:focus-visible) .cic-cat__chev { box-shadow: var(--cic-ring); background: var(--cic-green); color: #fff; }
.cic-cats-page .cic-cats li.cic-cat--parent > .cic-cat__chev { margin-right: 4px; }

.cic-cats-page .cic-cats ul.cic-cat__sub {
	position: absolute;
	top: calc(100% + 6px);
	left: 0;
	right: 0;
	width: auto !important;
	z-index: 40;
	margin: 0;
	padding: 6px !important;
	list-style: none;
	background: #fff;
	border: 1px solid var(--cic-border);
	border-radius: 10px;
	box-shadow: var(--cic-shadow-lg);
	max-height: 300px;
	overflow-y: auto;
}
.cic-cats-page .cic-cats ul.cic-cat__sub > li { margin: 0 !important; padding: 0; list-style: none; }
.cic-cats-page .cic-cats ul.cic-cat__sub > li > a.sublink {
	display: block;
	margin: 0 !important;
	padding: 9px 12px;
	border-radius: 7px;
	font-size: 13px !important;
	line-height: 1.35;
	text-align: left !important;
	color: var(--cic-heading) !important;
	text-decoration: none;
}
.cic-cats-page .cic-cats ul.cic-cat__sub > li > a.sublink:hover,
.cic-cats-page .cic-cats ul.cic-cat__sub > li.selFromFilter > a.sublink { background: var(--cic-soft); color: var(--cic-green-dd) !important; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
	.cic-cats-hero__inner { flex-direction: column; align-items: flex-start; gap: 26px; }
	.cic-cats-hero__copy { padding-right: 0; border-right: 0; }
	.cic-cats-page .cic-cats-hero__badges { width: 100%; padding-top: 22px; border-top: 1px solid #dfe6dc; flex-wrap: wrap; gap: 18px 32px; }
}
@media (max-width: 1024px) {
	.cic-cats-page .cic-cats ul.cic-cats__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
	.cic-cats-hero { padding: 34px 0 36px; }
	.cic-cats-page .cic-cats ul.cic-cats__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
	.cic-cats { padding: 22px 0 48px; }
}
@media (max-width: 560px) {
	.cic-cats-page .cic-container { padding: 0 16px; }
	.cic-cats-page .cic-cats ul.cic-cats__grid { grid-template-columns: minmax(0, 1fr); }
	.cic-cats-page .cic-cats-hero__badges { flex-direction: column; gap: 14px; }
	.cic-cats-hero__intro br { display: none; }
}
