/**
 * EDD Admin Menu CSS
 *
 * @package     EDD
 * @subpackage  Admin CSS
 * @copyright   Copyright (c) 2015, Pippin Williamson
 * @license     http://opensource.org/licenses/gpl-2.0.php GNU Public License
*/

@use "~@wordpress/base-styles/breakpoints" as wp-breakpoints;
@use "../variables/colors";


/* Main Menu
-------------------------------------------------------------- */
#menu-posts-download .wp-submenu {
	display: flex;
	flex-wrap: wrap;
	li {
		width: 100%;
	}
}

@media screen and (max-width: wp-breakpoints.$break-mobile) {
	#menu-posts-download.wp-not-current-submenu .wp-submenu {
		display: none;
	}
}

/* Submenu Styles
-------------------------------------------------------------- */

#menu-posts-download a[href^="edit.php?post_type=download"] {
	&:hover,
	&:focus {
		box-shadow: inset 4px 0 0 0 currentColor;
		transition: box-shadow .1s linear;
	}
}

#menu-posts-download li > a[href^="post-new.php?post_type=download"] {
	display: none;
}

/* Secondary Separators */
#menu-posts-download li:not(:last-child) a[href^="post-new.php?post_type=download"]:after,
#menu-posts-download li:not(:last-child) a[href^="edit.php?post_type=download&page=edd-discount"]:after,
#menu-posts-download li:not(:last-child) a[href^="edit.php?post_type=download&page=edd-reports"]:after,
#menu-posts-download li:nth-last-child(2) a:after {
	border-bottom: 1px solid rgba(255, 255, 255, 0.2);
	display: block;
	float: left;
	margin: 13px -15px 8px;
	content: '';
	width: calc(100% + 26px);

	@media screen and (max-width: wp-breakpoints.$break-medium) {
		margin: 20px -20px 8px -20px;
		width: calc(100% + 30px);
	}
}

#adminmenu #menu-posts-download {
	/* WordPress 5.7 fix for left-shadow on hover */
	ul.wp-submenu-wrap li {
		clear: both;
	}

	a.wp-has-current-submenu:after {
		display: none;
	}
}

/* Show Submenu Arrow */
ul#adminmenu #menu-posts-download ul.wp-submenu li.current a:before {
	right: 0;
	border: solid 8px transparent;
	content: " ";
	height: 0;
	width: 0;
	position: absolute;
	pointer-events: none;
	border-right-color: colors.$wp-gray-0;
	margin-top: 2px;
}

/* Onboarding Submenu Item */
a.edd-onboarding__menu-item {
	background: #dd823b !important;
	color: colors.$white !important;
	font-weight: 600;
	&:hover {
		color: colors.$black !important;
	}
}

a.edd-sidebar__upgrade-pro,
a.edd-sidebar__upgrade-pro:hover {
	background-color: colors.$edd-pro-upgrade !important;
	color: colors.$white !important;
	font-weight: 600;
}

.edd-admin-menu__new {
	color: colors.$warning;
	vertical-align: super;
	font-size: 9px;
	margin-left: 3px;
}
