/* Vaikystė Shop Extras — checkout polish
 * Loaded on cart + checkout only. Scoped to checkout/cart wrappers so it
 * can never leak into the shop or product pages.
 */

/* -------------------------------------------------------------------
 * 1. Payment methods list — modern tiles, radio and label on one row
 * ----------------------------------------------------------------- */
.woocommerce-checkout #payment ul.payment_methods,
.woocommerce-cart #payment ul.payment_methods {
	padding: 0 !important;
	border-bottom: 0 !important;
}

.woocommerce-checkout #payment ul.payment_methods li,
.woocommerce-cart #payment ul.payment_methods li {
	display: flex !important;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin: 0 0 10px !important;
	padding: 12px 14px !important;
	list-style: none !important;
	background: #fff;
	border: 1px solid #e8e8e8;
	border-radius: 12px;
}

.woocommerce-checkout #payment ul.payment_methods li > label,
.woocommerce-cart #payment ul.payment_methods li > label {
	display: inline-flex !important;
	align-items: center;
	gap: 8px;
	margin: 0 !important;
	font-weight: 700 !important;
	color: #343538;
	cursor: pointer;
}

.woocommerce-checkout #payment ul.payment_methods li > label img,
.woocommerce-cart #payment ul.payment_methods li > label img {
	max-height: 22px;
	width: auto;
	margin-left: 4px;
}

.woocommerce-checkout #payment ul.payment_methods li > input.input-radio,
.woocommerce-cart #payment ul.payment_methods li > input.input-radio {
	float: none !important;
	margin: 0 !important;
	accent-color: #e84d35;
}

/* the method description sits on its own full-width row, bold and dark */
.woocommerce-checkout #payment ul.payment_methods li .payment_box,
.woocommerce-cart #payment ul.payment_methods li .payment_box {
	flex: 0 0 100%;
	width: 100%;
	margin: 10px 0 0 !important;
	color: #343538 !important;
	font-weight: 600;
	line-height: 1.5;
}

.woocommerce-checkout #payment ul.payment_methods li .payment_box p,
.woocommerce-cart #payment ul.payment_methods li .payment_box p {
	font-weight: 600;
	color: #343538;
	margin: 0 0 4px;
}

/* -------------------------------------------------------------------
 * 2. Paysera bank list — grid of cards instead of one long grey column
 * ----------------------------------------------------------------- */
#payment .payment_method_paysera #paysera_country {
	width: auto !important;
	max-width: 260px;
	height: 40px;
	margin: 0 0 14px;
	padding: 0 10px;
	font-size: 13px;
	font-weight: 600;
	color: #343538;
	background: #fff;
	border: 1px solid #dcdcdc;
	border-radius: 8px;
}

/* 6-track grid: a normal option takes 2 tracks (3 per row), so a group that
 * holds only two options can split the row in half and give the long names
 * the width they need without growing taller. */
#payment .payment_method_paysera .payment-group-wrapper {
	display: grid;
	grid-template-columns: repeat(6, minmax(0, 1fr));
	gap: 10px;
	margin: 0 0 16px;
}

#payment .payment_method_paysera .payment-group-title {
	grid-column: 1 / -1;
	margin: 6px 0 0;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #8a8a8a;
}

#payment .payment_method_paysera .paysera-payment-method {
	grid-column: span 2;
	margin: 0 !important;
	min-width: 0;
}

/* a group with two options only: they share the full row evenly */
#payment .payment_method_paysera
	.payment-group-wrapper:not(:has(.paysera-payment-method ~ .paysera-payment-method ~ .paysera-payment-method))
	.paysera-payment-method {
	grid-column: span 3;
}

/* a group that holds a single option: it takes the whole row (must come last,
 * because a one-option group also matches the two-option rule above) */
#payment .payment_method_paysera
	.payment-group-wrapper:not(:has(.paysera-payment-method ~ .paysera-payment-method))
	.paysera-payment-method {
	grid-column: 1 / -1;
}

/* The last row is balanced by checkout.js, which counts the visible tiles per
 * group (Paysera hides options by country, so CSS alone cannot count them) and
 * stretches the leftover two tiles across the full row. */

#payment .payment_method_paysera .paysera-payment-method-label {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	width: 100%;
	min-height: 56px;
	padding: 10px 12px;
	background: #fff;
	border: 1px solid #e8e8e8;
	border-radius: 12px;
	cursor: pointer;
	transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

#payment .payment_method_paysera .paysera-payment-method-label:hover {
	border-color: #c9c9c9;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

#payment .payment_method_paysera .paysera-payment-method-label > div:first-child {
	display: flex;
	align-items: center;
	gap: 8px;
	min-width: 0;
}

#payment .payment_method_paysera .paysera-text {
	font-size: 12.5px;
	font-weight: 600;
	line-height: 1.25;
	color: #343538;
	overflow-wrap: anywhere;
}

