/**
 * Checkout & order-pay — payment methods list fixes.
 * order-pay uses #payment without .woocommerce-checkout-payment, so plugin/theme rules may not apply.
 */

.woocommerce-checkout #payment ul.payment_methods,
.woocommerce-checkout #payment ul.wc_payment_methods,
.woocommerce-order-pay #payment ul.payment_methods,
.woocommerce-order-pay #payment ul.wc_payment_methods {
	list-style: none !important;
	margin: 0;
	padding-left: 0;
}

.woocommerce-checkout #payment ul.payment_methods > li,
.woocommerce-checkout #payment ul.wc_payment_methods > li,
.woocommerce-order-pay #payment ul.payment_methods > li,
.woocommerce-order-pay #payment ul.wc_payment_methods > li {
	list-style: none !important;
	margin-left: 0;
	padding-left: 0;
}

.woocommerce-checkout #payment ul.payment_methods > li::marker,
.woocommerce-checkout #payment ul.wc_payment_methods > li::marker,
.woocommerce-order-pay #payment ul.payment_methods > li::marker,
.woocommerce-order-pay #payment ul.wc_payment_methods > li::marker {
	content: none;
}

.woocommerce-checkout #payment .wc_payment_methods img,
.woocommerce-order-pay #payment .wc_payment_methods img,
#payment .wc_payment_methods img {
	max-height: 24px !important;
	width: auto !important;
	height: auto !important;
	max-width: 100px !important;
	float: none !important;
	display: inline-block;
	vertical-align: middle;
	margin: 0 0 0 0.45em !important;
	object-fit: contain;
}

.woocommerce-checkout #payment .wc_payment_methods label,
.woocommerce-order-pay #payment .wc_payment_methods label {
	display: inline-flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 0.35rem;
	line-height: 1.4;
	cursor: pointer;
}

@media (max-width: 849px) {
	.woocommerce-checkout #payment ul.payment_methods,
	.woocommerce-order-pay #payment ul.payment_methods {
		padding: 0.75rem 0;
	}

	.woocommerce-checkout #payment .wc_payment_methods .wc_payment_method,
	.woocommerce-order-pay #payment .wc_payment_methods .wc_payment_method {
		padding: 0.55rem 0;
	}

	.woocommerce-checkout #payment .wc_payment_methods img,
	.woocommerce-order-pay #payment .wc_payment_methods img,
	#payment .wc_payment_methods .payment_method_lwc-whatsapp-order img {
		max-height: 22px !important;
		max-width: 22px !important;
	}
}

/* Classic checkout / order-pay — credit card form (not block checkout) */
.woocommerce-checkout #payment div.payment_box,
.woocommerce-order-pay #payment div.payment_box {
	background: #f8f9fb !important;
	border: 1px solid rgba(0, 0, 0, 0.08) !important;
	border-radius: 12px !important;
	padding: 0.9rem 0.85rem !important;
	margin: 0.65rem 0 0 !important;
	font-size: 0.875rem;
	line-height: 1.5;
}

.woocommerce-checkout #payment div.payment_box::before,
.woocommerce-order-pay #payment div.payment_box::before,
.woocommerce-checkout #payment div.payment_box::after,
.woocommerce-order-pay #payment div.payment_box::after {
	display: none !important;
}

.woocommerce-checkout #payment div.payment_box > p,
.woocommerce-order-pay #payment div.payment_box > p {
	margin: 0 0 0.75rem;
	color: rgba(0, 0, 0, 0.62);
	font-size: 0.8125rem;
	line-height: 1.45;
}

.woocommerce-checkout #payment fieldset.wc-credit-card-form,
.woocommerce-order-pay #payment fieldset.wc-credit-card-form,
#payment fieldset.wc-credit-card-form {
	border: 0;
	margin: 0;
	padding: 0;
	min-width: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem 0.85rem;
}

.woocommerce-checkout #payment fieldset.wc-credit-card-form .clear,
.woocommerce-order-pay #payment fieldset.wc-credit-card-form .clear,
#payment fieldset.wc-credit-card-form .clear {
	display: none;
}

.woocommerce-checkout #payment .wc-credit-card-form .form-row,
.woocommerce-order-pay #payment .wc-credit-card-form .form-row,
#payment .wc-credit-card-form .form-row {
	float: none !important;
	width: auto !important;
	margin: 0 !important;
	padding: 0 !important;
}

