/* Product Filter Pro - Frontend Styles */

.pfp-filters-wrapper {
	margin-bottom: 30px;
}

.pfp-title {
	font-size: 18px;
	font-weight: 600;
	margin-bottom: 20px;
	color: #333;
}

.pfp-filters {
	background: #f9f9f9;
	padding: 20px;
	border-radius: 5px;
	border: 1px solid #eee;
}

.pfp-filter-group {
	margin-bottom: 0;
	padding-bottom: 0;
	border-bottom: 1px solid #ddd;
	border-radius: 0;
}

.pfp-filter-group:last-child {
	border-bottom: none;
}

.pfp-filter-title {
	font-size: 14px;
	font-weight: 600;
	text-transform: none;
	color: #333;
	margin: 0;
	padding: 15px 0;
	letter-spacing: 0;
	cursor: pointer;
	user-select: none;
	display: flex;
	justify-content: space-between;
	align-items: center;
	background: transparent;
	border: none;
	width: 100%;
	text-align: left;
	transition: color 0.2s ease;
}

.pfp-filter-title:hover {
	color: #0066cc;
}

.pfp-toggle-icon {
	display: inline-block;
	font-size: 20px;
	font-weight: 300;
	margin-left: auto;
	transition: transform 0.3s ease;
}

.pfp-filter-group.collapsed .pfp-toggle-icon {
	transform: rotate(180deg);
}

.pfp-filter-options {
	display: block;
	max-height: 1000px;
	overflow: hidden;
	transition: max-height 0.3s ease, opacity 0.3s ease;
	opacity: 1;
	padding-bottom: 15px;
}

.pfp-filter-group.collapsed .pfp-filter-options {
	max-height: 0;
	opacity: 0;
	padding-bottom: 0;
	overflow: hidden;
}

