/**
 * Luga.bg My Account navigation.
 *
 * A focused port of the sidebar layout the site used before, covering only the
 * markup this plugin renders. The custom property names are kept identical to
 * the previous ones so existing overrides in the Luga.bg design layer and in
 * the Customizer keep applying without edits.
 */

/**
 * PROFILE CARD
 *
 * Deliberately selected through the .yith-wcmap class rather than the
 * #my-account-menu id. These are base styles that the Luga.bg design layer is
 * meant to override, and that layer targets the profile with class selectors.
 * Raising the specificity here with an id would silently win against it, which
 * is how the logout button ends up with the plain grey background instead of
 * the designed one.
 */
.yith-wcmap .user-profile {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	margin-bottom: 30px;
}

.yith-wcmap .user-profile .user-avatar {
	margin-right: 20px;
}

.yith-wcmap .user-profile .user-avatar img {
	border-radius: var(--ywcmap-avatar-border-radius, 0);
	/* Uploaded avatars are not always square; cover the box instead of stretching. */
	object-fit: cover;
	aspect-ratio: 1 / 1;
}

.yith-wcmap .user-profile .user-avatar.avatar-upload {
	cursor: pointer;
	position: relative;
}

.yith-wcmap .user-profile .user-avatar.avatar-upload:after {
	content: "";
	display: block;
	position: absolute;
	right: -5px;
	bottom: -10px;
	width: 35px;
	height: 35px;
	border-radius: 50%;
	background: url("../images/photo.svg") #29ac8f no-repeat;
	background-position: 8px 9px;
	background-size: 18px;
}

.yith-wcmap .user-profile .user-info > span {
	display: block;
	margin-bottom: 7px;
	line-height: normal;
}

.yith-wcmap .user-profile .user-info .username {
	font-weight: 600;
}

.yith-wcmap .user-profile .user-info .user-email {
	font-size: 80%;
}

.yith-wcmap .user-profile .user-info .logout a {
	padding: 2px 10px;
	font-size: 80%;
	text-decoration: none;
	text-transform: uppercase;
	border: 0;
	color: var(--ywcmap-logout-text-color, #ffffff);
	background-color: var(--ywcmap-logout-background-color, #c0c0c0);
}

.yith-wcmap .user-profile .user-info .logout a:hover {
	color: var(--ywcmap-logout-text-color-hover, #ffffff);
	background-color: var(--ywcmap-logout-background-color-hover, #333333);
}

.yith-wcmap.position-vertical-right .user-profile {
	flex-direction: row-reverse;
}

.yith-wcmap.position-vertical-right .user-profile .user-avatar {
	margin-right: 0;
	margin-left: 10px;
}

.yith-wcmap.position-vertical-right .user-profile .user-info {
	text-align: right;
}

/** MENU **/
#my-account-menu {
	font-size: var(--ywcmap-font-size, 16px);
	width: 30%;
	box-sizing: border-box;
}

#my-account-menu ~ .woocommerce-MyAccount-content {
	width: 67%;
	box-sizing: border-box;
	margin: 0;
}

#my-account-menu ~ .woocommerce-MyAccount-content .woocommerce-MyAccount-content {
	float: none;
	width: 100%;
	margin: 0;
}

#my-account-menu .myaccount-menu {
	list-style: none;
	padding: 0;
	margin: 0 0 30px;
}

#my-account-menu .myaccount-menu li {
	position: relative;
}

#my-account-menu .myaccount-menu li.active,
#my-account-menu .myaccount-menu li.is-active {
	font-weight: bold;
}

/* The borderless layout shows the menu background through, so item
   backgrounds are only painted for the layouts that ask for them. */
#my-account-menu.layout-simple .myaccount-menu li,
#my-account-menu.layout-modern .myaccount-menu li {
	background-color: var(--ywcmap-items-background-color, #ffffff);
}

