/**
 * Classic cart and checkout (D-113, THEME-06). Tokens only; CSS-only layout; no element is hidden.
 * Never restyle Geowidget or gateway widget internals (D-114 carried gate re-checks them).
 */

/* Fields */
.woocommerce form .form-row label {
	font-size: var(--materli-text-label);
	font-weight: var(--materli-weight-strong);
}

.woocommerce form .form-row input.input-text,
.woocommerce form .form-row select,
.woocommerce form .form-row textarea {
	min-height: 48px;
	border: 1px solid var(--materli-color-control-border);
	border-radius: var(--materli-radius);
	font-size: var(--materli-text-body);
	padding: 0 var(--materli-space-md);
}

.woocommerce form .form-row textarea {
	padding: var(--materli-space-sm) var(--materli-space-md);
}

/* Errors: the message text carries the meaning, colour only reinforces it. */
.woocommerce form .form-row.woocommerce-invalid input.input-text,
.woocommerce form .form-row.woocommerce-invalid select {
	border-color: var(--materli-color-danger);
}

.woocommerce-error {
	color: var(--materli-color-danger);
	border: 1px solid var(--materli-color-danger);
	border-radius: var(--materli-radius);
	padding: var(--materli-space-md);
}

/* Buttons */
#place_order,
.checkout-button {
	min-height: 48px;
	width: 100%;
	background: var(--materli-color-accent);
	color: var(--materli-color-surface);
	border: 1px solid var(--materli-color-accent);
	border-radius: var(--materli-radius);
	font-weight: var(--materli-weight-strong);
}

button[name="update_cart"] {
	min-height: var(--materli-hit);
	background: transparent;
	color: var(--materli-color-text);
	border: 1px solid var(--materli-color-text);
	border-radius: var(--materli-radius);
}

/* Payment methods */
.wc_payment_method {
	border-bottom: 1px solid var(--materli-color-border);
	padding: var(--materli-space-md) 0;
}

/*
 * VAT note under the order total, "(zawiera 36,92 zł VAT)" (2026-10-29): its own line below the total,
 * never split inside the brackets. The amount and "zł" are already joined by WooCommerce's no-break space.
 */
.shop_table .includes_tax {
	display: block;
	white-space: nowrap;
}

/* Keep the "× 1" quantity off a line of its own; WooCommerce's template whitespace before it is breakable. */
.woocommerce-checkout-review-order-table td.product-name {
	text-wrap: pretty;
}

/* InPost locker row: spacing and border only, widget internals untouched. */
.easypack-parcel-machine td,
.easypack-parcel-machine th {
	padding: var(--materli-space-md) 0;
	border-top: 1px solid var(--materli-color-border);
}

/*
 * InPost "Wybierz punkt odbioru" trigger (2026-10-29): the plugin's yellow block (white on #FCC905,
 * 1.6:1; 19px; 90% black shadow) restyled as a full-width secondary button. CSS only: the markup,
 * id and click handler stay the plugin's, and the Geowidget modal is untouched. The row's first cell
 * is empty, so it is pinned to half the table and the trigger pulls back over it to span the panel.
 * !important only where the plugin's front.css already uses it.
 */
.woocommerce-checkout-review-order-table tr.easypack-parcel-machine th {
	width: 50%;
}

.woocommerce-checkout-review-order-table td.easypack-parcel-machine-select {
	padding-bottom: var(--materli-space-md);
}

.woocommerce-checkout-review-order-table #easypack_show_geowidget {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: var(--materli-space-sm);
	min-height: 48px;
	max-width: none;
	margin: 0 0 0 -100%;
	padding: var(--materli-space-sm) var(--materli-space-md);
	background: transparent;
	color: var(--materli-color-accent);
	border: 1px solid var(--materli-color-accent) !important;
	border-radius: var(--materli-radius);
	box-shadow: none !important;
	font-size: var(--materli-text-body) !important;
	font-weight: var(--materli-weight-strong);
	line-height: 1.2;
	text-align: center;
	transition: background-color var(--materli-motion-quick), color var(--materli-motion-quick);
}

/* Phosphor map-pin (regular, @phosphor-icons/core 2.1.1, MIT), painted in the text colour. */
.woocommerce-checkout-review-order-table #easypack_show_geowidget::before {
	content: "";
	flex: 0 0 auto;
	width: 20px;
	height: 20px;
	background: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256'%3E%3Cpath d='M128,64a40,40,0,1,0,40,40A40,40,0,0,0,128,64Zm0,64a24,24,0,1,1,24-24A24,24,0,0,1,128,128Zm0-112a88.1,88.1,0,0,0-88,88c0,31.4,14.51,64.68,42,96.25a254.19,254.19,0,0,0,41.45,38.3,8,8,0,0,0,9.18,0A254.19,254.19,0,0,0,174,200.25c27.45-31.57,42-64.85,42-96.25A88.1,88.1,0,0,0,128,16Zm0,206c-16.53-13-72-60.75-72-118a72,72,0,0,1,144,0C200,161.23,144.53,209,128,222Z'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256'%3E%3Cpath d='M128,64a40,40,0,1,0,40,40A40,40,0,0,0,128,64Zm0,64a24,24,0,1,1,24-24A24,24,0,0,1,128,128Zm0-112a88.1,88.1,0,0,0-88,88c0,31.4,14.51,64.68,42,96.25a254.19,254.19,0,0,0,41.45,38.3,8,8,0,0,0,9.18,0A254.19,254.19,0,0,0,174,200.25c27.45-31.57,42-64.85,42-96.25A88.1,88.1,0,0,0,128,16Zm0,206c-16.53-13-72-60.75-72-118a72,72,0,0,1,144,0C200,161.23,144.53,209,128,222Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.woocommerce-checkout-review-order-table #easypack_show_geowidget:hover,
