/* Filter By Sherry - Frontend Styles */

.fbs-wrapper {
	--fbs-active-bg: #2563eb;
	--fbs-active-text: #ffffff;
	--fbs-inactive-bg: #f1f1f1;
	--fbs-inactive-text: #333333;
	--fbs-border-color: #dddddd;
	--fbs-font-family: inherit;
	--fbs-font-size: 14px;
	--fbs-font-weight: 500;
	--fbs-columns: 4;
	--fbs-pill-padding-v: 8px;
	--fbs-pill-padding-h: 20px;
	--fbs-pill-margin: 10px;
	--fbs-pill-radius: 999px;
	--fbs-card-padding: 16px;
	--fbs-card-margin: 24px;
	--fbs-card-radius: 8px;
	margin: 20px 0;
	width: 100%;
	box-sizing: border-box;
}

.fbs-wrapper * {
	box-sizing: border-box;
}

.fbs-capsule-bar {
	display: flex;
	gap: var(--fbs-pill-margin);
	margin-bottom: 24px;
	padding-bottom: 4px;
}

.fbs-wrapper.fbs-horizontal .fbs-capsule-bar {
	flex-wrap: nowrap;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: thin;
}

.fbs-wrapper.fbs-wrap .fbs-capsule-bar {
	flex-wrap: wrap;
}

