/**
 * Multimaak Personalizer — klant-editor & cart-preview styling.
 *
 * Multimaak-groen: #5b8c51.
 */

.mmp-local-open-editor {
	margin-top: 10px;
}

/* ------------------------------------------------------------------ */
/* Modal overlay                                                       */
/* ------------------------------------------------------------------ */
.mmp-local-modal-overlay {
	position: fixed;
	inset: 0;
	z-index: 999999;
	background: rgba(0, 0, 0, 0.85);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	box-sizing: border-box;
}

.mmp-local-modal-overlay[hidden] {
	display: none !important;
}

body.mmp-local-modal-open {
	overflow: hidden !important;
}

.mmp-local-modal {
	background: #fff;
	width: 100%;
	max-width: 1200px;
	max-height: 92vh;
	border-radius: 10px;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

/* Header */
.mmp-local-modal-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 22px;
	border-bottom: 1px solid #e5e5e5;
	flex: 0 0 auto;
}

.mmp-local-modal-header h2 {
	margin: 0;
	font-size: 18px;
	line-height: 1.3;
	color: #1d2327;
}

.mmp-local-modal-close {
	background: none;
	border: none;
	font-size: 30px;
	line-height: 1;
	cursor: pointer;
	color: #646970;
	padding: 0 6px;
}

.mmp-local-modal-close:hover {
	color: #1d2327;
}

/* Body */
.mmp-local-modal-body {
	display: flex;
	flex: 1 1 auto;
	min-height: 0;
	overflow: hidden;
}

