/**
 * Header account widget.
 *
 * Location: /assets/css/frontend/account/account-widget.css
 *
 * @package SunTechPortal
 */

.stp-header-account-widget {
	--stp-account-widget-primary: #ff5a00;
	--stp-account-widget-primary-hover: #d94d00;
	--stp-account-widget-badge-bg: #16a34a;
	--stp-account-widget-text: #071326;
	--stp-account-widget-icon: #071326;
	--stp-account-widget-icon-hover: #071326;
	--stp-account-widget-muted: #64748b;
	--stp-account-widget-border: #d7deea;
	--stp-account-widget-border-soft: #e5e7eb;
	--stp-account-widget-bg: #ffffff;
	--stp-account-widget-hover-bg: #fff7ed;
	--stp-account-widget-orange-soft: #fff7ed;
	--stp-account-widget-max-height: 416px;

	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-family: inherit;
}

.stp-header-account-widget *,
.stp-header-account-widget *::before,
.stp-header-account-widget *::after {
	box-sizing: border-box;
}

.stp-header-account-widget a,
.stp-header-account-widget span,
.stp-header-account-widget strong,
.stp-header-account-widget small,
.stp-header-account-widget p,
.stp-header-account-widget button,
.stp-header-account-widget h3 {
	font-family: inherit;
}

.stp-header-account-widget::after {
	content: "";
	position: absolute;
	top: 100%;
	right: 0;
	left: 0;
	z-index: 10019;
	display: none;
	height: 14px;
}

.stp-header-account-widget:not(.is-click-closed):hover::after,
.stp-header-account-widget.is-open::after {
	display: block;
}

.stp-header-account-widget .stp-header-action {
	border: 0;
	cursor: pointer;
}

.stp-account-widget-panel {
	position: absolute;
	top: calc(100% + 12px);
	right: 0;
	z-index: 10020;
	display: flex;
	flex-direction: column;
	width: 314px;
	max-width: calc(100vw - 24px);
	max-height: min(var(--stp-account-widget-max-height), calc(100vh - 150px));
	overflow: hidden;
	padding: 0;
	border: 1px solid var(--stp-account-widget-border);
	border-radius: 16px;
	background: var(--stp-account-widget-bg);
	color: var(--stp-account-widget-text);
	box-shadow: none;
	opacity: 0;
	visibility: hidden;
	transform: translateY(8px);
	transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
	pointer-events: none;
}

.stp-account-widget-panel::before {
	content: "";
	position: absolute;
	top: -7px;
	right: 22px;
	display: block;
	width: 13px;
	height: 13px;
	border-top: 1px solid var(--stp-account-widget-border);
	border-left: 1px solid var(--stp-account-widget-border);
	background: var(--stp-account-widget-bg);
	transform: rotate(45deg);
}

.stp-header-account-widget:not(.is-click-closed):hover .stp-account-widget-panel,
.stp-header-account-widget.is-open .stp-account-widget-panel {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
	pointer-events: auto;
}

.stp-account-widget-profile {
	display: grid;
	grid-template-columns: 46px minmax(0, 1fr);
	gap: 11px;
	align-items: center;
	padding: 14px 16px;
	border-bottom: 1px solid var(--stp-account-widget-border-soft);
	background: var(--stp-account-widget-bg);
}

.stp-account-widget-profile__avatar {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 46px;
	height: 46px;
	overflow: hidden;
	border: 2px solid #ffffff;
	border-radius: 999px;
	background: var(--stp-account-widget-primary);
	color: #ffffff;
	font-size: 17px;
	font-weight: 900;
	letter-spacing: 0.01em;
	line-height: 1;
}

.stp-account-widget-profile__avatar img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: inherit;
}

.stp-account-widget-profile__body {
	min-width: 0;
}

