/* ============================================
   WEBUP PRODUCT FILTERS - COMPLETE CSS
   ============================================ */

/* Base Filters Styling */
.webup-product-filters {
	background: #fff;
	padding: 20px;
	border-radius: 8px;
}

.webup-filter-section {
	margin-bottom: 24px;
	padding-bottom: 24px;
	border-bottom: 1px solid #e0e0e0;
}

.webup-filter-section:last-child {
	border-bottom: none;
	margin-bottom: 0;
	padding-bottom: 0;
}

/* Filter Headings */
.webup-filter-heading {
	font-size: 16px;
	font-weight: 600;
	margin: 0 0 16px 0;
	color: #333;
	display: flex;
	align-items: center;
	justify-content: space-between;
	user-select: none;
}

.webup-filter-section.collapsible .webup-filter-heading {
	cursor: pointer;
}

.webup-toggle-icon {
	font-size: 20px;
	line-height: 1;
	transition: transform 0.3s ease;
	margin-left: auto;
}

.webup-filter-section.collapsed .webup-toggle-icon {
	transform: rotate(-90deg);
}

.webup-filter-section.collapsed .webup-filter-content {
	display: none;
}

/* Attribute badges */
.webup-badge-global,
.webup-badge-custom {
	display: inline-block;
	padding: 2px 8px;
	font-size: 10px;
	font-weight: 600;
	border-radius: 3px;
	margin-left: 8px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.webup-badge-global {
	background: #9C27B0;
	color: white;
}

.webup-badge-custom {
	background: #2196F3;
	color: white;
}

/* Filter Content */
.webup-filter-content {
	animation: slideDown 0.3s ease;
}

@keyframes slideDown {
	from {
		opacity: 0;
		transform: translateY(-10px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* Filter List */
.webup-filter-list {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

/* Checkboxes */
.webup-checkbox-label {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px 0;
	cursor: pointer;
	transition: color 0.2s ease;
}

.webup-checkbox-label:hover {
	color: #4CAF50;
}

.webup-filter-checkbox {
	width: 18px;
	height: 18px;
	cursor: pointer;
	position: relative;
	appearance: none;
	-webkit-appearance: none;
	-moz-appearance: none;
	border: 2px solid #ddd;
	border-radius: 3px;
	background: #fff;
	transition: all 0.2s ease;
	flex-shrink: 0;
}

.webup-filter-checkbox:checked {
	background-color: #4CAF50;
	border-color: #4CAF50;
}

.webup-filter-checkbox:checked::after {
	content: '✓';
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	color: white;
	font-size: 12px;
	font-weight: bold;
}

.webup-filter-checkbox:hover {
	border-color: #4CAF50;
}

.webup-filter-checkbox:focus {
	outline: 2px solid #4CAF50;
	outline-offset: 2px;
}

/* Count badges */
.count {
	color: #999;
	font-size: 12px;
	margin-left: auto;
}

/* Tag Pills (for both tags and custom attributes) */
.webup-filter-tags.pills,
.webup-custom-filter.pills {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.webup-tag-pill,
.webup-custom-pill {
	display: inline-block;
	cursor: pointer;
}

.webup-tag-pill input,
.webup-custom-pill input {
	display: none;
}

.webup-tag-pill span,
.webup-custom-pill span {
	display: inline-block;
	padding: 6px 14px;
	background: #f5f5f5;
	border: 2px solid #e0e0e0;
	border-radius: 20px;
	font-size: 13px;
	transition: all 0.2s ease;
	user-select: none;
}

.webup-tag-pill input:checked + span,
.webup-custom-pill input:checked + span {
	background: #4CAF50;
	border-color: #4CAF50;
	color: white;
}

.webup-tag-pill:hover span,
.webup-custom-pill:hover span {
	border-color: #4CAF50;
}

/* Swatches */
.webup-swatches-wrapper {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.webup-swatch-label {
	cursor: pointer;
	display: inline-block;
}

.webup-swatch-input {
	display: none;
}

.webup-swatch {
	display: inline-block;
	width: 36px;
	height: 36px;
	border: 2px solid #e0e0e0;
	border-radius: 50%;
	transition: all 0.2s ease;
	position: relative;
}

.webup-swatch-color {
	background-size: cover;
	background-position: center;
}

.webup-swatch-image {
	background-size: cover;
	background-position: center;
	border-radius: 4px;
}

.webup-swatch-text {
	padding: 8px 16px;
	border-radius: 4px;
	background: #f5f5f5;
	font-size: 13px;
	width: auto;
	height: auto;
	border-radius: 4px;
}

.webup-swatch-input:checked + .webup-swatch {
	border-color: #4CAF50;
	border-width: 3px;
	box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
}

.webup-swatch-input:checked + .webup-swatch.webup-swatch-text {
	background: #4CAF50;
	color: white;
	border-color: #4CAF50;
}

.webup-swatch:hover {
	transform: scale(1.1);
	border-color: #4CAF50;
}

/* Button Groups (for both attributes and custom) */
.webup-button-group,
.webup-custom-buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.webup-filter-button-label,
.webup-custom-button-label {
	cursor: pointer;
}

.webup-filter-button-label input,
.webup-custom-button-label input {
	display: none;
}

.webup-filter-button-text,
.webup-custom-button-text {
	display: inline-block;
	padding: 8px 16px;
	background: #f5f5f5;
	border: 2px solid #e0e0e0;
	border-radius: 4px;
	font-size: 14px;
	transition: all 0.2s ease;
	user-select: none;
}

.webup-filter-button-label input:checked + .webup-filter-button-text,
.webup-custom-button-label input:checked + .webup-custom-button-text {
	background: #4CAF50;
	border-color: #4CAF50;
	color: white;
}

.webup-filter-button-text:hover,
.webup-custom-button-text:hover {
	border-color: #4CAF50;
}

/* Price Slider */
.webup-price-slider-wrapper {
	padding: 10px 0;
}

.webup-price-slider {
	height: 40px;
	position: relative;
	margin: 20px 0;
	padding: 15px 0;
}

.price-slider-track {
	position: absolute;
	top: 50%;
	left: 0;
	right: 0;
	height: 6px;
	background: #e0e0e0;
	border-radius: 3px;
	transform: translateY(-50%);
}

.price-slider-range {
	position: absolute;
	height: 100%;
	background: #4CAF50;
	border-radius: 3px;
	transition: left 0.1s, width 0.1s;
}

.price-slider-handle {
	position: absolute;
	top: 50%;
	width: 20px;
	height: 20px;
	background: #4CAF50;
	border: 3px solid #fff;
	border-radius: 50%;
	cursor: pointer;
	transform: translate(-50%, -50%);
	box-shadow: 0 2px 6px rgba(0,0,0,0.2);
	transition: transform 0.2s, box-shadow 0.2s;
	z-index: 10;
}

.price-slider-handle:hover {
	transform: translate(-50%, -50%) scale(1.2);
	box-shadow: 0 3px 8px rgba(0,0,0,0.3);
}

.price-slider-handle:active {
	transform: translate(-50%, -50%) scale(1.1);
}

body.no-select {
	user-select: none;
	-webkit-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
}

.webup-price-inputs {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-top: 15px;
}

.webup-price-input {
	flex: 1;
	padding: 8px 12px;
	border: 2px solid #e0e0e0;
	border-radius: 4px;
	font-size: 14px;
	transition: border-color 0.2s ease;
}

.webup-price-input:focus {
	outline: none;
	border-color: #4CAF50;
}

.webup-price-separator {
	color: #999;
	font-weight: 500;
}

/* Filter Actions */
.webup-filter-actions {
	margin-top: 20px;
}

.webup-filter-button {
	width: 100%;
	padding: 12px 24px;
	background: #4CAF50;
	color: white;
	border: none;
	border-radius: 4px;
	font-size: 16px;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.2s ease;
}

.webup-filter-button:hover {
	background: #45a049;
}

.webup-filter-button:active {
	transform: scale(0.98);
}

/* Reset Button */
.webup-filter-reset-wrapper {
	margin-bottom: 20px;
}

.webup-filter-reset {
	padding: 8px 16px;
	background: #f5f5f5;
	border: 1px solid #e0e0e0;
	border-radius: 4px;
	font-size: 13px;
	cursor: pointer;
	transition: all 0.2s ease;
	color: #666;
}

.webup-filter-reset:hover {
	background: #fff;
	border-color: #999;
	color: #333;
}

.webup-filter-reset:active {
	transform: scale(0.98);
}

/* Active Filters Widget */
.webup-active-filters-widget {
	margin-bottom: 24px;
}

.webup-active-filters-title {
	font-size: 14px;
	font-weight: 600;
	margin: 0 0 12px 0;
	color: #333;
}

.webup-active-filters-list {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 12px;
	min-height: 20px;
}

.webup-active-filter-tag {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 6px 12px;
	background: #f0f0f0;
	border-radius: 20px;
	font-size: 13px;
	color: #333;
}

.webup-remove-filter {
	cursor: pointer;
	color: #999;
	font-weight: bold;
	font-size: 16px;
	line-height: 1;
	transition: color 0.2s ease;
	padding: 0 4px;
}

.webup-remove-filter:hover {
	color: #e74c3c;
}

.webup-clear-all-filters {
	padding: 6px 14px;
	background: #fff;
	border: 1px solid #e0e0e0;
	border-radius: 4px;
	font-size: 13px;
	cursor: pointer;
	transition: all 0.2s ease;
	color: #666;
}

.webup-clear-all-filters:hover {
	background: #f5f5f5;
	border-color: #999;
	color: #333;
}

.webup-clear-all-filters:active {
	transform: scale(0.98);
}

/* Loading State */
.webup-filters-loading {
	opacity: 0.5;
	pointer-events: none;
	position: relative;
}

.webup-filters-loading::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: 30px;
	height: 30px;
	margin: -15px 0 0 -15px;
	border: 3px solid #f3f3f3;
	border-top: 3px solid #4CAF50;
	border-radius: 50%;
	animation: spin 1s linear infinite;
}

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

/* Select Dropdown */
.webup-filter-select {
	width: 100%;
	padding: 10px;
	border: 2px solid #e0e0e0;
	border-radius: 4px;
	font-size: 14px;
	transition: border-color 0.2s ease;
}

.webup-filter-select:focus {
	outline: none;
	border-color: #4CAF50;
}

/* List Style Links */
.webup-filter-link {
	display: block;
	padding: 8px 0;
	color: #333;
	text-decoration: none;
	transition: color 0.2s ease;
}

.webup-filter-link:hover {
	color: #4CAF50;
}

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

	.webup-filter-heading {
		font-size: 14px;
	}

	.webup-swatch {
		width: 32px;
		height: 32px;
	}

	.webup-swatches-wrapper {
		gap: 8px;
	}

	.webup-tag-pill span,
	.webup-custom-pill span {
		padding: 5px 12px;
		font-size: 12px;
	}

	.webup-filter-button-text,
	.webup-custom-button-text {
		padding: 6px 12px;
		font-size: 13px;
	}

	.webup-price-slider {
		margin: 15px 0;
	}

	.webup-filter-button {
		padding: 10px 20px;
		font-size: 14px;
	}
}

@media (max-width: 480px) {
	.webup-product-filters {
		padding: 12px;
	}

	.webup-swatch {
		width: 28px;
		height: 28px;
	}

	.webup-badge-global,
	.webup-badge-custom {
		font-size: 9px;
		padding: 1px 6px;
	}
}

/* Accessibility */
.webup-filter-checkbox:focus-visible,
.webup-tag-pill:focus-within,
.webup-custom-pill:focus-within,
.webup-filter-button-label:focus-within,
.webup-custom-button-label:focus-within,
.webup-swatch-label:focus-within {
	outline: 2px solid #4CAF50;
	outline-offset: 2px;
	border-radius: 4px;
}

/* Print styles */
@media print {
	.webup-product-filters {
		display: none;
	}
}

/* Dark mode support (optional) */
/*@media (prefers-color-scheme: dark) {
	.webup-product-filters {
		background: #1e1e1e;
		color: #e0e0e0;
	}

	.webup-filter-heading {
		color: #e0e0e0;
	}

	.webup-filter-section {
		border-bottom-color: #333;
	}

	.webup-filter-checkbox {
		border-color: #555;
		background: #2a2a2a;
	}

	.webup-checkbox-label {
		color: #e0e0e0;
	}

	.webup-tag-pill span,
	.webup-custom-pill span,
	.webup-filter-button-text,
	.webup-custom-button-text {
		background: #2a2a2a;
		border-color: #444;
		color: #e0e0e0;
	}

	.webup-price-input {
		background: #2a2a2a;
		border-color: #444;
		color: #e0e0e0;
	}

	.price-slider-track {
		background: #444;
	}

	.webup-filter-reset {
		background: #2a2a2a;
		border-color: #444;
		color: #e0e0e0;
	}

	.webup-active-filter-tag {
		background: #2a2a2a;
		color: #e0e0e0;
	}
}*/