.mmp-local-canvas-wrap {
	position: relative;
	flex: 1 1 auto;
	display: flex;
	align-items: center;
	justify-content: center;
	background:
		linear-gradient(45deg, #eee 25%, transparent 25%),
		linear-gradient(-45deg, #eee 25%, transparent 25%),
		linear-gradient(45deg, transparent 75%, #eee 75%),
		linear-gradient(-45deg, transparent 75%, #eee 75%);
	background-size: 22px 22px;
	background-position: 0 0, 0 11px, 11px -11px, -11px 0;
	background-color: #f6f7f7;
	padding: 20px;
	overflow: auto;
}

.mmp-local-canvas-holder {
	background: #fff;
	box-shadow: 0 4px 18px rgba(0, 0, 0, 0.15);
	line-height: 0;
}

/* Laadindicator */
.mmp-local-loading {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 12px;
	background: rgba(255, 255, 255, 0.9);
	color: #1d2327;
	font-size: 14px;
}

.mmp-local-loading[hidden] {
	display: none;
}

.mmp-local-spinner {
	width: 34px;
	height: 34px;
	border: 3px solid rgba(91, 140, 81, 0.25);
	border-top-color: #5b8c51;
	border-radius: 50%;
	animation: mmp-local-spin 0.8s linear infinite;
}

@keyframes mmp-local-spin {
	to {
		transform: rotate(360deg);
	}
}

/* Bedieningspaneel */
.mmp-local-controls {
	flex: 0 0 320px;
	width: 320px;
	border-left: 1px solid #e5e5e5;
	padding: 18px;
	box-sizing: border-box;
	overflow-y: auto;
	background: #fbfbfc;
}

.mmp-local-controls-title {
	margin: 0 0 14px;
	font-size: 14px;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: #646970;
}

.mmp-local-field {
	margin-bottom: 16px;
}

.mmp-local-field label {
	display: block;
	font-size: 13px;
	font-weight: 600;
	color: #1d2327;
	margin-bottom: 5px;
}

.mmp-local-field input[type="text"],
.mmp-local-field textarea,
.mmp-local-field select {
	width: 100%;
	box-sizing: border-box;
	padding: 9px 11px;
	border: 1px solid #ccc;
	border-radius: 6px;
	font-size: 14px;
}

.mmp-local-field input[type="text"]:focus,
.mmp-local-field textarea:focus {
	outline: none;
	border-color: #5b8c51;
	box-shadow: 0 0 0 2px rgba(91, 140, 81, 0.2);
}

.mmp-local-field-row {
	display: flex;
	gap: 8px;
	align-items: center;
	margin-top: 6px;
}

.mmp-local-upload-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: #fff;
	border: 1px dashed #5b8c51;
	color: #4a7342;
	border-radius: 6px;
	padding: 10px 12px;
	cursor: pointer;
	font-size: 13px;
	width: 100%;
	justify-content: center;
	box-sizing: border-box;
}

.mmp-local-upload-btn:hover {
	background: rgba(91, 140, 81, 0.06);
}

.mmp-local-upload-input {
	display: none;
}

.mmp-local-upload-thumb {
	width: 44px;
	height: 44px;
	object-fit: cover;
	border-radius: 6px;
	border: 1px solid #ddd;
}

.mmp-local-color-swatch {
	display: inline-block;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	border: 2px solid #fff;
	box-shadow: 0 0 0 1px #ccc;
	cursor: pointer;
	padding: 0;
}

.mmp-local-color-swatch.is-active {
	box-shadow: 0 0 0 2px #5b8c51;
}

.mmp-local-no-fields {
	color: #646970;
	font-size: 13px;
	font-style: italic;
}

.mmp-local-error {
	background: #fbeaea;
	border: 1px solid #d63638;
	color: #a00;
	border-radius: 6px;
	padding: 10px 12px;
	font-size: 13px;
	margin-top: 12px;
}

.mmp-local-error[hidden] {
	display: none;
}

/* Footer */
.mmp-local-modal-footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 14px 22px;
	border-top: 1px solid #e5e5e5;
	flex: 0 0 auto;
	flex-wrap: wrap;
}

.mmp-local-footer-left,
.mmp-local-footer-right {
	display: flex;
	gap: 8px;
	align-items: center;
}

.mmp-local-btn {
	border: none;
	border-radius: 6px;
	padding: 11px 18px;
	font-size: 14px;
	cursor: pointer;
	line-height: 1.2;
}

.mmp-local-btn-ghost {
	background: #f0f0f1;
	color: #1d2327;
	font-size: 13px;
	padding: 9px 14px;
}

.mmp-local-btn-ghost:hover {
	background: #e0e0e1;
}

.mmp-local-btn-cancel {
	background: #fff;
	border: 1px solid #ccc;
	color: #646970;
}

.mmp-local-btn-cancel:hover {
	border-color: #999;
	color: #1d2327;
}

.mmp-local-btn-done {
	background: #5b8c51;
	color: #fff;
	font-weight: 600;
}

.mmp-local-btn-done:hover {
	background: #4a7342;
}

.mmp-local-btn:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

/* ------------------------------------------------------------------ */
/* Cart-preview                                                        */
/* ------------------------------------------------------------------ */
.mmp-local-cart-preview {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-top: 8px;
}

.mmp-local-cart-preview img {
	width: 54px;
	height: 54px;
	object-fit: contain;
	border: 1px solid #e5e5e5;
	border-radius: 6px;
	background: #fff;
	padding: 2px;
}

.mmp-local-cart-badge {
	display: inline-block;
	background: rgba(91, 140, 81, 0.15);
	color: #4a7342;
	font-size: 11px;
	font-weight: 600;
	padding: 2px 9px;
	border-radius: 12px;
}

/* ------------------------------------------------------------------ */
/* Responsief                                                          */
/* ------------------------------------------------------------------ */
@media screen and (max-width: 782px) {
	.mmp-local-modal {
		max-height: 96vh;
	}

	.mmp-local-modal-body {
		flex-direction: column;
		overflow-y: auto;
	}

	.mmp-local-canvas-wrap {
		flex: 0 0 auto;
		min-height: 300px;
	}

	.mmp-local-controls {
		flex: 1 1 auto;
		width: 100%;
		border-left: none;
		border-top: 1px solid #e5e5e5;
	}

	.mmp-local-modal-footer {
		gap: 8px;
	}

	.mmp-local-footer-left,
	.mmp-local-footer-right {
		flex: 1 1 100%;
		justify-content: center;
	}
}
