/* Układ koszyka, checkoutu i podziękowania. */

/* --- Checkout: jedna kolumna, „Informacje dodatkowe” na końcu --- */
.woocommerce-checkout #customer_details {
	display: flex;
	flex-direction: column;
	width: 100%;
	float: none;
}

.woocommerce-checkout #customer_details .col-1,
.woocommerce-checkout #customer_details .col-2 {
	float: none;
	width: 100%;
	max-width: 100%;
}

/* col-2 „znika” z układu, więc wysyłka i notatka są osobnymi elementami kolumny. */
.woocommerce-checkout #customer_details .col-2 {
	display: contents;
}

.woocommerce-checkout #customer_details .col-1 {
	order: 1;
}

.woocommerce-checkout #customer_details .woocommerce-shipping-fields {
	order: 2;
	width: 100%;
	margin-top: 1rem;
}

.woocommerce-checkout #customer_details .woocommerce-additional-fields {
	order: 3;
	width: 100%;
	margin-top: 0;
}

/* --- Podsumowanie koszyka: więcej miejsca na etykiety i kwoty --- */
.woocommerce-cart .cart_totals table.shop_table th,
.woocommerce-cart .cart_totals table.shop_table td {
	padding: 14px 16px;
	vertical-align: top;
}

.woocommerce-cart .cart_totals table.shop_table {
	table-layout: fixed;
	width: 100%;
}

/* Elementor ustawia tbody jako blok, więc wiersz sam musi zająć całą szerokość. */
body.woocommerce-cart.woocommerce-page .cart_totals table.shop_table tr {
	display: table;
	width: 100%;
	table-layout: fixed;
}

body.woocommerce-cart.woocommerce-page .cart_totals table.shop_table tr th {
	width: 36% !important;
	padding-right: 20px;
}

body.woocommerce-cart.woocommerce-page .cart_totals table.shop_table tr td {
	width: 64% !important;
	text-align: right;
	line-height: 1.5;
}

.woocommerce-cart .cart_totals table.shop_table td .includes_tax {
	display: block;
	margin-top: 4px;
	line-height: 1.4;
}

.woocommerce-cart .cart_totals table.shop_table td .amount,
.woocommerce-cart .cart_totals table.shop_table td bdi {
	white-space: nowrap;
}

/*
 * Wiersz rabatu: CSS strony koszyka chowa th i podstawia „Zaoszczędzono:” jako ::before.
 * Pokazujemy etykietę z kodu (np. „Voucher: KOD”). Na mobile WooCommerce wstawia ją z data-title.
 */
body.woocommerce-cart.woocommerce-page .cart_totals tr.cart-discount::before,
body.woocommerce-cart.woocommerce-page .cart_totals tr.cart-discount::after {
	content: none !important;
	display: none !important;
}

@media (min-width: 769px) {
	body.woocommerce-cart.woocommerce-page .cart_totals table.shop_table tr.cart-discount th {
		display: table-cell !important;
		visibility: visible !important;
		font-size: inherit !important;
		font-weight: 700 !important;
		color: inherit !important;
		text-indent: 0 !important;
	}
}

/* --- Koszyk: pole kodu z widoczną etykietą nad polem (bez placeholdera) --- */
body.woocommerce-cart .woocommerce-cart-form .coupon {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
}

body.woocommerce-cart .woocommerce-cart-form .coupon label[for="coupon_code"] {
	position: static !important;
	clip: auto !important;
	clip-path: none !important;
	width: 100% !important;
	height: auto !important;
	margin: 0 0 2px !important;
	overflow: visible !important;
	display: block !important;
	text-align: left !important;
	font-weight: 600;
}

/* Pole i mały przycisk „Zastosuj” obok siebie (nadpisuje width:49% z CSS strony koszyka). */
body.woocommerce-cart .woocommerce-cart-form .coupon {
	flex-wrap: wrap;
}

body.woocommerce-cart .woocommerce-cart-form .coupon #coupon_code {
	flex: 1 1 auto;
	width: auto !important;
	min-width: 0;
	max-width: 220px;
	height: 30px !important;
	margin: 0;
}

body.woocommerce-cart .woocommerce-cart-form .coupon button[name="apply_coupon"] {
	flex: 0 0 auto;
	width: auto !important;
	height: 30px;
	margin: 0;
	padding: 0 18px;
	font-size: 14px;
	line-height: 1;
	white-space: nowrap;
}

/* --- Podziękowanie za zamówienie --- */
.woocommerce-order-received .woocommerce-order ul.woocommerce-order-overview {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
	gap: 12px;
	margin: 0 0 2rem;
	padding: 0;
	list-style: none;
}

/* Clearfix WooCommerce (::before / ::after) wpadałby do siatki jako pusta komórka. */
.woocommerce-order-received .woocommerce-order ul.woocommerce-order-overview::before,
.woocommerce-order-received .woocommerce-order ul.woocommerce-order-overview::after {
	display: none !important;
	content: none !important;
}

.woocommerce-order-received .woocommerce-order ul.woocommerce-order-overview li {
	display: block !important;
	float: none;
	width: auto;
	min-width: 0;
	margin: 0 !important;
	padding: 12px 14px;
	border: 1px solid #e4e4e4;
	border-radius: 12px;
	background: #fafafa;
	font-size: 0.8rem;
	line-height: 1.4;
	text-transform: uppercase;
	overflow-wrap: break-word;
}

.woocommerce-order-received .woocommerce-order ul.woocommerce-order-overview li strong {
	display: block;
	margin-top: 4px;
	font-size: 1rem;
	text-transform: none;
}

.woocommerce-order-received .woocommerce-order table.woocommerce-table--order-details {
	width: 100%;
	table-layout: auto;
}

.woocommerce-order-received .woocommerce-order table.woocommerce-table--order-details th,
.woocommerce-order-received .woocommerce-order table.woocommerce-table--order-details td {
	padding: 12px 14px;
	vertical-align: top;
}

.woocommerce-order-received .woocommerce-order table.woocommerce-table--order-details tfoot td {
	text-align: right;
	white-space: nowrap;
}
