//
// ShopBar Styles
// --------------------------------------------------

@shopBarBackgroundColor: @var_ShopBarBackgroundColor;
@shopBarBorderColor: @var_ShopBarBorderColor;
@shopBarTextColor: @var_ShopBarTextColor;
@shopBarIconColor: @var_ShopBarIconColor;

.sb-textshadow() when (lightness(@shopBarBackgroundColor) > 80) {
  text-shadow: 0 1px 0 #fff;
}

#shopbar {
    overflow: visible;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    .small();
    z-index: 1000;
    
    .transition(opacity 0.12s ease-in-out);
    border-bottom: 1px solid @shopBarBorderColor;
    .box-shadow(0 0px 8px @shopBarBorderColor);
    
    @bg: top, @shopBarBackgroundColor, @shopBarBackgroundColor 40%, darken(@shopBarBackgroundColor, 7%) 100%;
    background-color: @shopBarBackgroundColor;
    background-image: -webkit-linear-gradient(@bg);
    background-image:         linear-gradient(@bg);
}

#shopbar.sticky {
    .opacity(75);
    &:hover {
        .opacity(100);
    }
}

#shopbar .form-search {
	margin: 0;
	margin-right: 8px;
	padding: 8px 0;
}

#instantsearch {
	width: 250px;
}

@media (min-width: 1200px) {	
	#instantsearch {
		width: 450px;
	}
}

#instantsearch-progress {
	position: absolute;
	right: 45px;
	top: 50%;
	margin-top: -10px;
	z-index: 10;
}

.typeahead {
	@baseHeight: 36px;
	&.dropdown-instantsearch.rich li {
		border-bottom: 1px solid rgba(0,0,0, 0.12);
		&:last-child { border-bottom: none }
	}
	.item-wrapper { 
		display: block; 
		height: @baseHeight; 
		padding: 5px 0;
	}
	.item-thumb { 
		float: left; 
		width: @baseHeight; 
		height: @baseHeight; 
		margin-right: 8px; 
		text-align: center;
	}
	.item-thumb > img { 
		max-height: 100% ;
	}
	.item-labels { 
		float: left; 
		height: @baseHeight; 
	}
	.item-primary { 
		font-size: 13px;
		line-height: @baseHeight / 2;
	}
	.item-secondary { 
		font-size: 11px;
		line-height: (@baseHeight / 2) - 2px;
		padding-top: 2px;
		opacity: 0.7 
	}
}

#shopbar-account .shopbar-flyout-container .register {
	text-align: center;
}
#shopbar-account .shopbar-flyout-container .fa {
	font-size: 16px;
}

.shopbar-flyout {
	padding: 10px;
	-webkit-transform: translateZ(0);
}

.shopbar-button {
    display: block;
    text-decoration: none;
    line-height: 14px;
    
    color: @shopBarTextColor;
	.sb-textshadow();
    .transition(color 0.15s linear);
    &:hover { 
		@textColor: contrast(@shopBarBackgroundColor);
		color: @textColor;
	}
}

.shopbar-divider {
    float: right;
    height: 28px;
    width: 1px;
    background-color: rgba(0,0,0, .15);
    margin: 8px;
	padding: 0;
	
    border-right: 1px solid @shopBarBackgroundColor;
	.no-rgba & { 
		background-color: darken(@shopBarBackgroundColor, 15%); 
	}
}

.shopbar-button-label { 
	position: relative; 
	display: inline-block;
}

.shopbar-tool {
	position: relative;
    padding: 8px 0;
}

.shopbar-tool.open .shopbar-flyout {
	visibility: visible;
	.opacity(100);
}

.shopbar-tool.open .dropdown-menu {
	display: block;
	margin: 0;
	text-shadow: none;
}

.shopbar-tool .shopbar-button-icon {
	position: relative;
	display: inline-block;
	margin: 2px 4px 0 0;
	
	span.label {
		position: absolute; 
		left: -3px; 
		top: -3px; 
		font-size: 11px;
		padding-top: 1px;
		padding-bottom: 1px;
	}
}

.shopbar-button-icon .fa {
	display: inline-block;
	font-size: 24px !important;
	font-style: normal;
	line-height: 28px;
	vertical-align: middle;
	
	color: @shopBarIconColor;
	.transition(color .1s linear);
}

.shopbar-button:hover .shopbar-button-icon .fa {
	color: darken(@shopBarIconColor, 22%);
}

.shopbar-button .fa {
	font-size: 12px;	
}

.shopbar-button .sm-arrow,
.shopbar-button .sm-arrow:after {
	position: absolute;
	display: inline-block;
	width: 0;
	height: 0;
	border-style: solid;
	border-color: transparent;
	left: 50%; 
	bottom: 0; 
	border-top: 0;
}

.shopbar-button .sm-arrow {
    border-width: 8px;
    z-index: 1002;
    visibility: hidden;
	margin-left: -8px; 
	border-bottom-color: #bbb;	
}

.shopbar-button .sm-arrow:after {
  	content: "";
  	border-width: 7px;
  	bottom: -8px;
  	z-index: 1001;
	margin-left: -7px; 
	border-bottom-color: #fff;
}

