/* Upselling Popup – popup. Colours and shapes can be changed with the variables below. */
.mzu-root {
	--mzu-bg: #fff;
	--mzu-text: #111;
	--mzu-muted: #666;
	--mzu-line: #e5e5e5;
	--mzu-media-bg: #f4f4f2;
	--mzu-accent: #000;
	--mzu-accent-text: #fff;
	--mzu-radius: 0;
	--mzu-btn-transform: uppercase;
	--mzu-overlay: rgba(17, 17, 17, 0.5);
	--mzu-z: 100001;

	position: fixed;
	inset: 0;
	z-index: var(--mzu-z);
	font-family: inherit;
	color: var(--mzu-text);
}

.mzu-root[hidden] {
	display: none;
}

html.mzu-lock,
html.mzu-lock body {
	overflow: hidden;
}

.mzu-overlay {
	position: absolute;
	inset: 0;
	background: var(--mzu-overlay);
	opacity: 0;
	transition: opacity 0.2s ease;
}

.mzu-dialog {
	position: absolute;
	top: 50%;
	left: 50%;
	box-sizing: border-box;
	width: fit-content;
	min-width: min(440px, calc(100% - 32px));
	max-width: min(920px, calc(100% - 32px));
	max-height: calc(100% - 48px);
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: 32px;
	background: var(--mzu-bg);
	border-radius: var(--mzu-radius);
	box-shadow: 0 24px 64px rgba(0, 0, 0, 0.18);
	opacity: 0;
	transform: translate(-50%, calc(-50% + 12px));
	transition: opacity 0.2s ease, transform 0.2s ease;
	outline: none;
}

.mzu-is-open .mzu-overlay {
	opacity: 1;
}

.mzu-is-open .mzu-dialog {
	opacity: 1;
	transform: translate(-50%, -50%);
}

.mzu-close {
	position: absolute;
	top: 8px;
	right: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--mzu-text);
	cursor: pointer;
}

.mzu-close:hover {
	opacity: 0.6;
}

.mzu-close:focus-visible,
.mzu-btn:focus-visible,
.mzu-item__link:focus-visible {
	outline: 2px solid var(--mzu-accent);
	outline-offset: 2px;
}

/* Added product */
.mzu-added {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 0 48px 18px 0;
	border-bottom: 1px solid var(--mzu-line);
}

.mzu-added__media img {
	display: block;
	width: 56px;
	height: 56px;
	object-fit: cover;
	background: var(--mzu-media-bg);
}

.mzu-added__text {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.mzu-added__label {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--mzu-text);
}

.mzu-added__name {
	font-size: 15px;
	color: var(--mzu-muted);
}

/* Heading: keeps the theme's h2 font */
.mzu-root .mzu-title {
	margin: 22px 0 18px;
	padding: 0;
	font-size: 26px;
	line-height: 1.2;
	color: var(--mzu-text);
}

/* Products */
.mzu-items {
	--mzu-cols: 4;
	display: grid;
	grid-template-columns: repeat(var(--mzu-cols), minmax(0, 184px));
	justify-content: center;
	gap: 20px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.mzu-items[data-count="1"] {
	grid-template-columns: minmax(0, 220px);
}

.mzu-item {
	display: flex;
	flex-direction: column;
	gap: 6px;
	min-width: 0;
	margin: 0;
	padding: 0;
}

.mzu-item::before,
.mzu-item::marker {
	content: none;
}

.mzu-item__link {
	display: flex;
	flex-direction: column;
	gap: 10px;
	color: var(--mzu-text);
	text-decoration: none;
}

.mzu-item__link:hover .mzu-item__name {
	text-decoration: underline;
}

.mzu-item__media {
	display: block;
	aspect-ratio: 1 / 1;
	overflow: hidden;
	background: var(--mzu-media-bg);
	border-radius: var(--mzu-radius);
}

.mzu-item__media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	margin: 0;
	transition: transform 0.3s ease;
}

.mzu-item__link:hover .mzu-item__media img {
	transform: scale(1.03);
}

.mzu-item__name {
	display: -webkit-box;
	overflow: hidden;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	font-size: 14px;
	font-weight: 500;
	line-height: 1.35;
}

