/**
 * Wallet page + sidebar widget styles.
 */

/* Sidebar wallet (under profile) — Digikala-style compact row */
.wf-wallet__nav {
	padding: 16px 16px 12px;
	border-bottom: 1px solid var(--wf-border, #ececec);
	background: #fff;
}

.wf-wallet__nav-main {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
	min-width: 0;
}

.wf-wallet__nav-start {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0;
	min-width: 0;
}

.wf-wallet__nav-title {
	display: block;
	margin: 0;
	padding: 0;
	font-size: 13px;
	font-weight: 700;
	line-height: 1.25;
	color: var(--wf-text, #1a1a1a);
}

.wf-wallet__nav-balance,
.wf-wallet__nav-balance .amount,
.wf-wallet__nav-balance .woocommerce-Price-amount {
	margin: 0;
	padding-top: 1px;
	font-size: 14px !important;
	font-weight: 700 !important;
	line-height: 1.25 !important;
	font-variant-numeric: tabular-nums;
	color: var(--wf-text, #1a1a1a) !important;
	text-align: end;
	white-space: nowrap;
}

.wf-wallet__nav-balance .woocommerce-Price-currencySymbol {
	font-size: 10px !important;
	font-weight: 500 !important;
	opacity: 0.85;
	margin-inline: 2px;
}

.wf-wallet__nav-link,
body.wf-account-enabled .wf-account__nav a.wf-wallet__nav-link,
body.wf-account-enabled .woocommerce-MyAccount-navigation a.wf-wallet__nav-link,
html body.wf-style-controls .wf-account__nav a.wf-wallet__nav-link,
html body.wf-style-controls .woocommerce-MyAccount-navigation a.wf-wallet__nav-link {
	display: inline-flex !important;
	align-items: center !important;
	justify-content: flex-start !important;
	gap: 2px !important;
	width: auto !important;
	max-width: none !important;
	min-height: 0 !important;
	height: auto !important;
	margin: 2px 0 0 !important;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 0 !important;
	background: none !important;
	background-color: transparent !important;
	box-shadow: none !important;
	color: #0f6cbd !important;
	font-size: 12px !important;
	font-weight: 600 !important;
	line-height: 1.2 !important;
	text-decoration: none !important;
	text-align: start !important;
	cursor: pointer;
}

.wf-wallet__nav-link:hover,
body.wf-account-enabled .wf-account__nav a.wf-wallet__nav-link:hover,
body.wf-account-enabled .woocommerce-MyAccount-navigation a.wf-wallet__nav-link:hover,
html body.wf-style-controls .wf-account__nav a.wf-wallet__nav-link:hover,
html body.wf-style-controls .woocommerce-MyAccount-navigation a.wf-wallet__nav-link:hover {
	background: none !important;
	color: #0a4f91 !important;
	text-decoration: none !important;
	opacity: 1 !important;
}

.wf-wallet__nav-chevron {
	display: inline-block;
	font-size: 13px;
	line-height: 1;
	margin-inline-start: 1px;
}

[dir="rtl"] .wf-wallet__nav-chevron,
html[dir="rtl"] .wf-wallet__nav-chevron,
body.rtl .wf-wallet__nav-chevron {
	transform: scaleX(-1);
}

/* —— Wallet page —— */
.wf-wallet {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.wf-wallet__head {
	margin: 0 0 4px;
}

.wf-wallet__title {
	margin: 0 0 6px;
	padding: 0;
	border: 0;
	font-size: 20px;
	font-weight: 800;
	line-height: 1.35;
	color: var(--wf-text, #1a1a1a);
}

.wf-wallet__subtitle {
	margin: 0;
	font-size: 13px;
	line-height: 1.7;
	color: var(--wf-muted, #8c8c8c);
}

.wf-wallet__layout {
	display: grid;
	grid-template-columns: 1fr;
	gap: 16px;
}

.wf-wallet__layout--split {
	grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
	align-items: stretch;
}

.wf-wallet__balance-card {
	display: flex;
	margin: 0;
	overflow: hidden;
	background:
		linear-gradient(
			135deg,
			color-mix(in srgb, var(--wf-accent, #1a1a1a) 6%, #fff) 0%,
			#fff 55%
		);
}

.wf-wallet__balance-card-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	width: 100%;
	padding: 4px 2px;
}

.wf-wallet__balance-copy {
	min-width: 0;
}

.wf-wallet__balance-label {
	margin: 0 0 8px;
	font-size: 13px;
	font-weight: 500;
	color: var(--wf-muted, #8c8c8c);
}

.wf-wallet__balance,
.wf-wallet__balance .amount,
.wf-wallet__balance .woocommerce-Price-amount {
	margin: 0;
	font-size: 28px !important;
	font-weight: 800 !important;
	line-height: 1.25 !important;
	font-variant-numeric: tabular-nums;
	color: var(--wf-text, #1a1a1a) !important;
}

.wf-wallet__balance .woocommerce-Price-currencySymbol {
	font-size: 14px !important;
	font-weight: 600 !important;
	opacity: 0.75;
	margin-inline: 4px;
}

.wf-wallet__mark {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 52px;
	height: 52px;
	flex: 0 0 auto;
	color: var(--wf-accent, #1a1a1a);
	background: #fff;
	border: 1px solid var(--wf-border, #ececec);
	border-radius: var(--wf-radius, 8px);
}

.wf-wallet__topup .wf-account__card-head {
	margin-bottom: 14px;
}

.wf-wallet__presets {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
	gap: 8px;
	margin: 0 0 14px;
}

html body .wf-wallet button.wf-wallet__preset,
html body.wf-account-enabled .wf-wallet button.wf-wallet__preset,
html body.wf-style-controls .wf-wallet button.wf-wallet__preset,
html body.wf-style-controls .wf-account button.wf-wallet__preset,
.wf-wallet__preset {
	appearance: none !important;
	-webkit-appearance: none !important;
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	width: 100% !important;
	max-width: none !important;
	min-width: 0 !important;
	min-height: 44px !important;
	height: auto !important;
	margin: 0 !important;
	padding: 11px 10px !important;
	box-sizing: border-box !important;
	font-family: inherit !important;
	font-size: 13px !important;
	font-weight: 700 !important;
	font-style: normal !important;
	line-height: 1.3 !important;
	letter-spacing: normal !important;
	text-align: center !important;
	text-transform: none !important;
	text-decoration: none !important;
	text-shadow: none !important;
	color: var(--wf-text, #1a1a1a) !important;
	background: #fff !important;
	background-color: #fff !important;
	background-image: none !important;
	border: 1px solid var(--wf-border, #ececec) !important;
	border-radius: var(--wf-radius-btn, var(--wf-radius, 8px)) !important;
	box-shadow: none !important;
	outline: none !important;
	cursor: pointer !important;
	float: none !important;
	opacity: 1 !important;
	transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

html body .wf-wallet button.wf-wallet__preset:hover,
html body .wf-wallet button.wf-wallet__preset:focus,
html body.wf-style-controls .wf-wallet button.wf-wallet__preset:hover,
html body.wf-style-controls .wf-account button.wf-wallet__preset:hover,
.wf-wallet__preset:hover,
.wf-wallet__preset:focus {
	border-color: #d0d0d0 !important;
	background: var(--wf-soft, #f5f5f5) !important;
	background-color: var(--wf-soft, #f5f5f5) !important;
	background-image: none !important;
	color: var(--wf-text, #1a1a1a) !important;
	box-shadow: none !important;
	opacity: 1 !important;
}

html body .wf-wallet button.wf-wallet__preset.is-active,
html body.wf-style-controls .wf-wallet button.wf-wallet__preset.is-active,
html body.wf-style-controls .wf-account button.wf-wallet__preset.is-active,
.wf-wallet__preset.is-active {
	border-color: var(--wf-accent, #1a1a1a) !important;
	background: color-mix(in srgb, var(--wf-accent, #1a1a1a) 8%, #fff) !important;
	background-color: color-mix(in srgb, var(--wf-accent, #1a1a1a) 8%, #fff) !important;
	background-image: none !important;
	color: var(--wf-accent, #1a1a1a) !important;
	box-shadow: none !important;
}

html body .wf-wallet button.wf-wallet__preset .amount,
html body .wf-wallet button.wf-wallet__preset .woocommerce-Price-amount,
.wf-wallet__preset .amount,
.wf-wallet__preset .woocommerce-Price-amount {
	color: inherit !important;
	font-weight: inherit !important;
	background: none !important;
}

.wf-wallet__form {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.wf-wallet__field {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin: 0;
	font-size: 13px;
	font-weight: 500;
	color: var(--wf-muted, #8c8c8c);
}

.wf-wallet__field-label {
	display: block;
}

.wf-wallet__field-control {
	position: relative;
	display: flex !important;
	flex-direction: row;
	align-items: center;
	direction: ltr;
	width: 100%;
	min-height: 46px;
	box-sizing: border-box;
	background: #fff;
	border: 1px solid var(--wf-border, #ececec);
	border-radius: var(--wf-radius-btn, var(--wf-radius, 8px));
	overflow: hidden;
}

.wf-wallet__field-suffix {
	position: static !important;
	inset: auto !important;
	left: auto !important;
	right: auto !important;
	transform: none !important;
	flex: 0 0 auto;
	margin: 0;
	padding: 0 4px 0 14px;
	font-size: 12px;
	font-weight: 600;
	line-height: 1;
	color: var(--wf-muted, #8c8c8c);
	pointer-events: none;
	z-index: 1;
	white-space: nowrap;
}

.wf-wallet__field input,
html body .wf-wallet #wf-wallet-amount,
html body.wf-account-enabled .wf-wallet #wf-wallet-amount,
html body.wf-style-controls .wf-wallet #wf-wallet-amount {
	display: block !important;
	flex: 1 1 auto !important;
	width: auto !important;
	max-width: none !important;
	min-width: 0 !important;
	min-height: 44px !important;
	height: auto !important;
	margin: 0 !important;
	padding: 0 14px 0 8px !important;
	box-sizing: border-box !important;
	font-family: inherit !important;
	font-size: 15px !important;
	font-weight: 700 !important;
	line-height: 1.4 !important;
	direction: ltr !important;
	text-align: left !important;
	color: var(--wf-text, #1a1a1a) !important;
	background: transparent !important;
	background-image: none !important;
	border: 0 !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	outline: none !important;
	-moz-appearance: textfield !important;
	appearance: textfield !important;
}

.wf-wallet__field input::-webkit-outer-spin-button,
.wf-wallet__field input::-webkit-inner-spin-button,
html body .wf-wallet #wf-wallet-amount::-webkit-outer-spin-button,
html body .wf-wallet #wf-wallet-amount::-webkit-inner-spin-button {
	-webkit-appearance: none !important;
	margin: 0 !important;
}

.wf-wallet__field-control:focus-within {
	border-color: var(--wf-accent, #1a1a1a);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--wf-accent, #1a1a1a) 14%, transparent);
}

.wf-wallet__field input:focus,
html body .wf-wallet #wf-wallet-amount:focus,
html body.wf-style-controls .wf-wallet #wf-wallet-amount:focus {
	border: 0 !important;
	box-shadow: none !important;
	outline: none !important;
}

html body.wf-style-controls .wf-wallet__topup a.wf-btn.wf-wallet__submit,
html body.wf-style-controls .wf-wallet__topup button.wf-btn.wf-wallet__submit,
html body.wf-account-enabled .wf-wallet__topup button.wf-btn.wf-wallet__submit,
.wf-wallet__submit {
	width: 100% !important;
	min-height: 46px !important;
	justify-content: center !important;
}

.wf-wallet__msg {
	margin: 10px 0 0;
	font-size: 13px;
	line-height: 1.5;
	color: var(--wf-danger, #b91c1c);
}

.wf-wallet__msg.is-ok {
	color: var(--wf-ok, #15803d);
}

.wf-wallet__ledger .wf-account__card-head {
	margin-bottom: 4px;
}

.wf-wallet__empty {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 28px 16px 18px;
	text-align: center;
}

.wf-wallet__empty-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 56px;
	margin-bottom: 6px;
	color: var(--wf-muted, #8c8c8c);
	background: var(--wf-soft, #f5f5f5);
	border-radius: 50%;
}

.wf-wallet__empty-title {
	margin: 0;
	font-size: 14px;
	font-weight: 700;
	color: var(--wf-text, #1a1a1a);
}

.wf-wallet__empty-text {
	margin: 0;
	max-width: 280px;
	font-size: 13px;
	line-height: 1.7;
	color: var(--wf-muted, #8c8c8c);
}

.wf-wallet__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
}

.wf-wallet__row {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 14px 0;
	border-bottom: 1px solid var(--wf-border-soft, #f0f0f0);
}

.wf-wallet__row:last-child {
	border-bottom: 0;
	padding-bottom: 2px;
}

.wf-wallet__row-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	flex: 0 0 auto;
	border-radius: 50%;
	background: var(--wf-soft, #f5f5f5);
	color: var(--wf-text, #1a1a1a);
}

.wf-wallet__row.is-credit .wf-wallet__row-icon {
	background: color-mix(in srgb, var(--wf-ok, #15803d) 12%, #fff);
	color: var(--wf-ok, #15803d);
}

.wf-wallet__row.is-debit .wf-wallet__row-icon {
	background: var(--wf-soft, #f5f5f5);
	color: var(--wf-muted, #8c8c8c);
}

.wf-wallet__row-main {
	display: flex;
	flex-direction: column;
	gap: 3px;
	min-width: 0;
	flex: 1 1 auto;
}

.wf-wallet__row-main strong {
	font-size: 13px;
	font-weight: 700;
	line-height: 1.4;
	color: var(--wf-text, #1a1a1a);
}

.wf-wallet__row-note,
.wf-wallet__row-main time {
	font-size: 12px;
	line-height: 1.45;
	color: var(--wf-muted, #8c8c8c);
}

.wf-wallet__row-note {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.wf-wallet__row-amount {
	flex: 0 0 auto;
	font-size: 13px;
	font-weight: 800;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
	text-align: end;
}

.wf-wallet__row.is-credit .wf-wallet__row-amount {
	color: var(--wf-ok, #15803d);
}

.wf-wallet__row.is-debit .wf-wallet__row-amount {
	color: var(--wf-text, #1a1a1a);
}

.wf-wallet-gateway__balance {
	margin: 0.5em 0 0;
	font-size: 13px;
	font-weight: 600;
}

@media (max-width: 960px) {
	.wf-wallet__nav {
		padding: 16px 16px 12px;
	}

	.wf-wallet__layout--split {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 720px) {
	.wf-wallet {
		gap: 12px;
	}

	.wf-wallet__title {
		font-size: 18px;
	}

	.wf-wallet__balance,
	.wf-wallet__balance .amount,
	.wf-wallet__balance .woocommerce-Price-amount {
		font-size: 24px !important;
	}

	.wf-wallet__presets {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.wf-wallet__row {
		padding: 12px 0;
	}
}
