/* Match WooCommerce Blocks coupon panel rhythm in Order summary. */
.eshpos-checkout-loyalty {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
	width: 100%;
}

.eshpos-checkout-loyalty *,
.eshpos-checkout-loyalty *::before,
.eshpos-checkout-loyalty *::after {
	box-sizing: border-box;
}

.eshpos-checkout-loyalty--mount:not(.is-mounted):not(.is-visible-fallback) {
	display: none !important;
}

.eshpos-checkout-loyalty--mount.is-visible-fallback {
	border: 1px solid #e0e0e0;
	border-radius: 4px;
	display: block;
	margin: 1rem auto;
	max-width: 420px;
	padding: 0 16px;
}

.eshpos-checkout-loyalty--panel {
	background: transparent;
	border: 0;
	border-radius: 0;
	border-top: 1px solid hsla(0, 0%, 7%, 0.11);
	box-shadow: none;
}

.eshpos-checkout-loyalty__toggle,
.eshpos-checkout-loyalty__toggle:hover,
.eshpos-checkout-loyalty__toggle:focus,
.eshpos-checkout-loyalty__toggle:active {
	align-items: center;
	background: transparent !important;
	border: 0 !important;
	border-radius: 0;
	box-shadow: none !important;
	color: inherit;
	cursor: pointer;
	display: flex;
	font-family: inherit;
	font-size: 1em;
	font-weight: 400;
	gap: 12px;
	justify-content: space-between;
	letter-spacing: normal;
	line-height: 1.5;
	margin: 0;
	min-height: 52px;
	opacity: 1;
	outline: none;
	padding: 16px;
	text-align: left;
	text-decoration: none !important;
	text-transform: none;
	width: 100%;
}

.eshpos-checkout-loyalty__toggle-label {
	align-items: center;
	color: inherit;
	display: inline-flex;
	flex: 1 1 auto;
	font-weight: 400;
	line-height: 1.5;
	min-width: 0;
	text-decoration: none !important;
}

.eshpos-checkout-loyalty__toggle-icon {
	align-items: center;
	color: inherit;
	display: inline-flex;
	flex: 0 0 24px;
	height: 24px;
	justify-content: center;
	line-height: 0;
	margin: 0;
	opacity: 0.8;
	width: 24px;
}

.eshpos-checkout-loyalty__toggle-icon svg {
	display: block;
	height: 18px;
	transform: rotate(0deg);
	transition: transform 0.15s ease;
	width: 18px;
}

.eshpos-checkout-loyalty__toggle.is-open .eshpos-checkout-loyalty__toggle-icon svg {
	transform: rotate(180deg);
}

.eshpos-checkout-loyalty__body {
	margin-top: -4px;
	padding: 0 0 16px;
}

.eshpos-checkout-loyalty__form {
	align-items: center;
	display: grid;
	gap: 8px;
	grid-template-columns: minmax(0, 1fr) auto;
}

.eshpos-checkout-loyalty__input {
	border: 1px solid #50575e;
	border-radius: 4px;
	font-size: 1em !important;
	height: 42px;
	line-height: 1.2;
	margin: 0 !important;
	max-width: none;
	min-height: 42px;
	padding: 0 12px !important;
	width: 100%;
}

.eshpos-checkout-loyalty__input:focus {
	border-color: #1e1e1e;
	outline: 2px solid transparent;
}

.eshpos-checkout-loyalty__apply,
.eshpos-checkout-loyalty__apply.button {
	align-items: center;
	border-radius: 4px;
	display: inline-flex;
	font-size: 0.9em;
	font-weight: 600;
	height: 42px;
	justify-content: center;
	line-height: 1;
	margin: 0;
	min-height: 42px;
	padding: 0 14px !important;
	white-space: nowrap;
}

.eshpos-checkout-loyalty__applied {
	align-items: center;
	display: flex;
	flex-wrap: wrap;
	font-size: 0.95em;
	font-weight: 600;
	gap: 8px 12px;
	justify-content: space-between;
	line-height: 1.4;
	padding: 14px 0;
}

.eshpos-checkout-loyalty__applied span {
	min-width: 0;
	overflow-wrap: anywhere;
}

.eshpos-checkout-loyalty__remove,
.eshpos-checkout-loyalty__remove.button-link {
	background: transparent !important;
	border: 0 !important;
	box-shadow: none !important;
	color: #cc1818 !important;
	cursor: pointer;
	font-size: 0.9em;
	font-weight: 500;
	line-height: 1.2;
	margin: 0;
	padding: 0 !important;
	text-decoration: underline;
}

.eshpos-checkout-loyalty__message {
	font-size: 0.85em;
	line-height: 1.4;
	margin: 8px 0 0;
}

.eshpos-checkout-loyalty__message.is-error {
	color: #cc1818;
}

.eshpos-checkout-loyalty__message.is-success {
	color: #007017;
}

.eshpos-checkout-loyalty__hint {
	color: #757575;
	font-size: 0.9em;
	margin: 0;
	padding: 14px 0;
}

/* Critical: author display rules must not override the hidden attribute. */
.eshpos-checkout-loyalty [hidden],
.eshpos-checkout-loyalty__toggle[hidden],
.eshpos-checkout-loyalty__body[hidden],
.eshpos-checkout-loyalty__applied[hidden],
.eshpos-checkout-loyalty__message[hidden] {
	display: none !important;
}

/* When a voucher is applied, keep a single compact row. */
.eshpos-checkout-loyalty.has-voucher .eshpos-checkout-loyalty__toggle,
.eshpos-checkout-loyalty.has-voucher .eshpos-checkout-loyalty__body {
	display: none !important;
}

@media (max-width: 480px) {
	.eshpos-checkout-loyalty__form {
		grid-template-columns: 1fr;
	}

	.eshpos-checkout-loyalty__apply,
	.eshpos-checkout-loyalty__apply.button {
		width: 100%;
	}
}
