/*------------------------------------------------------------------------------*/
/* Loaylty Points Highlight
/*------------------------------------------------------------------------------*/

.HighlightPoints {
	border-radius: var(--border-radius);
	display: block;
	margin-bottom: 0;
}

.HighlightPoints > :last-child {
	margin-bottom: 0;
}

[data-cart-loyalty-points="0"],
[data-cart-loyalty-points^="-"] {
	display: none;
}

.MiniCartCartLoyaltyPoints {
	margin: 1rem;
}

/*------------------------------------------------------------------------------*/
/* Loyalty Sign Up Form
/*------------------------------------------------------------------------------*/

.LoyaltyProgramSignUp {
	align-items: center;
	background-color: var(--background-accent-color);
	border-radius: var(--border-radius);
	color: var(--color-text-accent);
	display: flex;
	flex-direction: column;
	padding: 1.5rem 2rem;
	text-align: center;
}

.LoyaltyProgramSignUp > * {
	gap: 1rem;
	margin-bottom: 1rem;
	max-width: 40ch;
}

.LoyaltyProgramSignUp h2 {
	margin-bottom: 0;
}

.LoyaltyProgramSignUp :last-child {
	margin-bottom: 0;
}

.LoyaltyIcon {
	text-align: center;
	margin-bottom: 1rem;
}

.LoyaltyProgramSignUp button {
	--background-color: var(--color-accent);
	--border-color: var(--color-accent);
	--button-height: 4.5rem;
	border: 0;
	color: var(--color-text-on-accent);
	display: inline-flex;
	font-weight: var(--font-heading-weight);
	padding: 1rem 3rem;
	text-transform: var(--font-heading-transform);
	width: 100%;
}

.LoyaltyProgramSignUp button:hover {
	--background-color: var(--color-accent-darker);
	--border-color: var(--color-accent-darker);
	color: var(--color-text-on-accent);
}

/*------------------------------------------------------------------------------*/
/* Loyalty Program on Account Page
/*------------------------------------------------------------------------------*/

.CustomerLoyaltyProgram {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
}

.CustomerLoyaltyProgram p {
	max-width: 27ch;
}

/*------------------------------------------------------------------------------*/
/* Loyalty Points & Tiers on Account Page
/*------------------------------------------------------------------------------*/

.CustomerLoyaltyPointTiers {
	border-radius: var(--border-radius);
	max-width: 300px;
	overflow: hidden;
	position: relative;
	z-index: 1;
	width: 100%;
}

.CustomerLoyaltyPointTiers > :where(dt, dd:not(.CustomerLoyaltyNextTier)) {
	background-color: var(--background-accent-color);
	font-size: var(--font-size-xlarge);
	font-weight: bold;
	padding: 2rem 1rem;
}

.CustomerLoyaltyPointTiers dd {
	border-bottom-left-radius: var(--border-radius);
	border-bottom-right-radius: var(--border-radius);
}

.CustomerLoyaltyPointTiers dt {
	background-color: var(--background-accent-color-shade-2);
	margin: 0;
	position: relative;
}

.CustomerLoyaltyNextTier {
	padding-top: 2rem;
}

.CustomerLoyaltyPointTiers dt::after {
	background: inherit;
	content: '';
	height: 20px;
	left: calc(50% - 10px);
	position: absolute;
	top: calc(100% - 10px);
	transform: rotate(45deg);
	width: 20px;
}

/* Show logic, show only Current */

.CustomerLoyaltyPointTiers > :not(.Current) {
	display: none;
}

.CustomerLoyaltyPointTiers:not(:has(.Current + .CustomerLoyaltyNextTier)) dt.Current + dd + .CustomerLoyaltyNextTier {
	background-color: var(--background-accent-color);
	display: block;
	padding: 2rem 1rem;
}

.CustomerLoyaltyPointTiers .Current + .CustomerLoyaltyNextTier:not(:last-child) {
	display: block;
}

/* Prevent FOUC */
[data-loyalty-next-tier-discount]:not(.Loaded) span {
	opacity: 0;
}

/*------------------------------------------------------------------------------*/
/* Loyalty Points & Tiers on Info Page
/*------------------------------------------------------------------------------*/

.CustomerLoyaltyTiersList {
	max-width: 500px;
}

.TiersList {
	--gap: .5rem;
	--current-state: 0%;
	--bullet-width: 8px;
	display: flex;
	flex-direction: column-reverse;
	list-style: none;
	margin-left: 120px;
	position: relative;
	gap: var(--gap);
}