.fbs-pill {
	font-family: var(--fbs-font-family);
	font-size: var(--fbs-font-size);
	font-weight: var(--fbs-font-weight);
	background: var(--fbs-inactive-bg);
	color: var(--fbs-inactive-text);
	border: 1px solid var(--fbs-border-color);
	border-radius: var(--fbs-pill-radius);
	padding: var(--fbs-pill-padding-v) var(--fbs-pill-padding-h);
	cursor: pointer;
	white-space: nowrap;
	flex-shrink: 0;
	position: relative;
	overflow: hidden;
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.fbs-pill.fbs-active {
	background: var(--fbs-active-bg);
	color: var(--fbs-active-text);
	border-color: var(--fbs-active-bg);
}

/* Pill hover effects */
.fbs-pill-hover-scale .fbs-pill:hover {
	transform: scale(1.06);
}
.fbs-pill-hover-lift .fbs-pill:hover {
	transform: translateY(-3px);
	box-shadow: 0 6px 14px rgba(0, 0, 0, 0.12);
}
.fbs-pill-hover-darken .fbs-pill:hover {
	filter: brightness(0.92);
}
.fbs-pill-hover-underline .fbs-pill::after {
	content: "";
	position: absolute;
	left: 50%;
	bottom: 0;
	width: 0;
	height: 2px;
	background: currentColor;
	transition: width 0.25s ease, left 0.25s ease;
}
.fbs-pill-hover-underline .fbs-pill:hover::after {
	width: 80%;
	left: 10%;
}

/* Pill entrance animations (run once on page load) */
.fbs-pill-anim-fade .fbs-pill {
	animation: fbsFadeIn 0.4s ease both;
}
.fbs-pill-anim-slide-up .fbs-pill {
	animation: fbsSlideUp 0.4s ease both;
}
.fbs-pill-anim-zoom .fbs-pill {
	animation: fbsZoomIn 0.35s ease both;
}
.fbs-capsule-bar .fbs-pill:nth-child(1) { animation-delay: 0.02s; }
.fbs-capsule-bar .fbs-pill:nth-child(2) { animation-delay: 0.06s; }
.fbs-capsule-bar .fbs-pill:nth-child(3) { animation-delay: 0.10s; }
.fbs-capsule-bar .fbs-pill:nth-child(4) { animation-delay: 0.14s; }
.fbs-capsule-bar .fbs-pill:nth-child(5) { animation-delay: 0.18s; }
.fbs-capsule-bar .fbs-pill:nth-child(6) { animation-delay: 0.22s; }
.fbs-capsule-bar .fbs-pill:nth-child(n+7) { animation-delay: 0.26s; }

.fbs-products-area {
	position: relative;
	min-height: 60px;
}

.fbs-loader {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(255, 255, 255, 0.7);
	font-family: var(--fbs-font-family);
	font-size: var(--fbs-font-size);
	z-index: 5;
}

.fbs-products.fbs-fading {
	opacity: 0.4;
	pointer-events: none;
	transition: opacity 0.15s ease;
}

/* WooCommerce grid columns override for the plugin's own grid classes */
ul.products.fbs-products-grid {
	display: grid !important;
	grid-template-columns: repeat(var(--fbs-columns), 1fr);
	gap: var(--fbs-card-margin);
	margin: 0 !important;
}

ul.products.fbs-products-grid.fbs-layout-list {
	grid-template-columns: 1fr;
}

ul.products.fbs-products-grid li.product {
	width: 100% !important;
	margin: 0 !important;
	float: none !important;
	padding: var(--fbs-card-padding) !important;
	border-radius: var(--fbs-card-radius) !important;
	border: 1px solid transparent;
	transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

/* Generic (non-WooCommerce) post grid */
.fbs-generic-grid {
	display: grid;
	grid-template-columns: repeat(var(--fbs-columns), 1fr);
	gap: var(--fbs-card-margin);
}

.fbs-generic-grid.fbs-layout-list {
	grid-template-columns: 1fr;
}

.fbs-generic-card {
	border: 1px solid var(--fbs-border-color);
	border-radius: var(--fbs-card-radius);
	overflow: hidden;
	padding: var(--fbs-card-padding);
	transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.fbs-generic-thumb {
	overflow: hidden;
	border-radius: calc(var(--fbs-card-radius) - 2px);
}

.fbs-generic-thumb img {
	width: 100%;
	height: auto;
	display: block;
	transition: transform 0.35s ease;
}

.fbs-generic-title {
	font-family: var(--fbs-font-family);
	font-size: calc(var(--fbs-font-size) + 2px);
	margin: 10px 0 6px;
}

.fbs-generic-excerpt {
	font-size: var(--fbs-font-size);
	color: #666;
}

.fbs-no-products {
	font-family: var(--fbs-font-family);
	font-size: var(--fbs-font-size);
	padding: 30px 0;
	text-align: center;
	color: #888;
}

/* Card hover effects - apply to both WooCommerce product items and generic cards */
.fbs-card-hover-lift .fbs-products-grid li.product:hover,
.fbs-card-hover-lift .fbs-generic-card:hover {
	transform: translateY(-6px);
	box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
}
.fbs-card-hover-zoom .fbs-products-grid li.product:hover img,
.fbs-card-hover-zoom .fbs-generic-card:hover img {
	transform: scale(1.08);
}
.fbs-card-hover-zoom .fbs-products-grid li.product,
.fbs-card-hover-zoom .fbs-generic-card {
	overflow: hidden;
}
.fbs-card-hover-glow .fbs-products-grid li.product:hover,
.fbs-card-hover-glow .fbs-generic-card:hover {
	border-color: var(--fbs-active-bg);
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* Card entrance animations - replay automatically because AJAX
   responses always insert brand-new DOM nodes. */
.fbs-card-anim-fade .fbs-products-grid li.product,
.fbs-card-anim-fade .fbs-generic-card {
	animation: fbsFadeIn 0.45s ease both;
}
.fbs-card-anim-slide-up .fbs-products-grid li.product,
.fbs-card-anim-slide-up .fbs-generic-card {
	animation: fbsSlideUp 0.45s ease both;
}
.fbs-card-anim-zoom .fbs-products-grid li.product,
.fbs-card-anim-zoom .fbs-generic-card {
	animation: fbsZoomIn 0.4s ease both;
}
.fbs-products-grid li.product:nth-child(1), .fbs-generic-grid .fbs-generic-card:nth-child(1) { animation-delay: 0.02s; }
.fbs-products-grid li.product:nth-child(2), .fbs-generic-grid .fbs-generic-card:nth-child(2) { animation-delay: 0.06s; }
.fbs-products-grid li.product:nth-child(3), .fbs-generic-grid .fbs-generic-card:nth-child(3) { animation-delay: 0.10s; }
.fbs-products-grid li.product:nth-child(4), .fbs-generic-grid .fbs-generic-card:nth-child(4) { animation-delay: 0.14s; }
.fbs-products-grid li.product:nth-child(5), .fbs-generic-grid .fbs-generic-card:nth-child(5) { animation-delay: 0.18s; }
.fbs-products-grid li.product:nth-child(6), .fbs-generic-grid .fbs-generic-card:nth-child(6) { animation-delay: 0.22s; }
.fbs-products-grid li.product:nth-child(n+7), .fbs-generic-grid .fbs-generic-card:nth-child(n+7) { animation-delay: 0.26s; }

@keyframes fbsFadeIn {
	from { opacity: 0; }
	to { opacity: 1; }
}
@keyframes fbsSlideUp {
	from { opacity: 0; transform: translateY(16px); }
	to { opacity: 1; transform: translateY(0); }
}
@keyframes fbsZoomIn {
	from { opacity: 0; transform: scale(0.9); }
	to { opacity: 1; transform: scale(1); }
}

@media (max-width: 782px) {
	ul.products.fbs-products-grid,
	.fbs-generic-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 480px) {
	ul.products.fbs-products-grid,
	.fbs-generic-grid {
		grid-template-columns: 1fr;
	}
}

@media (prefers-reduced-motion: reduce) {
	.fbs-wrapper * {
		animation: none !important;
		transition: none !important;
	}
}
