/* Uptown Tiered Discount — cart / checkout promo + gift ladder.
   Self-contained: no reliance on theme variables (WoodMart). */

.uptown-td,
.uptown-td-dialog,
.uptown-td-order-gifts {
	/* Follow the WoodMart theme settings; fallbacks match the live site. */
	--td-ink: var(--wd-title-color, #242424);
	--td-muted: var(--wd-text-color, #767676);
	--td-surface: var(--btn-default-bgcolor, #f7f7f7);
	--td-surface-2: var(--btn-default-bgcolor-hover, #efefef);
	--td-card: #fff;
	--td-line: rgba(0, 0, 0, 0.105);
	--td-accent: var(--wd-primary-color, rgb(45, 54, 142));
	--td-accent-text: var(--wd-primary-color, rgb(45, 54, 142));
	--td-accent-soft: color-mix(in srgb, var(--td-accent) 7%, #fff);
	--td-radius: var(--wd-brd-radius, 0px);
	font-family: inherit;
	font-size: 15px;
	line-height: 1.6;
	color: var(--td-ink);
}

.uptown-td {
	container: uptown-td / inline-size;
	box-sizing: border-box;
	margin: 0 0 20px;
	/* Same frame as WoodMart's Cart totals box. Keep padding small so the
	   desktop cart column stays above the 720px container breakpoint. */
	padding: 18px 20px;
	background: var(--td-card);
	border: 3px solid var(--brdcolor-gray-200, rgba(0, 0, 0, 0.075));
	border-radius: var(--td-radius);
}

.uptown-td *,
.uptown-td *::before,
.uptown-td *::after,
.uptown-td-dialog *,
.uptown-td-order-gifts * {
	box-sizing: border-box;
}

.uptown-td p,
.uptown-td h3,
.uptown-td ul,
.uptown-td ol {
	margin: 0;
	padding: 0;
}

.uptown-td ul,
.uptown-td ol {
	list-style: none;
}

/* ---- Head ---- */
.uptown-td__head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 6px;
}

.uptown-td .uptown-td__title {
	font-family: var(--wd-title-font, inherit);
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.3px;
	color: var(--td-muted);
	text-transform: uppercase;
	line-height: 1.6;
}

.uptown-td button.uptown-td__terms-link {
	appearance: none;
	background: none;
	border: 0;
	padding: 2px 0;
	margin: 0;
	font: inherit;
	font-size: 13px;
	font-weight: 500;
	text-transform: none;
	letter-spacing: 0;
	line-height: 1.6;
	color: var(--td-ink);
	text-decoration: underline;
	text-underline-offset: 3px;
	cursor: pointer;
	box-shadow: none;
	min-height: 0;
}

.uptown-td button.uptown-td__terms-link:hover {
	color: var(--td-accent-text);
}

.uptown-td--checkout button.uptown-td__terms-link {
	display: inline-block;
	margin-top: 8px;
}

/* ---- Headline ---- */
.uptown-td .uptown-td__headline {
	font-size: 17px;
	font-weight: 600;
	line-height: 1.5;
	margin-bottom: 14px;
}

.uptown-td__headline strong,
.uptown-td__discount strong {
	color: var(--td-accent-text);
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}

.uptown-td--checkout .uptown-td__headline {
	font-size: 15px;
	margin-bottom: 10px;
}

.uptown-td .uptown-td__discount {
	font-size: 14px;
	color: var(--td-muted);
	margin-top: 12px;
}

/* ---- Ladder: rail ---- */
.uptown-td__ladder {
	--rail-inset: 8px;
}

.uptown-td__rail {
	position: relative;
	height: 34px;
	margin-inline: var(--rail-inset);
}

.uptown-td__track {
	position: absolute;
	inset-inline: 0;
	top: 20px;
	height: 6px;
	border-radius: var(--td-radius);
	background: var(--td-surface-2);
	box-shadow: inset 0 0 0 1px var(--td-line);
	overflow: hidden;
}

.uptown-td__fill {
	display: block;
	width: 100%;
	height: 100%;
	background: var(--td-accent);
	transform-origin: left center;
	transform: scaleX(var(--fill, 0));
	animation: uptown-td-fill 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes uptown-td-fill {
	from {
		transform: scaleX(0);
	}
}

.uptown-td__dot {
	position: absolute;
	top: 17px;
	left: var(--pos, 0%);
	width: 12px;
	height: 12px;
	margin-left: -6px;
	border-radius: 50%;
	background: var(--td-card);
	border: 2px solid var(--td-line);
}

.uptown-td__dot.is-earned {
	background: var(--td-accent);
	border-color: var(--td-accent);
}

.uptown-td__dot.is-next {
	border-color: var(--td-ink);
}

.uptown-td__marker {
	position: absolute;
	top: 0;
	left: calc(var(--fill, 0) * 100%);
	width: 0;
	height: 100%;
}

.uptown-td__marker::after {
	content: "";
	position: absolute;
	left: -1px;
	top: 14px;
	width: 2px;
	height: 18px;
	background: var(--td-ink);
	border-radius: 1px;
}

.uptown-td__marker-label {
	position: absolute;
	bottom: 18px;
	left: 0;
	transform: translateX(-50%);
	white-space: nowrap;
	font-size: 12px;
	line-height: 1.4;
	font-weight: 600;
	color: var(--td-muted);
	font-variant-numeric: tabular-nums;
}

/* Keep the label inside the box at both ends. */
.uptown-td__ladder[style*="--fill:0.0"] .uptown-td__marker-label,
.uptown-td__ladder[style*="--fill:0.00"] .uptown-td__marker-label {
	transform: none;
}

.uptown-td__ladder[style*="--fill:1.0"] .uptown-td__marker-label {
	transform: translateX(-100%);
}

.uptown-td--checkout .uptown-td__ladder {
	margin-bottom: 4px;
}

/* ---- Ladder: stops (desktop = under the track) ---- */
.uptown-td__stops {
	display: grid;
	margin-inline: var(--rail-inset);
	margin-top: 10px;
}

.uptown-td__stop {
	grid-area: 1 / 1;
	justify-self: start;
	width: 116px;
	margin-left: var(--cpos, 0%);
	transform: translateX(calc(-1 * var(--cpos, 0%)));
	text-align: left;
	font-size: 13px;
	line-height: 1.45;
}

.uptown-td__stack {
	display: flex;
	align-items: center;
	margin-bottom: 8px;
}

.uptown-td__thumb {
	display: inline-flex;
	flex: 0 0 auto;
	width: 40px;
	height: 40px;
	border-radius: var(--td-radius);
	overflow: hidden;
	background: var(--td-surface-2);
	border: 2px solid var(--td-surface);
	box-shadow: 0 0 0 1px var(--td-line);
}

.uptown-td__stack .uptown-td__thumb + .uptown-td__thumb {
	margin-left: -10px;
}

.uptown-td__thumb img,
.uptown-td__img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	margin: 0;
	border-radius: 0;
}

.uptown-td__ph {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	font-size: 15px;
	font-weight: 700;
	color: var(--td-muted);
	background: var(--td-surface-2);
}

.uptown-td__more {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 40px;
	margin-left: 6px;
	font-size: 12px;
	font-weight: 600;
	color: var(--td-muted);
}

.uptown-td__stop-title {
	font-weight: 700;
	font-size: 14px;
}

.uptown-td__range,
.uptown-td__value {
	color: var(--td-muted);
	font-variant-numeric: tabular-nums;
}

.uptown-td__badge {
	display: inline-block;
	margin-top: 6px;
	padding: 1px 8px;
	border-radius: var(--td-radius);
	font-size: 12px;
	font-weight: 600;
	line-height: 1.6;
	background: var(--td-surface-2);
	color: var(--td-muted);
	font-variant-numeric: tabular-nums;
}

.uptown-td__stop.is-earned .uptown-td__badge {
	background: var(--td-accent);
	color: #fff;
}

.uptown-td__stop.is-next .uptown-td__badge {
	background: var(--td-ink);
	color: #fff;
	font-size: 13px;
	padding: 2px 10px;
}

/* 'Highest set only': reached, but replaced by a higher set. */
.uptown-td__stop.is-passed {
	opacity: 0.62;
}

.uptown-td__stop.is-passed .uptown-td__stop-title {
	text-decoration: line-through;
	text-decoration-thickness: 1px;
}

.uptown-td__stop.is-locked {
	opacity: 0.62;
}

.uptown-td__stop.is-earned .uptown-td__thumb {
	box-shadow: 0 0 0 1px var(--td-accent);
}

/* ---- Earned block ---- */
.uptown-td__earned {
	margin-top: 16px;
	padding-top: 14px;
	border-top: 1px solid var(--td-line);
}

.uptown-td .uptown-td__earned-title {
	font-size: 14px;
	font-weight: 700;
	margin-bottom: 8px;
	text-transform: none;
}

.uptown-td__set + .uptown-td__set {
	margin-top: 12px;
}

.uptown-td__set-head {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 4px 10px;
	margin-bottom: 6px;
	font-size: 14px;
}

.uptown-td__pick {
	font-size: 12px;
	color: var(--td-accent-text);
	font-weight: 600;
}

.uptown-td__items {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 8px 14px;
}

.uptown-td__items li {
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: 14px;
	line-height: 1.45;
}

.uptown-td__items .uptown-td__thumb {
	width: 44px;
	height: 44px;
	border: 0;
}

.uptown-td__item-name {
	flex: 1 1 auto;
	min-width: 0;
}

.uptown-td__qty {
	flex: 0 0 auto;
	color: var(--td-muted);
	font-variant-numeric: tabular-nums;
	font-size: 13px;
}

.uptown-td__items--compact {
	grid-template-columns: 1fr;
	gap: 6px;
}

.uptown-td__items--compact .uptown-td__thumb {
	width: 32px;
	height: 32px;
}

.uptown-td__items--compact li {
	font-size: 13px;
	gap: 8px;
}

.uptown-td--checkout {
	padding: 12px 14px;
	margin-bottom: 16px;
}

.uptown-td--checkout .uptown-td__earned {
	margin-top: 12px;
	padding-top: 10px;
}

/* ---- Buttons ---- */
.uptown-td__btn,
.uptown-td-dialog button.uptown-td__btn {
	appearance: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 40px;
	padding: 8px 22px;
	margin: 0;
	border: 0;
	border-radius: var(--btn-accented-brd-radius, var(--td-radius));
	background: var(--btn-accented-bgcolor, var(--td-accent));
	color: var(--btn-accented-color, #fff);
	font: inherit;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.4;
	text-transform: uppercase;
	letter-spacing: 0.3px;
	cursor: pointer;
	box-shadow: var(--btn-accented-box-shadow, inset 0 -2px 0 rgba(0, 0, 0, 0.15));
}

.uptown-td__btn:hover {
	background: var(--btn-accented-bgcolor-hover, rgb(59, 112, 186));
	color: var(--btn-accented-color-hover, #fff);
}

/* ---- Focus ---- */
.uptown-td button:focus-visible,
.uptown-td-dialog button:focus-visible,
.uptown-td-dialog input:focus-visible {
	outline: 2px solid var(--td-ink);
	outline-offset: 2px;
}

/* ---- Narrow containers (mobile / checkout column): vertical timeline ---- */
@container uptown-td (max-width: 720px) {
	/* .uptown-td prefix: must beat the `.uptown-td ol` margin/padding reset. */
	.uptown-td .uptown-td__stops {
		display: flex;
		flex-direction: column;
		gap: 0;
		margin-inline: 0;
		margin-top: 14px;
		padding-left: 22px;
		position: relative;
	}

	.uptown-td__stops::before {
		content: "";
		position: absolute;
		left: 5px;
		top: 8px;
		bottom: 8px;
		width: 2px;
		background: var(--td-line);
	}

	.uptown-td__stop {
		position: relative;
		width: auto;
		margin-left: 0;
		transform: none;
		padding: 0 0 18px;
		display: grid;
		grid-template-columns: auto 1fr;
		column-gap: 12px;
		align-items: start;
	}

	.uptown-td__stop:last-child {
		padding-bottom: 0;
	}

	.uptown-td__stop::before {
		content: "";
		position: absolute;
		left: -22px;
		top: 4px;
		width: 12px;
		height: 12px;
		border-radius: 50%;
		background: var(--td-card);
		border: 2px solid var(--td-line);
	}

	.uptown-td__stop.is-earned::before,
	.uptown-td__stop.is-passed::before {
		background: var(--td-accent);
		border-color: var(--td-accent);
	}

	.uptown-td__stop.is-next::before {
		border-color: var(--td-ink);
	}

	.uptown-td__stack {
		grid-row: 1 / span 5;
		margin-bottom: 0;
	}

	.uptown-td__badge {
		justify-self: start;
	}

	.uptown-td .uptown-td__headline {
		font-size: 16px;
	}

	.uptown-td__items {
		grid-template-columns: 1fr;
	}
}

/* ---- Dialog ---- */
.uptown-td-dialog {
	box-sizing: border-box;
	width: calc(100% - 32px);
	max-width: 520px;
	max-height: min(86vh, 720px);
	padding: 0;
	border: 1px solid var(--td-line);
	border-radius: var(--td-radius);
	background: var(--td-card);
	color: var(--td-ink);
	overflow: hidden;
}

.uptown-td-dialog[open] {
	display: flex;
	flex-direction: column;
}

.uptown-td-dialog::backdrop {
	background: rgba(0, 0, 0, 0.5);
}

.uptown-td-dialog__panel {
	display: flex;
	flex-direction: column;
	min-height: 0;
	max-height: min(86vh, 720px);
}

.uptown-td-dialog__body {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: 22px 22px 8px;
}

.uptown-td-dialog .uptown-td-dialog__title {
	margin: 0 0 14px;
	font-size: 19px;
	font-weight: 700;
	line-height: 1.4;
	text-transform: none;
}

.uptown-td-dialog .uptown-td__set {
	margin-bottom: 14px;
	padding-bottom: 14px;
	border-bottom: 1px solid var(--td-line);
}

.uptown-td-dialog .uptown-td__set + .uptown-td__set {
	margin-top: 0;
}

.uptown-td-dialog ul.uptown-td__items {
	margin: 0;
	padding: 0;
	list-style: none;
	grid-template-columns: 1fr;
}

.uptown-td-dialog__terms {
	font-size: 14px;
	color: var(--td-muted);
	padding-bottom: 12px;
}

.uptown-td-dialog__terms ul,
.uptown-td-dialog__terms ol {
	margin: 0 0 0 1.2em;
	padding: 0;
	list-style: revert;
}

.uptown-td-dialog__terms p {
	margin: 0 0 8px;
}

.uptown-td-dialog__footer {
	flex: 0 0 auto;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 10px 16px;
	padding: 12px 22px;
	background: var(--td-surface);
	border-top: 1px solid var(--td-line);
}

.uptown-td-dialog__remember {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 14px;
	cursor: pointer;
}

.uptown-td-dialog__remember input {
	width: 18px;
	height: 18px;
	margin: 0;
	accent-color: var(--td-accent);
}

html:has(.uptown-td-dialog[open]) {
	overflow: hidden;
}

/* ---- Order gifts (thank-you / My Account) ---- */
.uptown-td-order-gifts {
	margin: 0 0 28px;
}

.uptown-td-order-gifts__set {
	margin: 0 0 14px;
	padding: 12px 14px;
	background: var(--td-surface);
	border: 1px solid var(--td-line);
	border-radius: var(--td-radius);
}

.uptown-td-order-gifts .uptown-td-order-gifts__set-title {
	margin: 0;
	font-size: 15px;
	font-weight: 700;
	text-transform: none;
}

.uptown-td-order-gifts__note {
	margin: 0 0 6px;
	font-size: 13px;
	color: var(--td-accent-text);
	font-weight: 600;
}

.uptown-td-order-gifts__items {
	margin: 6px 0 0;
	padding: 0;
	list-style: none;
}

.uptown-td-order-gifts__items li {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 4px 0;
}

.uptown-td-order-gifts__items img {
	width: 48px;
	height: 48px;
	object-fit: cover;
	border-radius: var(--td-radius);
	margin: 0;
}

/* ---- Motion ---- */
@media (prefers-reduced-motion: reduce) {
	.uptown-td__fill {
		animation: none;
	}
}
