/**
 * NexaShop User Account & Auth Widget Styles
 * Exact Digikala UI/UX Replication with Full RTL & Responsive Support
 */

/* ==========================================================================
   1. Base Widget Wrap
   ========================================================================== */
.nexashop-auth-widget-wrap {
	position: relative;
	display: inline-flex;
	align-items: center;
	direction: rtl;
	box-sizing: border-box;
	font-family: inherit;
}

/* ==========================================================================
   2. Guest State: Login / Register Button
   ========================================================================== */
.nexashop-auth-btn-guest {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 8px 16px;
	background-color: #ffffff;
	color: #0c0c0c;
	border: 1px solid #e0e0e2;
	border-radius: 8px;
	font-size: 13px;
	font-weight: 700;
	text-decoration: none;
	cursor: pointer;
	overflow: hidden;
	transition: all 0.22s ease-in-out;
	user-select: none;
}

.nexashop-auth-btn-guest:hover {
	background-color: #f7f7f8;
	border-color: #c0c2c5;
	color: #0c0c0c;
}

.nexashop-auth-btn-guest .nexashop-auth-btn-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: #3f4064;
	font-size: 18px;
	line-height: 1;
}

.nexashop-auth-btn-guest .nexashop-auth-btn-icon svg {
	width: 18px;
	height: 18px;
	fill: currentColor;
}

/* Shine / Light Animation Effect */
.nexashop-auth-btn-guest.has-shine-effect::after {
	content: '';
	position: absolute;
	top: -50%;
	left: -60%;
	width: 30%;
	height: 200%;
	background: linear-gradient(
		to right,
		rgba(255, 255, 255, 0) 0%,
		rgba(255, 255, 255, 0.45) 50%,
		rgba(255, 255, 255, 0) 100%
	);
	transform: rotate(30deg);
	pointer-events: none;
	animation: nexashop-btn-shine 4.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes nexashop-btn-shine {
	0%, 70% {
		left: -60%;
	}
	100% {
		left: 140%;
	}
}

/* ==========================================================================
   3. Logged-in State: Profile Trigger
   ========================================================================== */
.nexashop-user-trigger {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 10px 16px;
	background-color: #e5b822;
	border: 1px solid transparent;
	border-radius: 12px;
	color: #1e293b;
	font-family: inherit;
	font-size: 13.5px;
	font-weight: 700;
	cursor: pointer;
	transition: all 0.2s ease;
	outline: none;
}

.nexashop-user-trigger.is-icon-only {
	padding: 9px 11px;
}

.nexashop-user-trigger:hover,
.nexashop-auth-widget-wrap.is-open .nexashop-user-trigger {
	filter: brightness(0.97);
	color: #0c0c0c;
}

.nexashop-user-trigger-text {
	font-size: 13.5px;
	font-weight: 700;
	line-height: 1.4;
	white-space: nowrap;
}

.nexashop-user-trigger-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 20px;
	line-height: 1;
}

.nexashop-user-trigger-icon svg {
	width: 20px;
	height: 20px;
	fill: currentColor;
}

.nexashop-user-trigger-caret {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: currentColor;
	opacity: 0.75;
	transition: transform 0.25s ease;
}

.nexashop-auth-widget-wrap.is-open .nexashop-user-trigger-caret {
	transform: rotate(180deg);
}

/* ==========================================================================
   4. Logged-in State: Dropdown Panel (Matches Image 1)
   ========================================================================== */
.nexashop-user-dropdown-panel {
	position: absolute;
	top: calc(100% + 10px);
	left: 0;
	width: 260px;
	background-color: #ffffff;
	border: 1px solid #e0e0e2;
	border-radius: 16px;
	box-shadow: 0 12px 32px -4px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0, 0, 0, 0.05);
	padding: 8px 0 0 0;
	overflow: hidden;
	z-index: 1050;
	opacity: 0;
	visibility: hidden;
	transform: translateY(8px);
	transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s;
	box-sizing: border-box;
}

.nexashop-user-dropdown-panel.panel-align-right {
	right: 0;
	left: auto;
}

.nexashop-user-dropdown-panel.panel-align-left {
	left: 0;
	right: auto;
}

/* Hover or is-open state */
.nexashop-auth-widget-wrap.is-open .nexashop-user-dropdown-panel,
.nexashop-auth-widget-wrap:hover .nexashop-user-dropdown-panel {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

/* Row 1: User Profile Header */
.nexashop-user-header-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 12px 18px;
	text-decoration: none;
	color: #0c0c0c;
	transition: background-color 0.18s ease;
}

.nexashop-user-header-row:hover {
	background-color: #f7f7f8;
}

