/* Mobile slide-out menu: geometry, scrim and stacking.

	   Four defects this replaces.

	   1. Themify Ultra ships the side menu as a PUSH drawer -- opening it sets
	      body{position:relative;left:-300px} and slides the entire page 300px
	      left. On the front page that pushed the logo off-screen and left the
	      price bar looking half-scrolled, which reads as a broken header.
	   2. The scrim (.body-overlay) is a pale rgba(207,207,207,.7) at z-index
	      998 -- underneath #headerwrap (z-index 1000) -- so the header stayed
	      bright while everything else washed out.
	   3. #mobile-menu is a child of #headerwrap, which is position:sticky with
	      z-index:1000 and therefore its own stacking context. The drawer's
	      declared z-index of 11111 was capped at 1000, so any scrim painted
	      above the header also painted above the drawer. The JS below lifts the
	      drawer to <body> so its z-index means what it says.
	   4. The drawer was a fixed 300px, leaving a ~110px live sliver of page on a
	      412px phone, and the search row's border-top rendered as a stray rule
	      floating in the empty padding above it. */
	@media screen and (max-width: 1200px) {

		/* Overlay, don't push. */
		body,
		#pagewrap {
			left: 0 !important;
		}

		#mobile-menu.sidemenu {
			display: block !important;
			position: fixed !important;
			top: 0 !important;
			bottom: 0 !important;
			right: 0 !important;
			left: auto !important;
			height: auto !important;
			width: 88vw !important;
			max-width: 360px !important;
			padding: 54px 18px 28px !important;
			background: #fff !important;
			overflow-y: auto !important;
			-webkit-overflow-scrolling: touch;
			transform: translateX(103%);
			transition: transform .26s ease !important;
			visibility: hidden;
			box-shadow: -8px 0 28px rgba(16, 24, 40, .18) !important;
			z-index: 2147483000 !important;
		}
		#mobile-menu.sidemenu.ccs-drawer-open {
			transform: translateX(0);
			visibility: visible;
		}

		/* Themify's own scrim is retired in favour of one we control. */
		.body-overlay {
			display: none !important;
		}
		#ccs-scrim {
			position: fixed;
			top: 0;
			right: 0;
			bottom: 0;
			left: 0;
			background: rgba(10, 17, 28, .62);
			opacity: 0;
			visibility: hidden;
			transition: opacity .26s ease, visibility 0s linear .26s;
			z-index: 2147482999;
		}
		#ccs-scrim.ccs-scrim-on {
			opacity: 1;
			visibility: visible;
			transition: opacity .26s ease;
		}

		/* Admin bar sits above everything for logged-in users; keep the close
		   button clear of it. */
		body.admin-bar #mobile-menu.sidemenu {
			top: 32px !important;
		}

		/* Drawer head. */
		/* Themify reveals the close button by stripping .tf_hide, and snippet 31
		   creates the search row with an inline display:none and un-hides it from
		   its own toggle. Neither of those toggles runs any more, so show both
		   outright -- the drawer they live in is hidden when closed anyway. */
		#mobile-menu #menu-icon-close {
			display: block !important;
			position: absolute !important;
			top: 10px !important;
			right: 12px !important;
			width: 40px !important;
			height: 40px !important;
			padding: 0 !important;
			margin: 0 !important;
			z-index: 2 !important;
		}
		/* The theme drew this X from a rule scoped to #headerwrap, which no longer
		   matches now that the drawer lives on <body>. Draw it here instead. */
		#mobile-menu #menu-icon-close::before,
		#mobile-menu #menu-icon-close::after {
			content: "";
			position: absolute;
			left: 11px;
			top: 19px;
			width: 18px;
			height: 2px;
			border-radius: 2px;
			background: #111;
		}
		#mobile-menu #menu-icon-close::before {
			transform: rotate(45deg);
		}
		#mobile-menu #menu-icon-close::after {
			transform: rotate(-45deg);
		}
		#mobile-menu #ccs-mob-bar {
			display: block !important;
			border-top: 0 !important;
		}
		#mobile-menu #main-nav-wrap {
			margin-top: 0 !important;
		}
	}

	@media screen and (max-width: 782px) {
		body.admin-bar #mobile-menu.sidemenu {
			top: 46px !important;
		}
	}

	@media screen and (min-width: 1201px) {
		#ccs-scrim {
			display: none !important;
		}
	}