@import "abstracts/variables";
@import "mixins/normal_mixins.scss";
/** Public related CSS */

@keyframes spin {
	from {
		transform: rotate(0deg);
	}
	to {
		transform: rotate(360deg);
	}
}

.tgwc-woocommerce-customize-my-account {
	#tgwc-woocommerce {
		display: flex;

		.tgwc-icon {
			width: 0.875em;
			height: 1em;
			vertical-align: -0.125em;
			display: inline-block;
			font-size: inherit;
		}

		.woocommerce-MyAccount-content {
			flex: 1;
		}

		&[data-menu-style="tab"] {
			flex-direction: column;

			.tgwc-woocommerce-MyAccount-navigation,
			.woocommerce-MyAccount-content {
				width: 100%;
				grid-column: auto;
			}

			.bsMyAccount {
				width: 100%;
				display: flex;
				flex-direction: column;
			}

			.tgwc-woocommerce-MyAccount-navigation {
				display: flex;
				flex-direction: row;
				max-width: 100%;

				.tgwc-woocommerce-MyAccount-navigation-wrap {
					margin: 20px 0;

					> ul {
						> li {
							min-width: fit-content;
						}

						&:not(.scroll_tabs_container) {
							overflow: hidden;
							display: flex;
						}
					}
				}

				ul {
					li {
						white-space: nowrap;
						position: static;

						a {
							padding: 8px 12px;
							border-bottom: 2px solid transparent;
							transition: all 0.25s ease 0s;

							&:hover {
								border-color: $border-color;
							}
						}

						ul {
							display: none;
							flex-direction: column;
							position: absolute;
							width: 160px;
							max-width: 160px;
							border-radius: 4px;
							box-shadow: 0 1px 6px 1px
								transparentize($color__gray-900, 0.9);
							z-index: 10;
							background: #fff;
						}

						&.is-active {
							a {
								border-bottom: 2px solid currentColor;
							}
						}

						&:hover {
							ul {
								display: flex;
							}
						}
					}

					// Customize Scrollbar style
					&.scroll_tabs_container {
						height: inherit;

						li {
							background: transparent;
							padding: 0;
							line-height: inherit;
						}

						.scroll_tab_left_button,
						.scroll_tab_right_button {
							height: inherit;
							bottom: 0;

							&.scroll_arrow_disabled {
								visibility: hidden;
								opacity: 0;
							}

							&::before {
								content: "";
								width: 10px;
								height: 10px;
								padding: 0;
								line-height: inherit;
								display: block;
								position: absolute;
								top: 50%;
								left: 0;
								right: 0;
								margin: 0 auto;
								border: 2px solid $color__gray-900;
								border-left: transparent;
								border-bottom: transparent;
							}
						}

						.scroll_tab_left_button {
							background: linear-gradient(
								to left,
								transparentize($color__white, 1) 0,
								transparentize($color__white, 0.3)
							);

							&::before {
								transform: translateY(-50%) rotate(225deg);
							}
						}

						.scroll_tab_right_button {
							background: linear-gradient(
								to right,
								transparentize($color__white, 1) 0,
								transparentize($color__white, 0.3)
							);

							&::before {
								transform: translateY(-50%) rotate(45deg);
							}
						}

						.scroll_tab_inner {
							height: auto;
							position: static !important;
							font-size: unset !important;
							display: flex;

							> li {
								min-width: fit-content;
							}
						}
					}
				}
			}
		}

		&[data-menu-style="sidebar"] {
			grid-auto-flow: column;
			.bsMyAccount {
				width: 100%;
				display: flex;
			}
			.tgwc-woocommerce-MyAccount-navigation {
				width: 100%;
				max-width: 280px;
			}

			.tgwc-woocommerce-MyAccount-navigation,
			.woocommerce-MyAccount-content {
				position: relative;
				padding-right: 15px;
				padding-left: 15px;
				margin: 0;
			}

			.tgwc-woocommerce-MyAccount-navigation-wrap {
				.tgwc-nav-tab-left-scroll,
				.tgwc-nav-tab-right-scroll {
					display: none;
				}
			}

			ul {
				li {
					ul {
						padding-left: 20px;
					}

					&.woocommerce-MyAccount-navigation-link {
						&.is-active a {
							border-width: 1px 0 0;
							border-style: solid;
							border-color: $border-color;
						}
						a {
							border-width: 1px 0 0;
							border-style: solid;
							border-color: $border-color;
							img {
								width: 24px;
								height: 24px;
							}
						}
					}
				}
			}

			&[data-sidebar-position="left"] {
				.tgwc-woocommerce-MyAccount-navigation {
					position: sticky;
					position: -webkit-sticky;
					top: 16px;
					align-self: flex-start;
					grid-column: 1/2;
				}

				.woocommerce-MyAccount-content {
					grid-column: 2/-1;
				}
			}

			&[data-sidebar-position="right"] {
				flex-direction: row-reverse;

				.tgwc-woocommerce-MyAccount-navigation {
					grid-column: 4/-1;
				}

				.woocommerce-MyAccount-content {
					grid-column: 1/4;
				}
			}
		}

		.tgwc-woocommerce-MyAccount-navigation {
			ul {
				margin: 0;
				list-style: none;
				padding: 0;

				li {
					margin: 0;
					border: none;

					a {
						display: flex;
						align-items: center;
						text-decoration: none;
						padding: 12px 0;
						word-break: break-all;
						white-space: normal;

						&::before,
						&::after {
							content: none;
						}

						span {
							flex: 1;
							display: flex;
							align-items: center;
						}
					}

					&.tgwc-group {
						&[data-collapsed="true"] > ul {
							display: none;
						}
						> a {
							flex-direction: row-reverse;
							> span {
								background: inherit;
								color: inherit;
								line-height: unset;
								padding-right: 0;
								padding-left: 0;
							}

							> svg {
								width: 12px;
								height: auto;
							}
						}

						&.tgwc-navicon-right,
						&.tgwc-navicon-left {
							> a {
								flex-direction: row;
							}
						}
					}

					&.tgwc-navicon-left {
						a,
						a > span {
							justify-content: flex-end;
							flex-direction: row-reverse;

							svg {
								margin-right: 8px;
							}
						}
					}

					&.tgwc-navicon-right {
						a,
						a > span {
							justify-content: space-between;

							svg {
								margin-left: 8px;
							}
						}
					}
				}
			}
		}

		@media (max-width: 768px) {
			&[data-menu-style][data-sidebar-position] {
				grid-template-columns: auto;
				grid-auto-flow: row;

				.tgwc-woocommerce-MyAccount-navigation,
				.woocommerce-MyAccount-content {
					grid-column: auto;
				}
			}
		}
	}
}

