/**
 * Rim Mebel Cart Fix — корзина + checkout.
 * Высокая специфичность против WoodMart (html body.rmcf-*).
 */

/* ========== КОРЗИНА ========== */

html body.rmcf-cart-on.woocommerce-cart .woocommerce-cart-form table.shop_table thead th,
html body.rmcf-cart-on .woocommerce-cart-form table.shop_table thead th,
html body.rmcf-cart-on .woocommerce-cart-form .shop_table thead th {
	font-size: 11px !important;
	font-weight: 600 !important;
	letter-spacing: 0.02em !important;
	line-height: 1.25 !important;
	padding-top: 8px !important;
	padding-bottom: 8px !important;
}

html body.rmcf-nowrap-on .woocommerce-cart-form table.shop_table td.product-sku,
html body.rmcf-nowrap-on .woocommerce-cart-form table.shop_table th.product-sku,
html body.rmcf-nowrap-on .woocommerce-cart-form .shop_table td.product-sku,
html body.rmcf-nowrap-on .woocommerce-cart-form .shop_table th.product-sku {
	word-break: normal !important;
	overflow-wrap: normal !important;
	white-space: nowrap !important;
}

html body.rmcf-nowrap-on .woocommerce-cart-form .shop_table td.product-price,
html body.rmcf-nowrap-on .woocommerce-cart-form .shop_table th.product-price,
html body.rmcf-nowrap-on .woocommerce-cart-form .shop_table td.product-subtotal,
html body.rmcf-nowrap-on .woocommerce-cart-form .shop_table th.product-subtotal,
html body.rmcf-nowrap-on .woocommerce-cart-form .shop_table td.product-price .amount,
html body.rmcf-nowrap-on .woocommerce-cart-form .shop_table td.product-subtotal .amount,
html body.rmcf-nowrap-on .woocommerce-cart-form .shop_table td.product-price .woocommerce-Price-amount,
html body.rmcf-nowrap-on .woocommerce-cart-form .shop_table td.product-subtotal .woocommerce-Price-amount {
	white-space: nowrap !important;
}

html body.rmcf-nowrap-on .woocommerce-cart-form .shop_table th.product-sku,
html body.rmcf-nowrap-on .woocommerce-cart-form .shop_table td.product-sku,
html body.rmcf-nowrap-on .woocommerce-cart-form .shop_table th.product-price,
html body.rmcf-nowrap-on .woocommerce-cart-form .shop_table td.product-price {
	width: 1% !important;
	padding-left: 8px !important;
	padding-right: 8px !important;
	vertical-align: middle !important;
}

