.pd-progress-wrapper {
	margin: 0 0 1.5em;
	padding: 20px 18px 22px;
	border-radius: 16px;
	background: #ffffff;
}

/* Placeholder printed when there's nothing to show yet (see PD_Frontend::render_in_cart()). */
.pd-progress-wrapper:empty {
	display: none;
}

/* Static "1" replacing the normal editable quantity input on a gift line —
   centered to roughly match the width/alignment of a real quantity input,
   so the row doesn't look broken next to the others. */
.pd-gift-quantity {
	display: inline-block;
	min-width: 2em;
	text-align: center;
}

.pd-progress-message {
	margin: 0 0 1.2em;
	font-size: 15px;
	text-align: center;
	font-weight: 500;
}

/* "Sale items don't count" note under the bar — informative, not a warning. */
.pd-progress-note {
	display: flex;
	align-items: flex-start;
	justify-content: center;
	gap: 6px;
	margin: 0.6em 0 0;
	font-size: 12px;
	line-height: 1.4;
	color: #6b7280;
	text-align: left;
}

.pd-progress-note__icon {
	flex: 0 0 auto;
	margin-top: 1px;
	color: var( --pd-accent-color, #2f62a8 );
}

/* The markers row is shifted up with relative positioning, which leaves
   its original space below it; pull the note into that space. */
.pd-progress-bar__markers + .pd-progress-note {
	margin-top: -14px;
}

/* Sale product line label, e.g. "Not included (sale item)". */
.pd-sale-item-label {
	display: block;
	margin-top: 2px;
	font-size: 12px;
	font-weight: normal;
	color: #6b7280;
}

.pd-progress-bar {
	position: relative;
	height: 8px;
	border-radius: 999px;
	background: #e6ebf2;
	overflow: hidden;
}

.pd-progress-bar__fill {
	position: relative;
	height: 100%;
	background: var( --pd-accent-color, #2f62a8 );
	border-radius: 999px;
	overflow: hidden;
	/* No CSS transition here on purpose — frontend-progress.js owns the
	 * grow/shrink animation exclusively (via jQuery .animate()), since a
	 * CSS transition running concurrently on the same "width" property is
	 * a race hazard: the two animation systems could each
	 * think they were the one driving the value, and jQuery's .animate()
	 * additionally needs manual replay after AJAX fragment refresh replaces
	 * the whole element (a CSS transition can't animate across that anyway,
	 * since the new element has no prior state to transition from). */
}

.pd-progress-bar__fill--complete {
	background: var( --pd-accent-color-complete, #2f62a8 );
}

/* "Slim" layout (templates/progress-bar-slim.php): one plain bar, no
   markers. Head row: message on the left, "1/5" rewards earned on the right. */
.pd-progress-slim__head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	margin: 0 0 10px;
}

.pd-progress-slim .pd-progress-message {
	flex: 1 1 auto;
	margin: 0;
	text-align: left;
}

.pd-progress-slim__count {
	flex: 0 0 auto;
	font-size: 13px;
	color: #8794a4;
	white-space: nowrap;
}

/* One box per reward under the bar: filled = earned, outlined = next,
   grey = still ahead. Lists reset: themes style ul / li. */
.pd-progress-slim__rewards {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 12px 0 0 !important;
	padding: 0 !important;
	list-style: none !important;
}

.pd-progress-slim__reward {
	margin: 0 !important;
	padding: 4px 12px;
	border: 1.5px solid transparent;
	border-radius: 999px;
	background: #eef1f6;
	color: #8794a4;
	font-size: 12px;
	font-weight: 600;
	line-height: 1.4;
	white-space: nowrap;
	list-style: none;
}

.pd-progress-slim__reward::before,
.pd-progress-slim__reward::marker {
	content: none;
}

.pd-progress-slim__reward.is-achieved {
	background: var( --pd-accent-color, #2f62a8 );
	border-color: var( --pd-accent-color, #2f62a8 );
	color: #fff;
}

.pd-progress-slim__reward.is-next {
	background: #fff;
	border-color: var( --pd-accent-color, #2f62a8 );
	color: var( --pd-accent-color, #2f62a8 );
}

/* Text for screen readers only. */
.pd-sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect( 0 0 0 0 );
	white-space: nowrap;
	border: 0;
}

.pd-progress-slim + .pd-progress-note {
	justify-content: flex-start;
}

/* Shimmer sweep across the filled portion only — a subtle "keep going" cue,
   not a generic loading indicator. Stops once the max reward is reached
   (see the --complete override below), since there's nothing left to nudge
   the customer toward. */
.pd-progress-bar__fill::after {
	content: '';
	position: absolute;
	top: 0;
	bottom: 0;
	left: 0;
	width: 60%;
	background: linear-gradient( 90deg, transparent, rgba( 255, 255, 255, 0.45 ), transparent );
	animation: pd-progress-shimmer 2.2s ease-in-out infinite;
}

.pd-progress-bar__fill--complete::after {
	content: none;
}

@keyframes pd-progress-shimmer {
	0% {
		transform: translateX( -100% );
	}

	100% {
		transform: translateX( 250% );
	}
}

/* Without motion the sweep would stand still as a light band on the fill:
   leave it out. */
@media ( prefers-reduced-motion: reduce ) {
	.pd-progress-bar__fill::after {
		content: none;
		animation: none;
	}
}

/* Icon + caption per reward-type step, positioned below the bar at each
   step's threshold percentage — replaces plain dot markers so a customer
   can tell shipping/discount/gift steps apart at a glance. */
.pd-progress-bar__markers {
	position: relative;
	height: 58px;
	top: -18px;
	line-height: 1;
}

/* Every marker is centered on its own position, so the icons always stay in
   threshold order. Its width (--pd-marker-slot, set inline by the template)
   is the smallest distance between two neighbouring markers, so centered
   labels can never overlap each other. */
.pd-progress-bar__marker-item {
	position: absolute;
	top: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	width: var( --pd-marker-slot, 34% );
	transform: translateX( -50% );
	text-align: center;
}

/* The last marker sits at the very end of the bar; draw it a little
   inside, so its icon and label aren't pressed against the card's edge.
   (The fill still runs to the end: at 100% it just passes under it.) */
.pd-progress-bar__marker-item:last-child {
	transform: translateX( calc( -50% - 12px ) );
}

/* Labels of markers at the bar's ends (is-edge-start / is-edge-end, set by
   the template when the marker's slot would cross the start or the end of
   the bar) only grow inward, so they don't overflow past the card's edges:
   as wide as their text (at most half a slot plus 25px), ending at most
   12px past the icon's outer edge — about centred under a short label,
   centred lines when a long one wraps. Every other label stays centred
   under its icon. */
.pd-progress-bar__marker-item.is-edge-start .pd-progress-bar__marker-label {
	align-self: flex-start;
	width: max-content;
	max-width: calc( 50% + 25px );
	margin-left: calc( 50% - 25px );
	text-align: center;
}

.pd-progress-bar__marker-item.is-edge-end .pd-progress-bar__marker-label {
	align-self: flex-end;
	width: max-content;
	max-width: calc( 50% + 25px );
	margin-right: calc( 50% - 25px );
	text-align: center;
}

.pd-progress-bar__marker-item.is-edge-start.is-edge-end .pd-progress-bar__marker-label {
	margin-left: 0;
}

.pd-progress-bar__marker-icon {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 26px;
	margin-bottom: 4px;
	border-radius: 50%;
	background: #fff;
	border: 2px solid #dce3ec;
	color: #afbbca;
	box-sizing: border-box;
	/* White "cutout" ring so the marker reads cleanly against the track
	   behind it, regardless of exactly where along the rail it sits. */
	box-shadow: 0 0 0 4px #fff;
	transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

/* Achieved markers match whatever color the fill line itself currently is —
   the normal accent color while still filling up, switching to the
   "complete" color only once the bar itself has switched (100% reached). */
.pd-progress-bar__marker-item.is-achieved .pd-progress-bar__marker-icon {
	background: var( --pd-accent-color, #2f62a8 );
	border-color: var( --pd-accent-color, #2f62a8 );
	color: #fff;
}

.pd-progress-bar__markers--complete .pd-progress-bar__marker-item.is-achieved .pd-progress-bar__marker-icon {
	background: var( --pd-accent-color-complete, #2f62a8 );
	border-color: var( --pd-accent-color-complete, #2f62a8 );
}

/* The single step the customer is currently working toward — outlined
   rather than filled, so it visibly reads as "not yet earned" while still
   standing out from the plain grey later steps. */
.pd-progress-bar__marker-item.is-next .pd-progress-bar__marker-icon {
	border-color: var( --pd-accent-color, #2f62a8 );
	color: var( --pd-accent-color, #2f62a8 );
}

.pd-progress-bar__marker-halo {
	position: absolute;
	inset: -2px;
	border-radius: 999px;
	border: 2px solid var( --pd-accent-color, #2f62a8 );
	animation: pd-progress-halo-pulse 2s ease-out infinite;
	pointer-events: none;
}

@keyframes pd-progress-halo-pulse {
	0%,
	100% {
		transform: scale( 1 );
		opacity: 0.55;
	}

	50% {
		transform: scale( 1.5 );
		opacity: 0;
	}
}

@media ( prefers-reduced-motion: reduce ) {
	.pd-progress-bar__marker-halo {
		animation: none;
	}
}

/* At most two lines, then an ellipsis — the full text is in the title
   tooltip. Keeps labels inside the markers row however long they are. */
.pd-progress-bar__marker-label {
	display: -webkit-box;
	width: 100%;
	overflow: hidden;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	font-size: 11px;
	line-height: 1.15;
	color: #777;
	overflow-wrap: break-word;
}

.pd-progress-bar__marker-item.is-achieved .pd-progress-bar__marker-label {
	color: var( --pd-accent-color, #2f62a8 );
	font-weight: 600;
	line-height: 1.15 !important;
}

.pd-progress-bar__markers--complete .pd-progress-bar__marker-item.is-achieved .pd-progress-bar__marker-label {
	color: var( --pd-accent-color-complete, #2f62a8 );
}

.pd-progress-bar__marker-item.is-next .pd-progress-bar__marker-label {
	color: #1c2430;
	font-weight: 600;
	line-height: 1.15 !important;
}

/* "Segmented" layout — one grid column per step, each with its own fill and
   caption, as an alternative to the single continuous bar above. Kept as a
   fully separate class namespace (pd-progress-segmented*) so it can never
   collide with or accidentally inherit from the classic layout's rules. */
.pd-progress-segmented__header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
}

.pd-progress-wrapper .pd-progress-segmented__title {
	margin: 0;
	font-size: 1.15em;
	font-weight: 700;
	text-align: left;
}
#sc-drawer-root .pd-progress-segmented__title {
	font-size: 0.8em;
}

.pd-progress-segmented__pill {
	flex: 0 0 auto;
	padding: 6px 14px;
	border-radius: 999px;
	background: #e9f5ee;
	color: #1a7f4e;
	font-size: 0.8em;
	font-weight: 600;
	white-space: nowrap;
}
#sc-drawer-root .pd-progress-segmented__pill {
	padding: 4px 10px;
	font-size: 0.75em;
}

.pd-progress-segmented__subtitle {
	margin: 4px 0 8px 0px;
	font-size: 0.85em;
	color: #8794a4;
	text-align: left;
}
#sc-drawer-root .pd-progress-segmented__subtitle {
	font-size: 0.7em;
}

/* auto-fit + minmax lets the grid size itself to however many columns
   actually fit — full-width on the Cart page, fewer per row (wrapping
   automatically) inside Side Cart's narrower drawer — without any
   viewport-width media query, which wouldn't reflect the drawer's own
   width anyway (it's a fixed-position panel, not full-viewport). */
.pd-progress-segmented__track {
	display: grid;
	grid-template-columns: repeat( auto-fit, minmax( 70px, 1fr ) );
	gap: 16px 12px;
}
#sc-drawer-root .pd-progress-segmented__track {
	gap: 12px 5px;
}

.pd-progress-segmented__bar {
	height: 8px;
	border-radius: 999px;
	background: #e6ebf2;
}

.pd-progress-segmented__segment.is-achieved .pd-progress-segmented__bar {
	background: var( --pd-accent-color, #2f62a8 );
}

.pd-progress-segmented__caption {
	display: flex;
	flex-direction: column;
	margin-top: 8px;
	text-align: center;
    line-height: normal;
    font-size: 15px;
}
#sc-drawer-root .pd-progress-segmented__caption {
	font-size: 14px;
}

.pd-progress-segmented__caption-label {
	font-size: 1em;
	font-weight: 700;
	color: #afbbca;
	margin-bottom: 5px;
}
#sc-drawer-root .pd-progress-segmented__caption-label {
	font-size: 0.75em;
}

.pd-progress-segmented__caption-amount {
	font-size: 0.9em;
	color: #afbbca;
}
#sc-drawer-root .pd-progress-segmented__caption-amount {
	font-size: 0.85em;
}

.pd-progress-segmented__segment.is-achieved .pd-progress-segmented__caption-label {
	color: var( --pd-accent-color, #2f62a8 );
}

.pd-progress-segmented__segment.is-achieved .pd-progress-segmented__caption-amount {
	color: #1c2430;
}

.pd-progress-segmented__segment.is-next .pd-progress-segmented__caption-label {
	color: #1c2430;
}
