/* Carton picker opened from Quick View. */
#nsd-carton-bundle-dialog {
	--nsd-bundle-line: #e8d9d8;
	--nsd-bundle-tint: #fbf5f4;
	--nsd-bundle-gutter: clamp(16px, 3.5vw, 28px);
	position: fixed;
	inset: 0;
	width: min(650px, calc(100% - 48px));
	max-width: none;
	max-height: calc(100vh - 48px);
	max-height: calc(100dvh - 48px);
	margin: auto;
	padding: 0;
	overflow: hidden;
	border: 1px solid var(--nsd-bundle-line);
	border-block-start: 3px solid var(--nsd-action, #931c2a);
	border-radius: 17px;
	background: #fff;
	color: var(--nsd-ink, #191516);
	box-shadow: 0 24px 72px rgb(51 25 26 / 26%);
	font: 400 .92rem / 1.4 var(--nsd-body, system-ui, sans-serif);
}

#nsd-carton-bundle-dialog[open] {
	display: flex;
	flex-direction: column;
}

#nsd-carton-bundle-dialog::backdrop { background: rgb(29 18 20 / 42%); }

body.nsd-redesign:has(#nsd-carton-bundle-dialog[open]) { overflow: hidden; }

#nsd-carton-bundle-dialog,
#nsd-carton-bundle-dialog * { box-sizing: border-box; }

#nsd-carton-bundle-dialog [hidden],
#nsd-quick-view .nsd-bundle-open[hidden] { display: none !important; }

#nsd-carton-bundle-dialog .nsd-bundle-head {
	display: grid;
	flex: 0 0 auto;
	grid-template-columns: minmax(0, 1fr) 44px;
	align-items: center;
	gap: 6px 12px;
	padding: 10px var(--nsd-bundle-gutter);
	border-bottom: 1px solid var(--nsd-bundle-line);
	background: var(--nsd-bundle-tint);
}

#nsd-carton-bundle-dialog .nsd-bundle-head h2 {
	margin: 0;
	color: inherit;
	font: 750 clamp(1.12rem, 3vw, 1.44rem) / 1.2 var(--nsd-display, system-ui, sans-serif);
	letter-spacing: -.03em;
}

#nsd-carton-bundle-dialog .nsd-bundle-loading {
	margin: 18px var(--nsd-bundle-gutter);
	color: #5b5052;
	font-size: .83rem;
}

#nsd-carton-bundle-dialog .nsd-bundle-close {
	grid-column: 2;
	grid-row: 1;
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	margin: 0;
	padding: 0;
	border: 1px solid var(--nsd-bundle-line);
	border-radius: 8px;
	background: #fff;
	color: var(--nsd-action, #931c2a);
	font: 400 1.35rem / 1 var(--nsd-body, system-ui, sans-serif);
	cursor: pointer;
}

#nsd-carton-bundle-dialog .nsd-bundle-close:hover {
	border-color: var(--nsd-action, #931c2a);
	color: var(--nsd-action, #931c2a);
}

#nsd-carton-bundle-dialog .nsd-bundle-form {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	min-height: 0;
	margin: 0;
	padding: 0;
	border: 0;
}

#nsd-carton-bundle-dialog :is(.nsd-bundle-tiers, .nsd-bundle-picker) {
	min-inline-size: 0;
	margin: 0 var(--nsd-bundle-gutter);
}

#nsd-carton-bundle-dialog .nsd-bundle-select {
	display: grid;
	flex: 0 0 auto;
	gap: 5px;
	min-width: 0;
	margin: 12px var(--nsd-bundle-gutter) 0;
	font-size: .83rem;
	font-weight: 700;
}

#nsd-carton-bundle-dialog .nsd-bundle-select select {
	width: 100%;
	min-height: 44px;
	margin: 0;
	padding: 7px 10px;
	border: 1px solid #cbbab9;
	border-radius: 8px;
	background: #fff;
	color: var(--nsd-ink, #191516);
	font: 500 .9rem / 1.3 var(--nsd-body, system-ui, sans-serif);
}

#nsd-carton-bundle-dialog .nsd-bundle-tiers {
	display: grid;
	flex: 0 0 auto;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 7px;
	margin-block-start: 14px;
	padding: 0;
	border: 0;
}

#nsd-carton-bundle-dialog .nsd-bundle-tiers legend,
#nsd-carton-bundle-dialog .nsd-bundle-picker > label {
	margin: 0 0 7px;
	padding: 0;
	border: 0;
	color: inherit;
	font-size: .83rem;
	font-weight: 700;
}

