/**
 * Minimal View — QR modal.
 *
 * Ported from the inline <style> in `mm_qr_modal_html()` (Code Snippets export,
 * Live 2026-08-12 lines 16254–16410). Unused `#mm-qr-icon` and `#mm-qr-url-label` rules
 * from the original are dropped — neither element is rendered any more.
 *
 * Added here: the `.mm-qr-status` line and the disabled state for both the trigger button
 * and the download button, which the old version had scattered across two other files
 * (the trade-in shortcode's inline <style> and widgets.css).
 */

/* ── Overlay ─────────────────────────────────────────────────────────────── */

#mm-qr-overlay {
	position: fixed;
	inset: 0;
	background: rgba(10, 10, 15, 0.72);
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
	z-index: 999999;
	display: flex !important;
	align-items: center;
	justify-content: center;
	opacity: 0;
	transition: opacity 0.25s ease;
	padding: 20px;
	box-sizing: border-box;
}

#mm-qr-overlay.mm-visible {
	opacity: 1;
}

/*
 * The inline `display:none` is how the modal starts hidden; these two selectors make sure
 * the `display:flex !important` above cannot override it while it is still closed.
 */
#mm-qr-overlay[style*="display:none"],
#mm-qr-overlay[style*="display: none"] {
	display: none !important;
}

/* ── Card ────────────────────────────────────────────────────────────────── */

#mm-qr-modal {
	position: relative;
	background: #ffffff;
	border-radius: 20px;
	width: 100%;
	max-width: 380px;
	box-shadow: 0 32px 80px rgba(0, 0, 0, 0.22), 0 8px 24px rgba(0, 0, 0, 0.12);
	transform: translateY(16px) scale(0.97);
	transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
	overflow: hidden;
}

#mm-qr-overlay.mm-visible #mm-qr-modal {
	transform: translateY(0) scale(1);
}

#mm-qr-inner {
	padding: 28px 32px 32px;
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	gap: 0;
}

/* ── Copy ────────────────────────────────────────────────────────────────── */

#mm-qr-title {
	font-size: 20px;
	font-weight: 700;
	color: #1a1a2e;
	margin: 0 0 10px;
	letter-spacing: -0.3px;
	line-height: 1.2;
}

#mm-qr-desc {
	font-size: 12px;
	color: #6b7280;
	margin: 0 0 22px;
	line-height: 1.2rem;
	max-width: 300px;
}

/* ── QR ──────────────────────────────────────────────────────────────────── */

#mm-qr-code-wrap {
	background: #f9f9fc;
	border: 1.5px solid #e8e8f0;
	border-radius: 16px;
	padding: 16px;
	margin-bottom: 14px;
	line-height: 0;
}

#mm-qr-canvas {
	display: block;
	border-radius: 6px;
}

/*
 * Status line: "Preparing your QR…" while the payload resolver runs, or the error message
 * if the code could not be drawn. Collapses to nothing when empty so the layout does not
 * shift once it clears.
 */
.mm-qr-status {
	font-size: 12px;
	color: #6b7280;
	margin: 0 0 14px;
	min-height: 0;
	max-width: 300px;
	line-height: 1.4;
}

.mm-qr-status:empty {
	margin: 0;
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */

#mm-qr-download {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 12px 24px;
	background: #1a1a2e;
	color: #ffffff;
	border: none;
	border-radius: 10px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	letter-spacing: 0.2px;
	transition: background 0.18s ease, transform 0.15s ease, box-shadow 0.18s ease;
	font-family: inherit;
	box-shadow: 0 4px 14px rgba(26, 26, 46, 0.25);
}

#mm-qr-download:hover:not(:disabled) {
	background: #0f3460;
	transform: translateY(-1px);
	box-shadow: 0 6px 20px rgba(15, 52, 96, 0.35);
}

#mm-qr-download:active:not(:disabled) {
	transform: translateY(0);
}

#mm-qr-download:disabled {
	background: #c7c7d1;
	box-shadow: none;
	cursor: not-allowed;
	transform: none;
}

#mm-qr-close {
	position: absolute;
	top: 14px;
	right: 14px;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	border: none;
	background: #f3f4f6;
	color: #6b7280;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 10;
	transition: background 0.15s ease, color 0.15s ease;
	padding: 0;
	line-height: 0;
}

#mm-qr-close:hover {
	background: #1a1a2e;
	color: #ffffff;
}

/* ── Trigger button ──────────────────────────────────────────────────────── */

/*
 * The trigger stays disabled until the selection is complete.
 *
 * Previously defined twice with different colours: the trade-in shortcode's inline <style>
 * used #ccc/#888, widgets.css used #E5E5E5/#C1C1C1. widgets.css's values are kept — they
 * are the ones customers currently see on the product page, and the trade-in form's greyed
 * button now matches it instead of being a shade off.
 */
.mm-save-selection-qr:disabled {
	background: #e5e5e5 !important;
	color: #c1c1c1 !important;
	cursor: not-allowed !important;
	opacity: 1 !important;
}

/*
 * Sticky-cart placement. Was `style="line-height:2em; border: none;"` on the element.
 *
 * !important because inline styles beat every stylesheet, so these two properties
 * previously outranked theme rules like `.woocommerce button.button { border: … }`. Dropping
 * to a plain class would have quietly handed the border back to the theme.
 */
.mm-save-selection-qr--sticky {
	line-height: 2em !important;
	border: none !important;
}

/*
 * Trade-in form placement: full width at the end of step 3.
 * Was `style="margin-top:12px"` on the wrapper and
 * `style="line-height:2.5em; border: none; width:100%"` on the button.
 */
.mm-save-selection-qr-wrap {
	margin-top: 12px;
}

.mm-save-selection-qr-wrap .mm-save-selection-qr {
	line-height: 2.5em !important;
	border: none !important;
	width: 100% !important;
}
