/* Valabi Wallet — storefront hints (cashback line, expiring-credit nudge). */

.vw-hint {
	--vw-hint-accent: #0ca678;
	--vw-hint-deep: #087f5b;
	--vw-hint-soft: #e6fcf5;
	--vw-hint-line: #c3fae8;

	display: flex;
	align-items: center;
	gap: 10px;
	margin: 12px 0;
	padding: 10px 12px;
	border: 1px solid var(--vw-hint-line);
	border-radius: 12px;
	background: #fff;
	color: #181219;
	font-size: 13.5px;
	line-height: 1.75;
	box-sizing: border-box;
}
.vw-hint *, .vw-hint *::before, .vw-hint *::after { box-sizing: border-box; }
.vw-hint--expiry {
	--vw-hint-accent: #d9480f;
	--vw-hint-deep: #a8360b;
	--vw-hint-soft: #fff4e6;
	--vw-hint-line: #ffd8a8;
	background: var(--vw-hint-soft);
}
.vw-hint--wide { margin: 0 0 16px; }
.vw-hint__icon {
	display: flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border-radius: 10px;
	background: var(--vw-hint-soft);
	color: var(--vw-hint-accent);
}
.vw-hint--expiry .vw-hint__icon { background: #fff; }
.vw-hint__icon svg { width: 18px; height: 18px; stroke-width: 1.9; }
.vw-hint__text { min-width: 0; text-wrap: pretty; }
.vw-hint__text strong { color: var(--vw-hint-deep); font-weight: 800; white-space: nowrap; }
.vw-hint[hidden] { display: none !important; }

.vw-hint__sub { display: block; color: #5f5764; font-size: 12px; font-weight: 400; line-height: 1.6; }

/* ------------------------------------------------------------------
 * Checkout / cart: «پرداخت با کیف پول» + «هدیهٔ خرید بعدی»
 * Retheme without editing the plugin by overriding these variables on
 * .vw-checkout (or any ancestor). Logical properties only: RTL needs no
 * special cases.
 * ------------------------------------------------------------------ */
.vw-checkout {
	--vw-green: #2f7d59;
	--vw-green-bg: #eef6f1;
	--vw-green-text: #23694a;
	--vw-green-muted: #3f6b56;
	--vw-tile-bg: #f3f2ee;
	--vw-radius: 16px;
	--vw-border: #eceae5;
	--vw-ink: #22201c;
	--vw-muted: #6b675f;
	--vw-switch-off: #cfcdc6;
	--vw-switch-edge: #8c887f;
	color: var(--vw-ink);
	font: inherit;
	line-height: 1.7;
}
.vw-checkout, .vw-checkout *, .vw-checkout *::before, .vw-checkout *::after { box-sizing: border-box; }

/* The summary-table row that hosts the section */
table .vw-checkout-row > td {
	padding-block: 10px !important;
	padding-inline: 0 !important;
	border: 0 !important;
	background: transparent !important;
	text-align: start !important;
}
.vw-checkout-row > td::before { display: none !important; }

.vw-checkout__card {
	border: 1px solid var(--vw-border);
	border-radius: var(--vw-radius);
	background: #fff;
	overflow: hidden;
}

/* Wallet row: tile · title/balance · switch. The whole row is the label. */
.vw-wallet {
	display: flex;
	align-items: center;
	gap: 12px;
	min-block-size: 64px;
	margin: 0;
	padding: 10px 14px;
	cursor: pointer;
}
.vw-wallet--forced { cursor: default; }
.vw-wallet--blocked { cursor: default; }
.vw-wallet--blocked .vw-wallet__tile { background: #f1f0ec; color: var(--vw-muted); }
.vw-wallet--blocked .vw-wallet__title { color: var(--vw-muted); }
.vw-wallet__tile {
	display: flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	inline-size: 44px;
	block-size: 44px;
	border-radius: 12px;
	background: var(--vw-tile-bg);
	color: var(--vw-ink);
}
.vw-wallet__tile svg { inline-size: 22px; block-size: 22px; }
.vw-wallet__text { display: flex; flex: 1 1 auto; flex-direction: column; min-inline-size: 0; }
.vw-wallet__title { font-size: 15px; font-weight: 800; line-height: 1.5; }
.vw-wallet__balance { color: var(--vw-muted); font-size: 12.5px; line-height: 1.6; }
.vw-wallet__balance b { color: var(--vw-ink); font-weight: 700; }

/* The switch: a real checkbox with role="switch", restyled. */
.vw-switch {
	-webkit-appearance: none;
	appearance: none;
	position: relative;
	flex: 0 0 auto;
	inline-size: 52px !important;
	block-size: 32px !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 999px;
	background: var(--vw-switch-off) !important;
	box-shadow: inset 0 0 0 1px var(--vw-switch-edge);
	cursor: pointer;
	transition: background-color .18s ease, box-shadow .18s ease;
}
.vw-switch::before {
	content: "";
	position: absolute;
	inset-block-start: 3px;
	inset-inline-start: 3px;
	inline-size: 26px;
	block-size: 26px;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 1px 3px rgba(0, 0, 0, .25), 0 1px 1px rgba(0, 0, 0, .08);
	transition: inset-inline-start .18s ease;
}
.vw-switch:checked { background: var(--vw-green) !important; box-shadow: inset 0 0 0 1px var(--vw-green); }
.vw-switch:checked::before { inset-inline-start: 23px; }
.vw-switch:focus-visible { outline: 3px solid var(--vw-green); outline-offset: 3px; }
.vw-switch:disabled { opacity: .5; cursor: not-allowed; }
@media (prefers-reduced-motion: reduce) {
	.vw-switch, .vw-switch::before { transition: none; }
}

/* The amount field, while the switch is on */
.vw-wallet__amount {
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 12px 14px 14px;
	border-block-start: 1px solid var(--vw-border);
	background: #faf9f6;
}
.vw-wallet__amount[hidden] { display: none !important; }
.vw-wallet__question { margin: 0; color: var(--vw-ink); font-size: 12.5px; font-weight: 700; }
.vw-wallet__field { display: flex; gap: 8px; align-items: stretch; }
.vw-wallet__input {
	display: flex;
	flex: 1 1 auto;
	align-items: center;
	gap: 8px;
	min-inline-size: 0;
	block-size: 48px;
	padding-inline: 14px;
	border: 1px solid #c9c6be;
	border-radius: 12px;
	background: #fff;
}
.vw-wallet__input:focus-within { border-color: var(--vw-green); box-shadow: 0 0 0 3px rgba(47, 125, 89, .18); }
.vw-wallet__input input {
	flex: 1 1 auto;
	inline-size: 100% !important;
	min-inline-size: 0;
	block-size: auto !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	outline: 0;
	box-shadow: none !important;
	background: transparent !important;
	color: var(--vw-ink);
	font: inherit;
	font-size: 17px !important;
	font-weight: 800;
	text-align: end;
}
.vw-wallet__unit { flex: 0 0 auto; color: var(--vw-muted); font-size: 12.5px; }
.vw-wallet__max {
	flex: 0 0 auto;
	min-block-size: 48px;
	margin: 0;
	padding-inline: 14px;
	border: 0;
	border-radius: 12px;
	background: var(--vw-green);
	color: #fff;
	font: inherit;
	font-size: 13px;
	font-weight: 700;
	line-height: 1;
	cursor: pointer;
}
.vw-wallet__max:hover { background: var(--vw-green-text); }
.vw-wallet__max:focus-visible { outline: 3px solid var(--vw-green); outline-offset: 2px; }
.vw-wallet__hint { color: var(--vw-muted); font-size: 12px; line-height: 1.7; }
.vw-wallet__hint b { color: var(--vw-ink); font-weight: 700; }

/* The wallet row outside the order table (positions before_payment /
   before_submit): same card, just its own spacing. */
.vw-checkout-standalone { margin-block: 14px; }
.vw-checkout-standalone .vw-checkout { inline-size: 100%; }

/* «هدیهٔ خرید بعدی» — shared */
.vw-cashback { display: flex; align-items: flex-start; color: var(--vw-green-text); }
.vw-cashback__body { display: flex; flex: 1 1 auto; flex-direction: column; gap: 2px; min-inline-size: 0; }
.vw-cashback strong { font-weight: 800; }
.vw-cashback__methods { color: var(--vw-green-muted); font-size: 12px; }
.vw-cashback__methods strong { color: var(--vw-green-text); }
.vw-cashback__login {
	align-self: flex-start;
	margin-block-start: 6px;
	padding: 6px 14px;
	border: 1px solid var(--vw-green);
	border-radius: 10px;
	background: #fff;
	color: var(--vw-green-text) !important;
	font-size: 13px;
	font-weight: 700;
	text-decoration: none !important;
}
.vw-cashback__login:focus-visible { outline: 3px solid var(--vw-green); outline-offset: 2px; }
.vw-cashback__bar { display: block; block-size: 6px; margin-block-start: 6px; overflow: hidden; border-radius: 99px; background: #d7e9df; }
.vw-cashback__bar span { display: block; block-size: 100%; border-radius: 99px; background: var(--vw-green); }

/* Style 1 — banner: separate, tinted, under the wallet card */
.vw-cashback--banner {
	gap: 12px;
	padding: 14px;
	border-radius: var(--vw-radius);
	background: var(--vw-green-bg);
}
.vw-checkout__card + .vw-cashback--banner { margin-block-start: 10px; }
.vw-cashback__tile {
	display: flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	inline-size: 40px;
	block-size: 40px;
	border-radius: 12px;
	background: var(--vw-green);
	color: #fff;
}
.vw-cashback__tile svg { inline-size: 22px; block-size: 22px; }
.vw-cashback__title { color: var(--vw-green-text); font-size: 14.5px; font-weight: 800; line-height: 1.6; }
.vw-cashback__note { color: var(--vw-green-muted); font-size: 12.5px; line-height: 1.7; }
.vw-cashback__note strong { color: var(--vw-green-text); }

/* Style 2 — inline: one line inside the wallet card; the divider is the
   line's own top border, so no cashback means no divider. */
.vw-cashback--inline {
	gap: 8px;
	padding: 12px 14px;
	font-size: 13px;
	line-height: 1.7;
}
.vw-checkout__card > * + .vw-cashback--inline { border-block-start: 1px solid var(--vw-border); }
.vw-cashback__icon { display: flex; flex: 0 0 auto; color: var(--vw-green-text); padding-block-start: 1px; }
.vw-cashback__icon svg { inline-size: 20px; block-size: 20px; }
.vw-cashback__text { color: var(--vw-green-text); }

/* States */
.vw-cashback--excluded { color: var(--vw-muted); }
.vw-cashback--excluded.vw-cashback--banner { background: #f4f3f0; }
.vw-cashback--excluded .vw-cashback__tile { background: #dcdad4; color: #55524b; }
.vw-cashback--excluded .vw-cashback__title,
.vw-cashback--excluded .vw-cashback__note,
.vw-cashback--excluded .vw-cashback__text,
.vw-cashback--excluded .vw-cashback__icon { color: var(--vw-muted); }
.vw-cashback--excluded strong { color: var(--vw-ink); }

@media (max-width: 420px) {
	.vw-wallet { padding-inline: 12px; gap: 10px; }
	.vw-wallet__amount { padding-inline: 12px; }
	.vw-wallet__max { padding-inline: 12px; }
	.vw-cashback--banner { padding: 12px; }
}

/* ------------------------------------------------------------------
 * Cart & checkout BLOCKS: the same section inside the blocks' own slots
 * ------------------------------------------------------------------ */
.vw-blocks-slot { padding-block: 8px; }
.vw-checkout.is-busy .vw-checkout__card { opacity: .7; }
.vw-checkout.is-busy .vw-wallet { cursor: progress; }