#nsd-carton-bundle-dialog .nsd-bundle-tiers label {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
	align-items: center;
	align-content: center;
	gap: 2px 6px;
	min-height: 57px;
	margin: 0;
	padding: 7px 9px;
	border: 1px solid var(--nsd-bundle-line);
	border-radius: 9px;
	background: #fff;
	color: inherit;
	cursor: pointer;
}

#nsd-carton-bundle-dialog .nsd-bundle-tiers label:has(:checked) {
	border-color: var(--nsd-action, #931c2a);
	background: var(--nsd-bundle-tint);
}

#nsd-carton-bundle-dialog .nsd-bundle-tiers strong {
	font-size: .86rem;
	font-weight: 750;
	line-height: 1.2;
}

#nsd-carton-bundle-dialog .nsd-bundle-tiers span {
	grid-column: 2;
	color: var(--nsd-action, #931c2a);
	font-size: .76rem;
	font-weight: 700;
	line-height: 1.2;
}

#nsd-carton-bundle-dialog :is(input[type='checkbox'], input[type='radio']) {
	appearance: auto;
	opacity: 1;
	width: 17px;
	height: 17px;
	margin: 0;
	accent-color: var(--nsd-action, #931c2a);
}

#nsd-carton-bundle-dialog .nsd-bundle-tiers label:has(:disabled) { opacity: .64; cursor: default; }

#nsd-carton-bundle-dialog .nsd-bundle-picker {
	display: flex;
	flex: 1 1 280px;
	flex-direction: column;
	min-height: 0;
	padding: 16px 0 12px;
}

#nsd-carton-bundle-dialog .nsd-bundle-picker input[type='search'] {
	flex: 0 0 auto;
	width: 100%;
	min-height: 44px;
	margin: 0 0 8px;
	padding: 8px 12px;
	border: 1px solid #cbbab9;
	border-radius: 8px;
	background: #fff;
	color: var(--nsd-ink, #191516);
	font: 400 1rem / 1.35 var(--nsd-body, system-ui, sans-serif);
}

#nsd-carton-bundle-dialog .nsd-bundle-options {
	flex: 1 1 auto;
	min-height: 0;
	margin: 0;
	padding: 0;
	overflow: auto;
	overscroll-behavior: contain;
	border: 1px solid var(--nsd-bundle-line);
	border-radius: 9px;
	background: #fff;
	list-style: none;
}

#nsd-carton-bundle-dialog .nsd-bundle-option { margin: 0; }

#nsd-carton-bundle-dialog .nsd-bundle-option ~ .nsd-bundle-option {
	border-top: 1px solid var(--nsd-bundle-line);
}

#nsd-carton-bundle-dialog :is(label.nsd-bundle-option, .nsd-bundle-option > label) {
	display: grid;
	grid-template-columns: 18px minmax(0, 1fr) auto;
	align-items: center;
	gap: 10px;
	min-height: 48px;
	margin: 0;
	padding: 9px 12px;
	color: inherit;
	font-size: .83rem;
	font-weight: 600;
	overflow-wrap: anywhere;
	cursor: pointer;
}

#nsd-carton-bundle-dialog :is(label.nsd-bundle-option, .nsd-bundle-option > label):is(:hover, :has(:checked)) {
	background: var(--nsd-bundle-tint);
}

#nsd-carton-bundle-dialog .nsd-bundle-option label > :last-child,
#nsd-carton-bundle-dialog label.nsd-bundle-option > :last-child {
	font-size: .82rem;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

#nsd-carton-bundle-dialog .nsd-bundle-option:has(:disabled) { opacity: .76; }
#nsd-carton-bundle-dialog .nsd-bundle-option:has(:disabled) label,
#nsd-carton-bundle-dialog label.nsd-bundle-option:has(:disabled) { cursor: default; }

#nsd-carton-bundle-dialog .nsd-bundle-summary {
	display: flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: space-between;
	gap: 10px 16px;
	padding: 10px var(--nsd-bundle-gutter);
	border-top: 1px solid var(--nsd-bundle-line);
	background: var(--nsd-bundle-tint);
}

#nsd-carton-bundle-dialog .nsd-bundle-progress {
	margin: 0;
	color: inherit;
	font-weight: 700;
}

#nsd-carton-bundle-dialog .nsd-bundle-submit {
	flex-shrink: 0;
	min-height: 44px;
	margin: 0;
	padding: 8px 14px;
	border: 1px solid transparent;
	border-radius: 8px;
	background: var(--nsd-action, #931c2a);
	color: #fff;
	font: 750 .88rem / 1.25 var(--nsd-body, system-ui, sans-serif);
	cursor: pointer;
}

#nsd-carton-bundle-dialog .nsd-bundle-submit:hover:not(:disabled) { background: #751925; }

