/**
 * AJAX Product Category Filter — frontend styles.
 * Designed to mirror the reference "The Kit Lab" shop layout.
 */

.apcf-wrap {
	--apcf-accent: #E3ADCA;
	--apcf-heading: #2F6956;
	--apcf-text: #8C8C8C;
	/* --apcf-gap: 40px; */
	--apcf-gap: 30px;
	--apcf-card-radius: 0px;

	display: grid;
	grid-template-columns: 330px 1fr;
	/* gap: 40px; */
	gap: 30px;
	align-items: start;
	color: #333;
	font-family: inherit;
	position: relative;
}

.apcf-wrap * {
	box-sizing: border-box;
}

/* ------------------------------------------------------------------ Sidebar */
.apcf-sidebar {
	position: relative;
	padding-top: 50px;
}

.apcf-sidebar-heading {
	background: transparent !important;
    color: var(--apcf-heading) !important;
    font-size: 20px !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    letter-spacing: -3% !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 8px;
    border: none !important;
    padding: 0 0 16px 0 !important;
    margin: 0;
    cursor: pointer !important;
    text-align: left;
    text-transform: capitalize !important;
}

.apcf-sidebar-heading .apcf-chevron {
	transition: transform 0.25s ease;
	flex: 0 0 auto;
	color: #9aa0a6;
}

.apcf-sidebar-heading[aria-expanded="false"] .apcf-chevron {
	transform: rotate(-90deg);
}

.apcf-cat-list {
	list-style: none;
	margin: 0;
	padding: 0;
	overflow: hidden;
	transition: max-height 0.3s ease;
}

.apcf-cat-item {
	margin: 0;
}

.apcf-cat-link {
	font-size: 16px;
	font-weight: 400;
	letter-spacing: -3%;
	display: inline-flex;
	align-items: baseline;
	gap: 6px;
	/* padding: 9px 0; */
	color: var(--apcf-text)!important;
	text-decoration: none!important;
	transition: color 0.18s ease;
}

.apcf-cat-link:hover {
	/* color: var(--apcf-accent); */
	color: #E3ADCA;
}

.apcf-cat-item.is-active .apcf-cat-link,
.apcf-cat-item.is-active .apcf-cat-count {
	/* color: var(--apcf-accent);
	font-weight: 600; */
	color: #E3ADCA!important;
}

.apcf-cat-count {
	/* color: #b7b7b7;
	font-size: 14px; */
}

/* ------------------------------------------------------------------ Toolbar */
.apcf-toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 22px;
	min-height: 34px;
}

.apcf-sort {
	display: flex;
	align-items: center;
	gap: 10px;
}

.apcf-sort-label {
	color: #8C8C8C;
	font-size: 16px;
	white-space: nowrap;
}

.apcf-orderby {
	border: 0;
	background: transparent;
	font-size: 16px;
	color: #000;
	cursor: pointer;
	padding: 4px 4px;
	/* max-width: 220px; */
	max-width: 100%;
}

.apcf-orderby:focus {
	outline: none;
}

.apcf-view-switch {
	display: flex;
	align-items: center;
	gap: 20px;
}

.apcf-view-btn {
    background-color: transparent !important;
    border-radius: 0px !important;
    color: #000000 !important;
    cursor: pointer !important;
	display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    padding: 0 !important;
    border: none !important;
    transition: color 0.15s ease, background 0.15s ease;
}

.apcf-view-btn:hover {
	color: #2F6956;
}

.apcf-view-btn.is-active {
	color: var(--apcf-accent);
}

/* ------------------------------------------------------------------ Results */
.apcf-results {
	position: relative;
	min-height: 120px;
}

.apcf-products {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: var(--apcf-gap);
}

.apcf-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.apcf-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.apcf-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.apcf-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.apcf-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.apcf-cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }

/* ------------------------------------------------------------------ Card */
.apcf-card {
	position: relative;
	border-radius: var(--apcf-card-radius);
	overflow: hidden;
	background: #f2f2f2;
}

.apcf-card-link {
	display: block;
	text-decoration: none;
	color: inherit;
}

.apcf-card-media {
	position: relative;
	aspect-ratio: 3 / 4;
	overflow: hidden;
	background: linear-gradient(180deg, #f7f7f7 0%, #eaeaea 100%);
}

.apcf-card-media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.4s ease;
}

.apcf-card:hover .apcf-card-media img {
	transform: scale(1.04);
}

