/**
 * Корзина: компактные названия, сетка купона и кнопки, подпись «Итого».
 */

/* --------------------------------------------------------------------------
   Таблица товаров
   -------------------------------------------------------------------------- */
body.woocommerce-cart .woocommerce,
body.woocommerce-page.woocommerce-cart .woocommerce {
	max-width: 100%;
}

body.woocommerce-cart .woocommerce-cart-form,
body.woocommerce-page.woocommerce-cart .woocommerce-cart-form {
	margin-bottom: 28px;
}

body.woocommerce-cart .woocommerce table.shop_table.cart,
body.woocommerce-page.woocommerce-cart .woocommerce table.shop_table.cart {
	width: 100%;
	table-layout: auto;
	border-collapse: separate;
	border-spacing: 0;
}

body.woocommerce-cart .woocommerce table.shop_table.cart :is(th, td),
body.woocommerce-page.woocommerce-cart .woocommerce table.shop_table.cart :is(th, td) {
	padding: 14px 12px;
	vertical-align: middle;
}

body.woocommerce-cart .woocommerce table.shop_table.cart thead th,
body.woocommerce-page.woocommerce-cart .woocommerce table.shop_table.cart thead th {
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	white-space: nowrap;
}

body.woocommerce-cart .woocommerce table.shop_table.cart img,
body.woocommerce-page.woocommerce-cart .woocommerce table.shop_table.cart img {
	width: 72px;
	height: 72px;
	max-width: 72px;
	object-fit: contain;
}

/* Названия: меньше кегль, перенос, компактные цвет и размер */
body.woocommerce-cart .woocommerce table.shop_table.cart td.product-name,
body.woocommerce-page.woocommerce-cart .woocommerce table.shop_table.cart td.product-name,
body.woocommerce-cart .woocommerce table.shop_table.cart .product-name a,
body.woocommerce-page.woocommerce-cart .woocommerce table.shop_table.cart .product-name a {
	font-family: var(--rc-font, inherit);
	font-size: 14px;
	font-weight: 600;
	font-style: normal;
	line-height: 1.35;
	letter-spacing: 0;
	text-transform: none;
	text-decoration: none;
	overflow-wrap: anywhere;
	word-break: break-word;
	hyphens: auto;
	white-space: normal;
}

body.woocommerce-cart .woocommerce table.shop_table.cart .product-name a:hover,
body.woocommerce-page.woocommerce-cart .woocommerce table.shop_table.cart .product-name a:hover {
	text-decoration: underline;
}