.woocommerce-checkout #payment .wc-credit-card-form .form-row-wide,
.woocommerce-order-pay #payment .wc-credit-card-form .form-row-wide,
#payment .wc-credit-card-form .form-row-wide {
	flex: 1 1 100%;
}

.woocommerce-checkout #payment .wc-credit-card-form .form-row-first,
.woocommerce-order-pay #payment .wc-credit-card-form .form-row-first,
.woocommerce-checkout #payment .wc-credit-card-form .form-row-last,
.woocommerce-order-pay #payment .wc-credit-card-form .form-row-last,
#payment .wc-credit-card-form .form-row-first,
#payment .wc-credit-card-form .form-row-last {
	flex: 1 1 calc(50% - 0.45rem);
	min-width: 0;
}

.woocommerce-checkout #payment .wc-credit-card-form label,
.woocommerce-order-pay #payment .wc-credit-card-form label,
#payment .wc-credit-card-form label {
	display: block;
	margin: 0 0 0.35rem;
	font-size: 0.8125rem;
	font-weight: 600;
	line-height: 1.3;
	color: rgba(0, 0, 0, 0.78);
}

.woocommerce-checkout #payment .wc-credit-card-form .required,
.woocommerce-order-pay #payment .wc-credit-card-form .required,
#payment .wc-credit-card-form .required {
	color: #c40000;
	text-decoration: none;
}

.woocommerce-checkout #payment .wc-credit-card-form .input-text,
.woocommerce-order-pay #payment .wc-credit-card-form .input-text,
#payment .wc-credit-card-form .input-text {
	width: 100% !important;
	box-sizing: border-box;
	margin: 0;
	padding: 0.65rem 0.75rem;
	font-size: 16px;
	line-height: 1.35;
	color: rgba(0, 0, 0, 0.85);
	border: 1px solid rgba(0, 0, 0, 0.12) !important;
	border-radius: 10px !important;
	background: #fff !important;
	box-shadow: none !important;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
	-webkit-appearance: none;
	appearance: none;
}

.woocommerce-checkout #payment .wc-credit-card-form .input-text::placeholder,
.woocommerce-order-pay #payment .wc-credit-card-form .input-text::placeholder,
#payment .wc-credit-card-form .input-text::placeholder {
	color: rgba(0, 0, 0, 0.38);
}

.woocommerce-checkout #payment .wc-credit-card-form .input-text:focus,
.woocommerce-order-pay #payment .wc-credit-card-form .input-text:focus,
#payment .wc-credit-card-form .input-text:focus {
	outline: none !important;
	border-color: rgba(var(--fs-color-primary-rgb, 68, 96, 132), 0.55) !important;
	box-shadow: 0 0 0 3px rgba(var(--fs-color-primary-rgb, 68, 96, 132), 0.12) !important;
}

/* Card brand icons in gateway title (isafepaycc / vmccline) */
.woocommerce-checkout #payment .payment_method_isafepaycc > label img,
.woocommerce-order-pay #payment .payment_method_isafepaycc > label img,
.woocommerce-checkout #payment .payment_method_vmccline > label img,
.woocommerce-order-pay #payment .payment_method_vmccline > label img {
	max-height: 20px !important;
	width: auto !important;
	margin: 0 0 0 0.25em !important;
	vertical-align: middle;
}

@media (max-width: 849px) {
	.woocommerce-checkout #payment div.payment_box,
	.woocommerce-order-pay #payment div.payment_box {
		padding: 0.8rem 0.75rem !important;
	}

	.woocommerce-checkout #payment .wc-credit-card-form .form-row-first,
	.woocommerce-order-pay #payment .wc-credit-card-form .form-row-first,
	.woocommerce-checkout #payment .wc-credit-card-form .form-row-last,
	.woocommerce-order-pay #payment .wc-credit-card-form .form-row-last,
	#payment .wc-credit-card-form .form-row-first,
	#payment .wc-credit-card-form .form-row-last {
		flex: 1 1 calc(50% - 0.4rem);
	}
}

/* YITH Points — redeem rewards message (block checkout) */
.wp-block-yith-par-message-reward-cart_container {
	margin: 0 0 0.85rem;
}

