@import "settings/variables";
@import "settings/mixins";
@import "settings/elementor-breakpoints";

.elementor-widget-civi-icon-box {
	.civi-icon-box {
		@extend %NormalTransition;
		position: relative;
		display: block;
		width: 100%;

		/**
		 * Hover background
		 */
		&:before {
			@extend %NormalTransition;
			content: "";
			position: absolute;
			top: 0;
			left: 0;
			right: 0;
			bottom: 0;
			visibility: hidden;
			opacity: 0;
		}

		&:hover {
			&:before {
				visibility: visible;
				opacity: 1;
			}
		}

		ul {
			margin: 0;
		}
	}

	.icon-box-wrapper {
		position: relative;
		z-index: 1;
		text-align: center;
	}

	.icon,
	.heading,
	.description,
	.icon-box-button {
		@extend %NormalTransition;
	}

	.heading,
	.description {
		display: inline-block;
	}

	.heading {
		font-size: 20px;
		margin-bottom: 0;

		a {
			color: inherit;
		}
	}

	.civi-icon-box {
		.civi-icon {
			color: #333;
		}

		&:hover {
			.heading-divider {
				&:after {
					width: 100%;
				}
			}
		}
	}

	.heading-divider-wrap {
		margin-top: 27px;
	}

	.heading-divider {
		position: relative;
		height: 3px;

		&:before,
		&:after {
			content: "";
			position: absolute;
			left: 0;
			top: 0;
		}

		&:before {
			width: 100%;
			height: 1px;
			top: 1px;
			background: #eee;
		}

		&:after {
			@extend %NormalTransition;
			width: 0;
			height: 3px;
			left: 50%;
			transform: translate(-50%, 0);
			background: $primary_color;
		}
	}

	.heading-wrap + .description-wrap {
		margin-top: 8px;
	}

	.description {
		font-size: 15px;
		line-height: 1.74;
	}

	.icon-box-content {
		flex-grow: 1;
	}

	.civi-button-wrapper {
		margin: 34px 0 0;
		line-height: 0;
	}

	&.civi-icon-box-style-01 {
		.civi-icon-box {
			padding: 32px 37px 48px;
			background: #fff;
			border-radius: 5px;

			&:hover {
				box-shadow: 0 0 40px rgba(51, 51, 51, 0.1);
			}

			.heading {
				font-size: 24px;
				font-weight: 500;
				line-height: 1.34;
			}

			.civi-button {
				&.style-text {
					color: #8c89a2;
				}
			}
		}

		.civi-icon,
		.civi-icon-view {
			font-size: 56px;
		}

		.heading-wrap + .description-wrap {
			margin-top: 18px;
		}
	}

	&.civi-icon-box-style-02 {
		.civi-icon-box {
			padding: 51px 35px 50px;

			&:after {
				@extend %NormalTransition;
				pointer-events: none;
				content: "";
				position: absolute;
				left: 0;
				right: 0;
				bottom: 0;
				height: 3px;
				background: $primary_color;
				opacity: 0;
				visibility: hidden;
			}

			&:hover {
				background: #fff;
				box-shadow: 0 16px 40px #ededed;

				&:after {
					opacity: 1;
					visibility: visible;
				}
			}
		}
	}

	&.civi-icon-box-style-03 {
		.civi-icon-box {
			.civi-icon-view,
			.civi-icon {
				font-size: 48px;
			}

			.heading {
				font-size: 24px;
				font-weight: 600;
				line-height: 1.5;
			}

			.description-wrap {
				margin-top: 12px;
			}
		}
	}
}

@media (min-width: 768px) {
	.elementor-widget-civi-icon-box {
		&.elementor-position-left,
		&.elementor-position-right {
			.icon-box-wrapper {
				display: flex;
			}

			.civi-icon-wrap {
				display: inline-flex;
				flex: 0 0 auto;
			}

			&.civi-icon-box-style-03 {
				.heading-wrap + .description-wrap {
					margin-top: 10px;
				}
			}
		}

		&.elementor-position-right {
			.icon-box-wrapper {
				text-align: right;
				flex-direction: row-reverse;
			}

			.civi-icon-wrap {
				margin-left: 20px;
			}

			&.civi-icon-box-style-03 {
				.civi-icon-wrap {
					margin-left: 35px;
				}
			}
		}

		&.elementor-position-left {
			.icon-box-wrapper {
				text-align: left;
				flex-direction: row;
			}

			.civi-icon-wrap {
				margin-right: 20px;
			}

			&.civi-icon-box-style-03 {
				.civi-icon-wrap {
					margin-right: 35px;
				}
			}
		}

		&.elementor-position-top {
			.civi-icon-wrap {
				margin-bottom: 24px;
			}
		}

		&.elementor-vertical-align-top {
			.icon-box-wrapper {
				align-items: flex-start;
			}
		}

		&.elementor-vertical-align-middle {
			.icon-box-wrapper {
				align-items: center;
			}
		}

		&.elementor-vertical-align-bottom {
			.icon-box-wrapper {
				align-items: flex-end;
			}
		}
	}
}

@media (max-width: 767px) {
	.elementor-widget-civi-icon-box .civi-icon-wrap {
		margin-left: auto !important;
		margin-right: auto !important;
		margin-bottom: 15px;
	}
}

@include elementor-breakpoint-down(sm) {
	.elementor-widget-civi-icon-box.civi-icon-box-style-01 {
		.civi-icon-box {
			padding: 41px 30px 25px;
		}
	}
}