.stp-account-widget-profile__body strong {
	display: flex;
	align-items: center;
	gap: 6px;
	min-width: 0;
	margin: 0;
	overflow: hidden;
	color: var(--stp-account-widget-text);
	font-size: 14px;
	font-weight: 800;
	line-height: 1.25;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.stp-account-widget-profile__body strong .dashicons {
	width: 14px;
	height: 14px;
	color: var(--stp-account-widget-primary);
	font-size: 14px;
	line-height: 1;
}

.stp-account-widget-profile__body > span {
	display: block;
	overflow: hidden;
	margin-top: 3px;
	color: var(--stp-account-widget-muted);
	font-size: 12px;
	font-weight: 600;
	line-height: 1.35;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.stp-account-widget-profile__body em {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	width: fit-content;
	margin-top: 6px;
	padding: 3px 8px;
	border: 1px solid #bbf7d0;
	border-radius: 999px;
	background: #ecfdf5;
	color: #16a34a;
	font-size: 10px;
	font-style: normal;
	font-weight: 800;
	line-height: 1;
}

.stp-account-widget-profile__body em::after {
	content: "✓";
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 12px;
	height: 12px;
	border-radius: 999px;
	background: #16a34a;
	color: #ffffff;
	font-size: 8px;
	line-height: 1;
}

.stp-account-widget-section {
	padding: 12px 16px 0;
}

.stp-account-widget-section--orders {
	padding-top: 12px;
}

.stp-account-widget-section h3,
.stp-account-widget-section__head h3 {
	margin: 0;
	color: var(--stp-account-widget-text);
	font-size: 14px;
	font-weight: 800;
	line-height: 1.25;
}

.stp-account-widget-section__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	margin-bottom: 10px;
}

.stp-account-widget-section__head a {
	color: var(--stp-account-widget-primary);
	font-size: 11px;
	font-weight: 800;
	line-height: 1.2;
	text-decoration: none !important;
	white-space: nowrap;
}

.stp-account-widget-section__head a:hover,
.stp-account-widget-section__head a:focus {
	color: var(--stp-account-widget-primary-hover);
	text-decoration: none !important;
	outline: none;
}

.stp-account-widget-order-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	overflow: hidden;
	border: 1px solid var(--stp-account-widget-border-soft);
	border-radius: 13px;
	background: #ffffff;
}

.stp-account-widget-order-grid span {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-direction: column;
	min-width: 0;
	min-height: 58px;
	padding: 8px 5px;
	text-align: center;
}

.stp-account-widget-order-grid span + span {
	border-left: 1px solid var(--stp-account-widget-border-soft);
}

.stp-account-widget-order-grid .dashicons {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 22px;
	margin-bottom: 4px;
	border-radius: 999px;
	background: var(--stp-account-widget-orange-soft);
	color: var(--stp-account-widget-primary);
	font-size: 13px;
	line-height: 1;
}

