/* ── Open button ───────────────────────────────────────────── */
#open-banner-tool {
	width: 100%; padding: 15px;
	background: #222; color: #fff;
	border: 2px solid #444;
	text-transform: uppercase; font-weight: bold;
	cursor: pointer; margin-bottom: 20px;
	transition: .3s; border-radius: 4px; font-size: 1.1em;
}
#open-banner-tool:hover          { background: #000; }
#open-banner-tool.has-design     { background: #4CAF50; border-color: #45a049; }

/* ── Modal shell ───────────────────────────────────────────── */
#bd-modal {
	display: none; position: fixed;
	inset: 0; z-index: 999999; background: #fff;
}
.bd-modal-content { display: flex; flex-direction: column; height: 100%; width: 100%; }

/* ── Header ────────────────────────────────────────────────── */
.bd-header {
	height: 50px; background: #1a1a1a; color: #fff;
	display: flex; justify-content: space-between; align-items: center;
	padding: 0 15px; border-bottom: 1px solid #333; flex-shrink: 0;
}
.bd-header h3 { margin: 0; font-size: 1rem; color: #fff; font-weight: 500; }

/* ── Action buttons ────────────────────────────────────────── */
.bd-actions button {
	padding: 8px 15px; border-radius: 4px; border: none;
	font-weight: bold; cursor: pointer; margin-left: 10px; font-size: .85rem;
}
.btn-cancel          { background: #444; color: #fff; }
.btn-confirm         { background: #4CAF50; color: #fff; }
.btn-confirm:disabled { background: #888; cursor: not-allowed; }

/* ── Workspace ─────────────────────────────────────────────── */
.bd-workspace { flex: 1; display: flex; overflow: hidden; height: 100%; }

.bd-sidebar {
	width: 340px; background: #f9f9f9; border-right: 1px solid #ddd;
	padding: 20px; overflow-y: auto;
	display: flex; flex-direction: column; gap: 20px;
	flex-shrink: 0; z-index: 20;
}

.bd-canvas-area {
	flex: 1; position: relative;
	display: flex; align-items: center; justify-content: center;
	overflow: hidden; touch-action: none;
	background-color: #f0f0f0;
	background-image:
		linear-gradient(#e0e0e0 1px, transparent 1px),
		linear-gradient(90deg, #e0e0e0 1px, transparent 1px);
	background-size: 40px 40px;
	background-position: center;
}

/* ── Sidebar groups ────────────────────────────────────────── */
.bd-group label {
	display: block; font-weight: 800; margin-bottom: 6px;
	font-size: .8rem; text-transform: uppercase;
	color: #333; letter-spacing: .5px;
}
.bd-input,
.bd-select,
.bd-textarea {
	width: 100%; padding: 10px; border: 1px solid #ccc;
	border-radius: 4px; font-size: 1rem;
	background: #fff; box-sizing: border-box;
}
.bd-textarea { height: 70px; resize: none; font-family: sans-serif; }

/* ── Alignment buttons ─────────────────────────────────────── */
.align-controls { display: flex; gap: 5px; margin-top: 8px; }
.btn-align {
	flex: 1; padding: 10px; border: 1px solid #999;
	background: #f5f5f5; color: #000 !important;
	cursor: pointer; font-size: .85rem; font-weight: bold;
	border-radius: 4px; transition: .2s; text-transform: uppercase;
}
.btn-align:hover  { background: #e0e0e0; }
.btn-align.active { background: #222 !important; color: #fff !important; border-color: #000; }

/* ── Dimension inputs ──────────────────────────────────────── */
.bd-dimensions-row { display: flex; gap: 10px; }
.bd-dim-col        { flex: 1; }
.size-box {
	display: flex; align-items: center;
	background: #fff; border: 1px solid #ccc;
	border-radius: 4px; padding: 0 8px;
	height: 45px; width: 100%; box-sizing: border-box;
}
.size-box input {
	border: none; background: transparent;
	height: 100%; width: 100%;
	text-align: center; font-weight: bold; font-size: 1.2em;
	color: #333; outline: none; padding: 0; margin: 0;
}
.size-box span { font-size: .8em; color: #777; font-weight: 600; white-space: nowrap; margin-left: 2px; }

/* ── Font upload ───────────────────────────────────────────── */
.font-upload-btn {
	display: inline-block; width: 100%; padding: 10px;
	border: 2px dashed #999; text-align: center;
	cursor: pointer; background: #fff; color: #555;
	border-radius: 4px; font-size: .8em;
	transition: .2s; font-weight: bold;
	text-transform: uppercase; margin-top: 5px;
	box-sizing: border-box;
}
.font-upload-btn:hover { border-color: #333; color: #000; background: #eee; }
.font-upload-btn input { display: none; }

/* ── Color swatches ────────────────────────────────────────── */
.color-options { display: flex; gap: 8px; flex-wrap: wrap; }
.color-swatch {
	width: 36px; height: 36px; border-radius: 50%;
	cursor: pointer; border: 2px solid #ddd;
	box-shadow: 0 2px 4px rgba(0,0,0,.1);
	transition: transform .15s;
}
.color-swatch.active {
	border: none;
	box-shadow: 0 0 0 2px #fff, 0 0 0 4px #222;
	transform: scale(1.1);
}

/* ── Font spinner ──────────────────────────────────────────── */
#font-loader-spinner {
	display: none; font-size: .8em; color: #2271b1;
	margin-top: 5px; font-weight: bold;
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 768px) {
	.bd-workspace       { flex-direction: column-reverse; }
	.bd-canvas-area     { height: 40%; flex: none; border-bottom: 1px solid #ccc; }
	.bd-sidebar         { width: 100%; flex: 1; border-right: none; padding: 15px; }
}