.nexashop-user-header-name {
	font-size: 14px;
	font-weight: 800;
	color: #0c0c0c;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	text-align: right;
}

.nexashop-user-header-arrow {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: #81858b;
}

/* Separator Line */
.nexashop-user-menu-separator {
	height: 1px;
	background-color: #f0f0f1;
	margin: 4px 0;
}

/* Row 2: VIP / Subscription Row (Plus) */
.nexashop-vip-banner-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 10px 18px;
	text-decoration: none;
	transition: background-color 0.18s ease;
}

.nexashop-vip-banner-row:hover {
	background-color: #faf5fc;
}

.nexashop-vip-brand-wrap {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.nexashop-vip-title {
	font-size: 13px;
	font-weight: 700;
	color: #81858b;
}

.nexashop-vip-icon {
	display: inline-flex;
	align-items: center;
	color: #81858b;
	font-size: 15px;
}

.nexashop-vip-action-wrap {
	display: inline-flex;
	align-items: center;
	gap: 4px;
}

.nexashop-vip-action {
	font-size: 12px;
	font-weight: 700;
	color: #a83296;
}

.nexashop-vip-arrow {
	display: inline-flex;
	align-items: center;
	color: #a83296;
}

/* Menu List */
.nexashop-user-menu-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.nexashop-user-menu-item {
	margin: 0;
	padding: 0;
}

.nexashop-user-menu-link {
	display: flex;
	align-items: center;
	justify-content: flex-start;
	gap: 10px;
	padding: 12px 18px;
	text-decoration: none;
	color: #3f4064;
	transition: all 0.18s ease;
}

/* Menu Item Icon Order & Alignment Modifiers */
.nexashop-user-dropdown-panel.icon-order-before_text .nexashop-user-menu-link .nexashop-user-menu-item-icon {
	order: 1;
}

.nexashop-user-dropdown-panel.icon-order-before_text .nexashop-user-menu-link .nexashop-user-menu-item-content,
.nexashop-user-dropdown-panel.icon-order-before_text .nexashop-user-logout-link .nexashop-user-menu-item-text {
	order: 2;
}

.nexashop-user-dropdown-panel.icon-order-after_text .nexashop-user-menu-link .nexashop-user-menu-item-content,
.nexashop-user-dropdown-panel.icon-order-after_text .nexashop-user-logout-link .nexashop-user-menu-item-text {
	order: 1;
}

.nexashop-user-dropdown-panel.icon-order-after_text .nexashop-user-menu-link .nexashop-user-menu-item-icon {
	order: 2;
}

.nexashop-user-dropdown-panel.item-align-flex-start .nexashop-user-menu-link {
	justify-content: flex-start;
}

.nexashop-user-dropdown-panel.item-align-space-between .nexashop-user-menu-link {
	justify-content: space-between;
}

.nexashop-user-dropdown-panel.item-align-center .nexashop-user-menu-link {
	justify-content: center;
}

.nexashop-user-dropdown-panel.item-align-flex-end .nexashop-user-menu-link {
	justify-content: flex-end;
}

.nexashop-user-menu-link:hover {
	background-color: #f7f7f8;
	color: #0c0c0c;
}

.nexashop-user-menu-item-content {
	display: inline-flex;
	align-items: center;
	gap: 8px;
}

.nexashop-user-menu-item-text {
	font-size: 13px;
	font-weight: 600;
	line-height: 1.4;
}

.nexashop-user-menu-item-badge {
	display: inline-block;
	background: #ef394e;
	color: #ffffff;
	font-size: 10px;
	font-weight: 700;
	padding: 1px 6px;
	border-radius: 999px;
}

.nexashop-user-menu-item-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 18px;
	color: #3f4064;
	line-height: 1;
}

.nexashop-user-menu-item-icon svg {
	width: 18px;
	height: 18px;
	fill: currentColor;
}

/* Logout Section (Distinct & Flush Rounded at bottom) */
.nexashop-user-logout-wrap {
	margin: 0;
	padding: 0;
}

.nexashop-user-logout-link {
	color: #424750;
	padding: 13px 18px 14px;
	border-radius: 0 0 15px 15px;
	transition: all 0.18s ease;
}

.nexashop-user-logout-link:hover {
	background-color: #fff5f5;
	color: #ef394e;
}

.nexashop-user-logout-link:hover .nexashop-user-menu-item-text,
.nexashop-user-logout-link:hover .nexashop-user-menu-item-icon {
	color: #ef394e;
}

/* ==========================================================================
   5. Modal Backdrop & Dialog (AJAX Login / Register Modal)
   ========================================================================== */