.wp-block-yith-par-message-reward-cart_container .wp-block-yith-par-message-reward-cart,
.woocommerce-checkout #yith-par-message-reward-cart {
	background: linear-gradient(135deg, rgba(var(--fs-color-primary-rgb, 68, 96, 132), 0.07) 0%, #f8f9fb 55%) !important;
	border: 1px solid rgba(0, 0, 0, 0.08) !important;
	border-radius: 12px !important;
	color: rgba(0, 0, 0, 0.76) !important;
	padding: 0.9rem 0.85rem !important;
	margin: 0 !important;
	font-size: 0.875rem;
	line-height: 1.55;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

.wp-block-yith-par-message-reward-cart_container .wp-block-yith-par-message-reward-cart::before,
.wp-block-yith-par-message-reward-cart_container .wp-block-yith-par-message-reward-cart::after,
.woocommerce-checkout #yith-par-message-reward-cart::before,
.woocommerce-checkout #yith-par-message-reward-cart::after {
	display: none !important;
}

.wp-block-yith-par-message-reward-cart_container .wp-block-yith-par-message-reward-cart strong,
.woocommerce-checkout #yith-par-message-reward-cart strong {
	color: rgba(0, 0, 0, 0.9);
	font-weight: 700;
}

.wp-block-yith-par-message-reward-cart_container .wp-block-yith-par-message-reward-cart .woocommerce-Price-amount,
.woocommerce-checkout #yith-par-message-reward-cart .woocommerce-Price-amount {
	font-weight: 700;
	color: var(--fs-color-secondary, #c40000);
}

.wp-block-yith-par-message-reward-cart_container .ywpar_apply_discounts,
.woocommerce-checkout #yith-par-message-reward-cart .ywpar_apply_discounts {
	display: inline;
	margin: 0;
}

.wp-block-yith-par-message-reward-cart_container .default-layout .ywpar_apply_discounts,
.woocommerce-checkout #yith-par-message-reward-cart.default-layout .ywpar_apply_discounts {
	display: inline;
}

.wp-block-yith-par-message-reward-cart_container .ywpar_apply_discounts > span,
.woocommerce-checkout #yith-par-message-reward-cart .ywpar_apply_discounts > span {
	display: inline;
	vertical-align: middle;
}

.wp-block-yith-par-message-reward-cart_container #ywpar-points-max,
.woocommerce-checkout #yith-par-message-reward-cart #ywpar-points-max {
	display: inline-block;
	vertical-align: middle;
	max-width: none !important;
	min-width: 0;
	width: 5.25rem;
	margin: 0;
	padding: 0.5rem 0.55rem;
	font-size: 16px;
	line-height: 1.3;
	text-align: center;
	border: 1px solid rgba(0, 0, 0, 0.12) !important;
	border-radius: 8px !important;
	background: #fff !important;
	box-shadow: none !important;
}

.wp-block-yith-par-message-reward-cart_container #ywpar-points-max:focus,
.woocommerce-checkout #yith-par-message-reward-cart #ywpar-points-max:focus {
	outline: none;
	border-color: rgba(var(--fs-color-primary-rgb, 68, 96, 132), 0.5) !important;
	box-shadow: 0 0 0 3px rgba(var(--fs-color-primary-rgb, 68, 96, 132), 0.1) !important;
}

.wp-block-yith-par-message-reward-cart_container #ywpar_apply_discounts,
.woocommerce-checkout #yith-par-message-reward-cart #ywpar_apply_discounts {
	display: inline-block;
	vertical-align: middle;
	margin: 0 !important;
	padding: 0.5rem 0.95rem !important;
	font-size: 0.8125rem !important;
	font-weight: 600;
	line-height: 1.3;
	border-radius: 8px !important;
	text-transform: none;
	letter-spacing: 0;
	min-height: 38px;
	box-shadow: none;
}

.wp-block-yith-par-message-reward-cart_container .ywpar-button-message,
.woocommerce-checkout #yith-par-message-reward-cart .ywpar-button-message {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin: 0 0 0 0.35rem;
	vertical-align: middle;
	padding: 0.5rem 0.95rem;
	font-size: 0.8125rem;
	font-weight: 600;
	line-height: 1.3;
	text-decoration: none !important;
	border-radius: 8px;
	background: var(--fs-color-primary, #446084);
	color: #fff !important;
}