html body.rmcf-cart-on .woocommerce-cart-form .shop_table td.product-sku {
	font-size: 13px !important;
	font-weight: 400 !important;
	line-height: 1.3 !important;
	color: var(--color-gray-500, #777777) !important;
}

html body.rmcf-dims-on .woocommerce-cart-form .shop_table th.rmcf-product-dimensions,
html body.rmcf-dims-on .woocommerce-cart-form .shop_table td.rmcf-product-dimensions {
	width: 1% !important;
	padding-left: 8px !important;
	padding-right: 8px !important;
	vertical-align: middle !important;
	white-space: nowrap !important;
	font-variant-numeric: tabular-nums !important;
}

html body.rmcf-dims-on .woocommerce-cart-form .shop_table td.rmcf-product-dimensions {
	font-size: 13px !important;
	font-weight: 400 !important;
	line-height: 1.3 !important;
	color: var(--color-gray-500, #777777) !important;
}

html body.rmcf-cart-on .woocommerce-cart-form .shop_table td.product-quantity {
	width: 1% !important;
	padding-left: 6px !important;
	padding-right: 6px !important;
	vertical-align: middle !important;
}

html body.rmcf-cart-on .woocommerce-cart-form td.product-quantity div.quantity,
html body.rmcf-cart-on .woocommerce-cart-form .shop_table td.product-quantity div.quantity {
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	gap: 0 !important;
	margin: 0 !important;
	max-width: 96px !important;
	font-size: 0 !important;
}

html body.rmcf-cart-on .woocommerce-cart-form td.product-quantity div.quantity :is(input[type="number"], input[type="text"], input.qty) {
	width: 36px !important;
	min-width: 36px !important;
	max-width: 40px !important;
	height: 32px !important;
	min-height: 32px !important;
	max-height: 32px !important;
	padding: 0 2px !important;
	margin: 0 !important;
	font-size: 13px !important;
	line-height: 32px !important;
	text-align: center !important;
	box-sizing: border-box !important;
}

html body.rmcf-cart-on .woocommerce-cart-form td.product-quantity div.quantity :is(.minus, .plus, input.minus, input.plus, input[type="button"]) {
	width: 28px !important;
	min-width: 28px !important;
	max-width: 28px !important;
	height: 32px !important;
	min-height: 32px !important;
	max-height: 32px !important;
	padding: 0 !important;
	margin: 0 !important;
	font-size: 14px !important;
	line-height: 30px !important;
	box-sizing: border-box !important;
}

/* ========== CHECKOUT: ВАШ ЗАКАЗ ========== */

html body.rmcf-checkout-on .woocommerce-checkout-review-order-table thead th {
	font-size: 11px !important;
	font-weight: 600 !important;
	line-height: 1.25 !important;
	padding-top: 6px !important;
	padding-bottom: 6px !important;
	flex-basis: auto !important;
}

html body.rmcf-checkout-on .woocommerce-checkout-review-order-table thead th.product-name {
	flex: 1 1 auto !important;
	min-width: 0 !important;
}

html body.rmcf-checkout-on .woocommerce-checkout-review-order-table thead th.product-total {
	flex: 0 0 auto !important;
	width: auto !important;
	white-space: nowrap !important;
}

/* Колонку артикула (тема / старый JS) скрываем — артикул рядом с qty */
html body.rmcf-checkout-on .woocommerce-checkout-review-order-table thead th.product-sku,
html body.rmcf-checkout-on .woocommerce-checkout-review-order-table thead th.rmcf-product-sku,
html body.rmcf-checkout-on .woocommerce-checkout-review-order-table tr.cart_item > td.product-sku,
html body.rmcf-checkout-on .woocommerce-checkout-review-order-table tr.cart_item > td.rmcf-product-sku {
	display: none !important;
}

html body.rmcf-checkout-on .woocommerce-checkout-review-order-table .cart_item {
	align-items: center !important;
	gap: 8px !important;
}

html body.rmcf-checkout-on .woocommerce-checkout-review-order-table .cart_item .product-name {
	flex: 1 1 auto !important;
	min-width: 0 !important;
	padding-right: 6px !important;
}

/* Название товара — меньше и максимум 2 строки */
html body.rmcf-checkout-on .woocommerce-checkout-review-order-table .cart_item .product-name > a {
	display: -webkit-box !important;
	-webkit-box-orient: vertical !important;
	-webkit-line-clamp: 2 !important;
	overflow: hidden !important;
	font-size: 12px !important;
	font-weight: 500 !important;
	line-height: 1.3 !important;
	max-width: 100% !important;
	word-break: break-word !important;
}

/* Подытог строки — в одну строку, компактнее */
html body.rmcf-checkout-on .woocommerce-checkout-review-order-table .cart_item .product-total,
html body.rmcf-checkout-on .woocommerce-checkout-review-order-table .cart_item td.product-total {
	flex: 0 0 auto !important;
	white-space: nowrap !important;
	padding-left: 6px !important;
	text-align: right !important;
}

html body.rmcf-checkout-on .woocommerce-checkout-review-order-table .cart_item .product-total .amount,
html body.rmcf-checkout-on .woocommerce-checkout-review-order-table .cart_item .product-total .woocommerce-Price-amount {
	font-size: 13px !important;
	font-weight: 600 !important;
	white-space: nowrap !important;
	display: inline-block !important;
}


/* WoodMart: не растягивать meta на 100% ширины */
html body.rmcf-checkout-on .wd-checkout-prod-title > .rmcf-qty-sku-wrap,
html body.rmcf-checkout-on .wd-checkout-prod-title > .rmcf-inline-meta,
html body.rmcf-checkout-on .wd-checkout-prod-title > .rmcf-inline-sku,
html body.rmcf-checkout-on .wd-checkout-prod-title > .rmcf-inline-dims,
html body.rmcf-checkout-on .product-name > .rmcf-qty-sku-wrap,
html body.rmcf-checkout-on .product-name > .rmcf-inline-meta {
	width: auto !important;
	max-width: 100% !important;
	margin-top: 6px !important;
}

html body.rmcf-checkout-on .rmcf-inline-meta {
	display: inline-flex !important;
	flex-direction: column !important;
	flex-wrap: nowrap !important;
	align-items: flex-start !important;
	justify-content: center !important;
	gap: 2px !important;
	visibility: visible !important;
	opacity: 1 !important;
}

/* Дубли под названием — скрываем, оставляем только строку у qty */
html body.rmcf-checkout-on .wd-checkout-prod-title > .rmcf-inline-meta,
html body.rmcf-checkout-on .wd-checkout-prod-title > .rmcf-inline-sku,
html body.rmcf-checkout-on .wd-checkout-prod-title > .rmcf-inline-dims,
html body.rmcf-checkout-on td.product-name > .rmcf-inline-meta,
html body.rmcf-checkout-on td.product-name > .rmcf-inline-sku,
html body.rmcf-checkout-on td.product-name > .rmcf-inline-dims {
	display: none !important;
}

html body.rmcf-checkout-on .rmcf-qty-sku-wrap .rmcf-inline-meta,
html body.rmcf-checkout-on .product-quantity .rmcf-inline-meta {
	display: inline-flex !important;
	flex-direction: column !important;
	visibility: visible !important;
	opacity: 1 !important;
	position: static !important;
	height: auto !important;
	clip: auto !important;
}

html body.rmcf-checkout-on .rmcf-qty-sku-wrap .rmcf-inline-sku,
html body.rmcf-checkout-on .rmcf-qty-sku-wrap .rmcf-inline-dims,
html body.rmcf-checkout-on .product-quantity .rmcf-inline-sku,
html body.rmcf-checkout-on .product-quantity .rmcf-inline-dims {
	display: block !important;
	visibility: visible !important;
	opacity: 1 !important;
	position: static !important;
	height: auto !important;
	clip: auto !important;
}

/* Строка: количество + артикул справа */
html body.rmcf-checkout-on .woocommerce-checkout-review-order-table .product-name .rmcf-qty-sku-wrap,
html body.rmcf-checkout-on .wd-checkout-prod-title .rmcf-qty-sku-wrap,
html body.rmcf-checkout-on .rmcf-qty-sku-wrap {
	display: flex !important;
	flex-wrap: wrap !important;
	align-items: flex-start !important;
	gap: 8px !important;
	margin-top: 6px !important;
	max-width: 100% !important;
	width: auto !important;
}

/* Количество на checkout — компактнее */
html body.rmcf-checkout-on .woocommerce-checkout-review-order-table .product-name div.quantity,
html body.rmcf-checkout-on .woocommerce-checkout-review-order-table .product-name .rmcf-qty-sku-wrap div.quantity {
	display: inline-flex !important;
	align-items: center !important;
	margin-top: 0 !important;
	max-width: 92px !important;
	flex: 0 0 auto !important;
	font-size: 0 !important;
}

html body.rmcf-checkout-on .woocommerce-checkout-review-order-table .product-name div.quantity :is(input[type="number"], input[type="text"], input.qty) {
	width: 34px !important;
	min-width: 34px !important;
	max-width: 38px !important;
	height: 30px !important;
	min-height: 30px !important;
	max-height: 30px !important;
	padding: 0 2px !important;
	margin: 0 !important;
	font-size: 12px !important;
	line-height: 30px !important;
	text-align: center !important;
	box-sizing: border-box !important;
}

html body.rmcf-checkout-on .woocommerce-checkout-review-order-table .product-name div.quantity :is(.minus, .plus, input.minus, input.plus, input[type="button"]) {
	width: 26px !important;
	min-width: 26px !important;
	max-width: 26px !important;
	height: 30px !important;
	min-height: 30px !important;
	max-height: 30px !important;
	padding: 0 !important;
	margin: 0 !important;
	font-size: 13px !important;
	line-height: 28px !important;
	box-sizing: border-box !important;
}

html body.rmcf-checkout-on .rmcf-qty-sku-wrap .rmcf-inline-sku,
html body.rmcf-checkout-on .rmcf-qty-sku-wrap .rmcf-inline-dims,
html body.rmcf-checkout-on .rmcf-qty-sku-wrap .rmcf-inline-sku-label,
html body.rmcf-checkout-on .product-quantity .rmcf-inline-sku,
html body.rmcf-checkout-on .product-quantity .rmcf-inline-dims,
html body.rmcf-checkout-on .product-quantity .rmcf-inline-sku-label {
	flex: 0 1 auto !important;
	font-size: 12px !important;
	font-weight: 400 !important;
	line-height: 1.25 !important;
	color: #aaaaaa !important;
	white-space: nowrap !important;
	overflow: hidden !important;
	text-overflow: ellipsis !important;
	vertical-align: middle !important;
	max-width: 100% !important;
}

/* Итоги внизу — суммы без переноса */
html body.rmcf-checkout-on .woocommerce-checkout-review-order-table tfoot .amount,
html body.rmcf-checkout-on .woocommerce-checkout-review-order-table tfoot .woocommerce-Price-amount {
	white-space: nowrap !important;
}

@media (max-width: 768.98px) {
	/* Компактные строки корзины: подпись и значение в одну линию */
	html body.rmcf-cart-on .woocommerce-cart-form .shop_table_responsive tr.cart_item > td.product-sku,
	html body.rmcf-nowrap-on .woocommerce-cart-form .shop_table_responsive tr.cart_item > td.product-sku,
	html body.rmcf-cart-on .woocommerce-cart-form .shop_table_responsive tr.cart_item > td.product-price,
	html body.rmcf-nowrap-on .woocommerce-cart-form .shop_table_responsive tr.cart_item > td.product-price,
	html body.rmcf-dims-on .woocommerce-cart-form .shop_table_responsive tr.cart_item > td.rmcf-product-dimensions,
	html body.rmcf-dims-on .woocommerce-cart-form .shop_table_responsive td.rmcf-product-dimensions,
	html body.rmcf-cart-on .woocommerce-cart-form .shop_table_responsive tr.cart_item > td.product-subtotal,
	html body.rmcf-nowrap-on .woocommerce-cart-form .shop_table_responsive tr.cart_item > td.product-subtotal {
		display: flex !important;
		flex-direction: row !important;
		flex-wrap: nowrap !important;
		align-items: center !important;
		justify-content: space-between !important;
		gap: 8px !important;
		width: 100% !important;
		max-width: 100% !important;
		box-sizing: border-box !important;
		text-align: right !important;
		white-space: normal !important;
		word-break: normal !important;
		overflow-wrap: anywhere !important;
		padding-top: 5px !important;
		padding-bottom: 5px !important;
		line-height: 1.25 !important;
		font-size: 12px !important;
	}

	html body.rmcf-cart-on .woocommerce-cart-form .shop_table_responsive tr.cart_item > td.product-sku::before,
	html body.rmcf-nowrap-on .woocommerce-cart-form .shop_table_responsive tr.cart_item > td.product-sku::before,
	html body.rmcf-cart-on .woocommerce-cart-form .shop_table_responsive tr.cart_item > td.product-price::before,
	html body.rmcf-nowrap-on .woocommerce-cart-form .shop_table_responsive tr.cart_item > td.product-price::before,
	html body.rmcf-dims-on .woocommerce-cart-form .shop_table_responsive tr.cart_item > td.rmcf-product-dimensions::before,
	html body.rmcf-dims-on .woocommerce-cart-form .shop_table_responsive td.rmcf-product-dimensions::before,
	html body.rmcf-cart-on .woocommerce-cart-form .shop_table_responsive tr.cart_item > td.product-subtotal::before,
	html body.rmcf-nowrap-on .woocommerce-cart-form .shop_table_responsive tr.cart_item > td.product-subtotal::before {
		content: attr(data-title) !important;
		float: none !important;
		display: inline-block !important;
		flex: 0 0 auto !important;
		margin: 0 !important;
		padding: 0 !important;
		max-width: 42% !important;
		font-weight: 600 !important;
		text-transform: uppercase !important;
		font-size: 11px !important;
		letter-spacing: 0.02em !important;
		line-height: 1.25 !important;
		text-align: left !important;
		white-space: nowrap !important;
	}

	html body.rmcf-cart-on .woocommerce-cart-form .shop_table_responsive tr.cart_item > td.product-sku,
	html body.rmcf-nowrap-on .woocommerce-cart-form .shop_table_responsive tr.cart_item > td.product-sku {
		color: var(--color-gray-500, #777777) !important;
	}

	html body.rmcf-cart-on .woocommerce-cart-form .shop_table_responsive tr.cart_item > td.product-price .amount,
	html body.rmcf-cart-on .woocommerce-cart-form .shop_table_responsive tr.cart_item > td.product-price .woocommerce-Price-amount,
	html body.rmcf-cart-on .woocommerce-cart-form .shop_table_responsive tr.cart_item > td.product-subtotal .amount,
	html body.rmcf-cart-on .woocommerce-cart-form .shop_table_responsive tr.cart_item > td.product-subtotal .woocommerce-Price-amount,
	html body.rmcf-nowrap-on .woocommerce-cart-form .shop_table_responsive tr.cart_item > td.product-price .amount,
	html body.rmcf-nowrap-on .woocommerce-cart-form .shop_table_responsive tr.cart_item > td.product-price .woocommerce-Price-amount,
	html body.rmcf-nowrap-on .woocommerce-cart-form .shop_table_responsive tr.cart_item > td.product-subtotal .amount,
	html body.rmcf-nowrap-on .woocommerce-cart-form .shop_table_responsive tr.cart_item > td.product-subtotal .woocommerce-Price-amount {
		display: inline !important;
		white-space: nowrap !important;
		font-size: 12px !important;
		line-height: 1.25 !important;
	}

	/* Количество: подпись и степпер в одну линию */
	html body.rmcf-cart-on .woocommerce-cart-form .shop_table_responsive tr.cart_item > td.product-quantity {
		display: flex !important;
		flex-direction: row !important;
		flex-wrap: nowrap !important;
		align-items: center !important;
		justify-content: space-between !important;
		gap: 8px !important;
		width: 100% !important;
		padding-top: 5px !important;
		padding-bottom: 5px !important;
	}

	html body.rmcf-cart-on .woocommerce-cart-form .shop_table_responsive tr.cart_item > td.product-quantity::before {
		content: attr(data-title) !important;
		float: none !important;
		display: inline-block !important;
		flex: 0 0 auto !important;
		margin: 0 !important;
		font-weight: 600 !important;
		text-transform: uppercase !important;
		font-size: 11px !important;
		line-height: 1.25 !important;
		white-space: nowrap !important;
	}

	html body.rmcf-cart-on .woocommerce-cart-form .shop_table_responsive tr.cart_item > td.product-quantity div.quantity {
		margin: 0 0 0 auto !important;
	}

	html body.rmcf-cart-on .woocommerce-cart-form .shop_table_responsive tr.cart_item {
		padding-top: 8px !important;
		padding-bottom: 8px !important;
	}

	html body.rmcf-cart-on .woocommerce-cart-form .shop_table_responsive tr.cart_item td.product-name {
		padding-top: 4px !important;
		padding-bottom: 4px !important;
		font-size: 13px !important;
		line-height: 1.3 !important;
	}

	html body.rmcf-checkout-on .rmcf-qty-sku-wrap .rmcf-inline-sku,
	html body.rmcf-checkout-on .rmcf-qty-sku-wrap .rmcf-inline-dims,
	html body.rmcf-checkout-on .rmcf-qty-sku-wrap .rmcf-inline-sku-label {
		font-size: 12px !important;
	}
}
