/* Cart page fixes for the new flow (loaded only when the new flow is active). */

/* Coupon: input next to the button and wide enough for "Nuolaidos kodas". */
@media (min-width: 769px) {
	.woocommerce-cart-form td.actions,
	.woocommerce-cart-form .cart-actions {
		width: 100%;
	}
	.woocommerce-cart-form .wd-coupon-form {
		flex-wrap: nowrap;
		gap: 10px;
		width: 100%;
		max-width: 420px;
	}
	.woocommerce-cart-form .wd-coupon-form #coupon_code {
		flex: 1 1 auto;
		width: auto;
		max-width: none;
		min-width: 220px;
	}
	.woocommerce-cart-form .wd-coupon-form .button {
		flex: 0 0 auto;
		margin: 0;
	}
}

/*
 * Totals: the child theme turns the shipping th/td into blocks inside a table row, so
 * they were squeezed into the first column. Lay the rows out as flex instead.
 */
.cart_totals table.shop_table > tbody {
	display: flex;
	flex-direction: column;
}
.cart_totals table.shop_table > tbody > tr:not(.woocommerce-shipping-totals) {
	display: flex;
	justify-content: space-between;
	align-items: center;
	border-bottom: 1px solid rgba(0, 0, 0, 0.106);
}
.cart_totals table.shop_table > tbody > tr:not(.woocommerce-shipping-totals) > * {
	display: block;
	width: auto;
	border: 0;
}
.cart_totals table.shop_table > tbody > tr:last-child {
	border-bottom: 0;
}
.cart_totals tr.woocommerce-shipping-totals > th,
.cart_totals tr.woocommerce-shipping-totals > td {
	width: 100%;
	padding-left: 0;
}

/* Shipping options: radio on the left, label fills the row. */
.cart_totals #shipping_method li {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin-bottom: 10px;
}
.cart_totals #shipping_method li input.shipping_method {
	float: none;
	top: 0;
	flex: 0 0 auto;
	margin: 4px 0 0 !important; /* child theme forces a 64px left margin */
}
.cart_totals #shipping_method li label {
	flex: 1 1 auto;
}
.cart_totals .woocommerce-shipping-destination,
.cart_totals .woocommerce-shipping-calculator {
	text-align: left;
}
/* Owner (2026-10-27): black "Krepšelis → Kasa → Baigta" bar instead of the theme green. */
/* Must out-rank the site's inline ".page-title.page-title-default { green !important }". */
body .wd-page-title.page-title.page-title-default {
	background-color: #000 !important;
}
/* QA (2026-10-27): mobile totals printed each label twice ("Suma" + "Suma6.99€"). */
@media (max-width: 768px) {
	.cart_totals td::before {
		content: none !important;
	}
	.cart_totals tr:not(.woocommerce-shipping-totals) {
		display: flex;
		flex-direction: row !important; /* the theme stacks them in a column */
		justify-content: space-between;
		align-items: baseline;
	}
	.cart_totals tr:not(.woocommerce-shipping-totals) th,
	.cart_totals tr:not(.woocommerce-shipping-totals) td {
		display: block;
		width: auto;
		padding: 10px 0;
		border: 0;
		text-align: right;
	}
	.cart_totals tr:not(.woocommerce-shipping-totals) th {
		text-align: left;
	}
}
/* Sale lines (owner 2026-10-27): "−29 % Sutaupote 2.99€" under the price. */
.mp-saving {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
	margin-top: 4px;
	color: #1a7f37;
	font-size: 13px;
	font-weight: 600;
}
.mp-saving__pct,
.mp-saving__amt {
	white-space: nowrap;
}
.mp-saving__pct {
	padding: 1px 6px;
	border-radius: 4px;
	background: #1a7f37;
	color: #fff;
}

/*
 * UI pass 2026-11-18: the theme makes td.actions a flex box, which takes it out of its
 * colspan; the coupon form (~330px) then sized column 1, the "×" column grew to 327px
 * and the table overflowed under the totals card, hiding the subtotal column.
 */
@media (min-width: 769px) {
	.woocommerce-cart-form td.actions {
		display: table-cell !important; /* the theme's flex rule out-ranks a plain one */
	}
	.woocommerce-cart-form .cart-actions {
		display: flex;
		align-items: center;
		gap: 10px;
	}
	.woocommerce-cart-form td.product-subtotal {
		white-space: nowrap;
		vertical-align: middle;
	}
}
