/* Auction Store Credit — frontend. */

/* Popup */
body.ans-store-credit-modal-open {
	overflow: hidden;
}

.ans-store-credit-modal[hidden] {
	display: none;
}

.ans-store-credit-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
}

.ans-store-credit-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba( 0, 0, 0, 0.5 );
}

.ans-store-credit-modal__dialog {
	position: relative;
	width: 100%;
	max-width: 440px;
	max-height: calc( 100vh - 32px );
	overflow-y: auto;
	padding: 24px;
	background: #fff;
	color: #1e1e1e;
	border-radius: 8px;
	box-shadow: 0 10px 40px rgba( 0, 0, 0, 0.25 );
}

.ans-store-credit-modal__close {
	position: absolute;
	top: 8px;
	right: 12px;
	padding: 0 6px;
	border: 0;
	background: none;
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
	color: inherit;
}

.ans-store-credit-modal h3 {
	margin: 0 24px 8px 0;
}

.ans-store-credit-modal__error,
.ans-store-credit-topup-error {
	color: #b32d2e;
}

.ans-store-credit-summary {
	width: 100%;
	margin: 12px 0;
	border-collapse: collapse;
}

.ans-store-credit-summary th,
.ans-store-credit-summary td {
	padding: 6px 0;
	border-bottom: 1px solid #e5e5e5;
	text-align: left;
}

.ans-store-credit-summary td {
	text-align: right;
	font-weight: 600;
}

.ans-store-credit-summary__after th,
.ans-store-credit-summary__after td {
	border-bottom: 0;
}

.ans-store-credit-step,
.ans-store-credit-modal__panel > .ans-store-credit-cancel {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 12px;
}

.ans-store-credit-step[hidden] {
	display: none;
}

.ans-store-credit-warning {
	padding: 12px;
	background: #fcf9e8;
	border: 1px solid #dba617;
	border-radius: 4px;
}

.ans-store-credit-warning p {
	flex-basis: 100%;
	margin: 0 0 4px;
}

/* Store Credit or Payment Gateway: the two options stacked, with OR centred between them. */
.ans-store-credit-step--choices {
	flex-direction: column;
	align-items: stretch;
}

.ans-store-credit-step--choices .button {
	margin: 0;
	text-align: center;
}

.ans-store-credit-or {
	display: block;
	text-align: center;
	font-weight: 600;
}

/* Top-up form (popup + My Account) */
.ans-store-credit-topup-wrapper {
	margin: 12px 0;
}

.ans-store-credit-topup-wrapper[hidden] {
	display: none;
}

.ans-store-credit-topup-presets,
.ans-store-credit-topup-custom {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 8px;
}

.ans-store-credit-topup-presets .button,
.ans-store-credit-topup-custom .button {
	margin: 0;
}

.ans-store-credit-topup-preset.is-selected {
	outline: 2px solid currentColor;
	outline-offset: 1px;
}

/* Only Predefined Buttons: the amount mirrors the selected button and must read as locked. */
.ans-store-credit-topup-custom input.ans-store-credit-topup-amount[readonly] {
	background: transparent;
	border: 1px dashed #c3c4c7;
	box-shadow: none;
	color: inherit;
	font-weight: 600;
	cursor: not-allowed;
	pointer-events: none;
	-moz-appearance: textfield;
	appearance: textfield;
}

.ans-store-credit-topup-custom input.ans-store-credit-topup-amount[readonly]::-webkit-inner-spin-button,
.ans-store-credit-topup-custom input.ans-store-credit-topup-amount[readonly]::-webkit-outer-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.ans-store-credit-topup-custom label {
	flex: 1 1 140px;
}

.ans-store-credit-topup-custom input {
	width: 100%;
}

.ans-store-credit-topup-note {
	font-size: 0.85em;
	opacity: 0.8;
}

/* My Account */
.ans-store-credit-balance-card {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 16px 20px;
	margin-bottom: 16px;
	border: 1px solid #e5e5e5;
	border-radius: 8px;
}

.ans-store-credit-balance-card__label {
	display: block;
	font-size: 0.9em;
	opacity: 0.8;
}

.ans-store-credit-balance-card__value {
	font-size: 1.6em;
}

.ans-store-credit-account-topup {
	padding: 16px 20px;
	margin-bottom: 24px;
	border: 1px dashed #c3c4c7;
	border-radius: 8px;
}

/* Store credit log statuses (Credit / Debit). */
.ans_credit_status,
.ans_debit_status {
	display: inline-flex;
	padding: 0 10px;
	line-height: 2.5em;
	color: #fff;
	border-radius: 4px;
	border-bottom: 1px solid rgba(0, 0, 0, 0.05);
	white-space: nowrap;
}

.ans_credit_status {
	background: #00cc99;
}

.ans_debit_status {
	background: #ff0000;
}
