.kkart-block-cart {
	.kkart-block-components-shipping-calculator {
		white-space: nowrap;
	}

	.kkart-block-components-product-name {
		color: inherit;
	}
	.kkart-block-components-address-form {
		.kkart-block-components-text-input,
		.kkart-block-components-country-input,
		.kkart-block-components-state-input {
			&:first-of-type {
				margin-top: 0;
			}
		}
	}
}

table.kkart-block-cart-items,
table.kkart-block-cart-items th,
table.kkart-block-cart-items td {
	// Override Storefront theme gray table background.
	background: none !important;
	// Remove borders on default themes.
	border: 0;
	margin: 0;
}

.editor-styles-wrapper table.kkart-block-cart-items,
table.kkart-block-cart-items {
	table-layout: fixed;
	width: 100%;

	.kkart-block-cart-items__header {
		@include font-size(smaller);
		text-transform: uppercase;

		.kkart-block-cart-items__header-image {
			width: 100px;
		}
		.kkart-block-cart-items__header-product {
			visibility: hidden;
			min-width: 300px;
		}
		.kkart-block-cart-items__header-quantity {
			width: 116px;
		}
		.kkart-block-cart-items__header-total {
			width: 100px;
			text-align: right;
		}
	}
	.kkart-block-cart-items__row {
		.kkart-block-cart-item__image img {
			width: 100%;
			margin: 0;
		}
		.kkart-block-cart-item__quantity {
			.kkart-block-cart-item__remove-link {
				@include link-button;
				@include font-size(smaller);

				text-transform: none;
				white-space: nowrap;
			}
			.kkart-block-cart-item__remove-icon {
				@include link-button;

				fill: currentColor;
				position: absolute;
				top: $gap;
				right: 0;
				display: none;
			}
		}
		.kkart-block-cart-item__total {
			@include font-size(regular);
			text-align: right;
			line-height: 1.25;

			.kkart-block-components-product-price__regular,
			.kkart-block-components-product-price__value {
				display: block;
			}
		}

		&.is-disabled {
			opacity: 0.5;
			pointer-events: none;
			transition: opacity 200ms ease;
		}
	}
}

// Loading placeholder state.
.kkart-block-cart--is-loading {
	th span,
	h2 span {
		@include placeholder();
		@include force-content();
		min-width: 84px;
		display: inline-block;
	}
	h2 span {
		min-width: 33%;
	}
	.kkart-block-cart-items {
		.kkart-block-cart-items__row {
			.kkart-block-cart-item__price,
			.kkart-block-cart-item__product-metadata,
			.kkart-block-cart-item__image > *,
			.kkart-block-components-quantity-selector {
				@include placeholder();
			}
			.kkart-block-cart-item__product-name {
				@include placeholder();
				@include force-content();
				min-width: 84px;
				display: inline-block;
			}
			.kkart-block-cart-item__product-metadata {
				margin-top: 0.25em;
				min-width: 8em;
			}
			.kkart-block-cart-item__remove-link,
			.kkart-block-cart-item__remove-icon {
				visibility: hidden;
			}
			.kkart-block-cart-item__image a {
				display: block;
			}
			.kkart-block-cart-item__total {
				> span,
				> div {
					display: none;
				}
				.kkart-block-cart-item__price {
					@include force-content();
					display: block;
				}
			}
		}
	}
	.kkart-block-cart__sidebar .components-card {
		@include placeholder();
		@include force-content();
		min-height: 460px;
	}
}
.kkart-block-components-sidebar-layout.kkart-block-cart--skeleton {
	display: none;
}
.is-loading + .kkart-block-components-sidebar-layout.kkart-block-cart--skeleton {
	display: flex;
}

.is-medium,
.is-small,
.is-mobile {
	&.kkart-block-cart {
		.kkart-block-components-sidebar {
			.kkart-block-cart__totals-title {
				display: none;
			}
		}
	}
	table.kkart-block-cart-items {
		td {
			padding: 0;
		}
		.kkart-block-cart-items__header {
			display: none;
		}
		.kkart-block-cart-item__remove-link {
			display: none;
		}
		.kkart-block-cart-items__row {
			@include with-translucent-border(0 0 1px);
			display: grid;
			grid-template-columns: 80px 132px;
			padding: $gap 0;

			.kkart-block-cart-item__image {
				grid-column-start: 1;
				grid-row-start: 1;
				padding-right: $gap;
			}
			.kkart-block-cart-item__product {
				grid-column-start: 2;
				grid-column-end: 4;
				grid-row-start: 1;
				justify-self: stretch;
				margin-right: 24px;
				padding-bottom: $gap;
			}
			.kkart-block-cart-item__quantity {
				grid-column-start: 1;
				grid-row-start: 2;
				vertical-align: bottom;
				padding-right: $gap;
				align-self: end;
				padding-top: $gap;

				.kkart-block-cart-item__remove-link {
					display: none;
				}
				.kkart-block-cart-item__remove-icon {
					display: block;
				}
			}
			.kkart-block-cart-item__total {
				grid-column: 2 / span 2;
				grid-row-start: 2;
				align-self: end;
				justify-self: end;
				padding-bottom: 0.375em;

				.kkart-block-components-formatted-money-amount {
					display: inline-block;
				}

				.kkart-block-components-sale-badge {
					display: none;
				}
			}
		}
	}
}

.is-large.kkart-block-cart {
	.kkart-block-cart-items {
		@include with-translucent-border(0 0 1px);

		th {
			padding: 0.25rem $gap 0.25rem 0;
			white-space: nowrap;
		}
		td {
			@include with-translucent-border(1px 0 0);
			padding: $gap $gap $gap 0;
			vertical-align: top;
		}
		th:last-child,
		td:last-child {
			padding-right: 0;
		}
	}
	.kkart-block-components-radio-control__option {
		padding-left: $gap-large;
	}

	.kkart-block-components-radio-control__input {
		left: 0;
	}

	.kkart-block-components-sidebar {
		> .kkart-block-cart__totals-title,
		.kkart-block-components-shipping-calculator,
		.kkart-block-components-shipping-rates-control__package:not(.kkart-blocks-components-panel) {
			padding-left: $gap;
			padding-right: $gap;
		}
	}

	.kkart-block-cart__payment-options {
		padding: $gap;
	}
}
