/**
 * New Formazione: responsive WooCommerce cart.
 * Scoped to the cart page so catalogue and content tables are unaffected.
 */
body.woocommerce-cart table.shop_table,
body.woocommerce-cart table.shop_table tr,
body.woocommerce-cart table.shop_table td,
body.woocommerce-cart table.shop_table th {
	border-color: #ddd;
}

body.woocommerce-cart .cart-navigation-actions {
	display: flex;
	justify-content: center;
	flex-wrap: wrap;
	gap: 12px;
}

@media screen and (min-width: 768px) {
	body.woocommerce-cart table.woocommerce-cart-form__contents td.actions {
		display: flex;
		align-items: flex-end;
		flex-wrap: wrap;
		gap: 12px;
	}

	body.woocommerce-cart table.woocommerce-cart-form__contents td.actions .coupon {
		margin-right: auto;
	}

	body.woocommerce-cart table.woocommerce-cart-form__contents td.actions > .button,
	body.woocommerce-cart table.woocommerce-cart-form__contents td.actions .empty-cart-button {
		width: auto;
		margin: 0;
		float: none;
	}
}

@media screen and (max-width: 767px) {
	body.woocommerce-cart .site-main,
	body.woocommerce-cart .entry-content,
	body.woocommerce-cart .woocommerce,
	body.woocommerce-cart .woocommrece-cart-content {
		width: 100%;
		max-width: 100%;
		box-sizing: border-box;
		overflow-x: clip;
	}

	body.woocommerce-cart .woocommerce {
		padding-left: 12px;
		padding-right: 12px;
	}

	body.woocommerce-cart .woocommerce-cart-form {
		width: 100%;
		max-width: 100%;
		overflow: visible;
	}

	body.woocommerce-cart table.woocommerce-cart-form__contents {
		display: block;
		width: 100%;
		max-width: 100%;
		margin: 0;
		border: 0;
		table-layout: fixed;
	}

	body.woocommerce-cart table.woocommerce-cart-form__contents thead {
		display: none;
	}

	body.woocommerce-cart table.woocommerce-cart-form__contents tbody,
	body.woocommerce-cart table.woocommerce-cart-form__contents tr,
	body.woocommerce-cart table.woocommerce-cart-form__contents td {
		display: block;
		width: 100%;
		max-width: 100%;
		box-sizing: border-box;
	}

	body.woocommerce-cart table.woocommerce-cart-form__contents tr.cart_item {
		margin: 0 0 20px;
		padding: 14px;
		border: 1px solid #ddd;
		border-radius: 12px;
		background: #fff;
	}

	body.woocommerce-cart table.woocommerce-cart-form__contents tbody tr.cart_item td {
		position: relative;
		min-width: 0;
		min-height: 44px;
		padding: 10px 0;
		border: 0;
		border-bottom: 1px solid #ececec;
		text-align: right;
		overflow-wrap: anywhere;
	}

	body.woocommerce-cart table.woocommerce-cart-form__contents tbody tr.cart_item td:last-child {
		border-bottom: 0;
	}

	body.woocommerce-cart table.woocommerce-cart-form__contents td[data-title]::before {
		content: attr(data-title);
		float: left;
		max-width: 44%;
		padding-right: 12px;
		font-weight: 600;
		text-align: left;
	}

	body.woocommerce-cart table.woocommerce-cart-form__contents td.product-thumbnail {
		min-width: 0;
		text-align: center;
	}

	body.woocommerce-cart table.woocommerce-cart-form__contents td.product-thumbnail img {
		display: block;
		width: 100%;
		max-width: 260px;
		height: auto;
		margin: 0 auto;
		border-radius: 8px;
	}

	body.woocommerce-cart table.woocommerce-cart-form__contents td.product-name,
	body.woocommerce-cart table.woocommerce-cart-form__contents td.product-name a {
		text-align: left;
		overflow-wrap: anywhere;
	}

	body.woocommerce-cart table.woocommerce-cart-form__contents td.product-name::before {
		display: none;
	}

	body.woocommerce-cart table.woocommerce-cart-form__contents td.product-name > a {
		font-size: 17px;
		line-height: 1.35;
	}

	body.woocommerce-cart table.woocommerce-cart-form__contents .product-remove .remove {
		display: inline-flex;
		align-items: center;
		min-height: 44px;
		padding: 8px 0;
	}

	body.woocommerce-cart table.woocommerce-cart-form__contents td.product-price del,
	body.woocommerce-cart table.woocommerce-cart-form__contents td.product-price ins,
	body.woocommerce-cart table.woocommerce-cart-form__contents td.product-subtotal del,
	body.woocommerce-cart table.woocommerce-cart-form__contents td.product-subtotal ins {
		display: inline;
		white-space: normal;
	}

	body.woocommerce-cart table.woocommerce-cart-form__contents td.product-quantity .quantity {
		--em-quantity-width: 44px;
		--em-quantity-height: 44px;
		display: inline-flex;
		max-width: 100%;
	}

	body.woocommerce-cart table.woocommerce-cart-form__contents td.product-quantity .quantity input {
		min-width: 44px;
		font-size: 16px;
	}

	body.woocommerce-cart table.woocommerce-cart-form__contents td.actions {
		display: flex;
		flex-direction: column;
		gap: 12px;
		width: 100%;
		padding: 0;
		border: 0;
	}

	body.woocommerce-cart table.woocommerce-cart-form__contents td.actions::before {
		display: none;
	}

	body.woocommerce-cart table.woocommerce-cart-form__contents .actions .coupon {
		display: grid;
		grid-template-columns: minmax(0, 1fr);
		gap: 10px;
		width: 100%;
		margin: 0;
		float: none;
	}

	body.woocommerce-cart table.woocommerce-cart-form__contents .actions .coupon input.input-text,
	body.woocommerce-cart table.woocommerce-cart-form__contents .actions .coupon .button,
	body.woocommerce-cart table.woocommerce-cart-form__contents .actions > .button,
	body.woocommerce-cart table.woocommerce-cart-form__contents .actions .empty-cart-button {
		width: 100%;
		min-width: 0;
		min-height: 50px;
		margin: 0;
		padding: 12px 16px;
		float: none;
		box-sizing: border-box;
		white-space: normal;
		text-align: center;
	}

	body.woocommerce-cart table.woocommerce-cart-form__contents .actions .coupon input.input-text {
		width: 60%;
		margin-left: auto;
		margin-right: auto;
	}

	body.woocommerce-cart .cart-collaterals,
	body.woocommerce-cart .cart_totals {
		width: 100%;
		max-width: 100%;
		float: none;
		box-sizing: border-box;
	}

	body.woocommerce-cart .cart-navigation-actions,
	body.woocommerce-cart .wc-proceed-to-checkout {
		display: flex;
		flex-direction: column;
		gap: 12px;
		width: 100%;
		padding: 16px 0;
	}

	body.woocommerce-cart .cart-navigation-actions .button,
	body.woocommerce-cart .wc-proceed-to-checkout .button {
		display: flex;
		align-items: center;
		justify-content: center;
		width: 100%;
		min-width: 0;
		min-height: 52px;
		margin: 0;
		padding: 12px 16px;
		box-sizing: border-box;
		white-space: normal;
		text-align: center;
	}

	body.woocommerce-cart button,
	body.woocommerce-cart .button,
	body.woocommerce-cart input,
	body.woocommerce-cart select {
		max-width: 100%;
		box-sizing: border-box;
	}

	/* WooCommerce Cart Block fallback, should the page be migrated to Blocks. */
	body.woocommerce-cart .wc-block-cart,
	body.woocommerce-cart .wc-block-cart-items,
	body.woocommerce-cart .wc-block-cart-items__row,
	body.woocommerce-cart .wc-block-cart-item__product,
	body.woocommerce-cart .wc-block-components-totals-wrapper {
		min-width: 0;
		max-width: 100%;
		box-sizing: border-box;
	}

	body.woocommerce-cart .wc-block-cart-items__row {
		grid-template-columns: minmax(72px, 28%) minmax(0, 1fr);
	}

	body.woocommerce-cart .wc-block-cart__submit-container,
	body.woocommerce-cart .wc-block-cart__submit-container .wc-block-components-button {
		width: 100%;
		min-height: 52px;
	}

	/* Fixed chat systems actually loaded by the site (Cresta, Tawk and LHC). */
	body.woocommerce-cart .chat-widget,
	body.woocommerce-cart .chat-launcher,
	body.woocommerce-cart .joinchat,
	body.woocommerce-cart .ht-ctc-chat,
	body.woocommerce-cart #chaty-widget-0,
	body.woocommerce-cart .cresta-whatsapp-chat-box,
	body.woocommerce-cart .cresta-whatsapp-chat-container,
	body.woocommerce-cart #lhc_status_container,
	body.woocommerce-cart iframe[src*="embed.tawk.to"],
	body.woocommerce-cart iframe[src*="livehelper.formazioneintermediari.com"] {
		right: 12px !important;
		bottom: 80px !important;
		max-width: calc(100vw - 24px) !important;
	}

	body.woocommerce-cart .cresta-whatsapp-chat-container,
	body.woocommerce-cart .cresta-whatsapp-inner,
	body.woocommerce-cart .cresta-whatsapp-chat-top-header {
		width: min(300px, calc(100vw - 24px));
		max-width: calc(100vw - 24px);
		box-sizing: border-box;
	}
}
