/**
 * Toggle for WooCommerce — gift card box.
 *
 * Deliberately light-touch: it inherits the theme's form styling rather than
 * imposing its own, so the box looks native in Divi, Storefront or a block theme.
 */

.tfw-gift-card {
	margin: 0 0 1.5em;
}

.tfw-gift-card__label {
	display: block;
	font-weight: 600;
	margin-bottom: 0.35em;
}

.tfw-gift-card__row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5em;
}

.tfw-gift-card__input {
	flex: 1 1 14em;
	min-width: 0;
	margin: 0;
}

.tfw-gift-card__apply {
	margin: 0;
	flex: 0 0 auto;
}

.tfw-gift-card__remove {
	display: none;
	font-size: 0.85em;
}

.tfw-gift-card.tfw-has-card .tfw-gift-card__apply {
	display: none;
}

.tfw-gift-card.tfw-has-card .tfw-gift-card__remove {
	display: inline-block;
}

.tfw-gift-card.tfw-is-busy {
	opacity: 0.6;
}

.tfw-gift-card__message {
	margin: 0.5em 0 0;
	font-size: 0.85em;
	min-height: 1.2em;
}

.tfw-gift-card__message.tfw-is-error {
	color: #b32d2e;
}

.tfw-gift-card__message.tfw-is-success {
	color: #1a7f37;
}

/* Amount control, shown once a card is applied. */

.tfw-gift-card__applied {
	display: none;
	align-items: center;
	gap: 0.4em;
	margin-top: 0.6em;
	font-size: 0.9em;
}

.tfw-gift-card.tfw-has-card .tfw-gift-card__applied {
	display: flex;
	flex-wrap: wrap;
}

.tfw-gift-card__applied label {
	font-weight: 600;
	margin: 0;
}

.tfw-gift-card__amount {
	width: 6em;
	max-width: 6em;
	margin: 0;
	padding: 0.2em 0.4em;
	-moz-appearance: textfield;
}

.tfw-gift-card__amount::-webkit-outer-spin-button,
.tfw-gift-card__amount::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.tfw-gift-card__available {
	opacity: 0.75;
}

/* Legacy: editable amount inside the order review table. */

.tfw-order-review-row .woocommerce-Price-currencySymbol {
	position: relative;
	z-index: 1;
}

.tfw-order-review-row .tfw-amount {
	width: auto;
	max-width: 6em;
	padding: 0;
	margin: 0;
	border: 0 !important;
	background: transparent;
	font-size: inherit;
	font-weight: inherit;
	color: inherit;
	height: auto !important;
	text-align: left;
	-moz-appearance: textfield;
}

.tfw-order-review-row .tfw-amount::-webkit-outer-spin-button,
.tfw-order-review-row .tfw-amount::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.tfw-order-review-row .tfw-amount:focus {
	outline: none !important;
	text-decoration: underline dashed;
	text-underline-offset: 0.25ch;
}

.tfw-order-review-row .tfw-edit,
.tfw-order-review-row .tfw-gift-card__remove {
	display: inline-block;
	font-size: 0.75em;
	margin-left: 0.5em;
	font-weight: 400;
}