.wp-block-yith-par-message-reward-cart_container .ywpar_apply_discounts_container,
.woocommerce-checkout #yith-par-message-reward-cart .ywpar_apply_discounts_container {
	margin-top: 0.65rem;
}

.wp-block-yith-par-message-reward-cart_container .ywpar_apply_discounts_container .ywpar_apply_discounts,
.woocommerce-checkout #yith-par-message-reward-cart .ywpar_apply_discounts_container .ywpar_apply_discounts {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem;
}

.wp-block-yith-par-message-reward-cart_container .ywpar_apply_discounts .form-row,
.woocommerce-checkout #yith-par-message-reward-cart .ywpar_apply_discounts .form-row {
	float: none !important;
	width: auto !important;
	margin: 0 !important;
	padding: 0 !important;
}

.wp-block-yith-par-message-reward-cart_container .ywpar_min_reedem_value_error,
.woocommerce-checkout #yith-par-message-reward-cart .ywpar_min_reedem_value_error {
	margin-top: 0.35rem;
	font-size: 0.75rem;
}

@media (max-width: 849px) {
	.wp-block-yith-par-message-reward-cart_container {
		margin: 0 0 0.65rem;
	}

	.wp-block-yith-par-message-reward-cart_container .wp-block-yith-par-message-reward-cart,
	.woocommerce-checkout #yith-par-message-reward-cart {
		padding: 0.8rem 0.75rem !important;
		font-size: 0.8125rem;
		line-height: 1.55;
	}

	.wp-block-yith-par-message-reward-cart_container #ywpar-points-max,
	.woocommerce-checkout #yith-par-message-reward-cart #ywpar-points-max {
		width: 4.5rem;
		padding: 0.4rem 0.45rem;
	}

	.wp-block-yith-par-message-reward-cart_container #ywpar_apply_discounts,
	.woocommerce-checkout #yith-par-message-reward-cart #ywpar_apply_discounts {
		padding: 0.4rem 0.75rem !important;
		min-height: 34px;
	}
}

/* YITH Apply Points — loading state (Block Checkout sync) */
@keyframes cnvapes-ywpar-spin {
	to {
		transform: rotate(360deg);
	}
}

#ywpar_apply_discounts.cnvapes-ywpar-is-loading,
.ywpar-button-message.cnvapes-ywpar-is-loading {
	position: relative;
	pointer-events: none;
	opacity: 0.85;
}

#ywpar_apply_discounts.cnvapes-ywpar-is-loading .cnvapes-ywpar-btn-label,
.ywpar-button-message.cnvapes-ywpar-is-loading .cnvapes-ywpar-btn-label {
	visibility: hidden;
}

#ywpar_apply_discounts.cnvapes-ywpar-is-loading::before,
.ywpar-button-message.cnvapes-ywpar-is-loading::before {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: 1rem;
	height: 1rem;
	margin: -0.5rem 0 0 -0.5rem;
	border: 2px solid rgba(255, 255, 255, 0.35);
	border-top-color: #fff;
	border-radius: 50%;
	animation: cnvapes-ywpar-spin 0.65s linear infinite;
}

.cnvapes-ywpar-summary-loading {
	position: relative;
}

.cnvapes-ywpar-summary-loading > .cnvapes-ywpar-summary-overlay {
	position: absolute;
	inset: 0;
	z-index: 20;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-direction: column;
	gap: 0.65rem;
	background: rgba(255, 255, 255, 0.82);
	border-radius: 8px;
	pointer-events: none;
}

.cnvapes-ywpar-summary-loading > .cnvapes-ywpar-summary-overlay::before {
	content: '';
	width: 1.35rem;
	height: 1.35rem;
	border: 2px solid rgba(0, 0, 0, 0.08);
	border-top-color: var(--fs-color-primary, #446084);
	border-radius: 50%;
	animation: cnvapes-ywpar-spin 0.65s linear infinite;
}

.cnvapes-ywpar-summary-loading > .cnvapes-ywpar-summary-overlay .cnvapes-ywpar-summary-label {
	font-size: 0.8125rem;
	font-weight: 600;
	color: #333;
	text-align: center;
	padding: 0 1rem;
	line-height: 1.4;
}
