@import "variables";
.modal-open {
	padding-right: 0 !important;
}
.modal-backdrop {
	&.in {
		opacity: 0.75;
	}
}
.modal {
	padding-left: 0 !important;
	padding-right: 0 !important;

	.cross {
		background-color: #7D92B3;
		border: none;
		position: absolute; top: 16px; right: 16px; z-index: 5;
		display: block; width: 24px; height: 24px;
		@include border-radius(3px);
		@include transition();
		@media (max-width: 767px) {
			top: 8px; right: 8px;
		}
		&.cross-fixed{
			@include transition(none !important);
		}
		&:before, &:after {
			content: '';
			background: #fff;
			position: absolute; top: 50%; left: 50%;
			display: block; width: 80%; height: 2px;
			@include border-radius(4px);
		}
		&:before {
			@include transform(translateX(-50%) translateY(-50%) rotate(-45deg));
		}
		&:after {
			@include transform(translateX(-50%) translateY(-50%) rotate(45deg));
		}
		&:hover {
			background: darken(#7D92B3, 10%);
			cursor: pointer;
		}
		&.cross_float {
			position: relative;
			top: auto !important; right: auto !important;
			float: right;
			margin: -4px -12px 12px 8px;
			@media (max-width: 575px) {
				margin: -4px -4px 8px 8px;
			}
		}
		&.light {
			background-color: #ccc;
			&:hover {
				background-color: $red;
			}
		}
		&.simple {
			background: transparent;
			top: 6px;
			right: 6px;
			&:before, &:after {
				background: #333;
			}
			&:hover {
				&:before, &:after {
					background: #9b9b9b;
				}
			}
		}
		&.sm {
			top: 8px; right: 8px;
			width: 16px; height: 16px;
		}
		&.responsive-xs {
			@media(max-width: 767px){
				top: 8px; right: 8px;
				width: 16px; height: 16px;
			}
		}
	}
	.modal-dialog {
		position: relative;
		margin: 44px auto;
		@include transform(none !important);
		@include transition(all .3s ease-out 0s !important);
		//min-height: calc( 100% - 100px );
		@media (max-width: 767px){
			margin: 10px;
			//min-height: calc( 100% - 10px );
		}

		/*display: flex;
		-webkit-box-align: center;
		-ms-flex-align: center;
		align-items: center;*/

		&.modal-md {
			max-width: 450px !important;
			margin-left: auto !important;
			margin-right: auto !important;
			padding-left: 12px !important;
			padding-right: 12px !important;
		}
		&.modal-lg {
			width: auto !important;
			max-width: 920px !important;
			margin-left: auto !important;
			margin-right: auto !important;
			padding-left: 12px !important;
			padding-right: 12px !important;
		}
		&.modal-xl {
			width: auto !important;
			max-width: 1164px !important;
			margin-left: auto !important;
			margin-right: auto !important;
			padding-left: 12px !important;
			padding-right: 12px !important;
		}

		.modal-content {
			background: #fff;
			border: none;
			@include border-radius(3px);
			@include box-shadow(0 2px 4px 0 rgba(0,0,0,0.5));
			/*display: flex;
			-webkit-box-orient: vertical;
			-webkit-box-direction: normal;
			-ms-flex-direction: column;
			flex-direction: column;*/
			.modal-header {
				background: #dde4ec;
				margin: 0;
				padding: 16px 24px;
				padding-right: 48px;
				font-size: 18px;
				line-height: 1.25;
				font-weight: bold;
				@include border-radius(3px 3px 0 0);
				&.with-nav {
					border: none;
					padding-bottom: 0;
					.nav-tabs {
						border: none;
						position: relative;
						overflow: hidden;
						white-space: nowrap;
						li {
							display: inline-block;
							vertical-align: top;
							float: none;
						}
					}
					@media (max-width: 767px){
						padding-left: 12px;
						.nav-tabs {
							li {
								a {
									padding-left: 8px;
									padding-right: 8px;
									font-size: 14px;
								}
							}
						}
					}
				}
				&.danger {
					background: $color_red;
					color: $color_white;
					.cross {
						background: $color_white;
						opacity: 0.75;
						&:before, &:after {
							background: $color_red;
						}
						&:hover {
							opacity: 1;
						}
					}
				}
				&.white {
					background: none;
					border: 0;
				}
			}
			.modal-body {
				padding: 24px;
				&.padd-50 {
					padding: 48px 50px !important;
					@media (max-width: 767px) {padding: 32px !important;}
				}
				&.modal-body-fix {
					overflow-y: auto;
					max-height: 500px;
				}
			}
			.modal-footer {
				background: #dde4ec;
				padding: 13px 24px;
				@include border-radius(0 0 3px 3px);
				&.white { background: $color_white; }
				&.text-center { text-align: center; }
			}
			&.modal-content_secondary {
				background: $color_gray_10;
			}
		}
	}

	&.middle {
		.modal-dialog {
			//margin: 0 auto;
		}
	}

	&.modal-flex {
		width: 100%;
		height: 100%;
		.cross {
			top: 8px; right: 8px;
		}
		.modal-dialog {
			//width: 600px;
			max-width: 100%;
			margin: 24px auto;
			@media (max-width: 767px) {
				margin: 12px;
			}
			@media (min-width: 625px) {
				width: 600px;
				margin-left: auto;
				margin-right: auto;
			}
			.modal-content {
				position: relative;
				display: flex;
				flex-direction: column;
				width: 100%;
				.modal-header {
					//padding: 16px 24px;
				}
				.modal-body {
					position: relative;
					flex: 1 1 auto;
					padding: 16px 24px;
					@media (max-width: 575px) {
						padding: 12px;
					}
				}
				.modal-footer {
					background: transparent;
					border: 0;
					padding: 16px 24px;
					&.modal-footer_border {
						border-top: 1px solid rgba(0,0,0,0.1);
					}
					&.modal-footer_shadow {
						position: relative;
						&:before {
							content: '';
							background: -moz-linear-gradient(top, rgba(255,255,255,0) 0%, rgba(255,255,255,1) 100%);
							background: -webkit-linear-gradient(top, rgba(255,255,255,0) 0%,rgba(255,255,255,1) 100%);
							background: linear-gradient(to bottom, rgba(255,255,255,0) 0%,rgba(255,255,255,1) 100%);
							filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#00ffffff', endColorstr='#ffffff',GradientType=0 );
							position: absolute; bottom: 100%; left: 0; right: 0;
							z-index: 5;
							display: block;
							height: 10px;
						}
					}
				}
			}
			&.modal-dialog-centered {
				display: flex;
				align-items: center;
				min-height: calc(100% - 48px);
			}
			&.modal-dialog-scrollable {
				height: calc(100% - 48px);
				@media (max-width: 575px) {
					height: calc(100% - 24px);
				}

				overflow: hidden;
				.modal-body {
					overflow-y: auto;
				}

				.modal-content {
					max-height: 100%;

				}
			}
		}
	}
	&.modal-flex-scroll {
		.cross {
			top: 16px; right: 24px;
		}
		.modal-dialog {
			display: flex;
			flex-direction: column;
			flex-grow: 1;
			max-height: 100%;
		}
		.modal-content {
			display: flex;
			flex-direction: column;
			max-height: 100%;
			&.empty {
				position: relative;
				min-height: 240px;
				.spinner {
					position: absolute; top: 50%; left: 50%;
					@include transform(translateX(-50%) translateY(-50%));
				}
			}
		}
		.modal-header {
			//background: #dde4ec;
			padding: 16px 24px !important;
			font-weight: normal !important;
		}
		.modal-footer {}
		.modal-body {
			position: relative;
			overflow: hidden;
			overflow-y: auto;
			flex-grow: 1;
			&:not(:first-child){
				padding-top: 0;
			}
			&:not(:last-child){
				padding-bottom: 0;
			}
		}

		&.in {
			display: flex !important;
		}
	}
	&.modal-dark {
		.cross {
			&.simple {
				&:before, &:after {
					background: #a1a1a1;
				}
				&:hover {
					&:before, &:after {
						background: $red;
					}
				}
			}
		}
		.modal-content {
			background: #262626;
		}
	}
}