.woocommerce-checkout-review-order-table #easypack_show_geowidget:focus-visible {
	background: var(--materli-color-accent);
	color: var(--materli-color-surface);
}

.woocommerce-checkout-review-order-table #easypack_show_geowidget:focus-visible {
	outline: 2px solid var(--materli-color-focus);
	outline-offset: 2px;
}

/* The chosen locker's details box: the plugin's 3px yellow frame and 10px margin become a quiet card. */
.woocommerce-checkout-review-order-table #selected-parcel-machine {
	margin: var(--materli-space-sm) 0 0 -100%;
	padding: var(--materli-space-md);
	border: 1px solid var(--materli-color-border);
	border-radius: var(--materli-radius);
	background: var(--materli-color-surface);
	text-align: start;
}

@media (prefers-reduced-motion: reduce) {
	.woocommerce-checkout-review-order-table #easypack_show_geowidget {
		transition: none;
	}
}

/* Cart */
.woocommerce-cart-form .quantity input.qty {
	min-height: var(--materli-hit);
}

.cart-collaterals .cart_totals {
	background: var(--materli-color-surface-alt);
	padding: var(--materli-space-lg);
}

/*
 * Mobile cart: Blocksy's own responsive cart layout applies (thumbnail | name, quantity, price, remove).
 * The former "stacked cards" block targeted table.shop_table_responsive inside the cart form, which the
 * cart table never carries, so it matched nothing and was removed (WR-C08).
 */

/*
 * Desktop checkout: fields | sticky summary. Below 1000px the default single column applies.
 * The grid items are Blocksy's wrappers, form.checkout > .ct-customer-details and > .ct-order-review
 * (blocksy/inc/components/woocommerce/common/checkout.php); #customer_details, #order_review_heading
 * and #order_review sit inside them, so placement rules on those ids never applied (WR-C07). Blocksy
 * already makes .ct-order-review sticky at >= 1000px and gives a prepended NoticeGroup
 * grid-column: 1 / -1, so validation errors stay on top with auto placement.
 */
@media (min-width: 1000px) {
	form.checkout {
		display: grid;
		grid-template-columns: minmax(0, 1fr) 420px;
		column-gap: var(--materli-space-xl);
		align-items: start;
	}

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

}

/*
 * Order summary panel (2026-10-29): Blocksy's own .ct-order-review frame (2px palette-5 border, 35px
 * padding) is the one panel, heading included. A second panel on #order_review inside it framed a box
 * in a box and squeezed the totals to 346px.
 */
form.checkout .ct-order-review {
	--order-review-border: none;
	--order-review-padding: var(--materli-space-lg);
	background: var(--materli-color-surface-alt);
}

/*
 * Order-received documents block (COMP-10, D-131). Explicit link colours: Blocksy's link-hover
 * colour can drop below contrast on the surface-alt background.
 */
.materli-order-documents {
	background: var(--materli-color-surface-alt);
	border: 1px solid var(--materli-color-border);
	padding: var(--materli-space-md);
	margin-block: var(--materli-space-md);
	font-size: var(--materli-text-label);
}

.materli-order-documents p {
	margin: 0 0 var(--materli-space-sm);
}

.materli-order-documents ul {
	margin: 0;
	padding-left: var(--materli-space-md);
}

.materli-order-documents a {
	color: var(--materli-color-text);
	text-decoration: underline;
}

.materli-order-documents a:hover,
.materli-order-documents a:focus-visible {
	color: var(--materli-color-accent);
}

/* Marketing consent row (D-134): own row below the Terms row, never inside its label. */
.materli-consent-row {
	margin-top: var(--materli-space-md);
}

.materli-consent-row label {
	display: flex;
	align-items: center;
	gap: var(--materli-space-sm);
	min-height: 44px;
	font-size: var(--materli-text-body);
	font-weight: 400;
}

.materli-consent-row input[type="checkbox"] {
	flex: 0 0 24px;
	width: 24px;
	height: 24px;
	margin: 0;
	border: 1px solid var(--materli-color-control-border);
	border-radius: 4px;
	accent-color: var(--materli-color-accent);
}

.materli-consent-row input[type="checkbox"]:focus-visible {
	outline: 2px solid var(--materli-color-focus);
	outline-offset: 2px;
}
