/**
 * Phoenix B2B — 2.13.00 twarda naprawa checkoutu / zakładki „Zamówienie" (CSS-only).
 *
 * PO CO TA WARSTWA (diagnoza kaskady):
 *  panel-bundle.css ma dla mobile reguły o WYŻSZEJ specyficzności niż karty
 *  z 2.12.99 (np. `.phoenix-b2b-panel .pb2b-checkout-woo
 *  .woocommerce-checkout-review-order-table tfoot tr.woocommerce-shipping-totals
 *  #shipping_method li` = 1 ID + 4 klasy) i wymuszał `display:flex` +
 *  `text-align:right` na td tfoot — efekt: karta traciła układ grid, długa nazwa
 *  („InPost Paczkomaty…") była dociskana do prawej i UCINANA Z LEWEJ przez
 *  overflow rodzica. Ta warstwa ładuje się OSTATNIA i każdą regułę pisze z
 *  specyficznością ≥ panel-bundle (1 ID + ≥5 klas), bez transformów, bez
 *  ujemnych offsetów, bez overflow:hidden na rodzicach tekstu.
 *
 * Zakres: WYŁĄCZNIE checkout panelu B2B (`.phoenix-b2b-panel .pb2b-checkout-woo`).
 * Standardowy checkout WooCommerce poza panelem — nietknięty.
 *
 * @package PhoenixB2B
 */

/* =========================================================================
 * 0) RODZICE LISTY METOD — zero ucinania, zero poziomego scrolla, LTR.
 *    (Pokrywa oba konteksty: tabelę podsumowania ORAZ pola dostawy.)
 * ======================================================================= */
.phoenix-b2b-panel.pb2b-app .pb2b-checkout-woo .woocommerce-checkout-review-order-table tfoot tr.woocommerce-shipping-totals,
.phoenix-b2b-panel.pb2b-app .pb2b-checkout-woo .woocommerce-checkout-review-order-table tfoot tr.woocommerce-shipping-totals th,
.phoenix-b2b-panel.pb2b-app .pb2b-checkout-woo .woocommerce-checkout-review-order-table tfoot tr.woocommerce-shipping-totals td {
	display: block !important;
	width: 100% !important;
	max-width: 100% !important;
	min-width: 0 !important;
	text-align: left !important;
	direction: ltr !important;
	overflow: visible !important;
	transform: none !important;
	text-indent: 0 !important;
	white-space: normal !important;
}
.phoenix-b2b-panel.pb2b-app .pb2b-checkout-woo .woocommerce-checkout-review-order-table tfoot tr.woocommerce-shipping-totals th {
	margin: 0 0 8px !important;
	padding: 0 !important;
	font-weight: 700 !important;
}
.phoenix-b2b-panel.pb2b-app .pb2b-checkout-woo .woocommerce-checkout-review-order-table tfoot tr.woocommerce-shipping-totals td {
	padding: 0 !important;
	border: 0 !important;
}

/* Sama lista metod — pełna szerokość, pionowo, bez list-style. */
.phoenix-b2b-panel.pb2b-app .pb2b-checkout-woo .woocommerce-checkout-review-order-table tfoot tr.woocommerce-shipping-totals ul#shipping_method,
.phoenix-b2b-panel.pb2b-app .pb2b-checkout-woo #order_review ul#shipping_method,
.phoenix-b2b-panel.pb2b-app .pb2b-checkout-woo ul#shipping_method,
.phoenix-b2b-panel.pb2b-app .pb2b-checkout-woo ul.woocommerce-shipping-methods {
	display: flex !important;
	flex-direction: column !important;
	gap: 10px !important;
	width: 100% !important;
	max-width: 100% !important;
	margin: 0 !important;
	padding: 0 !important;
	list-style: none !important;
	overflow: visible !important;
}

/* =========================================================================
 * 1) KARTA METODY — grid: radio | nazwa+cena | (rozbicie pod spodem).
 *    Specyficzność: 1 ID + 5/6 klas → wygrywa z panel-bundle (1 ID + 4 klasy).
 * ======================================================================= */
