.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(--linkInitialColor);
	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;

	.woocommerce-mini-cart {
		max-height: 40vh;
		overflow-y: auto;

		li {
			grid-column-gap: 17px;
			padding-bottom: 15px;
			--listItemSpacing: 0 0 15px 0;

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

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

	.woocommerce-mini-cart__total {
		margin-top: 0;
		border-top-color: rgba(255, 255, 255, 0.1);
	}

	.woocommerce-mini-cart__buttons {
		.button {
			--buttonFontSize: 11px;
			--buttonFontWeight: 600;
			--padding: 0 10px;
			--buttonMinHeight: 45px;
			--buttonShadow: none;
			--buttonTransform: none;
			--buttonLetterSpacing: 0.05em;
			--buttonTextTransform: 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;
	}
}