@import "../../../../../css/_mixins.scss";
@import "../../../../../css/_trx_addons.vars.scss";

.sc_layouts_cart {
	position:relative;
	z-index:2000;
}
.sc_layouts_cart_icon,
.sc_layouts_cart_details {
	cursor:pointer;
}
.sc_layouts_cart_items_short {
	display:none;
	font-size:9px;
	background-color:#333;
	color: #fff;
	/*
	Old way: don't fit big numbers
	@include square(15px);
	@include border-round;
	@include abs-rt(-5px, -5px);
	*/
	/* New way: stretch to fit any number */
	min-width: 15px;
	min-height: 15px;
	line-height: 15px;
	text-align: center;
	padding: 0 2px;
	@include border-box;
	@include border-radius(8px);
	@include abs-rt;
	@include translate(50%,-33%);

	pointer-events: none;
}

.sc_layouts_row_type_compact .sc_layouts_cart_details {
	display:none;
}
.sc_layouts_row_type_compact .sc_layouts_cart_details {
	display:none;
}
.sc_layouts_row_type_compact .sc_layouts_cart_items_short {
	display:block;
}

/* Widget: Cart */
.sc_layouts_cart_widget {
	display:none;
	text-align:left;
	@include abs-rt(-2em, 4em, 2);
	width: 280px;
	padding: 1em;
	border: 1px solid #ddd;
	background-color: #fff;
	color: #888;
	@include border-box;
}
.sc_layouts_cart_widget:after {
	content: ' ';
	display:block;
	@include abs-rt(2.5em, 0);
	@include box(8px, 8px);
	margin: -5px 0 0 -4px;
	border-left: 1px solid #ddd;
	border-top: 1px solid #ddd;
	background-color:#fff;
	@include rotate(45deg);
}
.sc_layouts_cart_widget .widget_shopping_cart {
	text-align: left !important;
	@include font(0.9333em, 1.5em);
	
}
.sc_layouts_cart_widget .cart_list {
	max-height: 215px;
	overflow-y:auto;
	overflow-x:hidden;
}
.sc_layouts_cart_widget p {
	margin-bottom:0;
}
.sc_layouts_cart_widget p+p {
	margin-top:0.75em;
}
.sc_layouts_cart_widget .variation {
	display: none;
}

.sc_layouts_cart_panel {

	--sc_layouts-cart-panel-padding: 1.5em;
	--sc_layouts-cart-panel-padding-half: calc( var(--sc_layouts-cart-panel-padding) / 2 );
	--sc_layouts-cart-panel-padding-double: calc( var(--sc_layouts-cart-panel-padding) * 2 );
	--sc_layouts-cart-panel-padding-triple: calc( var(--sc_layouts-cart-panel-padding) * 2.5 );

	.sc_layouts_panel_inner {
		padding: var(--sc_layouts-cart-panel-padding);
	}
	.sc_layouts_cart_panel_header {
		@include abs-lt;
		width: 100%;
		@include border-box;
		padding: var(--sc_layouts-cart-panel-padding-half) var(--sc_layouts-cart-panel-padding);
		background-color: #eee;
	}
	.sc_layouts_cart_panel_title {
		margin:  0;
	}
	.sc_layouts_cart_items_short {
		display: inline-block;
		vertical-align: top;
		margin-left: 0.3em;
		font-size: 0.5em;
		@include border-round;
		position: static;
		@include transform-none;
	}
	.sc_layouts_cart_panel_widget {
		padding-top: var(--sc_layouts-cart-panel-padding-triple);

		.widget_shopping_cart {
			overflow: hidden;

			.widget_shopping_cart_content {
				overflow-x: hidden;
				overflow-y: scroll;
				max-height: calc( 100vh - 15em );
				margin-right: -16px;
			}

			ul.cart_list li {
				padding: 0 1.5em 1em 0;

				a:not(.remove) {
					font-size: 1.15em;
				}
				a.remove {
					left: auto;
					right: 0;
					margin-top: 0;
					text-align: center;
				}
				img {
					@include border-sharp;
					width: 5em;
					margin-right: 1em;
				}
				.variation {
					display: none;
				}
			}
			.woocommerce-mini-cart__total,
			.woocommerce-mini-cart__buttons {
				@include abs-lb(var(--sc_layouts-cart-panel-padding), var(--sc_layouts-cart-panel-padding));
				right: var(--sc_layouts-cart-panel-padding);
			}
			.woocommerce-mini-cart__total {
				bottom: calc( var(--sc_layouts-cart-panel-padding) + 4em );
				width: calc( 100% - var(--sc_layouts-cart-panel-padding-double) );
				text-align: right;
			}
			.woocommerce-mini-cart__buttons {
				@include flex;
				@include flex-justify-content(space-between);
				.button {
					width: 49%;
					text-align: center;
				}
			}
		}
	}
}

.sc_layouts_cart_link {
	display: block;
}

.sc_layouts_cart_button_wrap {
	@include fixed-rb(2em, 2em, 100100);
	@include transition-properties(bottom,opacity,transform);
	@include translateY(100px);
	opacity: 0;
	pointer-events: none;

	&.sc_layouts_cart_button_showed {
		@include translateY(0);
		opacity: 1;
		pointer-events: auto;
	}
	.trx_addons_scroll_to_top_show & {
		bottom: 6em;
	}

	.sc_layouts_cart_items_short {
		display: block;
		@include transform-none;
	}
	.sc_layouts_cart_widget {
		display: none;
	}
	.sc_layouts_cart_button_icon {
		display: block;
		@include font(1.5em, 1em);
		@include square(2em);
		@include border-round;
		@include box-shadow(0 0 3px rgba(0,0,0,.15));
		background-color: #efa752;
		color: #fff;
		position: relative;
		z-index: 1;
		@include transition-colors;
	}

	.sc_layouts_cart_button_sonar {
		display: block;
		background-color: #efa752;
		@include abs-pos(-10px, -10px, -10px, -10px);
		@include border-round;
		@include backface-hidden;
		@include perspective(800px);
		@include animation(sc-cart-button-sonar 2s ease infinite);
	}
}


/* Hotspot animation */
@-webkit-keyframes sc-cart-button-sonar {
	0% {
		opacity: 0;
		@include scale(.2);
	}
	50% {
		opacity: .8;
	}
	100% {
		opacity: 0;
		@include scale(1);
	}
}
@keyframes sc-cart-button-sonar {
	0% {
		opacity: 0;
		@include scale(.2);
	}
	50% {
		opacity: .8;
	}
	100% {
		opacity: 0;
		@include scale(1);
	}
}