#my-account-menu.layout-simple .myaccount-menu li:hover,
#my-account-menu.layout-modern .myaccount-menu li:hover {
	background-color: var(--ywcmap-items-background-color-hover, #ffffff);
}

#my-account-menu.layout-simple .myaccount-menu li.active,
#my-account-menu.layout-simple .myaccount-menu li.is-active,
#my-account-menu.layout-modern .myaccount-menu li.active,
#my-account-menu.layout-modern .myaccount-menu li.is-active {
	background-color: var(--ywcmap-items-background-color-active, #ffffff);
}

#my-account-menu .myaccount-menu li a {
	display: flex;
	align-items: center;
	padding: var(--ywcmap-menu-items-padding, 12px 5px 12px 0);
	font-style: normal;
	font-weight: 500;
	text-align: left;
	text-decoration: none;
	box-shadow: none;
	outline: none;
	color: var(--ywcmap-items-text-color, #777777);
	margin: 0;
	cursor: pointer;
}

#my-account-menu .myaccount-menu li a > span:last-child {
	flex: 1 1 auto;
}

#my-account-menu .myaccount-menu li a span.item-icon {
	width: 20px;
	margin-right: 10px;
}

#my-account-menu .myaccount-menu li a span.item-icon img {
	max-width: 20px;
	height: auto;
	display: block;
	width: 100%;
}

#my-account-menu .myaccount-menu li a:hover {
	color: var(--ywcmap-items-text-color-hover, #000000);
}

#my-account-menu .myaccount-menu li.active a,
#my-account-menu .myaccount-menu li.is-active a {
	color: var(--ywcmap-items-text-color-active, #000000);
}

/** SIMPLE LAYOUT BORDERS **/
#my-account-menu.layout-simple .myaccount-menu:before {
	border-bottom: 1px solid var(--ywcmap-menu-border-color, #e0e0e0);
	padding: 10px 0;
	content: "";
	display: block;
}

#my-account-menu.layout-simple .myaccount-menu:after {
	padding: 60px 0;
	content: "";
	display: block;
}

#my-account-menu.layout-simple .myaccount-menu > li {
	border-bottom: 1px solid var(--ywcmap-menu-border-color, #e0e0e0);
}

#my-account-menu.layout-simple.position-vertical-left .myaccount-menu:before,
#my-account-menu.layout-simple.position-vertical-left .myaccount-menu:after,
#my-account-menu.layout-simple.position-vertical-left .myaccount-menu li a {
	border-right: 1px solid var(--ywcmap-menu-border-color, #e0e0e0);
}

#my-account-menu.layout-simple.position-vertical-left .myaccount-menu li.active a,
#my-account-menu.layout-simple.position-vertical-left .myaccount-menu li.is-active a {
	border-right: 0;
}

#my-account-menu.layout-simple.position-vertical-right .myaccount-menu:before,
#my-account-menu.layout-simple.position-vertical-right .myaccount-menu:after,
#my-account-menu.layout-simple.position-vertical-right .myaccount-menu li a {
	border-left: 1px solid var(--ywcmap-menu-border-color, #e0e0e0);
}

#my-account-menu.layout-simple.position-vertical-right .myaccount-menu li > a {
	text-align: right;
}

#my-account-menu.layout-simple.position-vertical-right .myaccount-menu li.active a,
#my-account-menu.layout-simple.position-vertical-right .myaccount-menu li.is-active a {
	border-left: 0;
}

/** MODERN LAYOUT **/
#my-account-menu.layout-modern .myaccount-menu > li {
	border: 1px solid var(--ywcmap-items-border-color, #eaeaea);
	border-radius: 10px;
	margin-bottom: 15px;
	overflow: hidden;
	box-shadow: 0 0 16px 0 var(--ywcmap-items-shadow-color, rgba(114, 114, 114, 0.16));
	transition: all 0.3s ease;
}

