/*--------------------------------------------------------------
## Traka sa napretkom do poklona (korpa i mini korpa)
##
## Boje su prepisane iz assets/scss/config/_variables.scss. Fajl je namerno
## obican CSS, van gulp/webpack pipeline-a, da se moze menjati bez build koraka.
--------------------------------------------------------------*/

.gift-bar {
	--gift-dark: #172d27;
	--gift-green: #4f6b63;
	--gift-cascade: #879f98;
	--gift-gold: #d0b267;
	--gift-dew: #ebf8ee;
	--gift-border: #e7e7e7;
	--gift-muted: #4f4a47;

	box-sizing: border-box;
	width: 100%;
	margin: 0 0 24px;
	padding: 18px 20px;
	border: 1px solid var(--gift-border);
	border-radius: 14px;
	background: linear-gradient(180deg, #fff 0%, var(--gift-dew) 100%);
}

.gift-bar * {
	box-sizing: border-box;
}

.gift-bar__head {
	display: flex;
	align-items: center;
	gap: 10px;
}

.gift-bar__icon {
	flex: 0 0 auto;
	width: 22px;
	height: 22px;
	color: var(--gift-green);
	transition: color 350ms ease, transform 350ms ease;
}

.gift-bar__text {
	margin: 0;
	color: var(--gift-dark);
	font-size: 15px;
	line-height: 1.35;
}

.gift-bar__text strong {
	color: var(--gift-green);
	font-weight: 600;
	white-space: nowrap;
}

.gift-bar__track {
	position: relative;
	height: 8px;
	margin-top: 12px;
	border-radius: 99px;
	background: #dfe8e2;
	overflow: hidden;
}

.gift-bar__fill {
	position: absolute;
	top: 0;
	left: 0;
	height: 100%;
	min-width: 8px;
	border-radius: 99px;
	background: linear-gradient(90deg, var(--gift-green) 0%, var(--gift-cascade) 100%);
	transition: width 550ms cubic-bezier(0.4, 0, 0.2, 1), background 350ms ease;
}

/* Tanak odsjaj koji putuje trakom dok poklon jos nije osvojen. */
.gift-bar__fill::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
	background: linear-gradient(
		90deg,
		rgba(255, 255, 255, 0) 0%,
		rgba(255, 255, 255, 0.45) 50%,
		rgba(255, 255, 255, 0) 100%
	);
	transform: translateX(-100%);
	animation: gift-bar-shimmer 2.4s ease-in-out infinite;
}

.gift-bar__note {
	margin: 8px 0 0;
	color: var(--gift-muted);
	font-size: 13px;
	line-height: 1.4;
	opacity: 0.8;
}

/*--------------------------------------------------------------
## Osvojen poklon
--------------------------------------------------------------*/

.gift-bar.is-complete {
	border-color: rgba(208, 178, 103, 0.55);
	background: linear-gradient(180deg, #fff 0%, #faf4e6 100%);
}

.gift-bar.is-complete .gift-bar__icon {
	color: var(--gift-gold);
	animation: gift-bar-pop 450ms ease;
}

.gift-bar.is-complete .gift-bar__text strong {
	color: #a8863c;
}

.gift-bar.is-complete .gift-bar__fill {
	background: linear-gradient(90deg, var(--gift-gold) 0%, #e6d0a0 100%);
}

.gift-bar.is-complete .gift-bar__fill::after {
	animation: none;
	opacity: 0;
}

/*--------------------------------------------------------------
## Varijanta u mini korpi
--------------------------------------------------------------*/

.gift-bar--mini {
	margin: 0 0 16px;
	padding: 14px 16px;
	border-radius: 12px;
}

.gift-bar--mini .gift-bar__icon {
	width: 18px;
	height: 18px;
}

.gift-bar--mini .gift-bar__text {
	font-size: 13px;
}

.gift-bar--mini .gift-bar__track {
	height: 6px;
	margin-top: 10px;
}

.gift-bar--mini .gift-bar__note {
	font-size: 12px;
}

/*--------------------------------------------------------------
## Oznaka "Poklon" / "Gratis" na stavci korpe
--------------------------------------------------------------*/

.gift-bar__tag {
	display: inline-block;
	padding: 2px 8px;
	border-radius: 99px;
	background: #172d27;
	color: #fff;
	font-size: 10px;
	font-weight: 600;
	letter-spacing: 0.04em;
	line-height: 1.6;
	text-transform: uppercase;
	vertical-align: middle;
	white-space: nowrap;
}

.cart__product-quantity-fixed {
	display: inline-block;
	color: #4f4a47;
	font-size: 15px;
}

/*--------------------------------------------------------------
## Animacije
--------------------------------------------------------------*/

@keyframes gift-bar-shimmer {
	0% {
		transform: translateX(-100%);
	}

	60%,
	100% {
		transform: translateX(100%);
	}
}

@keyframes gift-bar-pop {
	0% {
		transform: scale(0.6);
	}

	60% {
		transform: scale(1.18);
	}

	100% {
		transform: scale(1);
	}
}

@media (prefers-reduced-motion: reduce) {
	.gift-bar__fill,
	.gift-bar__icon {
		transition: none;
	}

	.gift-bar__fill::after,
	.gift-bar.is-complete .gift-bar__icon {
		animation: none;
	}
}

@media (max-width: 575px) {
	.gift-bar {
		padding: 16px;
	}

	.gift-bar__text {
		font-size: 14px;
	}
}