.pfp-filter-options {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.pfp-filter-label {
	display: flex;
	align-items: center;
	gap: 8px;
	cursor: pointer;
	user-select: none;
	font-size: 14px;
	color: #666;
	transition: color 0.2s ease;
}

.pfp-filter-label:hover {
	color: #333;
}

.pfp-filter-input {
	cursor: pointer;
	width: 16px;
	height: 16px;
}

.pfp-filter-text {
	flex: 1;
}

.pfp-filter-count {
	color: #999;
	font-size: 12px;
}

/* Price Filter */
.pfp-price-inputs {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
	margin-bottom: 15px;
}

.pfp-price-input {
	padding: 10px 12px;
	border: 1px solid #ddd;
	border-radius: 4px;
	font-size: 14px;
	font-weight: 600;
	text-align: center;
	color: #333;
	background: #fff;
	transition: border-color 0.2s ease;
}

.pfp-price-input:focus {
	outline: none;
	border-color: #0066cc;
	box-shadow: 0 0 0 2px rgba(0, 102, 204, 0.1);
}

.pfp-price-slider-wrapper {
	position: relative;
	margin-bottom: 15px;
	height: 6px;
	display: flex;
	align-items: center;
}

.pfp-price-slider-track {
	position: absolute;
	left: 0;
	right: 0;
	height: 2px;
	background: #ddd;
	border-radius: 5px;
	z-index: 1;
}

.pfp-price-min-slider,
.pfp-price-max-slider {
	position: absolute;
	width: 100%;
	height: 6px;
	top: 0;
	background: none;
	border: none;
	padding: 0;
	margin: 0;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
	z-index: 2;
	pointer-events: none;
}

.pfp-price-min-slider {
	z-index: 5;
}

.pfp-price-max-slider {
	z-index: 4;
}

/* Slider thumb styling */
.pfp-price-min-slider::-webkit-slider-thumb,
.pfp-price-max-slider::-webkit-slider-thumb {
	-webkit-appearance: none;
	appearance: none;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: #0066cc;
	border: 3px solid white;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
	cursor: pointer;
	pointer-events: auto;
	transition: background 0.2s ease;
}

.pfp-price-min-slider::-webkit-slider-thumb:hover,
.pfp-price-max-slider::-webkit-slider-thumb:hover {
	background: #0052a3;
}

.pfp-price-min-slider::-moz-range-thumb,
.pfp-price-max-slider::-moz-range-thumb {
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: #0066cc;
	border: 3px solid white;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
	cursor: pointer;
	pointer-events: auto;
	transition: background 0.2s ease;
}

.pfp-price-min-slider::-moz-range-thumb:hover,
.pfp-price-max-slider::-moz-range-thumb:hover {
	background: #0052a3;
}

.pfp-price-display {
	text-align: center;
	font-weight: 600;
	color: #333;
	font-size: 13px;
	padding: 10px 0;
	border-top: 1px solid #f0f0f0;
}

.pfp-price-min-display,
.pfp-price-max-display {
	font-weight: 700;
	color: #0066cc;
}

/* Reset Button */
.pfp-reset-btn {
	display: block;
	width: 100%;
	padding: 10px 20px;
	margin-top: 20px;
	background-color: #f0f0f0;
	color: #333;
	border: 1px solid #ddd;
	border-radius: 4px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.3s ease;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.pfp-reset-btn:hover {
	background-color: #e0e0e0;
	border-color: #ccc;
}

.pfp-reset-btn:active {
	transform: scale(0.98);
}

/* Container Layout */
.pfp-container {
	display: grid;
	grid-template-columns: 1fr;
	gap: 30px;
}

@media (min-width: 1024px) {
	.pfp-container {
		grid-template-columns: 250px 1fr;
		gap: 30px;
	}
}

/* Products Section Header */
.pfp-products-section {
	width: 100%;
}

.pfp-products-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 25px;
	padding-bottom: 15px;
	border-bottom: 1px solid #eee;
	flex-wrap: wrap;
	gap: 15px;
}

.pfp-product-count {
	font-size: 14px;
	color: #666;
	font-weight: 500;
}

.pfp-product-count .pfp-total-products {
	font-weight: 700;
	color: #333;
}

/* Sorting Dropdown */
.pfp-sorting {
	flex-shrink: 0;
}

.pfp-sort-select {
	padding: 10px 15px;
	border: 1px solid #ddd;
	border-radius: 4px;
	font-size: 14px;
	color: #333;
	background-color: white;
	cursor: pointer;
	transition: border-color 0.2s ease;
	min-width: 180px;
}

.pfp-sort-select:hover {
	border-color: #999;
}

.pfp-sort-select:focus {
	outline: none;
	border-color: #0066cc;
	box-shadow: 0 0 0 2px rgba(0, 102, 204, 0.1);
}

/* Products Grid */
.pfp-products-wrapper {
	position: relative;
	min-height: 200px;
}

.pfp-products-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 20px;
	animation: fadeIn 0.3s ease;
}

@media (max-width: 768px) {
	.pfp-products-grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 15px;
	}
}

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

/* Loading Spinner */
.pfp-loader {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(255, 255, 255, 0.9);
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	border-radius: 4px;
	z-index: 100;
}

.pfp-spinner {
	width: 40px;
	height: 40px;
	border: 4px solid #f3f3f3;
	border-top: 4px solid #0066cc;
	border-radius: 50%;
	animation: spin 1s linear infinite;
	margin-bottom: 15px;
}

@keyframes spin {
	0% {
		transform: rotate(0deg);
	}
	100% {
		transform: rotate(360deg);
	}
}

.pfp-loader p {
	margin: 0;
	color: #666;
	font-size: 13px;
}

/* Pagination */
.pfp-pagination {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 8px;
	margin-top: 30px;
	margin-bottom: 20px;
	flex-wrap: wrap;
	min-height: 40px; /* Prevent layout shift */
}

.pfp-pagination:empty {
	display: none; /* Hide if no pagination */
}

.pfp-page-link,
.pfp-page-number {
	padding: 8px 12px;
	border: 1px solid #ddd;
	border-radius: 4px;
	font-size: 13px;
	text-decoration: none;
	color: #0066cc;
	background: white;
	cursor: pointer;
	transition: all 0.2s ease;
	display: inline-block;
}

