html.apfm-open,
html.apfm-open > body {
	width: 100%;
	height: 100%;
}

html.apfm-open > body {
	overflow: hidden;
}

.apfm-container {
	position: fixed;
	z-index: -1;
	visibility: hidden;
	opacity: 5;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
        margin: auto;
	width: 70%;
	height: 100%;
	overflow-y: scroll;
	overflow-x: hidden;

	-webkit-transform: scale(0.8);
	-moz-transform: scale(0.8);
	-ms-transform: scale(0.8);
	-o-transform: scale(0.8);
	transform: scale(0.8);

}

.apfm-container.apfm-opening,
.apfm-container.apfm-closing {
	visibility: visible;
	z-index: 99999;

}

.apfm-container.apfm-open {
	visibility: visible;
	z-index: 99999;

	/* for iOS momentum/inertia scrolling */
	/* Must be put here and not in original .apfm-container class because
	   else scrolling on main page is buggy */
	-webkit-overflow-scrolling: touch;

	/* These attributes are animated: */
	opacity: 1;
	-webkit-transform: scale(1);
	-moz-transform: scale(1);
	-ms-transform: scale(1);
	-o-transform: scale(1);
	transform: scale(1);
}

.apfm-container .apfm-wrapper {
	position: relative;
}

.apfm-container .apfm-close-button {
	position: absolute;
	z-index: 1000;
	top: 20px;
	right: 20px;
	width: 50px;
	height: 50px;
	cursor: pointer;

	/* No blue selection when clicking on the cross */
	-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
	-webkit-tap-highlight-color: transparent;
	-webkit-touch-callout: none;
	-webkit-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
	user-select: none;
}


.apfm-container .apfm-close-button::before,
.apfm-container .apfm-close-button::after {
	content: "";
	position: absolute;
	left: 0;
	top: 50%;
	width: 100%;
	height: 2px;
	background-color: #bbb;

	-webkit-transform: rotate(45deg);
	-moz-transform: rotate(45deg);
	-ms-transform: rotate(45deg);
	-o-transform: rotate(45deg);
	transform: rotate(45deg);

	-webkit-transition: background-color .2s;
	-moz-transition: background-color .2s;
	-ms-transition: background-color .2s;
	-o-transition: background-color .2s;
	transition: background-color .2s;
}

.apfm-container .apfm-close-button::after {
	-webkit-transform: rotate(-45deg);
	-moz-transform: rotate(-45deg);
	-ms-transform: rotate(-45deg);
	-o-transform: rotate(-45deg);
	transform: rotate(-45deg);
}

.apfm-container .apfm-close-button:hover::before,
.apfm-container .apfm-close-button:hover::after {
	background-color: #555;
}
