.ctfc-filter-instance {
	margin: 0 0 48px 0;
}

.ctfc-filter-bar {
	background: var( --ctfc-bg, #0e1320 );
	color: var( --ctfc-text, #ffffff );
	border: 1px solid var( --ctfc-border, #27314a );
	border-radius: 8px;
	padding: 16px 20px;
	margin: 0 0 24px 0;
}

.ctfc-filter-form {
	display: flex;
	flex-direction: column;
	gap: 20px;
}

.ctfc-filter-row {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: center;
	gap: 16px;
}

.ctfc-filter-field {
	display: flex;
	flex-direction: column;
	gap: 6px;
	min-width: 200px;
}

.ctfc-filter-field label {
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.02em;
	color: var( --ctfc-text, #ffffff );
}

.ctfc-filter-field-checkbox {
	flex-direction: row;
	align-items: center;
	min-width: 0;
}

.ctfc-filter-field-checkbox label {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
}

.ctfc-filter-field-checkbox input[type="checkbox"] {
	width: 16px;
	height: 16px;
	accent-color: var( --ctfc-accent, #00c2cb );
}

.ctfc-select {
	background: #ffffff;
	color: #111111;
	border: 1px solid var( --ctfc-border, #27314a );
	border-radius: 6px;
	padding: 8px 10px;
	font-size: 14px;
	min-width: 200px;
}

.ctfc-select:focus {
	outline: 2px solid var( --ctfc-accent, #00c2cb );
	outline-offset: 1px;
}

.ctfc-reset-button {
	background: transparent;
	color: var( --ctfc-accent, #00c2cb );
	border: 1px solid var( --ctfc-accent, #00c2cb );
	border-radius: 6px;
	padding: 8px 16px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.ctfc-reset-button:hover {
	background: var( --ctfc-accent, #00c2cb );
	color: var( --ctfc-accent-text, #0e1320 );
}

.ctfc-loading {
	display: none;
	width: 18px;
	height: 18px;
	border: 2px solid var( --ctfc-border, #27314a );
	border-top-color: var( --ctfc-accent, #00c2cb );
	border-radius: 50%;
	animation: ctfc-spin 0.6s linear infinite;
}

.ctfc-filter-bar.ctfc-loading-active .ctfc-loading {
	display: inline-block;
}

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

.ctfc-results-count {
	text-align: center;
	font-size: 13px;
	color: var( --ctfc-text, #ffffff );
	opacity: 0.85;
}

.ctfc-no-products {
	padding: 24px 0;
}

/* Self-contained product grid so layout/thumbnails never depend on the
   active theme or page builder. */
ul.ctfc-product-grid {
	display: grid !important;
	grid-template-columns: repeat( var( --ctfc-grid-columns-desktop, 4 ), 1fr );
	gap: var( --ctfc-grid-gap, 28px );
	list-style: none;
	margin: 0;
	padding: 0;
}

ul.ctfc-product-grid::before,
ul.ctfc-product-grid::after {
	content: none !important;
	display: none !important;
}

ul.ctfc-product-grid li.product {
	width: auto !important;
	margin: 0 !important;
	float: none !important;
	text-align: var( --ctfc-grid-align, center ) !important;
	background: var( --ctfc-grid-bg, #ffffff ) !important;
	border: var( --ctfc-grid-border-width, 1px ) solid var( --ctfc-grid-border-color, #e5e5e5 ) !important;
	border-radius: var( --ctfc-grid-radius, 8px ) !important;
	padding: 0 !important;
	overflow: hidden;
}

/* Image stays edge-to-edge; every other direct child gets the configured
   padding, and the last one also gets bottom padding, so the text/button
   area has breathing room without insetting the thumbnail. */
ul.ctfc-product-grid li.product > a:first-child {
	display: block;
	margin: 0 !important;
	padding: 0 !important;
}

ul.ctfc-product-grid li.product .woocommerce-loop-product__title,
ul.ctfc-product-grid li.product .price,
ul.ctfc-product-grid li.product .star-rating {
	padding-left: var( --ctfc-grid-padding-h, 20px ) !important;
	padding-right: var( --ctfc-grid-padding-h, 20px ) !important;
	display: block;
}

ul.ctfc-product-grid li.product .woocommerce-loop-product__title {
	padding-top: var( --ctfc-grid-padding-v, 20px ) !important;
}

ul.ctfc-product-grid li.product > .button {
	margin-bottom: var( --ctfc-grid-padding-v, 20px ) !important;
}

ul.ctfc-product-grid li.product > *:last-child:not( .button ) {
	margin-bottom: var( --ctfc-grid-padding-v, 20px ) !important;
}

ul.ctfc-product-grid li.product img {
	display: block;
	width: 100% !important;
	height: auto !important;
	max-width: 100%;
	object-fit: cover;
	border-radius: var( --ctfc-grid-image-radius, 0 );
}

ul.ctfc-product-grid li.product .woocommerce-loop-product__title {
	color: var( --ctfc-grid-title-color, #7a1430 ) !important;
	font-size: var( --ctfc-grid-title-font-size, 16px ) !important;
	font-weight: var( --ctfc-grid-title-font-weight, bold ) !important;
}

ul.ctfc-product-grid li.product .price,
ul.ctfc-product-grid li.product .price bdi,
ul.ctfc-product-grid li.product .price .woocommerce-Price-amount,
ul.ctfc-product-grid li.product .price .woocommerce-Price-currencySymbol {
	color: var( --ctfc-grid-price-color, #7a1430 ) !important;
	font-size: var( --ctfc-grid-price-font-size, 16px ) !important;
	font-weight: var( --ctfc-grid-price-font-weight, normal ) !important;
}

ul.ctfc-product-grid li.product .button {
	display: inline-block;
	background: var( --ctfc-grid-button-bg, #7a1430 ) !important;
	color: var( --ctfc-grid-button-text, #ffffff ) !important;
	border-color: var( --ctfc-grid-button-bg, #7a1430 ) !important;
}

@media ( max-width: 768px ) {
	.ctfc-filter-row {
		flex-direction: column;
		align-items: stretch;
	}

	.ctfc-filter-field,
	.ctfc-select {
		min-width: 0;
		width: 100%;
	}

	.ctfc-filter-field-checkbox {
		justify-content: center;
	}

	.ctfc-reset-button {
		width: 100%;
	}

	.ctfc-filter-instance {
		padding-left: var( --ctfc-grid-side-padding-mobile, 12px );
		padding-right: var( --ctfc-grid-side-padding-mobile, 12px );
		box-sizing: border-box;
	}

	ul.ctfc-product-grid {
		grid-template-columns: repeat( var( --ctfc-grid-columns-mobile, 2 ), 1fr ) !important;
		gap: var( --ctfc-grid-gap-mobile, 14px ) !important;
	}
}