.mzu-item__price {
	margin-top: auto;
	font-size: 14px;
	color: var(--mzu-muted);
}

.mzu-item__price del {
	opacity: 0.6;
	margin-right: 4px;
}

.mzu-item__price ins {
	text-decoration: none;
}

.mzu-item__price small,
.mzu-item__price .woocommerce-price-suffix {
	display: block;
	font-size: 11px;
}

/* Buttons */
.mzu-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	min-height: 44px;
	padding: 10px 18px;
	border: 1px solid var(--mzu-accent);
	border-radius: var(--mzu-radius);
	background: var(--mzu-accent);
	color: var(--mzu-accent-text);
	font: inherit;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: 0.02em;
	text-align: center;
	text-decoration: none;
	text-transform: var(--mzu-btn-transform);
	cursor: pointer;
	transition: opacity 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.mzu-btn:hover {
	opacity: 0.85;
	color: var(--mzu-accent-text);
	text-decoration: none;
}

.mzu-btn--ghost {
	background: transparent;
	color: var(--mzu-accent);
}

.mzu-btn--ghost:hover {
	color: var(--mzu-accent);
}

.mzu-btn--add {
	width: 100%;
	min-height: 40px;
	font-size: 12px;
}

.mzu-btn.is-loading {
	opacity: 0.6;
	cursor: progress;
}

.mzu-btn.is-added {
	background: transparent;
	color: var(--mzu-accent);
	cursor: default;
	opacity: 1;
}

.mzu-btn[disabled] {
	pointer-events: none;
}

.mzu-actions {
	display: flex;
	justify-content: flex-end;
	flex-wrap: wrap;
	gap: 12px;
	margin-top: 26px;
	padding-top: 20px;
	border-top: 1px solid var(--mzu-line);
}

.mzu-error {
	margin: 16px 0 0;
	font-size: 14px;
	color: #b32d2e;
}

.mzu-error[hidden],
.mzu-badge[hidden] {
	display: none;
}

.mzu-badge {
	display: inline-block;
	margin: 14px 0 0;
	padding: 3px 8px;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: #1d2327;
	background: #f0c33c;
}

/* Phone: panel from the bottom of the screen, products in a swipeable row */
@media (max-width: 640px) {
	.mzu-dialog {
		top: auto;
		bottom: 0;
		left: 0;
		width: 100%;
		min-width: 0;
		max-width: none;
		max-height: 88vh;
		max-height: 88dvh;
		padding: 20px 16px calc(16px + env(safe-area-inset-bottom));
		border-radius: 12px 12px 0 0;
		transform: translateY(100%);
		transition: opacity 0.2s ease, transform 0.28s ease;
	}

	.mzu-is-open .mzu-dialog {
		transform: translateY(0);
	}

	.mzu-close {
		top: 6px;
		right: 4px;
	}

	.mzu-added {
		padding-right: 44px;
		padding-bottom: 14px;
	}

	.mzu-added__media img {
		width: 48px;
		height: 48px;
	}

	.mzu-root .mzu-title {
		margin: 16px 0 14px;
		font-size: 21px;
	}

	.mzu-items,
	.mzu-items[data-count="1"] {
		grid-template-columns: none;
		grid-auto-flow: column;
		grid-auto-columns: 44%;
		justify-content: start;
		gap: 12px;
		overflow-x: auto;
		scroll-snap-type: x mandatory;
		-webkit-overflow-scrolling: touch;
		margin: 0 -16px;
		padding: 0 16px 4px;
		scroll-padding: 0 16px;
	}

	.mzu-items[data-count="1"] {
		grid-auto-columns: 60%;
	}

	.mzu-item {
		scroll-snap-align: start;
	}

	.mzu-actions {
		flex-direction: column-reverse;
		gap: 8px;
		margin-top: 18px;
		padding-top: 14px;
	}

	.mzu-actions .mzu-btn {
		width: 100%;
	}
}

@media (prefers-reduced-motion: reduce) {
	.mzu-overlay,
	.mzu-dialog,
	.mzu-item__media img {
		transition: none;
	}
}
