/*
 * 2M Creative Toolkit
 * Section Popups
 */


/*
 * Popup backdrop.
 */
.tmc-popup-backdrop {
	position: fixed;
	inset: 0;
	z-index: 999998;

	display: flex;
	align-items: center;
	justify-content: center;

	padding: 40px;

	background: rgba(0, 0, 0, 0.65);

	opacity: 0;
	visibility: hidden;
}


/*
 * Active backdrop.
 */
.tmc-popup-backdrop.is-open {
	opacity: 1;
	visibility: visible;
}


/*
 * Popup section while active.
 */
.tmc-popup-active {
    position: relative;
    z-index: 999999;

    /* Allow Divi to control the section width */
    flex: 0 1 auto;

    /* Keep the popup within the viewport */
    max-width: calc(100vw - 80px);
    max-height: calc(100vh - 80px);

    overflow-y: auto;
}


/*
 * Prevent page scrolling while popup is open.
 */
body.tmc-popup-open {
	overflow: hidden;
}


/*
 * Make popup close controls clickable.
 */
.tmc-popup-close {
	cursor: pointer;
}


/*
 * Mobile.
 */
@media (max-width: 767px) {

	.tmc-popup-backdrop {
		padding: 20px;
	}

	.tmc-popup-active {
		max-height: calc(100vh - 40px);
	}
}
/*
 * Hide popup sections on the front end.
 */
body:not(.et-fb) .et_pb_section[class*="tmc-popup-"] {
	display: none !important;
}

/*
 * Show active popup.
 */
body:not(.et-fb) .et_pb_section.tmc-popup-active {
	display: block !important;
}

/*
 * Popup trigger cursor.
 */
[class*="tmc-popup-open-"] {
	cursor: pointer;
}