.pfp-page-link:hover {
	background-color: #f5f5f5;
	border-color: #0066cc;
}

.pfp-page-number {
	color: #333;
	background: white;
	border-color: #ddd;
	cursor: default;
}

.pfp-page-number.pfp-current {
	background-color: #0066cc;
	color: white;
	border-color: #0066cc;
	font-weight: 600;
}

.pfp-prev,
.pfp-next {
	font-weight: 500;
}

/* Load More Button */
.pfp-load-more-btn {
	padding: 12px 30px;
	background-color: #0066cc;
	color: white;
	border: none;
	border-radius: 4px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.2s ease;
}

.pfp-load-more-btn:hover {
	background-color: #0052a3;
	transform: translateY(-2px);
}

.pfp-load-more-btn:active {
	transform: translateY(0);
}

/* No Products Message */
.pfp-no-products {
	text-align: center;
	color: #999;
	font-size: 14px;
	padding: 40px 20px;
}

/* Loading State */
.pfp-filters-wrapper.loading {
	opacity: 0.6;
	pointer-events: none;
}

.pfp-products-wrapper.loading::after {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(255, 255, 255, 0.7);
	display: flex;
	align-items: center;
	justify-content: center;
}

/* Mobile Styles */
@media (max-width: 768px) {
	.pfp-filters {
		padding: 15px;
	}

	.pfp-filter-group {
		margin-bottom: 20px;
		padding-bottom: 15px;
	}

	.pfp-filter-title {
		font-size: 13px;
	}

	.pfp-filter-label {
		font-size: 13px;
		gap: 6px;
	}

	.pfp-products-grid {
		grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
		gap: 15px;
	}
}

/* Mobile Modal */
@media (max-width: 768px) {
	.pfp-mobile-modal {
		position: fixed;
		bottom: 0;
		left: 0;
		right: 0;
		background: white;
		border-radius: 15px 15px 0 0;
		padding: 20px;
		max-height: 80vh;
		overflow-y: auto;
		z-index: 9999;
		animation: slideUp 0.3s ease-out;
	}

	.pfp-mobile-modal-overlay {
		position: fixed;
		top: 0;
		left: 0;
		right: 0;
		bottom: 0;
		background: rgba(0, 0, 0, 0.5);
		z-index: 9998;
	}

	@keyframes slideUp {
		from {
			transform: translateY(100%);
		}
		to {
			transform: translateY(0);
		}
	}
}

/* Accessibility */
.pfp-filter-input:focus {
	outline: 2px solid #0066cc;
	outline-offset: 2px;
}

.pfp-filter-label:focus-within {
	color: #0066cc;
}

/* Animation */
@keyframes fadeIn {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}

.pfp-products-wrapper {
	animation: fadeIn 0.3s ease-in;
}

/* Color Swatches */
.pfp-swatch {
	display: inline-block;
	width: 30px;
	height: 30px;
	border-radius: 4px;
	border: 2px solid #ddd;
	cursor: pointer;
	transition: all 0.2s ease;
}

.pfp-swatch:hover {
	border-color: #0066cc;
	transform: scale(1.1);
}

.pfp-swatch.selected {
	border-color: #0066cc;
	box-shadow: 0 0 0 2px rgba(0, 102, 204, 0.2);
}

/* Image Swatches */
.pfp-image-swatch {
	display: inline-block;
	width: 50px;
	height: 50px;
	border-radius: 4px;
	border: 2px solid #ddd;
	overflow: hidden;
	cursor: pointer;
	transition: all 0.2s ease;
	background-size: cover;
	background-position: center;
}

.pfp-image-swatch:hover {
	border-color: #0066cc;
	transform: scale(1.05);
}

.pfp-image-swatch.selected {
	border-color: #0066cc;
	box-shadow: 0 0 0 2px rgba(0, 102, 204, 0.2);
}