.stp-account-widget-order-grid small {
	overflow: hidden;
	max-width: 100%;
	color: var(--stp-account-widget-muted);
	font-size: 10px;
	font-weight: 700;
	line-height: 1.2;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.stp-account-widget-order-grid strong {
	margin-top: 2px;
	color: var(--stp-account-widget-text);
	font-size: 13px;
	font-weight: 900;
	line-height: 1;
}

.stp-account-widget-section:not(.stp-account-widget-section--orders) {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	overflow-x: hidden;
	padding-bottom: 12px;
	scrollbar-width: thin;
	scrollbar-color: #cbd5e1 transparent;
}

.stp-account-widget-section:not(.stp-account-widget-section--orders)::-webkit-scrollbar {
	width: 6px;
}

.stp-account-widget-section:not(.stp-account-widget-section--orders)::-webkit-scrollbar-track {
	background: transparent;
}

.stp-account-widget-section:not(.stp-account-widget-section--orders)::-webkit-scrollbar-thumb {
	border-radius: 999px;
	background: #cbd5e1;
}

.stp-account-widget-links {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 5px 8px;
	margin-top: 9px;
}

.stp-account-widget-link {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto auto;
	align-items: center;
	gap: 7px;
	min-width: 0;
	min-height: 32px;
	padding: 5px 7px;
	border: 1px solid transparent;
	border-radius: 10px;
	background: transparent;
	color: var(--stp-account-widget-text);
	font-size: 12px;
	font-weight: 800;
	line-height: 1.25;
	text-decoration: none !important;
	transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.stp-account-widget-link:hover,
.stp-account-widget-link:focus {
	border-color: var(--stp-account-widget-border-soft);
	background: var(--stp-account-widget-hover-bg);
	color: var(--stp-account-widget-text);
	text-decoration: none !important;
	outline: none;
}

.stp-account-widget-link:focus-visible {
	outline: 2px solid #111827;
	outline-offset: 2px;
}

.stp-account-widget-link > span {
	display: flex;
	align-items: center;
	gap: 8px;
	min-width: 0;
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
}

.stp-account-widget-link > span .dashicons {
	width: 17px;
	height: 17px;
	flex: 0 0 17px;
	color: var(--stp-account-widget-icon);
	font-size: 16px;
	line-height: 1;
	transition: color 0.16s ease;
}

.stp-account-widget-link:hover > span .dashicons,
.stp-account-widget-link:focus > span .dashicons {
	color: var(--stp-account-widget-icon-hover);
}

.stp-account-widget-link mark {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 18px;
	height: 18px;
	padding: 0 5px;
	border-radius: 999px;
	background: var(--stp-account-widget-badge-bg);
	color: #ffffff;
	font-size: 10px;
	font-weight: 900;
	line-height: 1;
}

.stp-account-widget-link > .dashicons {
	width: 15px;
	height: 15px;
	color: var(--stp-account-widget-muted);
	font-size: 15px;
	line-height: 1;
	transition: color 0.16s ease;
}

.stp-account-widget-link:hover > .dashicons,
.stp-account-widget-link:focus > .dashicons {
	color: var(--stp-account-widget-icon-hover);
}

.stp-account-widget-link[href*="payment-methods"] span,
.stp-account-widget-link[href*="support"] span,
.stp-account-widget-link[href*="profile"] span {
	font-size: 0;
}

.stp-account-widget-link[href*="payment-methods"] span::after {
	content: "Payment";
	color: inherit;
	font-size: 12px;
	font-weight: 800;
	line-height: 1.25;
}

.stp-account-widget-link[href*="support"] span::after {
	content: "Support";
	color: inherit;
	font-size: 12px;
	font-weight: 800;
	line-height: 1.25;
}

.stp-account-widget-link[href*="profile"] span::after {
	content: "Profile";
	color: inherit;
	font-size: 12px;
	font-weight: 800;
	line-height: 1.25;
}

.stp-account-widget-support {
	position: sticky;
	bottom: 0;
	z-index: 2;
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	gap: 10px;
	align-items: center;
	margin-top: auto;
	padding: 12px 16px 14px;
	border-top: 1px solid var(--stp-account-widget-border-soft);
	background: var(--stp-account-widget-bg);
}

.stp-account-widget-support > div {
	display: flex;
	align-items: center;
	gap: 9px;
	min-width: 0;
}

.stp-account-widget-support > div > .dashicons {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	flex: 0 0 32px;
	border-radius: 10px;
	background: var(--stp-account-widget-orange-soft);
	color: var(--stp-account-widget-primary);
	font-size: 21px;
	line-height: 1;
}

.stp-account-widget-support span {
	display: block;
	min-width: 0;
}

.stp-account-widget-support strong {
	display: block;
	color: var(--stp-account-widget-text);
	font-size: 12px;
	font-weight: 900;
	line-height: 1.25;
}

.stp-account-widget-support small {
	display: block;
	margin-top: 2px;
	color: var(--stp-account-widget-muted);
	font-size: 10px;
	font-weight: 600;
	line-height: 1.35;
}

.stp-account-widget-support > a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 36px;
	padding: 8px 12px;
	border: 1px solid var(--stp-account-widget-primary);
	border-radius: 999px;
	background: #ffffff;
	color: var(--stp-account-widget-primary);
	font-size: 11px;
	font-weight: 900;
	line-height: 1;
	text-align: center;
	text-decoration: none !important;
	white-space: nowrap;
	transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.stp-account-widget-support > a:hover,
.stp-account-widget-support > a:focus {
	border-color: var(--stp-account-widget-primary-hover);
	background: var(--stp-account-widget-primary-hover);
	color: #ffffff;
	text-decoration: none !important;
	outline: none;
}

.stp-account-widget-guest {
	padding: 16px;
}

.stp-account-widget-guest h3 {
	margin: 0;
	color: var(--stp-account-widget-text);
	font-size: 15px;
	font-weight: 900;
	line-height: 1.25;
}

.stp-account-widget-guest p {
	margin: 7px 0 0;
	color: var(--stp-account-widget-muted);
	font-size: 12px;
	font-weight: 600;
	line-height: 1.5;
}

.stp-account-widget-actions {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 10px;
	margin: 14px 0 10px;
}

.stp-account-widget-actions a,
.stp-account-widget-lost {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 38px;
	padding: 9px 12px;
	border: 1px solid transparent;
	border-radius: 999px;
	font-size: 12px;
	font-weight: 900;
	line-height: 1;
	text-align: center;
	text-decoration: none !important;
	transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.stp-account-widget-actions a:first-child {
	border-color: var(--stp-account-widget-primary);
	background: var(--stp-account-widget-primary);
	color: #ffffff;
}

.stp-account-widget-actions a:first-child:hover,
.stp-account-widget-actions a:first-child:focus {
	border-color: var(--stp-account-widget-primary-hover);
	background: var(--stp-account-widget-primary-hover);
	color: #ffffff;
	text-decoration: none !important;
	outline: none;
}

.stp-account-widget-actions a:last-child,
.stp-account-widget-lost {
	border-color: var(--stp-account-widget-border);
	background: #ffffff;
	color: var(--stp-account-widget-text);
}

.stp-account-widget-actions a:last-child:hover,
.stp-account-widget-actions a:last-child:focus,
.stp-account-widget-lost:hover,
.stp-account-widget-lost:focus {
	border-color: var(--stp-account-widget-primary);
	background: var(--stp-account-widget-orange-soft);
	color: var(--stp-account-widget-primary-hover);
	text-decoration: none !important;
	outline: none;
}

.stp-account-widget-lost {
	width: 100%;
	margin-top: 0;
}

.stp-account-widget-links--guest {
	grid-template-columns: 1fr;
	margin-top: 12px;
	padding-top: 12px;
	border-top: 1px solid var(--stp-account-widget-border-soft);
}

@media (prefers-reduced-motion: reduce) {
	.stp-account-widget-panel,
	.stp-account-widget-link,
	.stp-account-widget-link > span .dashicons,
	.stp-account-widget-link > .dashicons,
	.stp-account-widget-actions a,
	.stp-account-widget-lost,
	.stp-account-widget-support > a {
		transition: none;
	}
}

@media (max-width: 1024px) {
	.stp-account-widget-panel {
		position: fixed;
		top: var(--stp-account-widget-top, 44px);
		left: 50%;
		right: auto;
		width: min(314px, calc(100vw - 40px));
		max-width: calc(100vw - 40px);
		max-height: min(416px, calc(100vh - 78px));
		transform: translate(-50%, 8px);
	}

	.stp-header-account-widget:not(.is-click-closed):hover .stp-account-widget-panel,
	.stp-header-account-widget.is-open .stp-account-widget-panel {
		transform: translate(-50%, 0);
	}

	.stp-account-widget-panel::before {
		display: none;
	}
}

@media (max-width: 767px) {
	.stp-account-widget-panel {
		top: var(--stp-account-widget-top, 52px);
		width: min(314px, calc(100vw - 40px));
		max-width: calc(100vw - 40px);
		max-height: min(416px, calc(100vh - 86px));
	}
}

@media (max-width: 480px) {
	.stp-account-widget-panel {
		width: min(314px, calc(100vw - 40px));
		max-width: calc(100vw - 40px);
		max-height: min(416px, calc(100vh - 86px));
	}

	.stp-account-widget-profile {
		grid-template-columns: 42px minmax(0, 1fr);
		padding: 13px 14px;
	}

	.stp-account-widget-profile__avatar {
		width: 42px;
		height: 42px;
		font-size: 15px;
	}

	.stp-account-widget-section {
		padding-right: 14px;
		padding-left: 14px;
	}

	.stp-account-widget-support {
		grid-template-columns: 1fr;
		padding-right: 14px;
		padding-left: 14px;
	}

	.stp-account-widget-support > a {
		width: 100%;
	}
}

@media (max-width: 380px) {
	.stp-account-widget-panel {
		width: min(304px, calc(100vw - 32px));
		max-width: calc(100vw - 32px);
	}
}