#payment .payment_method_paysera .paysera-image {
	flex: 0 0 58px;
	width: 58px;
	display: flex;
	align-items: center;
	justify-content: flex-end;
}

#payment .payment_method_paysera .paysera-image img {
	display: block;
	max-height: 20px;
	max-width: 58px;
	width: auto;
	height: auto;
	object-fit: contain;
	object-position: right center;
}

/* the manual-transfer account field under "Banko pavedimas" */
#payment .payment_method_paysera input[type="text"] {
	width: 100%;
	height: 44px;
	padding: 0 12px;
	font-size: 13px;
	color: #343538;
	background: #fff;
	border: 1px solid #dcdcdc;
	border-radius: 8px;
}

#payment .payment_method_paysera input[type="radio"] {
	margin: 0 !important;
	accent-color: #e84d35;
}

/* selected card */
#payment .payment_method_paysera .paysera-payment-method-label:has(input:checked),
#payment .payment_method_paysera .paysera-payment-active .paysera-payment-method-label {
	border-color: #e84d35;
	background: #fff8f6;
	box-shadow: inset 0 0 0 1px #e84d35;
}

/* -------------------------------------------------------------------
 * 3. Shipping — pickup point label / dropdown in black, not grey
 * ----------------------------------------------------------------- */
.woocommerce-checkout .mp-selected-pickup-point-info,
.woocommerce-checkout .mp-selected-pickup-point-info *,
.woocommerce-checkout .select2-container .select2-selection--single .select2-selection__rendered,
.woocommerce-checkout .select2-container .select2-selection--single .select2-selection__placeholder,
.woocommerce-checkout .select2-container .select2-selection__arrow,
.woocommerce-checkout .select2-dropdown,
.woocommerce-checkout .select2-results__option {
	color: #343538 !important;
	font-weight: 500;
}

.woocommerce-checkout .select2-container .select2-selection--single {
	height: 44px;
	background: #fff;
	border: 1px solid #dcdcdc;
	border-radius: 8px;
}

.woocommerce-checkout .select2-container .select2-selection--single .select2-selection__rendered {
	line-height: 42px;
	padding-left: 12px;
}

.woocommerce-checkout .select2-container .select2-selection--single .select2-selection__arrow {
	height: 42px;
}

/* the pickup-point field label */
.woocommerce-checkout .form-row label[for*="pickup"],
.woocommerce-checkout .form-row label[for*="terminal"],
.woocommerce-checkout .multiparcels-grid-display-text {
	color: #343538 !important;
	font-weight: 600;
}

/* -------------------------------------------------------------------
 * 4. Mobile: keep the card grid single-column and roomy
 * ----------------------------------------------------------------- */
@media (max-width: 767px) {
	#payment .payment_method_paysera .payment-group-wrapper {
		grid-template-columns: 1fr;
	}

	#payment .payment_method_paysera .paysera-payment-method {
		grid-column: 1 / -1 !important;
	}

	.woocommerce-checkout #payment ul.payment_methods li,
	.woocommerce-cart #payment ul.payment_methods li {
		padding: 12px !important;
	}
}

/* -------------------------------------------------------------------
 * 5. Company purchase — checkbox and conditional company fields
 * ----------------------------------------------------------------- */
.woocommerce-checkout #billing_is_company_field,
.woocommerce-checkout #billing_wants_invoice_field {
	margin: 0 0 14px;
	padding: 12px 14px;
	background: #f7f7f7;
	border: 1px solid #e8e8e8;
	border-radius: 10px;
}

.woocommerce-checkout #billing_is_company_field label,
.woocommerce-checkout #billing_wants_invoice_field label {
	display: flex !important;
	align-items: center;
	gap: 10px;
	margin: 0 !important;
	font-weight: 600;
	color: #343538;
	cursor: pointer;
}

.woocommerce-checkout #billing_is_company_field input[type="checkbox"],
.woocommerce-checkout #billing_wants_invoice_field input[type="checkbox"] {
	margin: 0 !important;
	width: 18px;
	height: 18px;
	accent-color: #e84d35;
	flex: 0 0 auto;
}

.vkx-company-off {
	display: none !important;
}

/* WooCommerce appends its own „(nebūtinas)“ marker to optional checkbox
   labels; these two carry their own wording already. */
.woocommerce-checkout #billing_is_company_field .optional,
.woocommerce-checkout #billing_wants_invoice_field .optional {
	display: none;
}

.woocommerce-checkout #billing_wants_invoice_field.vkx-hidden {
	display: none !important;
}

.woocommerce-checkout #billing_wants_invoice_field {
	margin: 0 0 24px;
}

/* invoice details on the customer's order view */
.vkx-order-company {
	margin: 18px 0 0;
	padding: 14px 16px;
	background: #f7f7f7;
	border: 1px solid #e8e8e8;
	border-radius: 10px;
	font-size: 14px;
}

.vkx-order-company p {
	margin: 0 0 4px;
}

