.bgsubnav {
	background: #ddd;
	filter: drop-shadow( 0px 1px 2px #aaa );
	font-family: Roboto, sans-serif;
}

.bgsubnav ol,
.bgsubnav ul {
	list-style: none;
	margin: 0;
	padding-left: 0;
}

/* Override styles by the parent theme that add the li's count before it. */
.bgsubnav ol li::before {
	content: none;
}

/* Top level li's. */
.bgsubnav nav > ol > li {
	color: #000;
	display: block;
	padding: 0;
	position: relative;
	text-decoration: none;
	margin: 0;
	/* Theme fix. */
	background: transparent;
	letter-spacing: 0.08em;
}

/* Top level li's on hover. */
.bgsubnav nav > ol > li:hover,
.bgsubnav nav > ol > li:focus-within {
	background: #21759b;
	color: #fff;
	cursor: pointer;
}

.bgsubnav nav > ul > li > ul a {
	color: #21759b;
}

/* Top level li links. */
.bgsubnav nav > ol > li > a {
	color: #000;
	text-transform: uppercase;
	font-size: 11px;
	font-weight: inherit;
	letter-spacing: 2px;
	line-height: 40px;
	height: 40px;
	padding: 0px 10px 0px 10px;
	vertical-align: baseline;
	width: auto;
	text-decoration: none;
}

/* Top level li on hover elements. */
.bgsubnav nav > ol > li:hover > a,
.bgsubnav nav > ol > li:hover .dashicons-arrow-down,
.bgsubnav nav > ol > li:focus-within > a,
.bgsubnav nav > ol > li:focus-within .dashicons-arrow-down {
	color: #fff;
}

.bgsubnav li:focus-within a {
	outline: none;
}

.bgsubnav nav > ol > li:not(:last-of-type)::after {
	content: "»";
	padding: 0 10px 0 0;
}

.bgsubnav nav > ol > li > ul {
	visibility: hidden;
	opacity: 0;
	color: #000;
	position: absolute;
	margin-top: 0;
	left: 0;
	display: none;
	z-index: 1;
	cursor: initial;
	padding: 0;
	background-color: #eee;
	border-radius: 0 0 2px 2px;
	box-shadow: 0px 6px 12px 0px rgba( 0, 0, 0, 0.18 );
}

.bgsubnav ul.dropdown a {
	color: #21759b;
}

.bgsubnav ol li ul li {
	clear: both;
	width: 100%;
	padding: 2px 5px;
	font-size: 16px;
	line-height: 24px;
	color: #000;
}

.bgsubnav .dashicons.dashicons-arrow-down {
	font-size: 15px;
	vertical-align: middle;
	color: #000;
	width: 19px;
	height: auto;
	margin-left: -8px;
	transition: none;
}

.bgsubnav ol li ul li .bgsubnav-separator {
	border-bottom: 1px solid #ddd;
	margin-bottom: 10px;
	padding-bottom: 10px;
}

.bgsubnav ol li ul li .bgsubnav-top-separator {
	border-top: 1px solid #ddd;
	margin-top: 10px;
	padding-top: 10px;
}

.bgsubnav-orange {
	color: #f95b26 !important;
}

/* Allow the drop down menu to show when the parent has ".expanded" */
.bgsubnav ol li.bgsubnav-expanded ul {
	visibility: visible;
	opacity: 1;
	display: block;
}

/**
 * Logos in dropdown.
 */

[class^='bgsubnav-logo-'] > a::before {
	background-size: 30px 30px;
	display: inline-block;
	width: 30px;
	height: 30px;
	content:"";
	margin-right: 5px;
	vertical-align: text-bottom;
}

.bgsubnav-logo-w3-total-cache > a::before {
	background-image: url( '../img/subnav-logo-w3-total-cache.png' );
	background-size: 34px 30px;
	width: 34px;
	height: 30px;
}

.bgsubnav-logo-boldgrid-easy-seo > a::before {
	background-image: url( '../img/subnav-logo-boldgrid-easy-seo.png' );
}

.bgsubnav-logo-post-and-page-builder > a::before {
	background-image: url( '../img/subnav-logo-post-and-page-builder.png' );
}

.bgsubnav-logo-total-upkeep > a::before {
	background-image: url( '../img/subnav-logo-total-upkeep.png' );
}

.bgsubnav-logo-wordpress-website-builder > a::before {
	background-image: url( '../img/subnav-logo-wordpress-website-builder.png' );
}

.bgsubnav-logo-crio > a::before {
	background-image: url( '../img/subnav-logo-crio.png' );
}

.bgsubnav-logo-wordpress-hosting > a::before {
	background-image: url( '../img/subnav-logo-wordpress-hosting.png' );
}

.bgsubnav-logo-speed-coach > a::before {
	background-image: url( '../img/subnav-logo-speed-coach.png' );
	background-size: 22px 30px;
	width: 22px;
	height: 30px;
}

.bgsubnav-logo-cloud-wordpress > a::before {
	background-image: url( '../img/subnav-logo-cloud-wordpress.png' );
	background-size: 43px 30px;
	width: 43px;
	height: 30px;
}


@media ( max-width: 480px ) {
	/* Prevent z-index issues. */
	.bgsubnav ul.dropdown {
		position: relative;
	}
}

@media ( min-width: 481px ) {
	.bgsubnav li {
		float: left;
	}
	
	.bgsubnav nav > ol > li > ul {
		width: max-content;
	}
}

@media ( max-width: 992px ) {
	/* On small screens, the dropdown will be aligned left and will be width 100%. */
	.bgsubnav nav > ol > li {
		position: unset;
	}
	
	.bgsubnav ul.dropdown {
		width: 100%;
	}
	
	.bgsubnav .col-md-12 {
		padding: 0;
	}
}

@media ( min-width: 993px ) {
	/* On larger screens, menu will drop down simply on hover. */
	.bgsubnav ol li:hover > ul,
	.bgsubnav ol li:focus-within > ul,
	.bgsubnav ol li ul:hover,
	.bgsubnav ol li ul:focus {
		visibility: visible;
		opacity: 1;
		display: block;
	}
}


/**
 * Dropdown columns.
 */

/* The .dropdown was added for css specificity so that ul:focus does not set display to block. */
.bgsubnav .dropdown ul.bgsubnav-col {
	padding: 12px 10px;
	display: grid;
	grid-template-columns: minmax( 250px, max-content ) max-content;
}

/* The white box, the first column. */
ul.bgsubnav-col > li:first-child {
	box-shadow: 0px 6px 12px 0px rgba(0, 0, 0, 0.18);
	background: #fff;
	padding: 10px 15px;
}

/* The support box, the second column. */
ul.bgsubnav-col > li:nth-of-type(2) {
	padding-top: 0;
	margin: 0 5px 0 15px;
}

/* Marketing pages in first column. */
ul.bgsubnav-col > li:first-child ul {
	list-style-type: square;
	list-style-position: inside;
	margin-top: 10px;
}

/* Support pages in the second column. */
ul.bgsubnav-col > li:nth-of-type(2) ul {
	margin-top: 5px;
}

ul.bgsubnav-col > li:nth-of-type(2) li {
	padding: 0px;
	font-size: 14px;
}

/* Headings. */
ul.bgsubnav-col > li > a:first-child {
	font-size: 18px;
}

@media ( max-width: 480px ) {
	.bgsubnav .dropdown ul.bgsubnav-col {
		/* Make the 2 columns stack on really small views. */
		grid-template-columns: max-content;
		row-gap: 15px;
	}
}


/**
 * Sticky Subnav.
 *
 * Stickiness is toggled with js.
 */

@media ( min-width: 481px ) {
	/* Unstick the main sticky nav. */
	.bgsubnav-unstick-nav header#masthead {
		position: relative;
	}

	/* Adjust margin / paddings fo the main / site content. */
	.bgsubnav-unstick-nav .site-content {
		margin-top: 0;
		padding-top: 0 !important;
	}
	.bgsubnav-unstick-nav #content main.main {
		padding-top: 0 !important;
	}
	.page-template-learning-center-loop div.bgsubnav.bgsubnav-sticky {
		margin-top: 0;
	}

	/* Stick the subnav. */
	.bgsubnav-sticky {
		position: sticky;
		top: 0;
		z-index: 10;
	}
}

/**
 * Buy Pro button.
 */

.bgsubnav-upgrade {
	float: right;
	border-radius: 5px;
	height: 30px;
	line-height: 20px;
	padding: 5px 15px;
	margin-top: 5px;
	font-family: 'Exo 2';
	font-size: 12px;
	text-transform: uppercase;
}

@media ( max-width: 992px ) {
	.bgsubnav-upgrade {
		float: none;
		margin: 10px auto;
		display: block;
		width: fit-content;
	}
}
