// Mini cart
/**
 * Cart sidebar
 */

.widget {
	.woocommerce-mini-cart {
		.mini_cart_item {
			display: flex;
			&__thumb {
				width: 60px;
				flex-basis: 60px;
				img {
					width: 100%;
					display: block;
				}
			}

			&__info {
				flex-basis: calc(100% - 60px);
				width: calc(100% - 60px);
				padding: 0px 25px 0px 1em;
			}
		}
	}

	.cart_list {
		list-style: none outside;
		padding: 0;
		margin: 0;
		.wc-product-name,
		.quantity {
			display: block;
		}
		li {
			margin: 0 0 1em 0;
			list-style: none;
			position: relative;
			a.remove {
				position: absolute;
				right: 0px;
				top: 15px;
			}
			a {
				display: block;
			}
			a:not(.remove) {
				line-height: 1.35;
			}

			img {
				height: auto;
				box-shadow: none;
			}

			dl {
				margin: 0;
				padding-left: 1em;
				border-left: 2px solid rgba(0, 0, 0, 0.1);
				@include clearfix();

				dt,
				dd {
					display: inline-block;
					float: left;
				}

				dt {
					font-weight: 700;
					padding: 0 0 0.25em;
					margin: 0 4px 0 0;
					clear: left;
				}

				dd {
					padding: 0 0 0.25em;

					p:last-child {
						margin-bottom: 0;
					}
				}
			}
			.star-rating {
				float: none;
			}
		}
	}
}

.wc-mini-cart-footer {
	border-top: 1px solid $color_border;
	padding: 1.25em;
}

.widget-area {
	&.sidebar-inner {
		.widget_shopping_cart {
			.cart_list {
				margin-bottom: 1.25em;
			}
			.wc-mini-cart-footer {
				padding: 1.25em 0 0px;
			}
		}
	}

	.widget_shopping_cart {
		.quantity {
			text-transform: uppercase;
			display: block;
			margin-top: 7px;
		}
		.total {
			display: block;
			margin-top: 0px;
			margin-bottom: 1.1em;
			.amount {
				float: right;
				font-size: 110%;
				position: relative;
				top: -2px;
			}
		}
		.cart_list {
			&:after {
				content: none !important;
				display: none !important;
			}
		}

		.buttons {
			a {
				text-align: center;
				display: block;
				margin-bottom: 0.6em;
				font-size: 0.9em;
				min-height: auto;
				&:last-child {
					margin-bottom: 0px;
				}
			}
		}
	}
}

// Header Item: Shopping Cart
.item--wc_cart {
	position: relative;
	.cart-item-link {
		display: flex;
		align-items: center;
		font-weight: 600;
		font-size: 0.85em;
		> span {
			margin: 0 2px;
			&:first-child {
				margin-left: 0px;
			}
			&:last-child {
				margin-right: 0px;
			}
		}
		.tax_label {
			display: none;
		}
	}

	.cart-icon {
		display: inline-block;
		position: relative;
		font-size: 1.3em;
		i {
			width: 1.3em;
			height: 1.3em;
			display: block;
			position: relative;
			top: -1px;
			&:before {
				position: absolute;
				top: 50%;
				left: 50%;
				transform: translate(-50%, -50%);
			}
		}
		.cart-qty {
			position: absolute;
			top: -4px;
			right: 2px;
			left: auto;
			transform: translate(50%, 0%);
			font-size: 11px;
			min-width: 16px;
			min-height: 16px;
			line-height: 16px;
			display: block;
			text-align: center;
			.starterblog-wc-total-qty {
				color: #ffffff;
				box-shadow: 1px 1px 3px 0px rgba(0, 0, 0, 0.2);
				font-size: 11px;
				min-width: 16px;
				min-height: 16px;
				line-height: 16px;
				border-radius: 20px;
				background: $color_secondary;
				display: block;
				&.hide-qty {
					display: none;
				}
			}
		}
	}
	.cart-dropdown-box {
		position: absolute;
		text-align: left;
		top: 100%;
		right: 0px;
		left: auto;
		z-index: 30;
		min-width: 300px;
		padding: 10px 0 0;
		transition: all 0.3s ease;
		opacity: 0;
		height: 0;
		visibility: hidden;
		display: block;
		color: $color_text;
		transform: translateY(40px);
		.woocommerce-mini-cart {
			max-height: 300px;
			overflow: auto;
			display: block;
			padding: 1.25em;
			li {
				&:last-child {
					margin-bottom: 0;
				}
			}
		}
		.widget {
			border: 1px solid #eaecee;
			background: #ffffff;
			box-shadow: $boxshadow_dropdown;
			position: relative;
			&::before {
				border-top: 1px solid $color_border;
				border-left: 1px solid $color_border;
				background: #fff;
				content: "";
				display: block;
				position: absolute;
				width: 15px;
				height: 15px;
				transform: rotate(45deg);
				z-index: 27;
			}
		}
		// When cart empty
		.woocommerce-mini-cart__empty-message {
			padding: 1.25em;
		}
	}

	&:hover,
	&.cart-active {
		.cart-dropdown-box {
			opacity: 1;
			height: auto;
			overflow: initial;
			visibility: visible;
			display: block;
			transform: translateY(0px);
		}
	}
}

.item--wc_cart {
	&.d-align-right {
		.cart-dropdown-box {
			left: auto;
			right: -8px;
			.widget {
				&:before {
					top: -8px;
					right: 15px;
				}
			}
		}
	}
	&.d-align-left {
		.cart-dropdown-box {
			left: 0px;
			right: auto;
			.widget {
				&:before {
					top: -8px;
					left: 15px;
				}
			}
		}
	}

	@include for_device(mobile) {
		.wc-cart-mobile-hide {
			display: none !important;
		}
		.wc-cart-mobile-show {
			display: inline-block !important;
		}
	}

	@include for_device(tablet) {
		.wc-cart-tablet-hide {
			display: none;
		}
		.wc-cart-tablet-show {
			display: inline-block;
		}
	}

	@include for_device(desktop) {
		.wc-cart-desktop-hide {
			display: none;
		}
		.wc-cart-desktop-show {
			display: inline-block;
		}
	}
}

.header-menu-sidebar-inner {
	.cart-dropdown-box {
		display: none !important;
		visibility: hidden;
		height: 0px;
	}
}

// Hide cart on mobile
.cb-row--mobile {
	.cart-dropdown-box {
		@include for_device(mobile) {
			display: none !important;
		}
	}
}

.site-header {
	.builder-header-wc_cart-item {
		.widget_shopping_cart {
			.widgettitle {
				display: none;
			}
		}
	}
}