.TiersList li {
	align-items: center;
	display: flex;
	border: 1px solid var(--border-color);
	border-radius: var(--border-radius);
	flex-wrap: wrap;
	gap: .5rem;
	padding: .3rem;
	order: 1;
	position: relative;
}

.TiersList li.Current {
	background-color: var(--background-accent-color-shade-1);
	border-color: var(--color-accent);
}

/* Tier Visual Progress Line
/*------------------------------------------------------------------------------*/

.TierVisualProgress {
	align-items: flex-end;
	background-color: var(--border-color);
	bottom: calc(50% + var(--bullet-width) / 2);
	content: '';
	display: flex;
	height: var(--progress-bar-height, calc((100% - var(--gap)) + (var(--bullet-width) / 2)));
	left: -18px;
	position: absolute;
	width: 2px;
}

.TiersList li:last-child .TierVisualProgress {
	display: none;
}

.CurrentProgress {
	height: 100%;
	width: 100%;
}

.JS-Ready .CurrentProgress {
	background-color: var(--color-accent);
}

.Current .CurrentProgress {
	height: var(--current-state);
}

.Current ~ li .CurrentProgress {
	background-color: var(--border-color);
}

/* Tier Visual Progress Dots
/*------------------------------------------------------------------------------*/

/* Prevent FOUC */
.JS-Ready .TiersList li::before {
	background-color: var(--color-accent);
}

.TiersList li::before {
	background-color: var(--border-color);
	border-radius: 50px;
	bottom: auto;
	content: '';
	height: var(--bullet-width);
	left: -21px;
	position: absolute;
	top: auto;
	width: var(--bullet-width);
	z-index: 1;
}

.TiersList .Current ~ li::before {
	background-color: var(--border-color);
}

/* Tier Indicator
/*------------------------------------------------------------------------------*/

.TierIndicator {
	align-items: center;
	background-color: var(--color-accent);
	border-radius: 4px;
	color: var(--color-text-on-accent);
	display: flex;
	font-size: var(--font-size-small);
	font-weight: bold;
	justify-content: center;
	padding: .5rem;
	position: absolute;
	right: calc(100% + 10px);
	text-align: center;
	bottom: -14px;
	width: max-content;
}

.TierIndicator::after {
	background-color: var(--color-accent);
	border-top-right-radius: 1px;
	bottom: auto;
	content: '';
	height: 8px;
	right: -4px;
	position: absolute;
	top: auto;
	transform: rotate(45deg);
	width: 8px;
}

.Current .TierIndicator {
	bottom: var(--current-state);
	transform: translateY(14px);
	transform-origin: bottom;
}

/* Tier Info
/*------------------------------------------------------------------------------*/

.TiersList .TierPoints {
	font-weight: bold;
	margin-left: 1rem;
}

.TiersList .TierDiscount {
	background-color: var(--background-color-shade-2);
	border-radius: var(--border-radius);
	font-size: var(--font-size-small);
	margin-left: auto;
	min-width: 65px;
	padding: .5rem;
	text-align: center;
}

.Current .TierDiscount {
	color: var(--color-accent);
	font-weight: bold;
}

/* Tier Info
/*------------------------------------------------------------------------------*/

.TierInfo {
	background: var(--background-color-shade-2);
	border-radius: var(--border-radius);
	display: none;
	flex: 0 1 100%;
	font-size: var(--font-size-small);
	opacity: 0;
	padding: .5rem;
}

.Current + li > .TierInfo {
	display: block;
}

.JS-Ready .TierInfo {
	opacity: 1;
}

/* Disabled
/*------------------------------------------------------------------------------*/

[data-loyalty-customer-points="0"] .TiersList {
	margin-left: 30px;
}

[data-loyalty-customer-points="0"] .TiersList li::before,
[data-loyalty-customer-points="0"] .CurrentProgress {
	background-color: var(--border-color);
}

/*------------------------------------------------------------------------------*/
/* Loyalty Points & Tiers on Drawer
/*------------------------------------------------------------------------------*/

@media screen and (max-width: 400px) {
	.Drawer .TiersList {
		font-size: var(--font-size-small);
		margin-left: 60px;
	}

	.Drawer .TierIndicator {
		transform: translateY(14px) scale(.65);
		left: auto;
		right: 0;
		width: min-content;
	}
}