#nsd-carton-bundle-dialog .nsd-bundle-submit:disabled {
	border-color: #d9c8c7;
	background: #efe5e4;
	color: #6b5556;
	cursor: default;
}

#nsd-carton-bundle-dialog :is(button, input, .nsd-bundle-options):focus-visible {
	outline: 2px solid var(--nsd-action, #931c2a);
	outline-offset: 2px;
}

#nsd-carton-bundle-dialog .nsd-bundle-options:focus-visible { outline-offset: -3px; }

#nsd-quick-view .nsd-bundle-open {
	display: inline-flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	width: 100%;
	min-height: 44px;
	margin: 8px 0 0;
	padding: 9px 12px;
	border: 1px solid #ddc3c2;
	border-radius: 8px;
	background: #fff;
	color: var(--nsd-action, #931c2a);
	font: 700 .85rem / 1.3 var(--nsd-body, system-ui, sans-serif);
	text-align: start;
	text-decoration: none;
	cursor: pointer;
}

#nsd-quick-view .nsd-bundle-open span { display: flex; flex-wrap: wrap; align-items: baseline; gap: 3px 10px; }
#nsd-quick-view .nsd-bundle-open small { color: #5b5052; font-size: .75rem; font-weight: 600; }
#nsd-quick-view .nsd-bundle-open svg { flex: 0 0 17px; width: 17px; height: 17px; }
#nsd-quick-view .nsd-bundle-open:is(:hover, :focus-visible) { border-color: var(--nsd-action, #931c2a); }

@media (max-width: 600px) {
	#nsd-carton-bundle-dialog {
		--nsd-bundle-gutter: clamp(12px, 4vw, 20px);
		--nsd-bundle-top: max(14px, env(safe-area-inset-top));
		--nsd-bundle-right: max(14px, env(safe-area-inset-right));
		--nsd-bundle-bottom: max(14px, env(safe-area-inset-bottom));
		--nsd-bundle-left: max(14px, env(safe-area-inset-left));
		inset: var(--nsd-bundle-top) var(--nsd-bundle-right) var(--nsd-bundle-bottom) var(--nsd-bundle-left);
		width: min(460px, calc(100% - var(--nsd-bundle-left) - var(--nsd-bundle-right)));
		max-height: calc(100vh - var(--nsd-bundle-top) - var(--nsd-bundle-bottom));
		max-height: calc(100dvh - var(--nsd-bundle-top) - var(--nsd-bundle-bottom));
	}

	#nsd-carton-bundle-dialog .nsd-bundle-tiers label {
		position: relative;
		grid-template-columns: 1fr;
		justify-items: center;
		min-height: 52px;
		padding-inline: 2px;
		text-align: center;
		white-space: nowrap;
	}

	#nsd-carton-bundle-dialog .nsd-bundle-tiers label:has(:focus-visible) {
		outline: 2px solid var(--nsd-action, #931c2a);
		outline-offset: 2px;
	}

	#nsd-carton-bundle-dialog .nsd-bundle-tiers input[type='radio'] {
		position: absolute;
		inset: 0;
		width: 100%;
		height: 100%;
		opacity: 0;
		cursor: inherit;
	}

	#nsd-carton-bundle-dialog .nsd-bundle-tiers label:has(:checked) { box-shadow: inset 0 0 0 1px var(--nsd-action, #931c2a); }
	#nsd-carton-bundle-dialog .nsd-bundle-tiers strong { font-size: .75rem; }
	#nsd-carton-bundle-dialog .nsd-bundle-tiers span { grid-column: 1; font-size: .73rem; }

	#nsd-carton-bundle-dialog .nsd-bundle-progress { font-size: .85rem; line-height: 1.35; }
}

@media (max-width: 360px) {
	#nsd-carton-bundle-dialog .nsd-bundle-tiers { gap: 4px; }
	#nsd-carton-bundle-dialog .nsd-bundle-tiers strong { font-size: .7rem; }
}

@media (max-height: 440px) {
	#nsd-carton-bundle-dialog { max-height: calc(100dvh - 28px); }
	#nsd-carton-bundle-dialog :is(.nsd-bundle-head, .nsd-bundle-summary) { padding-block: 6px; }
	#nsd-carton-bundle-dialog .nsd-bundle-tiers { margin-block-start: 8px; }
	#nsd-carton-bundle-dialog .nsd-bundle-tiers label { min-height: 44px; padding-block: 5px; }
	#nsd-carton-bundle-dialog .nsd-bundle-form {
		overflow: auto;
		overscroll-behavior: contain;
	}
	#nsd-carton-bundle-dialog .nsd-bundle-picker { flex: 1 0 154px; padding-block: 8px; }
	#nsd-carton-bundle-dialog .nsd-bundle-summary { position: sticky; bottom: 0; }
}