/**
 * User Avatar
 **/
.tgwc-user-avatar {
	display: flex;
	flex-wrap: wrap;
	flex-direction: column;

	@at-root {
		[data-menu-style="sidebar"] & {
			margin-bottom: 24px;
		}
	}

	.dropzone {
		background: transparent;
		padding: 0;
		margin: 0;
		min-height: auto;
		border: none;

		.tgwc-user-avatar-image-wrap {
			width: 96px;
			height: 96px;
			position: relative;
			overflow: hidden;
			margin-bottom: 8px;

			.tgwc-remove-image,
			.tgwc-user-avatar-upload-icon {
				visibility: hidden;
				transition: all ease 0.4s;
				@include prefix(transition, all ease 0.4s);
				opacity: 0;
			}

			&:hover {
				.tgwc-remove-image,
				.tgwc-user-avatar-upload-icon {
					visibility: visible;
					opacity: 1;
				}
			}

			.avatar {
				width: 100%;
				height: 100%;
			}

			.tgwc-user-avatar-upload-icon,
			.tgwc-remove-image {
				color: $color__white;
				background: transparentize($color__gray-900, 0.5);
				padding: 4px;
				height: 24px;
				width: 24px;
				border-radius: 4px;
				position: absolute;
				right: 8px;
				cursor: pointer;
				line-height: 1;
			}
			.tgwc-remove-image {
				padding: 2px 4px;
			}
			.tgwc-user-avatar-upload-icon {
				bottom: 8px;
				display: inline-flex;
				align-items: center;
			}

			.tgwc-remove-image {
				top: 8px;
			}

			.tgwc-progress {
				position: absolute;
				top: 50%;
				left: 50%;
				transform: translate(-50%, -50%);
				text-align: center;
				margin: 0 auto;
				color: $color__white;

				&--loading {
					.tgwc-icon {
						animation: spin 1000ms infinite linear;
					}
				}
			}

			&.tgwc-user-avatar-image-wrap--square {
				border-radius: 4px;
			}

			&.tgwc-user-avatar-image-wrap--circle {
				border-radius: 50%;

				.tgwc-user-avatar-upload-icon {
					left: 0;
					right: 0;
					margin: 0 auto;
				}
			}
		}

		.dz-default {
			&.dz-message {
				margin: 16px 0;
			}
		}
	}

	.tgwc-user-info {
		.tgwc-user-id {
			display: block;
			font-size: 20px;
			font-weight: 600;
			margin-top: 8px;
			margin-bottom: 16px;
		}
	}

	&.tgwc-user-avatar--right-aligned,
	&.tgwc-user-avatar--center-aligned {
		flex-direction: column;
	}

	&.tgwc-user-avatar--right-aligned {
		text-align: right;
		align-items: flex-end;
	}

	&.tgwc-user-avatar--center-aligned {
		text-align: center;
		align-items: center;
	}

	&.tgwc-user-avatar--vertical-aligned {
		flex-direction: row;

		.dropzone {
			margin-right: 16px;
		}
	}
}

.tgwc-display-none {
	display: none;
}

#tgwc-file-drop-zone {
	.dz-default.dz-message {
		display: none;
	}
}

.tgwc-hide {
	display: none !important;
}

/* Loading animation */
.woocommerce-MyAccount-content.loading {
	position: relative;
	min-height: 200px;
}

.account-loading {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	text-align: center;
}

.spinner {
	display: inline-block;
	width: 40px;
	height: 40px;
	border: 3px solid rgba(0, 0, 0, 0.1);
	border-radius: 50%;
	border-top-color: #333;
	animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
	to {
		transform: rotate(360deg);
	}
}

/* Active menu item styling */
.woocommerce-MyAccount-navigation-link.is-active a {
	font-weight: 700;
	color: #000;
	position: relative;
}

.woocommerce-MyAccount-navigation-link.is-active a:after {
	content: "";
	position: absolute;
	left: 0;
	bottom: -2px;
	width: 100%;
	height: 2px;
	background-color: currentColor;
}

/* Smooth transitions */
.woocommerce-MyAccount-content {
	transition: opacity 0.3s ease;
}

.woocommerce-MyAccount-content.loading {
	opacity: 0.6;
}

.tgwc-profile-upload-limit-issue {
	display: block;
	padding: 10px 4px;
	margin: 8px;
	margin-left: 0px;
	border: 1px solid #f5c2c7;
	border-radius: 4px;
	background-color: #f8d7da;
	color: #842029;
	font-size: 13px;
	line-height: 1.4;
	position: relative;
}