body.woocommerce-cart .woocommerce table.shop_table.cart dl.variation,
body.woocommerce-page.woocommerce-cart .woocommerce table.shop_table.cart dl.variation {
	display: flex;
	flex-wrap: wrap;
	gap: 2px 12px;
	margin: 6px 0 0;
	padding: 0;
	color: var(--v4-muted, #5c6570);
	font-size: 12px;
	font-weight: 400;
	line-height: 1.4;
}

body.woocommerce-cart .woocommerce table.shop_table.cart dl.variation dt,
body.woocommerce-cart .woocommerce table.shop_table.cart dl.variation dd,
body.woocommerce-page.woocommerce-cart .woocommerce table.shop_table.cart dl.variation dt,
body.woocommerce-page.woocommerce-cart .woocommerce table.shop_table.cart dl.variation dd {
	display: inline;
	float: none;
	margin: 0;
	padding: 0;
	border: 0;
	font-size: inherit;
	font-weight: 400;
	line-height: inherit;
}

body.woocommerce-cart .woocommerce table.shop_table.cart dl.variation dt,
body.woocommerce-page.woocommerce-cart .woocommerce table.shop_table.cart dl.variation dt {
	color: var(--v4-muted, #5c6570);
}

body.woocommerce-cart .woocommerce table.shop_table.cart dl.variation dt::after,
body.woocommerce-page.woocommerce-cart .woocommerce table.shop_table.cart dl.variation dt::after {
	content: ":\00a0";
}

body.woocommerce-cart .woocommerce table.shop_table.cart dl.variation dd p,
body.woocommerce-page.woocommerce-cart .woocommerce table.shop_table.cart dl.variation dd p {
	display: inline;
	margin: 0;
}

body.woocommerce-cart .woocommerce table.shop_table.cart .product-price,
body.woocommerce-cart .woocommerce table.shop_table.cart .product-subtotal,
body.woocommerce-page.woocommerce-cart .woocommerce table.shop_table.cart .product-price,
body.woocommerce-page.woocommerce-cart .woocommerce table.shop_table.cart .product-subtotal {
	font-size: 14px;
	font-weight: 500;
	white-space: nowrap;
}

body.woocommerce-cart .woocommerce table.shop_table.cart .quantity .qty,
body.woocommerce-page.woocommerce-cart .woocommerce table.shop_table.cart .quantity .qty {
	width: 64px;
	max-width: 64px;
	height: 40px;
	padding: 0 8px;
	font-size: 16px;
	text-align: center;
}

/* --------------------------------------------------------------------------
   Купон и «Обновить корзину» — одна сетка
   -------------------------------------------------------------------------- */
/* display:grid на td сжимает ячейку (она перестаёт быть table-cell и
   не тянется на ширину таблицы) — купон складывается в 0px и наезжает
   на кнопку. На десктопе оставляем table-cell и выстраиваем ряд флоатами. */
body.woocommerce-cart .woocommerce table.cart td.actions,
body.woocommerce-page.woocommerce-cart .woocommerce table.cart td.actions {
	display: table-cell;
	width: 100%;
	padding: 16px 12px;
	vertical-align: middle;
}

body.woocommerce-cart .woocommerce table.cart td.actions::after,
body.woocommerce-page.woocommerce-cart .woocommerce table.cart td.actions::after {
	content: "";
	display: block;
	clear: both;
}

body.woocommerce-cart .woocommerce table.cart td.actions > input[type="hidden"],
body.woocommerce-page.woocommerce-cart .woocommerce table.cart td.actions > input[type="hidden"] {
	display: none;
}

body.woocommerce-cart .woocommerce table.cart td.actions .coupon,
body.woocommerce-page.woocommerce-cart .woocommerce table.cart td.actions .coupon {
	display: flex;
	float: left !important;
	box-sizing: border-box;
	flex-wrap: nowrap;
	align-items: center;
	gap: 8px;
	width: calc(100% - 200px) !important;
	max-width: 560px;
	margin: 0;
	padding: 0;
}

body.woocommerce-cart .woocommerce table.cart td.actions .coupon label,
body.woocommerce-page.woocommerce-cart .woocommerce table.cart td.actions .coupon label {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

body.woocommerce-cart .woocommerce table.cart td.actions .coupon .input-text,
body.woocommerce-page.woocommerce-cart .woocommerce table.cart td.actions .coupon .input-text {
	float: none !important;
	box-sizing: border-box;
	flex: 1 1 0;
	width: auto !important;
	min-width: 0;
	max-width: none;
	height: 44px;
	margin: 0;
	padding: 0 12px;
	font-size: 16px;
}

body.woocommerce-cart .woocommerce table.cart td.actions :is(button[name="apply_coupon"], button[name="update_cart"]).button.button,
body.woocommerce-page.woocommerce-cart .woocommerce table.cart td.actions :is(button[name="apply_coupon"], button[name="update_cart"]).button.button,
html body .woocommerce table.cart td.actions :is(button[name="apply_coupon"], button[name="update_cart"]).button.button {
	display: inline-flex;
	float: none !important;
	box-sizing: border-box;
	width: auto;
	min-height: 44px;
	margin: 0;
	padding: 0 16px;
	align-items: center;
	justify-content: center;
	border: 1px solid var(--v4-control, #c9cdd3);
	background: var(--v4-fill, #f3f5f7);
	color: var(--v4-ink, #111);
	font-size: 14px;
	font-weight: 600;
	line-height: 1.2;
	white-space: nowrap;
	opacity: 1 !important;
	cursor: pointer !important;
	pointer-events: auto !important;
}

body.woocommerce-cart .woocommerce table.cart td.actions button[name="update_cart"],
body.woocommerce-page.woocommerce-cart .woocommerce table.cart td.actions button[name="update_cart"] {
	float: right !important;
}

html body .woocommerce table.cart td.actions :is(button[name="apply_coupon"], button[name="update_cart"]).button.button:hover,
html body .woocommerce table.cart td.actions :is(button[name="apply_coupon"], button[name="update_cart"]).button.button:focus-visible {
	border-color: var(--v4-ink, #111);
	background: var(--v4-ink, #111);
	color: #fff;
}

/* Даже если WooCommerce ставит disabled — кнопка выглядит кликабельной.
   JS снимает disabled и сам обновляет корзину при смене количества. */
html body :is(.woocommerce, .woocommerce-page) table.cart td.actions button[name="update_cart"].button.button:is(.disabled, :disabled, [aria-disabled="true"]),
html body :is(.woocommerce, .woocommerce-page) table.cart td.actions button[name="update_cart"].button.button:is(.disabled, :disabled, [aria-disabled="true"]):hover {
	border-color: var(--v4-control, #c9cdd3);
	background: var(--v4-fill, #f3f5f7);
	color: var(--v4-ink, #111);
	opacity: 1 !important;
	cursor: pointer !important;
}

@media (max-width: 781px) {
	body.woocommerce-cart .woocommerce table.cart td.actions,
	body.woocommerce-page.woocommerce-cart .woocommerce table.cart td.actions {
		display: grid;
		grid-template-columns: 1fr;
		gap: 10px;
		width: 100%;
		padding: 16px 0 8px;
	}

	body.woocommerce-cart .woocommerce table.cart td.actions .coupon,
	body.woocommerce-page.woocommerce-cart .woocommerce table.cart td.actions .coupon {
		display: grid;
		grid-template-columns: 1fr;
		float: none !important;
		width: 100% !important;
		max-width: none;
	}

	body.woocommerce-cart .woocommerce table.cart td.actions .coupon .input-text,
	body.woocommerce-page.woocommerce-cart .woocommerce table.cart td.actions .coupon .input-text {
		flex: none;
		width: 100% !important;
	}

	body.woocommerce-cart .woocommerce table.cart td.actions :is(button[name="apply_coupon"], button[name="update_cart"]).button.button,
	body.woocommerce-page.woocommerce-cart .woocommerce table.cart td.actions :is(button[name="apply_coupon"], button[name="update_cart"]).button.button,
	html body .woocommerce table.cart td.actions :is(button[name="apply_coupon"], button[name="update_cart"]).button.button {
		float: none !important;
		width: 100%;
		justify-self: stretch;
	}

	/* Адаптивная таблица Woo: аккуратный стек, названия не раздувают блок */
	body.woocommerce-cart .woocommerce table.shop_table_responsive.cart thead,
	body.woocommerce-page.woocommerce-cart .woocommerce table.shop_table_responsive.cart thead {
		display: none;
	}

	body.woocommerce-cart .woocommerce table.shop_table_responsive.cart tr.cart_item,
	body.woocommerce-page.woocommerce-cart .woocommerce table.shop_table_responsive.cart tr.cart_item {
		display: grid;
		grid-template-columns: 72px minmax(0, 1fr);
		gap: 4px 12px;
		padding: 16px 0;
		border-bottom: 1px solid var(--v4-line, #e4e7eb);
	}

	body.woocommerce-cart .woocommerce table.shop_table_responsive.cart tr.cart_item td,
	body.woocommerce-page.woocommerce-cart .woocommerce table.shop_table_responsive.cart tr.cart_item td {
		display: block;
		width: auto;
		padding: 4px 0;
		text-align: left;
		border: 0;
	}

	body.woocommerce-cart .woocommerce table.shop_table_responsive.cart tr.cart_item td.product-thumbnail,
	body.woocommerce-page.woocommerce-cart .woocommerce table.shop_table_responsive.cart tr.cart_item td.product-thumbnail {
		grid-column: 1;
		grid-row: 1 / span 4;
		padding: 0;
	}

	body.woocommerce-cart .woocommerce table.shop_table_responsive.cart tr.cart_item td.product-thumbnail::before,
	body.woocommerce-cart .woocommerce table.shop_table_responsive.cart tr.cart_item td.product-remove::before,
	body.woocommerce-page.woocommerce-cart .woocommerce table.shop_table_responsive.cart tr.cart_item td.product-thumbnail::before,
	body.woocommerce-page.woocommerce-cart .woocommerce table.shop_table_responsive.cart tr.cart_item td.product-remove::before {
		display: none;
		content: none;
	}

	body.woocommerce-cart .woocommerce table.shop_table_responsive.cart tr.cart_item td.product-name,
	body.woocommerce-cart .woocommerce table.shop_table_responsive.cart tr.cart_item td.product-price,
	body.woocommerce-cart .woocommerce table.shop_table_responsive.cart tr.cart_item td.product-quantity,
	body.woocommerce-cart .woocommerce table.shop_table_responsive.cart tr.cart_item td.product-subtotal,
	body.woocommerce-cart .woocommerce table.shop_table_responsive.cart tr.cart_item td.product-remove,
	body.woocommerce-page.woocommerce-cart .woocommerce table.shop_table_responsive.cart tr.cart_item td.product-name,
	body.woocommerce-page.woocommerce-cart .woocommerce table.shop_table_responsive.cart tr.cart_item td.product-price,
	body.woocommerce-page.woocommerce-cart .woocommerce table.shop_table_responsive.cart tr.cart_item td.product-quantity,
	body.woocommerce-page.woocommerce-cart .woocommerce table.shop_table_responsive.cart tr.cart_item td.product-subtotal,
	body.woocommerce-page.woocommerce-cart .woocommerce table.shop_table_responsive.cart tr.cart_item td.product-remove {
		grid-column: 2;
	}

	body.woocommerce-cart .woocommerce table.shop_table_responsive.cart tr.cart_item td.product-name,
	body.woocommerce-page.woocommerce-cart .woocommerce table.shop_table_responsive.cart tr.cart_item td.product-name {
		padding-top: 0;
	}

	body.woocommerce-cart .woocommerce table.shop_table_responsive.cart tr.cart_item td.product-name::before,
	body.woocommerce-page.woocommerce-cart .woocommerce table.shop_table_responsive.cart tr.cart_item td.product-name::before {
		display: none;
		content: none;
	}

	body.woocommerce-cart .woocommerce table.shop_table_responsive.cart tr.cart_item td.product-price,
	body.woocommerce-cart .woocommerce table.shop_table_responsive.cart tr.cart_item td.product-quantity,
	body.woocommerce-cart .woocommerce table.shop_table_responsive.cart tr.cart_item td.product-subtotal,
	body.woocommerce-page.woocommerce-cart .woocommerce table.shop_table_responsive.cart tr.cart_item td.product-price,
	body.woocommerce-page.woocommerce-cart .woocommerce table.shop_table_responsive.cart tr.cart_item td.product-quantity,
	body.woocommerce-page.woocommerce-cart .woocommerce table.shop_table_responsive.cart tr.cart_item td.product-subtotal {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 12px;
		text-align: right;
	}

	body.woocommerce-cart .woocommerce table.shop_table_responsive.cart tr.cart_item td.product-price::before,
	body.woocommerce-cart .woocommerce table.shop_table_responsive.cart tr.cart_item td.product-quantity::before,
	body.woocommerce-cart .woocommerce table.shop_table_responsive.cart tr.cart_item td.product-subtotal::before,
	body.woocommerce-page.woocommerce-cart .woocommerce table.shop_table_responsive.cart tr.cart_item td.product-price::before,
	body.woocommerce-page.woocommerce-cart .woocommerce table.shop_table_responsive.cart tr.cart_item td.product-quantity::before,
	body.woocommerce-page.woocommerce-cart .woocommerce table.shop_table_responsive.cart tr.cart_item td.product-subtotal::before {
		float: none;
		margin: 0;
		color: var(--v4-muted, #5c6570);
		font-size: 12px;
		font-weight: 600;
		letter-spacing: 0.04em;
		text-transform: uppercase;
		content: attr(data-title);
	}

	body.woocommerce-cart .woocommerce table.shop_table_responsive.cart tr.cart_item td.product-remove,
	body.woocommerce-page.woocommerce-cart .woocommerce table.shop_table_responsive.cart tr.cart_item td.product-remove {
		text-align: left;
	}

	body.woocommerce-cart .woocommerce table.shop_table_responsive.cart tr.cart_item td.actions,
	body.woocommerce-page.woocommerce-cart .woocommerce table.shop_table_responsive.cart tr:not(.cart_item) td.actions,
	body.woocommerce-page.woocommerce-cart .woocommerce table.shop_table_responsive.cart td.actions {
		grid-column: 1 / -1;
		display: grid;
	}

	body.woocommerce-cart .woocommerce table.shop_table_responsive.cart tr.cart_item td.product-quantity .qty,
	body.woocommerce-page.woocommerce-cart .woocommerce table.shop_table_responsive.cart tr.cart_item td.product-quantity .qty {
		width: 64px;
		max-width: 64px;
	}
}

/* --------------------------------------------------------------------------
   Блок «Итого»
   -------------------------------------------------------------------------- */
body.woocommerce-cart .woocommerce .cart-collaterals,
body.woocommerce-page.woocommerce-cart .woocommerce .cart-collaterals {
	display: flex;
	float: none;
	width: 100%;
	justify-content: flex-end;
}

body.woocommerce-cart .woocommerce .cart-collaterals .cart_totals,
body.woocommerce-page.woocommerce-cart .woocommerce .cart-collaterals .cart_totals {
	float: none;
	box-sizing: border-box;
	width: 100%;
	max-width: 420px;
	padding: 20px 22px 22px;
}

body.woocommerce-cart .woocommerce .cart_totals > h2,
body.woocommerce-page.woocommerce-cart .woocommerce .cart_totals > h2 {
	margin: 0 0 12px;
	padding: 0;
	color: var(--v4-ink, #111);
	font-family: var(--rc-font, inherit);
	font-size: 1.25rem;
	font-weight: 650;
	letter-spacing: 0;
	line-height: 1.3;
	text-transform: none !important;
}

body.woocommerce-cart .woocommerce .cart_totals table th,
body.woocommerce-cart .woocommerce .cart_totals table td,
body.woocommerce-page.woocommerce-cart .woocommerce .cart_totals table th,
body.woocommerce-page.woocommerce-cart .woocommerce .cart_totals table td {
	padding: 8px 0;
	font-size: 14px;
	background: transparent;
}

body.woocommerce-cart .woocommerce .cart_totals tr.order-total th,
body.woocommerce-cart .woocommerce .cart_totals tr.order-total td,
body.woocommerce-page.woocommerce-cart .woocommerce .cart_totals tr.order-total th,
body.woocommerce-page.woocommerce-cart .woocommerce .cart_totals tr.order-total td {
	padding-top: 14px;
	border-top: 1px solid var(--v4-line, #e4e7eb);
	font-size: 16px;
	font-weight: 650;
}

@media (max-width: 781px) {
	body.woocommerce-cart .woocommerce .cart-collaterals,
	body.woocommerce-page.woocommerce-cart .woocommerce .cart-collaterals {
		justify-content: stretch;
	}

	body.woocommerce-cart .woocommerce .cart-collaterals .cart_totals,
	body.woocommerce-page.woocommerce-cart .woocommerce .cart-collaterals .cart_totals {
		max-width: none;
		padding: 16px;
	}
}

/* Пустая корзина */
body.woocommerce-cart .wc-empty-cart-message,
body.woocommerce-page.woocommerce-cart .wc-empty-cart-message,
body.woocommerce-cart .cart-empty,
body.woocommerce-page.woocommerce-cart .cart-empty {
	box-sizing: border-box;
	max-width: 100%;
}

body.woocommerce-cart .return-to-shop,
body.woocommerce-page.woocommerce-cart .return-to-shop {
	margin-top: 16px;
}

@media (max-width: 781px) {
	html body .woocommerce-cart .return-to-shop .button.button,
	html body .woocommerce-page.woocommerce-cart .return-to-shop .button.button {
		display: flex;
		width: 100%;
		justify-content: center;
	}
}
