/* 前台定制器样式 */

.cpd-customize-entry {
	margin-bottom: 12px;
}

.cpd-customize-status {
	color: #008a20;
	font-weight: 600;
	margin-top: 6px;
}

/* 弹窗遮罩 */
.cpd-modal {
	position: fixed;
	inset: 0;
	z-index: 999999;
}

.cpd-modal-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(15, 23, 42, 0.55);
	backdrop-filter: blur(4px);
}

/* 弹窗主体 */
.cpd-modal-dialog {
	position: relative;
	background: #fff;
	border-radius: 14px;
	max-width: 1000px;
	width: calc(100% - 40px);
	max-height: calc(100vh - 50px);
	margin: 25px auto;
	display: flex;
	flex-direction: column;
	box-shadow: 0 25px 60px rgba(0, 0, 0, 0.25), 0 4px 12px rgba(0, 0, 0, 0.08);
	overflow: hidden;
}

/* 头部 */
.cpd-modal-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 18px 24px;
	border-bottom: 1px solid #f0f0f0;
	background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

.cpd-modal-header h3 {
	margin: 0;
	font-size: 19px;
	font-weight: 700;
	color: #1e293b;
	letter-spacing: -0.2px;
}

.cpd-modal-close {
	background: none;
	border: none;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
	color: #94a3b8;
	padding: 4px 10px;
	border-radius: 6px;
	transition: all 0.15s ease;
}

.cpd-modal-close:hover {
	color: #475569;
	background: #e2e8f0;
}

/* 主体 */
.cpd-modal-body {
	display: flex;
	gap: 24px;
	padding: 24px;
	overflow: auto;
	flex: 1;
}

.cpd-designer-main {
	flex: 1;
	min-width: 0;
}

/* 画布容器 */
.cpd-canvas-wrap {
	display: flex;
	justify-content: center;
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	border-radius: 10px;
	padding: 16px;
	overflow: auto;
	box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.04);
}

.cpd-canvas-wrap .canvas-container {
	max-width: 100%;
}

/* 面切换标签 */
.cpd-view-tabs {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
	margin-bottom: 14px;
}

.cpd-size-selector {
	margin-bottom: 14px;
	font-size: 14px;
	color: #475569;
}

.cpd-size-selector select {
	padding: 7px 34px 7px 12px;
	border: 1px solid #cbd5e1;
	border-radius: 8px;
	font-size: 14px;
	cursor: pointer;
	background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 10px center;
	appearance: none;
	-webkit-appearance: none;
	-moz-appearance: none;
	transition: border-color 0.15s ease;
}

.cpd-size-selector select:hover {
	border-color: #94a3b8;
}

