.filters {
	display: block;
	position: fixed;
	top: 0;
	left: 0;
	width: 100vw;
	height: 100vh;
	background-color: rgba(0, 0, 0, 0.3);
	z-index: 1001;
	padding: 0;
	overflow-y: hidden;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.2s ease;

	&.active {
		opacity: 1;
		pointer-events: auto;
	}

	.filters-content {
		position: relative;
		transform: translateX(-100%);
		transition: transform 0.3s ease-in-out;
		display: block;
		max-width: 550px;
		height: 100vh;
		background-color: white;
		padding-top: 90px;
		padding-bottom: 50px;
		overflow-y: hidden;

		.close-filters-btn {
			position: absolute;
			z-index: 1;
			right: 25px;
			background-color: white;
			border: none;
			font-size: 20px;
			border-radius: 50%;
		}

		.main-sidebar {
			top: 0;
			padding-inline: 25px;
			padding-top: 30px;
			height: 100%;
		}
	}

	&.active .filters-content {
		transform: translateX(0);
	}
}

.sidebar {
	h3 {
		font-size: 18px;
		font-weight: medium;
		text-align: left;
		text-transform: uppercase;
		color: #000;
	}

	ul.main-sidebar {
		margin: 0;
		padding: 24px 15px;
		background-color: #fff;
		top: 72px;
		color: #000;
		position: sticky;
		max-height: 85vh;
		min-width: 275px;
		max-width: 325px;
		overflow-y: scroll;
		scrollbar-width: none;

		.filter-mainTitle {
			font-size: 20px;
			font-weight: 700;
		}

		.wc-block-price-slider {
			.wc-block-price-filter {
				margin-bottom: 0;

				.wc-block-price-filter__controls {
					margin: 16px 0 10px 0;

					.wc-block-price-filter__control {
						input {
							border: none;
							border-bottom: 1px solid #000;
							padding: 0;

							&.wc-block-components-price-slider__amount--max {
								text-align: right;
							}
						}
					}
				}
			}
		}

		.onsale-switcher,
		.instock-switcher {
			margin-block: 5px;

			form {
				display: flex;
				align-items: center;
				gap: 15px;

				.switch {
					position: relative;
					display: inline-block;
					width: 32px;
					height: 14px;

					input {
						opacity: 0;
						width: 0;
						height: 0;
					}
				}

				.slider {
					position: absolute;
					cursor: pointer;
					top: 0;
					left: 0;
					right: 0;
					bottom: 0;
					background-color: #ccc;
					transition: 0.4s;
					border-radius: 50px;

					&:before {
						position: absolute;
						content: '';
						height: 16px;
						width: 16px;
						left: -5px;
						bottom: -1px;
						background-color: white;
						transition: 0.4s;
						border-radius: 50%;
						box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
					}
				}

				input:checked + .slider {
					background-color: var(--mainColor);

					&:hover {
						background-color: var(--mainColor);
					}

					&:before {
						transform: translateX(26px);
					}
				}

				.switch:hover .slider {
					background-color: #b3b3b3;
				}

				.label {
					color: rgb(91, 91, 91);
					font-size: 14px;
				}
			}
		}

		.widget_product_categories {
			margin-top: 10px;

			.product-categories {
				padding-left: 0;

				li {
					padding-block: 3px;

					a {
						color: #5b5b5b;

						&:hover {
							color: var(--mainColor);
						}
					}
				}
			}
		}
	}
}

.page-lojas .sidebar ul.main-sidebar .custom-category-widget {
	margin: 0 0 1rem 0;
}

.sidebar ul.main-sidebar .custom-vendor-widget,
.sidebar ul.main-sidebar .custom-category-widget {
	margin: 3rem 0 1rem 0;

	.toggleCategories,
	.toggleVendors {
		background: none;
		border: none;
		font-size: 1rem;
		font-weight: bold;
		cursor: pointer;
		display: flex;
		align-items: center;
		gap: 5px;
		justify-content: space-between;
		padding: 0;
		width: 100%;

		&::after {
			content: '';
			display: inline-block;
			width: 10px;
			height: 10px;
			border-right: 2px solid #000;
			border-bottom: 2px solid #000;
			transform: rotate(-45deg);
			transition: transform 0.3s ease;
		}

		&.open::after {
			transform: rotate(45deg);
		}

		h3 {
			margin: 0;
		}
	}

	.categoryList,
	.vendorList {
		ul {
			list-style: none;
			padding-left: 0;
			margin: 0.5rem 0;
		}

		li {
			margin: 0.3rem 0;
			color: #5b5b5b;

			a {
				color: #5b5b5b;
				font-size: 14px;
			}

			.count {
				color: #000;
			}

			label {
				display: flex;
				align-items: center;
				gap: 5px;
				font-size: 14px;

				input[type='checkbox'] {
					appearance: none;
					width: 20px;
					height: 20px;
					border: 2px solid #5b5b5b;
					border-radius: 4px;
					background-color: #fff;
					position: relative;
					cursor: pointer;
					transition: background-color 0.3s, border-color 0.3s;
					flex-shrink: 0;
				}

				input[type='checkbox']:checked {
					background-color: var(--mainColor);
					border-color: var(--mainColor);
				}

				input[type='checkbox']:checked::after {
					content: '✔';
					position: absolute;
					top: 2px;
					left: 5px;
					color: var(--mainText);
					font-size: 12px;
					margin-left: -1px;
					margin-top: -3px;
				}

				input[type='checkbox']:hover {
					border-color: var(--mainColor);
				}
			}
		}

		.showMoreCategories,
		.showMoreVendors {
			background-color: transparent;
			border: none;
			color: #5b5b5b;
			font-size: 13px;
			padding: 0;
		}
	}
}

@media only screen and (max-width: 990px) {
	ul.main-sidebar {
		margin-bottom: 1rem !important;
	}
}

@media only screen and (max-width: 769px) {
	.filters {
		.filters-content {
			padding-top: 170px;
		}
	}

	.p-custom {
		padding-left: 24px !important;
		padding-right: 24px !important;
	}
}