.shopbar-tool.open .sm-arrow {
	visibility: visible;
}

/* taken from bootstrap */
.shopbar-flyout {
	position: absolute;
	visibility: hidden;
	.opacity(0);
	top: 100%;
	left: 0;
	z-index: @zindexDropdown;
	float: left;
	min-width: 320px;
	max-width: 420px;
	padding: 5px 0;
	margin: 0;
	list-style: none;
	-webkit-background-clip: padding-box;
	        background-clip: padding-box;
  	
  	height: 50px;
  	min-height: 50px;
	background-image: none;
	background-position: 50% 50%;
	background-repeat: no-repeat;
	
	.transition(opacity 0.15s ease-in-out);
	background-color: @dropdownBackground;
	border: 1px solid @dropdownBorder;
	border-color: rgba(0,0,0, 0.15);
	*border-right-width: 2px;
	*border-bottom-width: 2px;
	.border-radius(@baseBorderRadius);
	.box-shadow(0 2px 8px rgba(0,0,0,.2));
	
	.shopbar-tool.loading & {
		//background-image: url('images/loading.gif');
	}
	
    .spinner-container {
        height: 100%;
	}

    .shopbar-tool:not(.loading) & > .spinner-container {
		display: none;
	}

	.shopbar-tool.loading & > .shopbar-flyout-inner {
		display: none;
	}
	
	.shopbar-tool.loaded & {
		height: auto;
	}
  	
	// Dividers (basically an hr) within the dropdown
	.divider {
		.nav-divider(@dropdownDividerTop, @dropdownDividerBottom);
	}

	// Links within the dropdown menu
	a {
		font-weight: normal;
		line-height: @baseLineHeight;
		white-space: nowrap;
	}
}

.shopbar-tool .shopbar-flyout,
.shopbar-tool .shopbar-flyout-container {
	margin-top: -1px !important;
}

// Aligns the dropdown menu to right
.pull-right .shopbar-flyout,
.pull-right .shopbar-flyout-container {
	right: 0;
	left: auto;
}

#shopbar-flyout-cart,
#shopbar-flyout-wishlist { 
    width: 340px;
}

#shopbar-flyout-account { 
    width: 250px; 
}

.shopbar-flyout-inner {
	position: relative;
	min-height: 50px;
}

.shopbar-flyout-inner a {
    text-decoration: none;
	.transition(color .1s linear);
}

.shopbar-flyout-inner .no-items {
	position: absolute;
	left: 0;
	right: 0;
	top: 50%;
	margin: -(@baseLineHeight / 2) 10px 0 10px;
	text-align: center;
}

.shopbar-flyout-inner .items {
	padding: 0;
	margin: 0;
	.smaller();
}

.shopbar-flyout-inner .price {
	text-align: right;
}

.shopbar-flyout-inner .items .item {
	position: relative; 
	padding: 8px 20px;
	margin: 0;
	border-bottom: 1px solid #e5e5e5;

	&.omega { 
		border-bottom: none 
	}
	
	&.more { 
		text-align: center;
		.name {
			color: #777;
			font-size: 1.1em;
			font-weight: bold;
			&:hover {
				color: @gray;
			}
		}
	}

	.picture {
		display: inline-block;
		text-align: center;
		margin: 0; 
		margin-right: 4px;
		width: 32px;
		
		img { 
			max-width: 32px; 
			max-height: 50px 
		}
	}

	.quantity {
		width: 25px;
		margin-left: 5px;
		.times {
			font-size: .9em;
		}
	}

	.data {
		width: 160px;
		overflow: hidden;
		.text-overflow();
	}
	
	.data .attributes {
		white-space: initial;
		line-height: 12px;
	}
	
	&.no-thumb .data {
		width: 180px;
	}
	
	.action {
		padding-left: 4px;
		i { font-size: 11px }
	}
	
	.price {
		width: 64px;
	}

	.remove {
		position: absolute;
		right: 4px;
		top: 8px;
		.opacity(0);
		color: #000;
		.transition(opacity .1s linear);
	}
	
	&:hover .remove {
		.opacity(50);
	}

	.remove:hover {
		.opacity(100)
	}
}

#shopbar-flyout-wishlist .shopbar-flyout-inner .items .item {
	.data { width: 136px }
	&.no-thumb .data { width: 176px }
}

#shopbar-flyout-compare .shopbar-flyout-inner .items .item {
	.figure { margin-right: 8px }
	.data { width: 170px }
}

.shopbar-flyout-inner .summary {
    padding: 12px 20px;
	background: #f5f5f5; 
	border-top: 1px solid #c2c2c2;
	border-bottom: 1px solid #d2d2d2; 
	font-weight: bold; 
	.box-shadow(inset 0px 5px 20px -9px rgba(0,0,0, .25)); 	
}

.shopbar-flyout-inner .buttons {
	padding: 20px 20px 12px 20px;
}

#shopbar-flyout-account .shopbar-flyout-inner {
	padding: 10px 20px;
}


