/* Customize Button */
.mbp-customize-button-wrap {
	margin: 20px 0;
}

.mbp-customize-btn {
	background: #0073aa;
	color: #fff;
	border: none;
	padding: 12px 24px;
	font-size: 16px;
	font-weight: 600;
	cursor: pointer;
	border-radius: 4px;
	transition: background 0.3s ease;
}

.mbp-customize-btn:hover {
	background: #005a87;
}

/* Modal Overlay */
.mbp-modal {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 9999999;
	display: flex;
	align-items: center;
	justify-content: center;
}

.mbp-modal-overlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.7);
	backdrop-filter: blur(2px);
}

.mbp-modal-content {
	position: relative;
	background: #fff;
	border-radius: 8px;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
	max-width: 900px;
	width: 90%;
	max-height: 90vh;
	display: flex;
	flex-direction: column;
	z-index: 10000000;
	overflow: hidden;
}

.mbp-modal-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 20px 24px;
	border-bottom: 1px solid #e0e0e0;
	background: #f8f9fa;
}

.mbp-modal-header h2 {
	margin: 0;
	font-size: 24px;
	font-weight: 600;
	color: #333;
}

.mbp-modal-close {
	background: none;
	border: none;
	font-size: 32px;
	line-height: 1;
	color: #666;
	cursor: pointer;
	padding: 0;
	width: 32px;
	height: 32px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 4px;
	transition: all 0.2s ease;
}

.mbp-modal-close:hover {
	background: #e0e0e0;
	color: #000;
}

.mbp-modal-body {
	display: flex;
	flex: 1;
	overflow: hidden;
	padding: 24px;
	gap: 40px;
}

.mbp-modal-preview {
	flex: 0 0 400px;
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 400px;
	position: sticky;
	top: 0;
	align-self: flex-start;
	overflow: hidden;
}

.mbp-modal-form {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 20px;
	overflow-y: auto;
	overflow-x: hidden;
	max-height: calc(90vh - 140px);
	padding-right: 10px;
}

/* Custom scrollbar for form */
.mbp-modal-form::-webkit-scrollbar {
	width: 8px;
}

.mbp-modal-form::-webkit-scrollbar-track {
	background: #f1f1f1;
	border-radius: 4px;
}

.mbp-modal-form::-webkit-scrollbar-thumb {
	background: #888;
	border-radius: 4px;
}

.mbp-modal-form::-webkit-scrollbar-thumb:hover {
	background: #555;
}

.mbp-overlay-slider-nav {
	display: none; /* hidden by default (desktop) */
	align-items: center;
	justify-content: center;
	gap: 10px;
	margin-top: 10px;
}

.mbp-overlay-slider-nav .mbp-overlay-slider-prev,
.mbp-overlay-slider-nav .mbp-overlay-slider-next {
	min-width: 36px;
	padding: 6px 10px;
	font-size: 16px;
	line-height: 1;
}

.mbp-overlay-slider-indicator {
	font-size: 13px;
	color: #555;
	min-width: 60px;
	text-align: center;
}

.mbp-modal-form .mbp-field-wrap {
	margin: 0;
}

.mbp-modal-form label {
	display: block;
	margin-bottom: 8px;
	font-weight: 600;
	color: #333;
	font-size: 14px;
}

.mbp-modal-form input[type="text"],
.mbp-modal-form select {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid #ddd;
	border-radius: 4px;
	font-size: 14px;
	transition: border-color 0.2s ease;
}

/* -------------------------------------------------------------------------- */
/* Custom font faces (user-provided TTF/OTF files in assets/fonts)           */
/* Make sure the .ttf/.otf files exist with these exact filenames:           */
/*  - Zain.ttf                                                               */
/*  - Dephiana.otf                                                           */
/*  - WaitingAwakmu.ttf                                                      */
/*  - Samarkan.ttf                                                           */
/*  - CandlescriptDemo.otf                                                   */
/*  - MatisanScriptAltPERSONAL.otf                                           */
/*  - LastChristmasPERSONALUSE.otf                                           */
/* -------------------------------------------------------------------------- */
@font-face {
	font-family: 'Zain';
	src: url('../fonts/Zain.ttf') format('truetype');
	font-weight: normal;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: 'Dephiana';
	src: url('../fonts/Dephiana.otf') format('opentype');
	font-weight: normal;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: 'Waiting Awakmu';
	src: url('../fonts/WaitingAwakmu.ttf') format('truetype');
	font-weight: normal;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: 'Samarkan';
	src: url('../fonts/Samarkan.ttf') format('truetype');
	font-weight: normal;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: 'Candlescript Demo Version';
	src: url('../fonts/CandlescriptDemo.otf') format('opentype');
	font-weight: normal;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: 'Matisan Script Alt PERSONAL';
	src: url('../fonts/MatisanScriptAltPERSONAL.otf') format('opentype');
	font-weight: normal;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: 'Last Christmas PERSONAL USE';
	src: url('../fonts/LastChristmasPERSONALUSE.otf') format('opentype');
	font-weight: normal;
	font-style: normal;
	font-display: swap;
}

/* Font grid styles */
.mbp-font-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
	gap: 8px;
	margin-top: 4px;
}