/* Dark scrim so the overlaid title stays legible. */
.apcf-card-media::after {
	content: "";
	position: absolute;
	inset: auto 0 0 0;
	height: 100%;
	/* background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.62) 100%);
	background: linear-gradient(180deg, rgba(0, 0, 0, 0) 69.71%, #000000 100%); */
	background: linear-gradient(180deg, rgba(0, 0, 0, 0) 50%, #000000 100%);
	pointer-events: none;
}

.apcf-card-body {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	padding: 24px 20px;
	z-index: 2;
}

.apcf-card-title {
	color: #fff;
	font-family: Clear Sans!important;
	/* font-weight: 700!important; */
	font-weight: normal!important;
	/* font-size: 24px!important; */
	font-size: clamp(0.875rem, 0.833rem + 0.208vw, 1rem) !important;
	line-height: 1.1!important;
	margin: 0;
	/* text-shadow: 0 1px 6px rgba(0, 0, 0, 0.35); */
    text-transform: lowercase;
}
.apcf-card-title::first-letter {
  text-transform: uppercase;
}

.apcf-card-price {
    color: #fff;
    /* font-size: 18px; */
    font-size: clamp(0.75rem, 0.708rem + 0.208vw, 0.875rem);
    /* font-weight: 600; */
    font-weight: normal;
	margin-top: 15px;
}

.apcf-card-price del {
	opacity: 0.7;
	font-weight: 400;
	margin-right: 6px;
}

.apcf-card-actions {
	position: absolute;
	top: 14px;
	right: 14px;
	z-index: 3;
}

.apcf-card-actions .button {
	font-size: 13px;
}

/* ------------------------------------------------------------------ List view */
.apcf-view-list .apcf-products {
	grid-template-columns: 1fr !important;
	gap: 20px;
}

.apcf-view-list .apcf-card {
	background: #fff;
	border: 1px solid #ececec;
}

.apcf-view-list .apcf-card-link {
	display: grid;
	grid-template-columns: 200px 1fr;
	gap: 20px;
	align-items: center;
}

.apcf-view-list .apcf-card-media {
	aspect-ratio: 1 / 1;
	border-radius: var(--apcf-card-radius);
}

.apcf-view-list .apcf-card-media::after {
	display: none;
}

.apcf-view-list .apcf-card-body {
	position: static;
	padding: 12px 18px 12px 0;
}

.apcf-view-list .apcf-card-title {
	color: #222!important;
	/* text-shadow: none;
	font-size: 18px; */
}

.apcf-view-list .apcf-card-price {
	/* color: var(--apcf-accent); */
	color: #2F6956;
}

.apcf-view-list .apcf-card-actions {
	position: static;
	margin-top: 10px;
}

/* ------------------------------------------------------------------ Empty */
.apcf-empty {
	grid-column: 1 / -1;
	padding: 40px 0;
	color: #888;
	font-size: 16px;
}

/* ------------------------------------------------------------------ Pagination */
.apcf-pagination {
	margin-top: 34px;
	display: flex;
	justify-content: center;
}

.apcf-pagination--numbers ul {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	list-style: none;
	margin: 0;
	padding: 0;
}

.apcf-pagination--numbers ul li {
	margin-top: 0;
}

.apcf-pagination--numbers .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	height: 40px;
	padding: 0 10px;
	border: 1px solid #e2e2e2;
	border-radius: 0;
	color: #444;
	text-decoration: none;
	font-size: 15px;
	transition: all 0.15s ease;
}

.apcf-pagination--numbers a.page-numbers:hover {
	/* border-color: var(--apcf-accent);
	color: var(--apcf-accent); */
	border-color: #E3ADCA;
	color: #E3ADCA;
}

.apcf-pagination--numbers .page-numbers.current {
	/* background: var(--apcf-accent);
	border-color: var(--apcf-accent); */
	background: #E3ADCA;
	border-color: #E3ADCA;
	color: #fff;
}

.apcf-pagination--numbers .page-numbers.dots {
	border: 0;
}

.apcf-load-more {
	appearance: none;
	border: 0;
	background: var(--apcf-accent);
	color: #fff;
	font-size: 15px;
	font-weight: 600;
	padding: 13px 34px;
	border-radius: 40px;
	cursor: pointer;
	transition: opacity 0.15s ease, transform 0.15s ease;
}

.apcf-load-more:hover {
	opacity: 0.9;
}

.apcf-load-more:disabled {
	opacity: 0.55;
	cursor: default;
}

.apcf-pagination--infinite .apcf-load-more--fallback {
	display: none;
}

.apcf-sentinel {
	width: 100%;
	height: 1px;
}

/* ------------------------------------------------------------------ Loading */
.apcf-results.is-loading::before {
	content: "";
	position: absolute;
	inset: 0;
	background: rgba(255, 255, 255, 0.6);
	z-index: 5;
	border-radius: 8px;
}

.apcf-results.is-loading::after {
	content: "";
	position: absolute;
	top: 60px;
	left: 50%;
	width: 34px;
	height: 34px;
	margin-left: -17px;
	border: 3px solid #e5e5e5;
	border-top-color: var(--apcf-accent);
	border-radius: 50%;
	z-index: 6;
	animation: apcf-spin 0.7s linear infinite;
}

@keyframes apcf-spin {
	to { transform: rotate(360deg); }
}

/* Appended (load-more / infinite) fade-in. */
.apcf-card.apcf-just-added {
	animation: apcf-fade 0.4s ease both;
}

@keyframes apcf-fade {
	from { opacity: 0; transform: translateY(12px); }
	to { opacity: 1; transform: none; }
}

/* ------------------------------------------------------------------ Responsive */
@media (max-width: 1200px) {
	.apcf-wrap {
		grid-template-columns: 200px 1fr;
		/* gap: 32px; */
		gap: 25px;
	}
	.apcf-products {
		grid-template-columns: repeat(2, minmax(0, 1fr))!important;
	}
}

@media (max-width: 767px) {
	.apcf-wrap {
		grid-template-columns: 1fr;
		/* gap: 22px; */
		gap: 20px;
	}
	.apcf-sidebar-heading {
		padding-bottom: 12px;
		border-bottom: 1px solid #eee;
	}
	.apcf-products {
		grid-template-columns: repeat(2, minmax(0, 1fr))!important;
		gap: 15px;
	}
	.apcf-view-list .apcf-card-link {
		grid-template-columns: 110px 1fr;
	}
}

@media (max-width: 480px) {
	.apcf-sidebar {
		padding-top: 0;
	}
	.apcf-products {
		grid-template-columns: 1fr!important;
	}
}