#my-account-menu.layout-modern .myaccount-menu > li:hover {
	border-color: var(--ywcmap-items-border-color-hover, #cceae9);
	box-shadow: 0 0 16px 0 var(--ywcmap-items-shadow-color-hover, rgba(3, 163, 151, 0.16));
}

#my-account-menu.layout-modern .myaccount-menu > li.active,
#my-account-menu.layout-modern .myaccount-menu > li.is-active {
	border-color: var(--ywcmap-items-border-color-active, #cceae9);
	box-shadow: 0 0 16px 0 var(--ywcmap-items-shadow-color-active, rgba(3, 163, 151, 0.16));
}

/** NO-BORDERS LAYOUT **/
#my-account-menu.layout-no-borders {
	position: relative;
	padding: 20px 0;
}

#my-account-menu.layout-no-borders:before {
	content: "";
	background: var(--ywcmap-menu-background, #f4f4f4);
	top: 0;
	bottom: 0;
	display: block;
	position: absolute;
	right: 0;
	left: 0;
	z-index: -1;
}

#my-account-menu.layout-no-borders.position-vertical-left:before {
	margin-left: -50vw;
}

#my-account-menu.layout-no-borders.position-vertical-right:before {
	margin-right: -50vw;
}

/** POSITION **/
#my-account-menu.position-vertical-left {
	float: left;
	margin-right: 3%;
}

#my-account-menu.position-vertical-left ~ .woocommerce-MyAccount-content {
	float: right;
}

#my-account-menu.position-vertical-right {
	float: right;
	margin-left: 3%;
}

#my-account-menu.position-vertical-right ~ .woocommerce-MyAccount-content {
	float: left;
}

#my-account-menu.position-vertical-right li a {
	flex-direction: row-reverse;
	text-align: right;
}

#my-account-menu.position-vertical-right li a span.item-icon {
	margin-right: 0;
	margin-left: 10px;
}

/** RESPONSIVE **/
@media (max-width: 768px) {
	#my-account-menu .myaccount-menu li .item-icon {
		display: none;
	}
}

@media (max-width: 480px) {
	#my-account-menu {
		float: none !important;
		margin-right: 0 !important;
		margin-left: 0 !important;
		width: 100%;
		margin-bottom: 25px;
	}

	#my-account-menu ~ .woocommerce-MyAccount-content,
	#my-account-menu .woocommerce-MyAccount-content {
		float: none !important;
		width: 100%;
	}

	#my-account-menu .myaccount-menu,
	#my-account-menu .myaccount-menu li {
		display: block;
	}
}

/** AVATAR MODAL **/
#luga-mya-avatar[hidden] {
	display: none;
}

#luga-mya-avatar .avatar-modal-overlay {
	position: fixed;
	width: 100%;
	height: 100%;
	top: 0;
	left: 0;
	background-color: rgba(0, 0, 0, 0.5);
	z-index: 1000;
}

#luga-mya-avatar .avatar-modal-wrapper {
	position: fixed;
	width: 100%;
	height: 100%;
	top: 0;
	left: 0;
	z-index: 1001;
	overflow-x: hidden;
	overflow-y: auto;
	display: flex;
	align-items: center;
}

#luga-mya-avatar .avatar-modal-wrapper-region {
	padding: 20px;
	width: 100%;
}

#luga-mya-avatar .avatar-modal {
	position: relative;
	margin: 0 auto;
	max-width: 440px;
	background: #ffffff;
	border-radius: 8px;
}

#luga-mya-avatar .avatar-modal-close {
	position: absolute;
	right: 10px;
	top: 10px;
	padding: 0;
	line-height: 1;
	cursor: pointer;
	color: #c0c0c0;
	background: none;
	border: 0;
}

#luga-mya-avatar .avatar-modal-close:hover {
	color: #777777;
}

#luga-mya-avatar .avatar-modal-content {
	padding: 15px 30px 30px;
}

#luga-mya-avatar .avatar-modal-content.is-busy {
	opacity: 0.6;
	pointer-events: none;
}

