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

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

.minimog-grid-wrapper {
	.minimog-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;
				}
			}

			&.current,
			&:hover {
				color: $heading-color;
			}
		}

		.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: #111;
			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 #111;
				border-right: 4px solid transparent;
				border-left: 4px solid transparent;
				content: "";
			}
		}
	}
}

.minimog-grid-loader {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	color: #111;
	background: rgba(255, 255, 255, .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;
	}
}

.minimog-infinite-loader {
	display: none;
	margin: 0;
	color: $heading-color;

	.sk-wrap {
		margin: 0 auto;
	}

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

.minimog-grid-pagination {
	padding-top: 40px;
	text-align: center;

	.minimog-blog-grid:not(.minimog-grid-masonry) & {
		padding-top: 10px;
	}

	.pagination-wrapper {
		// display: inline-block;
		display: block; // Make tm-button can be full if set width 100%
	}

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

.minimog-grid-messages {
	text-align: center;
}

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

	.result-count {
		margin: 0 0 20px;
		color: $text-lighten-color;

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

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

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

		.minimog-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(var(--grid-columns, 3), 1fr);
	grid-gap: calc(1px * var(--grid-gutter, 30));

	.grid-sizer {
		display: none;
	}

	.grid-item {
		min-width: 0;
	}

	&.loaded {
		display: block;

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

.minimog-grid-wrapper {
	&[style*='--grid-columns-desktop:'] {
		--grid-columns: var(--grid-columns-desktop);
	}

	&[style*='--grid-gutter-desktop:'] {
		--grid-gutter: var(--grid-gutter-desktop);
	}
}

@include elementor-breakpoint-up(widescreen) {
	.minimog-grid-wrapper {
		&[style*='--grid-columns-widescreen:'] {
			--grid-columns: var(--grid-columns-widescreen);
		}

		&[style*='--grid-gutter-widescreen:'] {
			--grid-gutter: var(--grid-gutter-widescreen);
		}
	}
}

@include elementor-breakpoint-down(laptop) {
	.minimog-grid-wrapper {
		&[style*='--grid-columns-laptop:'] {
			--grid-columns: var(--grid-columns-laptop);
		}

		&[style*='--grid-gutter-laptop:'] {
			--grid-gutter: var(--grid-gutter-laptop);
		}
	}
}

@include elementor-breakpoint-down(tablet-extra) {
	.minimog-grid-wrapper {
		&[style*='--grid-columns-tablet-extra:'] {
			--grid-columns: var(--grid-columns-tablet-extra);
		}

		&[style*='--grid-gutter-tablet-extra:'] {
			--grid-gutter: var(--grid-gutter-tablet-extra);
		}
	}
}

@include elementor-breakpoint-down(tablet) {
	.minimog-grid-wrapper {
		&[style*='--grid-columns-tablet:'] {
			--grid-columns: var(--grid-columns-tablet);
		}

		&[style*='--grid-gutter-tablet:'] {
			--grid-gutter: var(--grid-gutter-tablet);
		}
	}
}

@include elementor-breakpoint-down(mobile-extra) {
	.minimog-grid-wrapper {
		&[style*='--grid-columns-mobile-extra:'] {
			--grid-columns: var(--grid-columns-mobile-extra);
		}

		&[style*='--grid-gutter-mobile-extra:'] {
			--grid-gutter: var(--grid-gutter-mobile-extra);
		}
	}
}

@include elementor-breakpoint-down(mobile) {
	.minimog-grid-wrapper {
		&[style*='--grid-columns-mobile:'] {
			--grid-columns: var(--grid-columns-mobile);
		}

		&[style*='--grid-gutter-mobile:'] {
			--grid-gutter: var(--grid-gutter-mobile);
		}
	}
}

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

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

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