.mbp-font-option {
	display: inline-block;
	padding: 8px 10px;
	border: 1px solid #ddd;
	border-radius: 4px;
	background: #f9f9f9;
	cursor: pointer;
	font-size: 13px;
	text-align: center;
	transition: all 0.2s ease;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.mbp-font-option:hover {
	border-color: #0073aa;
	background: #eef6fc;
}

.mbp-font-option.selected {
	border-color: #0073aa;
	background: #e6f4ff;
	color: #0073aa;
	font-weight: 600;
}

/* Color image swatches */
.mbp-color-image-swatch {
	border: 2px solid #ddd;
	border-radius: 4px;
}
.mbp-color-image-swatch.selected {
	border-color: #4CAF50;
}

.mbp-modal-form input[type="text"]:focus,
.mbp-modal-form select:focus {
	outline: none;
	border-color: #0073aa;
	box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.1);
}

/* Color Picker Styles */
.mbp-color-picker-wrapper {
	display: flex;
	gap: 10px;
	align-items: center;
}

.mbp-color-picker-wrapper input[type="color"] {
	width: 60px;
	height: 40px;
	border: 1px solid #ddd;
	border-radius: 4px;
	cursor: pointer;
	padding: 2px;
	background: none;
}

.mbp-color-picker-wrapper input[type="color"]::-webkit-color-swatch-wrapper {
	padding: 0;
}

.mbp-color-picker-wrapper input[type="color"]::-webkit-color-swatch {
	border: 1px solid #ccc;
	border-radius: 3px;
}

.mbp-color-hex {
	flex: 1;
	padding: 10px 12px;
	border: 1px solid #ddd;
	border-radius: 4px;
	font-size: 14px;
	font-family: monospace;
	text-transform: uppercase;
}

.mbp-color-hex:focus {
	outline: none;
	border-color: #0073aa;
	box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.1);
}

/* Preview styles moved above to make it sticky */

.mbp-modal-image-container {
	position: relative;
	display: inline-block;
	max-width: 100%;
	overflow: hidden;
}

.mbp-modal-image {
	max-width: 100%;
	height: auto;
	display: block;
	border-radius: 4px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.mbp-modal-footer {
	padding: 16px 24px;
	border-top: 1px solid #e0e0e0;
	background: #f8f9fa;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.mbp-modal-footer-buttons {
	display: flex;
	justify-content: flex-end;
	gap: 10px;
	align-items: center;
}

.mbp-modal-close-btn {
	background: #666;
	color: #fff;
	border: none;
	padding: 10px 20px;
	font-size: 14px;
	cursor: pointer;
	border-radius: 4px;
	transition: background 0.3s ease;
}

.mbp-modal-close-btn:hover {
	background: #555;
}

.mbp-modal-save-btn,
#mbp-save-customization {
	background: #0073aa;
	color: #fff;
	border: none;
	padding: 10px 24px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	border-radius: 4px;
	transition: background 0.3s ease;
}

.mbp-modal-save-btn:hover,
#mbp-save-customization:hover {
	background: #005a87;
}

.mbp-modal-save-btn:disabled,
#mbp-save-customization:disabled {
	background: #ccc;
	cursor: not-allowed;
	opacity: 0.7;
}

.mbp-modal-footer .mbp-preview-note {
	font-size: 13px;
	color: #666;
	margin: 0;
	text-align: center;
}

/* Responsive */
@media (max-width: 768px) {
	.mbp-modal-content {
		width: 95%;
		max-height: 95vh;
	}
	
	.mbp-modal-body {
		flex-direction: column;
		padding: 16px;
		gap: 30px;
		overflow: auto;
	}
	
	.mbp-modal-preview {
		flex: 0 0 auto;
		min-height: 300px;
		order: 1;
		position: relative;
		top: auto;
		align-self: auto;
	}
	
	.mbp-modal-form {
		flex: 0 0 auto;
		order: 2;
		overflow: visible;
		max-height: none;
		padding-right: 0;
	}

	.mbp-overlay-steps {
		display: flex;
		flex-direction: row;
		gap: 16px;
		overflow-x: auto;
		scroll-snap-type: x mandatory;
		padding-bottom: 10px;
		-ms-overflow-style: none;
		scrollbar-width: none;
	}

	.mbp-overlay-steps::-webkit-scrollbar {
		display: none;
	}

	.mbp-overlay-steps .mbp-overlay-fields-group {
		flex: 0 0 calc(100% - 20px);
		min-width: calc(100% - 20px);
		scroll-snap-align: start;
		background: #fff;
		border: 1px solid #e8e8e8;
		border-radius: 6px;
		box-shadow: 0 6px 14px rgba(0, 0, 0, 0.05);
		padding: 15px;
	}
	
	.mbp-modal-footer {
		flex-direction: column;
		gap: 12px;
		align-items: stretch;
	}
	
	.mbp-modal-footer-buttons {
		flex-direction: column;
		width: 100%;
	}
	
	.mbp-modal-footer-buttons .mbp-modal-close-btn,
	.mbp-modal-footer-buttons .mbp-modal-save-btn,
	.mbp-modal-footer-buttons #mbp-save-customization {
		width: 100%;
	}

	.mbp-overlay-slider-nav {
		display: flex; /* show slider controls only on mobile */
		margin-top: 6px;
	}
	
	.mbp-modal-close-btn {
		width: 100%;
	}
}