#luga-mya-avatar .avatar-modal-content h3 {
	text-align: center;
	margin: 10px 0 20px;
	font-size: 25px;
	font-weight: 600;
}

#luga-mya-avatar .cols-wrapper {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	justify-content: space-evenly;
}

#luga-mya-avatar .cols-wrapper .single-col {
	flex: 0 0 auto;
	width: 150px;
	margin: 10px;
}

#luga-mya-avatar .avatar-select > div {
	height: 150px;
	border-radius: 8px;
}

#luga-mya-avatar .avatar-select img {
	width: 150px;
	height: 150px;
	object-fit: cover;
	border-radius: 8px;
}

#luga-mya-avatar .avatar-select form {
	width: 100%;
	height: 100%;
	margin: 0;
	background: #f0f0f0;
	border-radius: 8px;
	display: table;
}

#luga-mya-avatar .avatar-select form label {
	display: table-cell;
	vertical-align: middle;
	text-align: center;
	color: #6d6d6d;
	cursor: pointer;
}

#luga-mya-avatar .avatar-select form input[type="file"] {
	display: none;
}

#luga-mya-avatar .avatar-error {
	margin: 14px 0 0;
	text-align: center;
	color: #b32d2e;
}

#luga-mya-avatar .avatar-actions {
	margin-top: 6px;
}

#luga-mya-avatar .avatar-actions a {
	text-decoration: none;
	outline: none;
	font-weight: 600;
}

#luga-mya-avatar .avatar-actions a.cancel {
	display: none;
	color: #aaa;
}

#luga-mya-avatar .avatar-actions a.cancel:hover {
	text-decoration: underline;
}

#luga-mya-avatar .avatar-actions a.reset {
	font-weight: 500;
	font-size: 14px;
	color: #00678a;
}

#luga-mya-avatar .avatar-actions a.reset[hidden] {
	display: none;
}

#luga-mya-avatar .avatar-actions a.reset i {
	margin-right: 5px;
}

#luga-mya-avatar .avatar-actions a.reset:hover {
	color: #2e80a9;
}

#luga-mya-avatar .avatar-actions .set-avatar {
	visibility: hidden;
	text-align: right;
}

#luga-mya-avatar .avatar-actions .set-avatar button {
	border-radius: 8px;
	background: #00678a;
	color: #fff;
}

#luga-mya-avatar .avatar-actions .set-avatar button:hover,
#luga-mya-avatar .avatar-actions .set-avatar button:focus {
	background: #2e80a9;
	color: #fff;
	transition: all 0.3s ease;
}

#luga-mya-avatar .avatar-modal-content:not(.avatar-uploaded) .current-avatar {
	position: relative;
	box-shadow: 0 0 14px 0 rgba(0, 98, 145, 0.5);
	border-radius: 8px;
}

#luga-mya-avatar .avatar-modal-content:not(.avatar-uploaded) .current-avatar:after,
#luga-mya-avatar .avatar-modal-content.avatar-uploaded .new-avatar:after {
	content: "\f00c";
	font-family: "FontAwesome";
	font-size: 25px;
	line-height: 25px;
	color: #97ca2d;
	position: absolute;
	top: -10px;
	right: -10px;
}

#luga-mya-avatar .avatar-modal-content.avatar-uploaded .current-avatar {
	opacity: 0.3;
}

#luga-mya-avatar .avatar-modal-content.avatar-uploaded .new-avatar {
	position: relative;
	box-shadow: 0 0 14px 0 rgba(0, 98, 145, 0.5);
	border-radius: 8px;
}

#luga-mya-avatar .avatar-modal-content.avatar-uploaded .avatar-actions .set-avatar {
	visibility: visible;
}

#luga-mya-avatar .avatar-modal-content.avatar-uploaded .avatar-actions a.reset {
	display: none;
}

#luga-mya-avatar .avatar-modal-content.avatar-uploaded .avatar-actions a.cancel {
	display: block;
}
