.ct-header-cart {
	display: flex;
	align-items: center;
	position: relative;
	--content: attr(data-count);

	.ct-cart-item {
		display: flex;
		align-items: center;

		i {
			display: flex;
			width: var(--iconSize);
			height: var(--iconSize);

			svg {
				width: inherit;
				height: inherit;
				fill: currentColor;
			}
		}

		// cart badge
		&:not([data-count='0']) {
			position: relative;

			&:before {
				position: absolute;
				content: var(--content);
				top: -9px;
				right: -9px;
				display: flex;
				align-items: center;
				justify-content: center;
				min-width: 16px;
				cursor: pointer;
				height: 16px;
				padding: 0 3px;
				font-size: 10px;
				font-weight: 600;
				font-style: normal;
				border-radius: 10px;
				color: var(--cartBadgeText);
				background: var(--cartBadgeBackground);
			}
		}

		&[data-count='0'] {
			~ .ct-cart-content {
				display: none;
			}
		}

		&[data-skip-badge]:before {
			display: none;
		}
	}

	&.ct-added {
		.ct-cart-item:before {
			animation: 0.6s ease-in-out 0.12s normal both 1 bounce-in;
		}
	}
}

@keyframes bounce-in {
	0% {
		transform: scale(0, 0);
	}
	20% {
		transform: scale(1.4, 1.4);
	}
	50% {
		transform: scale(0.8, 0.8);
	}
	85% {
		transform: scale(1.1, 1.1);
	}
	100% {
		transform: scale(1, 1);
	}
}

.ct-cart-label {
	display: var(--display, none);
	flex: 1;
}

.ct-cart-label,
.ct-cart-total {
	margin-right: 8px;
	font-size: 13px;
	font-weight: 600;
	line-height: normal;
	text-transform: uppercase;
}

// cart content
.ct-header-cart {
	&:hover:not([data-skip-dropdown]) {
		.ct-cart-content:not(.ct-initial) {
			opacity: 1;
			visibility: visible;
			transform: translate3d(0, 0, 0);
		}
	}
}

.ct-cart-content {
	position: absolute;
	z-index: 15;
	top: 100%;
	right: -15px;
	width: 310px;
	color: var(--color);
	margin-top: var(--dropdownTopOffset);
	padding: 22px 20px;
	border-radius: 2px;
	background: var(--backgroundColor);
	box-shadow: 0px 10px 20px 0px rgba(41, 51, 61, 0.1);

	opacity: 0;
	visibility: hidden;
	transform: translate3d(0, 10px, 0);
	transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;

	ul {
		position: relative;
		max-height: 40vh;
		overflow-y: auto;
		@include list-normalize;

		li {
			display: flex;
			align-items: center;
			position: relative;
			z-index: 1;
			padding-bottom: 15px;
			margin-bottom: 15px;

			&:not(:last-child) {
				border-bottom: 1px dashed rgba(255, 255, 255, 0.1);
			}

			&:last-child {
				margin-bottom: 0;
			}

			a:hover {
				color: var(--colorHover);
			}

			.product-thumb {
				flex: 0 0 75px;
				max-width: 75px;

				img {
					width: 100%;
				}
			}

			.product-data {
				display: flex;
				flex-direction: column;
				margin-left: 17px;
				width: 100%;
				padding-right: 18px;
			}

			.product-name {
				font-size: 15px;
				font-weight: 600;
				line-height: 20px;
				color: inherit;
				margin-bottom: 3px;
			}

			.quantity {
				font-size: 13px;

				span {
					font-weight: 500;
				}
			}

			.remove {
				position: absolute;
				z-index: 2;
				top: 0;
				right: 0;
				width: 15px;
				height: 15px;
				font-size: 17px;
				font-weight: normal;
				line-height: 13px;
				text-align: center;
				transition: color 0.12s cubic-bezier(0.455, 0.03, 0.515, 0.955);
			}

			.blockUI.blockOverlay {
				opacity: 0.85 !important;
				background-color: var(--cartDropDownBackground) !important;
			}
		}
	}

	.total {
		display: flex;
		justify-content: space-between;
		font-size: 12px;
		text-align: center;
		text-transform: uppercase;
		letter-spacing: 0.05em;
		padding-top: 30px;
		margin-bottom: 25px;
		border-top: 1px dashed rgba(255, 255, 255, 0.1);

		.amount {
			font-weight: 700;
		}
	}

	.buttons {
		display: flex;
		justify-content: space-between;

		> * {
			--buttonFontSize: 11px;
			--buttonFontWeight: 600;
			--height: 40px;
			--padding: 20px;
			--buttonShadow: none;
			--buttonTransform: none;

			width: calc(50% - 8px);
			letter-spacing: 0.05em;
			text-transform: uppercase;
		}
	}

	// placement
	&[data-placement='left'] {
		right: -20px;
	}

	&[data-placement='right'] {
		left: -20px;
	}

	// bridge
	&:before {
		position: absolute;
		content: '';
		width: 100%;
		height: var(--dropdownTopOffset);
		top: calc(var(--dropdownTopOffset) * -1);
		left: 0;
	}
}

// off canvas cart
#offcanvas .ct-header-cart {
	.ct-cart-item {
		width: 100%;
	}

	.ct-cart-label {
		--display: block;
	}

	.ct-cart-content {
		display: none;
	}
}
