.civi-grid-filter {
	padding-bottom: 61px;

	.container {
		padding-left: 0;
		padding-right: 0;
	}
}

.civi-grid-wrapper {
	.civi-grid-filter-buttons {
		margin-left: -15px;
		margin-right: -15px;
	}

	&.filter-style-01 {
		.btn-filter {
			position: relative;
			display: inline-block;
			padding: 0;
			margin: 5px 17px;
			color: inherit;
			border-bottom: 1px solid transparent;

			&:hover {
				.filter-counter {
					visibility: visible;
					opacity: 1;
					transform: translate(-50%, -100%);
				}
			}

			&.current {
				border-color: currentColor;

				.filter-text {
					font-weight: 500;
				}
			}
		}

		.filter-text {
			font-size: 12px;
			font-weight: 500;
			line-height: 1.34;
			text-transform: uppercase;
			letter-spacing: 1.38px;
		}

		.filter-counter {
			@extend %NormalTransition;
			position: absolute;
			top: 0;
			left: 50%;
			visibility: hidden;
			margin: 0 auto;
			min-width: 34px;
			height: 24px;
			line-height: 24px;
			border-radius: 3px;
			font-size: 12px;
			background-color: $primary_color;
			color: #fff;
			text-align: center;
			opacity: 0;
			transform: translate(-50%, -50%);

			&:before {
				position: absolute;
				right: 0;
				bottom: -4px;
				left: 0;
				display: block;
				margin: 0 auto;
				width: 0;
				height: 0;
				border-top: 4px solid $primary_color;
				border-right: 4px solid transparent;
				border-left: 4px solid transparent;
				content: "";
			}
		}
	}
}

.civi-grid-loader {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	color: $primary_color;
	background: rgba(255, 255, 255, 0.3);
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	display: flex;
	align-items: center;
	justify-content: center;

	&.show {
		pointer-events: auto;
		z-index: 2;
		opacity: 1;
		visibility: visible;
	}

	.sk-wrap {
		margin: 0 auto;
	}

	.sk-circle {
		width: 80px;
		height: 80px;
	}
}

.civi-infinite-loader {
	display: none;
	margin: 0;

	.sk-wrap {
		margin: 0 auto;
	}

	&.show {
		display: inline-block;
	}
}

.civi-grid-pagination {
	padding-top: 50px;
	text-align: center;

	.pagination-wrapper {
		display: inline-block;
	}

	.page-pagination {
		display: inline-block;
	}

	.navigation-buttons {
		display: flex;
		align-items: center;
		color: $primary_color;

		.nav-line {
			width: 150px;
			height: 1px;
			flex-shrink: 0;
			background: currentColor;
			margin: 0 30px;
		}

		.nav-link {
			@extend %NormalTransition;
			user-select: none;
			cursor: pointer;
			font-size: 34px;
			line-height: 1.2;
			font-weight: 500;
		}

		.disabled {
			opacity: 0.5;
			cursor: not-allowed;
		}
	}
}

.civi-load-more-button.civi-button {
	min-width: 250px;

	&.style-border {
		border-color: #eee;

		&:hover {
			border-color: transparent;
		}
	}
}

.civi-grid-messages {
	margin: 50px 0;
	text-align: center;
}

.civi-grid-sorting {
	margin-bottom: 10px;

	.result-count {
		margin: 0 0 20px;
		color: #7e7e7e;

		.count {
			font-weight: 500;
			color: #333;
		}
	}

	.ordering {
		text-align: right;
		margin: 0 0 20px;

		.civi-fake-select-wrap {
			width: 260px;
		}

		.civi-fake-select-current {
			.label {
				&:before {
					@extend %FontAwesomeRegular;
					content: "\f036";
					vertical-align: middle;
					font-size: 16px;
				}
			}
		}
	}
}

.civi-grid-metro {
	.grid-item-height {
		.civi-box,
		.civi-image {
			height: 100%;
		}

		.civi-image {
			img {
				width: 100%;
				height: 100%;
				object-fit: cover;
			}
		}
	}
}

// Fake layout. Improvement better display on page load.
.lazy-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	grid-gap: 30px;

	.grid-sizer {
		display: none;
	}

	&.loaded {
		display: block;

		.grid-sizer {
			display: block;
		}
	}
}

@include media-breakpoint-down(sm) {
	.civi-grid-wrapper {
		.civi-grid-filter-buttons {
			display: block;
		}
	}

	.civi-grid-sorting {
		text-align: left;

		.ordering {
			text-align: left;
		}
	}
}
