/* Size picker: desktop popover + mobile sheet. */

.mcs {
	--mcs-ink: #111;
	--mcs-paper: #fff;
	--mcs-line: #ececec;
	--mcs-soft: #f4f4f5;
	--mcs-ease: cubic-bezier(0.22, 1, 0.36, 1);
	position: fixed;
	inset: 0;
	z-index: 2147483020;
	pointer-events: none;
}

.mcs.is-open {
	pointer-events: auto;
}

.mcs-scrim {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.42);
	opacity: 0;
	transition: opacity 0.28s var(--mcs-ease);
}

.mcs.is-open .mcs-scrim {
	opacity: 1;
}

.mcs-panel {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	display: flex;
	flex-direction: column;
	max-height: min(78vh, 640px);
	padding: 0 16px calc(16px + env(safe-area-inset-bottom, 0px));
	border-radius: 24px 24px 0 0;
	background: #fff;
	color: #111;
	box-shadow: 0 -16px 48px rgba(0, 0, 0, 0.2);
	transform: translate3d(0, 110%, 0);
	transition: transform 0.42s var(--mcs-ease);
}

.mcs.is-open .mcs-panel {
	transform: translate3d(0, 0, 0);
}

.mcs-handle {
	display: flex;
	justify-content: center;
	padding: 10px 0 6px;
}

.mcs-handle i {
	width: 36px;
	height: 4px;
	border-radius: 999px;
	background: #d4d4d8;
}

.mcs-head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
	padding: 4px 0 14px;
}

.mcs-kicker {
	margin: 0 0 4px;
	color: #71717a;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
}

.mcs-name {
	margin: 0;
	font-size: 16px;
	font-weight: 700;
	letter-spacing: -0.02em;
	line-height: 1.25;
}

.mcs-x {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 40px;
	height: 40px;
	margin: -4px -6px 0 0;
	border: 0;
	border-radius: 50%;
	background: #f4f4f5;
	color: #111;
	cursor: pointer;
}

.mcs-x:active {
	transform: scale(0.96);
}

.mcs-sizes {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	overflow: auto;
	padding: 2px 0 14px;
	-webkit-overflow-scrolling: touch;
}

.mcs-chip {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 52px;
	min-height: 44px;
	padding: 0 14px;
	border: 1px solid #e4e4e7;
	border-radius: 12px;
	background: #fff;
	color: #111;
	font: inherit;
	font-size: 14px;
	font-weight: 700;
	cursor: pointer;
	touch-action: manipulation;
	transition: transform 0.16s var(--mcs-ease), background 0.16s var(--mcs-ease), border-color 0.16s var(--mcs-ease), color 0.16s var(--mcs-ease);
}

.mcs-chip:hover {
	border-color: #111;
}

.mcs-chip:active {
	transform: scale(0.96);
}

.mcs-chip.is-on {
	background: #111;
	border-color: #111;
	color: #fff;
}

.mcs-chip:disabled,
.mcs-chip.is-off {
	color: #a1a1aa;
	background: #f4f4f5;
	border-color: #ececec;
	text-decoration: line-through;
	cursor: not-allowed;
	transform: none;
}

.mcs-chip.is-busy {
	opacity: 0.55;
	pointer-events: none;
}

.mcs-pdp {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	margin-top: 4px;
	color: #52525b;
	font-size: 13px;
	font-weight: 600;
	text-decoration: none;
}

.mcs-pdp:hover {
	color: #111;
}

.mcs-empty {
	width: 100%;
	padding: 18px 4px;
	color: #71717a;
	font-size: 14px;
	line-height: 1.45;
}

@media (min-width: 768px) {
	.mcs-scrim {
		background: rgba(0, 0, 0, 0.18);
	}

	.mcs-panel {
		left: auto;
		right: auto;
		bottom: auto;
		width: 300px;
		max-height: min(64vh, 480px);
		padding: 16px 16px 12px;
		border-radius: 20px;
		box-shadow: 0 18px 50px rgba(0, 0, 0, 0.22);
		transform: translate3d(0, 10px, 0) scale(0.96);
		opacity: 0;
		transition: transform 0.28s var(--mcs-ease), opacity 0.28s var(--mcs-ease);
	}

	.mcs.is-open .mcs-panel {
		transform: none;
		opacity: 1;
	}

	.mcs-handle {
		display: none;
	}

	.mcs-head {
		padding-bottom: 12px;
	}

	.mcs-name {
		font-size: 15px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.mcs-scrim,
	.mcs-panel,
	.mcs-chip {
		transition: none !important;
	}
}