.cpd-size-selector select:focus {
	outline: none;
	border-color: #3b82f6;
	box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.cpd-view-tab {
	padding: 7px 18px;
	border: 1px solid #e2e8f0;
	border-radius: 22px;
	background: #fff;
	cursor: pointer;
	font-size: 14px;
	font-weight: 500;
	line-height: 1.6;
	color: #64748b;
	transition: all 0.18s ease;
}

.cpd-view-tab:hover {
	border-color: #3b82f6;
	color: #3b82f6;
}

.cpd-view-tab.is-active {
	background: linear-gradient(135deg, #3b82f6, #2563eb);
	border-color: transparent;
	color: #fff;
	box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

/* 工具栏 */
.cpd-toolbar {
	display: flex;
	gap: 8px;
	margin-top: 14px;
	flex-wrap: wrap;
}

.cpd-toolbar .button {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 7px 14px;
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	background: #fff;
	color: #475569;
	font-size: 13px;
	font-weight: 500;
	cursor: pointer;
	transition: all 0.15s ease;
}

.cpd-toolbar .button:hover {
	border-color: #3b82f6;
	color: #3b82f6;
	background: #f8fafc;
}

/* 坐标 / 尺寸输入面板 */
.cpd-object-info {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 16px;
	margin-top: 12px;
	padding: 12px 14px;
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	border-radius: 10px;
	font-size: 13px;
}

.cpd-object-info label {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	color: #64748b;
	font-weight: 500;
}

.cpd-object-info input {
	width: 72px;
	padding: 5px 8px;
	border: 1px solid #cbd5e1;
	border-radius: 6px;
	font-size: 13px;
	color: #1e293b;
	transition: border-color 0.15s ease;
}

.cpd-object-info input:focus {
	outline: none;
	border-color: #3b82f6;
	box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* 右侧面板 */
.cpd-designer-side {
	width: 300px;
	flex-shrink: 0;
}

.cpd-designer-side h4 {
	margin: 0 0 12px;
	font-size: 15px;
	font-weight: 700;
	color: #1e293b;
}

/* 区域列表 */
.cpd-zone-list {
	list-style: none;
	margin: 0 0 18px;
	padding: 0;
}

.cpd-zone-item {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 11px 13px;
	border: 1px solid #e2e8f0;
	border-radius: 10px;
	margin-bottom: 8px;
	cursor: pointer;
	background: #fff;
	transition: all 0.18s ease;
}

.cpd-zone-item:hover {
	border-color: #93c5fd;
	background: #f0f9ff;
}

.cpd-zone-item.is-active {
	border-color: #3b82f6;
	background: #eff6ff;
	box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.cpd-zone-item-name {
	font-weight: 600;
	flex: 1;
	color: #1e293b;
}

.cpd-zone-item-price {
	color: #2563eb;
	font-size: 13px;
	font-weight: 600;
}

.cpd-zone-item-status {
	color: #16a34a;
	font-size: 12px;
	font-weight: 600;
}

.cpd-zone-upload {
	font-size: 12px;
	padding: 4px 12px;
	line-height: 1.6;
	min-height: 26px;
	border-radius: 6px;
	border: 1px solid #3b82f6;
	background: #fff;
	color: #3b82f6;
	cursor: pointer;
	font-weight: 500;
	transition: all 0.15s ease;
}

.cpd-zone-upload:hover {
	background: #3b82f6;
	color: #fff;
}

/* 上传区域 */
.cpd-upload-box {
	border-top: 1px solid #f0f0f0;
	padding-top: 16px;
}

/* 主上传按钮 */
#cpd-upload-btn {
	display: inline-block;
	width: 100%;
	padding: 13px 18px;
	background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
	color: #fff !important;
	border: none;
	border-radius: 10px;
	font-size: 14px;
	font-weight: 600;
	text-align: center;
	cursor: pointer;
	transition: all 0.2s ease;
	box-shadow: 0 2px 8px rgba(59, 130, 246, 0.25);
}

#cpd-upload-btn:hover {
	background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
	box-shadow: 0 4px 14px rgba(59, 130, 246, 0.4);
	transform: translateY(-1px);
}

#cpd-upload-btn:active {
	transform: translateY(0);
}

#cpd-upload-btn:disabled {
	background: #cbd5e1;
	box-shadow: none;
	cursor: not-allowed;
	transform: none;
}

.cpd-upload-hint {
	color: #94a3b8;
	font-size: 12px;
	margin: 8px 0 0;
	text-align: center;
}

/* 费用汇总 */
.cpd-fee-summary {
	margin-top: 14px;
	font-weight: 700;
	color: #2563eb;
	font-size: 15px;
	text-align: center;
}

/* 底部 */
.cpd-modal-footer {
	display: flex;
	justify-content: flex-end;
	gap: 10px;
	padding: 16px 24px;
	border-top: 1px solid #f0f0f0;
	background: #f8fafc;
}

.cpd-modal-footer .button {
	padding: 9px 22px;
	border-radius: 8px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.15s ease;
}

.cpd-modal-footer #cpd-cancel {
	background: #fff;
	color: #64748b;
	border: 1px solid #e2e8f0;
}

.cpd-modal-footer #cpd-cancel:hover {
	background: #f1f5f9;
	border-color: #cbd5e1;
}

.cpd-modal-footer #cpd-confirm {
	background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
	color: #fff;
	border: none;
	box-shadow: 0 2px 8px rgba(59, 130, 246, 0.25);
}

.cpd-modal-footer #cpd-confirm:hover {
	box-shadow: 0 4px 14px rgba(59, 130, 246, 0.4);
	transform: translateY(-1px);
}

body.cpd-modal-open {
	overflow: hidden;
}

/* 购物车预览图 */
.cpd-cart-preview {
	max-width: 120px;
	height: auto;
	display: block;
}

/* 响应式 */
@media (max-width: 782px) {
	.cpd-modal-body {
		flex-direction: column;
	}

	.cpd-designer-side {
		width: 100%;
	}

	.cpd-modal-dialog {
		max-width: 100%;
		width: 100%;
		height: 100vh;
		margin: 0;
		border-radius: 0;
		max-height: none;
	}
}