.phoenix-b2b-panel.pb2b-app .pb2b-checkout-woo .woocommerce-checkout-review-order-table tfoot tr.woocommerce-shipping-totals ul#shipping_method > li,
.phoenix-b2b-panel.pb2b-app .pb2b-checkout-woo #order_review ul#shipping_method > li,
.phoenix-b2b-panel.pb2b-app .pb2b-checkout-woo form.checkout ul#shipping_method > li,
.phoenix-b2b-panel.pb2b-app .pb2b-checkout-woo form.checkout ul.woocommerce-shipping-methods > li {
	display: grid !important;
	grid-template-columns: 22px minmax(0, 1fr) !important;
	grid-template-areas: "radio label" "radio extra" !important;
	align-items: start !important;
	gap: 4px 12px !important;
	width: 100% !important;
	max-width: 100% !important;
	min-width: 0 !important;
	margin: 0 !important;
	padding: 16px 18px !important;
	border: 1px solid var(--pb2b-border, rgba(255, 255, 255, .1)) !important;
	border-radius: 18px !important;
	background: var(--pb2b-bg-2, rgba(255, 255, 255, .03)) !important;
	cursor: pointer !important;
	overflow: visible !important;
	position: static !important;
	transform: none !important;
	left: auto !important;
	text-indent: 0 !important;
	text-align: left !important;
	direction: ltr !important;
}
.phoenix-b2b-panel.pb2b-app .pb2b-checkout-woo form.checkout ul#shipping_method > li:has(input:checked),
.phoenix-b2b-panel.pb2b-app .pb2b-checkout-woo #order_review ul#shipping_method > li:has(input:checked) {
	border-color: var(--pb2b-primary, #7C3AED) !important;
	box-shadow: 0 0 0 2px color-mix(in srgb, var(--pb2b-primary, #7C3AED) 30%, transparent) !important;
}

/* Radio — statyczne, w kolumnie, nigdy nie nachodzi na tekst. */
.phoenix-b2b-panel.pb2b-app .pb2b-checkout-woo .woocommerce-checkout-review-order-table tfoot tr.woocommerce-shipping-totals ul#shipping_method > li > input[type="radio"],
.phoenix-b2b-panel.pb2b-app .pb2b-checkout-woo #order_review ul#shipping_method > li > input[type="radio"],
.phoenix-b2b-panel.pb2b-app .pb2b-checkout-woo form.checkout ul#shipping_method > li > input[type="radio"],
.phoenix-b2b-panel.pb2b-app .pb2b-checkout-woo form.checkout ul.woocommerce-shipping-methods > li > input[type="radio"] {
	grid-area: radio !important;
	width: 18px !important;
	height: 18px !important;
	margin: 3px 0 0 !important;
	position: static !important;
	float: none !important;
	transform: none !important;
	accent-color: var(--pb2b-primary, #7C3AED) !important;
	flex: none !important;
}

/* Nazwa metody — PEŁNA, zawijana, nigdy nie ucięta (z żadnej strony). */
.phoenix-b2b-panel.pb2b-app .pb2b-checkout-woo .woocommerce-checkout-review-order-table tfoot tr.woocommerce-shipping-totals ul#shipping_method > li > label,
.phoenix-b2b-panel.pb2b-app .pb2b-checkout-woo #order_review ul#shipping_method > li > label,
.phoenix-b2b-panel.pb2b-app .pb2b-checkout-woo form.checkout ul#shipping_method > li > label,
.phoenix-b2b-panel.pb2b-app .pb2b-checkout-woo form.checkout ul.woocommerce-shipping-methods > li > label {
	grid-area: label !important;
	display: block !important;
	width: 100% !important;
	min-width: 0 !important;
	max-width: 100% !important;
	margin: 0 !important;
	padding: 0 !important;
	white-space: normal !important;
	overflow: visible !important;
	text-overflow: clip !important;
	overflow-wrap: anywhere !important;
	word-break: normal !important;
	text-indent: 0 !important;
	text-align: left !important;
	direction: ltr !important;
	transform: none !important;
	position: static !important;
	font-weight: 600 !important;
	line-height: 1.4 !important;
	color: var(--pb2b-text, #e7e9ee) !important;
	cursor: pointer !important;
}

/* Cena w labelce WC — po prawej na szerokich, pod nazwą na wąskich. */
.phoenix-b2b-panel.pb2b-app .pb2b-checkout-woo form.checkout ul#shipping_method > li > label .woocommerce-Price-amount,
.phoenix-b2b-panel.pb2b-app .pb2b-checkout-woo #order_review ul#shipping_method > li > label .woocommerce-Price-amount,
.phoenix-b2b-panel.pb2b-app .pb2b-checkout-woo form.checkout ul#shipping_method > li > label .amount {
	float: right !important;
	margin-left: 10px !important;
	white-space: nowrap !important;
	font-weight: 700 !important;
	color: var(--pb2b-text-strong, #fff) !important;
}
@media (max-width: 560px) {
	.phoenix-b2b-panel.pb2b-app .pb2b-checkout-woo form.checkout ul#shipping_method > li > label .woocommerce-Price-amount,
	.phoenix-b2b-panel.pb2b-app .pb2b-checkout-woo #order_review ul#shipping_method > li > label .woocommerce-Price-amount,
	.phoenix-b2b-panel.pb2b-app .pb2b-checkout-woo form.checkout ul#shipping_method > li > label .amount {
		float: none !important;
		display: block !important;
		margin: 4px 0 0 !important;
	}
}

/* Rozbicie logistyczne (Phoenix) — pod nazwą, w obszarze `extra` gridu. */
.phoenix-b2b-panel.pb2b-app .pb2b-checkout-woo form.checkout ul#shipping_method > li .pb2b-ship-breakdown,
.phoenix-b2b-panel.pb2b-app .pb2b-checkout-woo #order_review ul#shipping_method > li .pb2b-ship-breakdown {
	grid-area: extra !important;
	display: flex !important;
	flex-direction: column !important;
	gap: 3px !important;
	min-width: 0 !important;
	width: 100% !important;
	margin-top: 4px !important;
	font-size: 12.5px !important;
	line-height: 1.45 !important;
	overflow: visible !important;
	text-align: left !important;
}

/* =========================================================================
 * 2) PRZYCISK „WYBIERZ PACZKOMAT" — pełna szerokość, tekst poziomo.
 * ======================================================================= */
.phoenix-b2b-panel.pb2b-app .pb2b-checkout-woo form.checkout button.easypack-open,
.phoenix-b2b-panel.pb2b-app .pb2b-checkout-woo form.checkout a.easypack-open,
.phoenix-b2b-panel.pb2b-app .pb2b-checkout-woo form.checkout .inpost-select-parcel,
.phoenix-b2b-panel.pb2b-app .pb2b-checkout-woo form.checkout button[id*="paczkomat"],
.phoenix-b2b-panel.pb2b-app .pb2b-checkout-woo form.checkout button[class*="paczkomat"],
.phoenix-b2b-panel.pb2b-app .pb2b-checkout-woo form.checkout [data-inpost-open],
.phoenix-b2b-panel.pb2b-app .pb2b-checkout-woo form.checkout .easypack-widget button {
	display: block !important;
	width: 100% !important;
	min-height: 44px !important;
	padding: 10px 16px !important;
	writing-mode: horizontal-tb !important;
	text-orientation: mixed !important;
	white-space: normal !important;
	letter-spacing: normal !important;
	text-indent: 0 !important;
	transform: none !important;
	overflow: visible !important;
	font-size: 14px !important;
	font-weight: 700 !important;
	line-height: 1.3 !important;
	border-radius: 12px !important;
}

/* =========================================================================
 * 3) PC — formularz po lewej, podsumowanie + dostawy po prawej (380–420 px).
 * ======================================================================= */
@media (min-width: 1000px) {
	.phoenix-b2b-panel.pb2b-app .pb2b-checkout-woo form.checkout.woocommerce-checkout {
		display: grid !important;
		grid-template-columns: minmax(0, 1fr) minmax(380px, 420px) !important;
		gap: 24px 28px !important;
		align-items: start !important;
	}
}

/* =========================================================================
 * 4) MOBILE — 1 kolumna, ZERO poziomego scrolla, zero białych pasków.
 * ======================================================================= */
@media (max-width: 999px) {
	.phoenix-b2b-panel.pb2b-app .pb2b-checkout-woo form.checkout.woocommerce-checkout {
		display: block !important;
		max-width: 100% !important;
		overflow-x: clip !important; /* clip zamiast hidden: nie tworzy scroll-kontenera i nie ucina focus-ringów */
	}
	.phoenix-b2b-panel.pb2b-app .pb2b-checkout-woo form.checkout #order_review,
	.phoenix-b2b-panel.pb2b-app .pb2b-checkout-woo form.checkout .woocommerce-checkout-review-order-table {
		width: 100% !important;
		max-width: 100% !important;
		min-width: 0 !important;
	}
	.phoenix-b2b-panel.pb2b-app .pb2b-checkout-woo form.checkout #order_review {
		padding: 16px !important;
	}
	/* Karty metod: pełna szerokość również w wąskim td tabeli podsumowania. */
	.phoenix-b2b-panel.pb2b-app .pb2b-checkout-woo .woocommerce-checkout-review-order-table tfoot tr.woocommerce-shipping-totals ul#shipping_method > li {
		width: 100% !important;
		padding: 16px !important;
		border-radius: 18px !important;
	}
}

/* Dark mode: żadnych białych teł/pasków na kartach i w breakdownie. */
.phoenix-b2b-panel.pb2b-app:not([data-pb2b-theme="light"]) .pb2b-checkout-woo form.checkout ul#shipping_method > li,
.phoenix-b2b-panel.pb2b-app:not([data-pb2b-theme="light"]) .pb2b-checkout-woo #order_review ul#shipping_method > li,
.phoenix-b2b-panel.pb2b-app:not([data-pb2b-theme="light"]) .pb2b-checkout-woo form.checkout ul#shipping_method > li .pb2b-ship-breakdown {
	background-image: none !important;
}
/* Cień tylko na karcie ZAZNACZONEJ (ring) — reszta bez cieni. */
.phoenix-b2b-panel.pb2b-app:not([data-pb2b-theme="light"]) .pb2b-checkout-woo form.checkout ul#shipping_method > li:not(:has(input:checked)),
.phoenix-b2b-panel.pb2b-app:not([data-pb2b-theme="light"]) .pb2b-checkout-woo #order_review ul#shipping_method > li:not(:has(input:checked)) {
	box-shadow: none !important;
}