.nexashop-modal-backdrop {
	position: fixed;
	top: 0;
	left: 0;
	width: 100vw;
	height: 100vh;
	background-color: rgba(0, 0, 0, 0.55);
	backdrop-filter: blur(4px);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 99999;
	padding: 20px;
	box-sizing: border-box;
	direction: rtl;
}

.nexashop-auth-dialog {
	position: relative;
	width: 100%;
	max-width: 420px;
	background: #ffffff;
	border-radius: 20px;
	box-shadow: 0 24px 48px -12px rgba(0, 0, 0, 0.25);
	padding: 32px 28px;
	box-sizing: border-box;
	animation: nexashop-modal-appear 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes nexashop-modal-appear {
	from {
		opacity: 0;
		transform: scale(0.94) translateY(12px);
	}
	to {
		opacity: 1;
		transform: scale(1) translateY(0);
	}
}

.nexashop-modal-close {
	position: absolute;
	top: 18px;
	left: 18px;
	background: transparent;
	border: none;
	font-size: 26px;
	line-height: 1;
	color: #81858b;
	cursor: pointer;
	padding: 4px;
	border-radius: 50%;
	transition: all 0.2s ease;
}

.nexashop-modal-close:hover {
	color: #ef394e;
	background: #fdf2f2;
}

.nexashop-auth-modal-header {
	margin-bottom: 24px;
	text-align: center;
}

.nexashop-auth-tabs {
	display: inline-flex;
	background: #f0f0f1;
	border-radius: 12px;
	padding: 4px;
	width: 100%;
}

.nexashop-auth-tab {
	flex: 1;
	padding: 10px 0;
	background: transparent;
	border: none;
	border-radius: 8px;
	font-size: 13px;
	font-weight: 700;
	color: #81858b;
	cursor: pointer;
	transition: all 0.2s ease;
}

.nexashop-auth-tab.active {
	background: #ffffff;
	color: #0c0c0c;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.nexashop-auth-msg {
	padding: 10px 14px;
	border-radius: 10px;
	font-size: 13px;
	font-weight: 600;
	margin-bottom: 16px;
	line-height: 1.5;
}

.nexashop-auth-msg.error {
	background: #fef2f2;
	color: #b91c1c;
	border: 1px solid #fecaca;
}

.nexashop-auth-msg.success {
	background: #f0fdf4;
	color: #15803d;
	border: 1px solid #bbf7d0;
}

.nexashop-auth-field-group {
	margin-bottom: 16px;
	text-align: right;
}

.nexashop-auth-field-group label {
	display: block;
	font-size: 12px;
	font-weight: 700;
	color: #3f4064;
	margin-bottom: 6px;
}

.nexashop-auth-pass-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.nexashop-lost-pass {
	font-size: 11px;
	color: #19bfd3;
	text-decoration: none;
}

.nexashop-lost-pass:hover {
	text-decoration: underline;
}

.nexashop-auth-field-group input {
	width: 100%;
	padding: 12px 14px;
	background: #f7f7f8;
	border: 1px solid #e0e0e2;
	border-radius: 10px;
	font-size: 13px;
	color: #0c0c0c;
	outline: none;
	box-sizing: border-box;
	transition: all 0.2s ease;
}

.nexashop-auth-field-group input:focus {
	background: #ffffff;
	border-color: #008eb2;
	box-shadow: 0 0 0 3px rgba(0, 142, 178, 0.12);
}

.nexashop-auth-remember {
	display: flex;
	align-items: center;
	margin-bottom: 20px;
	font-size: 12px;
	color: #62666d;
}

.nexashop-auth-remember label {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	cursor: pointer;
}

.nexashop-auth-terms {
	font-size: 11px;
	color: #81858b;
	line-height: 1.6;
	margin-bottom: 18px;
}

.nexashop-auth-submit-btn {
	width: 100%;
	padding: 13px;
	background: #ef394e;
	color: #ffffff;
	border: none;
	border-radius: 10px;
	font-size: 14px;
	font-weight: 800;
	cursor: pointer;
	transition: all 0.22s ease;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
}

.nexashop-auth-submit-btn:hover {
	background: #d82f42;
	box-shadow: 0 4px 12px rgba(239, 57, 78, 0.3);
}

.nexashop-auth-submit-btn:disabled {
	opacity: 0.7;
	cursor: not-allowed;
}

.btn-spinner {
	width: 16px;
	height: 16px;
	border: 2px solid rgba(255, 255, 255, 0.35);
	border-top-color: #ffffff;
	border-radius: 50%;
	animation: nexashop-spin 0.7s linear infinite;
}

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

/* Mobile responsive adjustments */
@media (max-width: 768px) {
	.nexashop-user-dropdown-panel {
		right: 0;
		left: auto;
		width: 280px;
	}
}
