/* Chocolia Lid Designer – Frontend-Editor
 * Palette: #c5306e (Marke), #fff, #000, #f5f5f5
 */

.cld-editor {
	margin: 18px 0;
	padding: 18px;
	border: 1px solid #e3e3e3;
	border-radius: 0;
	background: #f5f5f5;
	--cld-pink: #c5306e;
	--cld-pink-dark: #9d2657;
	font-family: 'Quicksand', sans-serif;
	color: #000;
}
.cld-editor button,
.cld-editor input,
.cld-editor select,
.cld-editor h2,
.cld-editor h3,
.cld-editor p,
.cld-editor label { font-family: 'Quicksand', sans-serif; }

/* Tabs (CPB | CLD) – Variablen hier erneut definieren, da der Stepper
   per JS AUS .cld-editor herausgelöst wird und dessen Variablen sonst fehlen. */
.cld-tabs,
.cld-stepper {
	--cld-pink: #c5306e;
	--cld-pink-dark: #9d2657;
}
.cld-tabs { margin: 16px 0; }
.cld-tabpanes { }
.cld-tabpane { }
.cld-pane-pralinen { padding: 4px 0 0; }
/* Editor im Tab: oberen Außenabstand reduzieren */
.cld-pane-aufdruck .cld-editor { margin-top: 4px; }

/* Status-Stepper (zugleich Tab-Kopf) */
.cld-stepper {
	display: flex;
	align-items: stretch;
	gap: 0;
	margin: 16px 0 20px;
	background: #fff;
	border: 1px solid #e0e0e0;
	position: relative;
}

.cld-step.cld-step-active {
	background-color: #c5306e;
}

.cld-step { position: relative; transition: background .15s; }
.cld-step:hover { background: #ddd; }

/* Aktiver Tab: pinker Hintergrund, weiße Schrift, Dreieck nach unten */
.cld-step-active { background: var(--cld-pink); }
.cld-step-active:hover { background: var(--cld-pink); }
.cld-step.cld-step-active .cld-step-title,
.cld-step.cld-step-active .cld-step-status,
.cld-step.cld-step-active .cld-step-check { color: #fff; }
.cld-step.cld-step-active .cld-step-num {
	background: rgba(255, 255, 255, 0.2);
	color: #fff;
	border-color: #fff;
}
.cld-step-active::after {
	content: '';
	position: absolute;
	left: 50%;
	bottom: -10px;
	transform: translateX(-50%);
	width: 0;
	height: 0;
	border-left: 10px solid transparent;
	border-right: 10px solid transparent;
	border-top: 10px solid var(--cld-pink);
	z-index: 3;
}
.cld-step {
	flex: 1 1 0;
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 14px;
	background: transparent;
	border: none;
	cursor: pointer;
	text-align: left;
	font-family: 'Quicksand', sans-serif;
	color: #000;
}
.cld-step-num {
	flex: 0 0 auto;
	display: inline-flex; align-items: center; justify-content: center;
	width: 26px; height: 26px;
	background: #f5f5f5; color: #000;
	border: 1px solid #ccc; border-radius: 50%;
	font-weight: 700; font-size: 13px;
}
.cld-step-body { display: flex; flex-direction: column; line-height: 1.25; }
.cld-step-title { font-weight: 700; font-size: 14px; }
.cld-step-status { font-size: 12px; color: #666; }
.cld-step-check { margin-left: auto; color: var(--cld-pink); display: none; }
.cld-step-sep { width: 1px; background: #e0e0e0; }

.cld-step-done .cld-step-num { background: var(--cld-pink); color: #fff; border-color: var(--cld-pink); }
.cld-step-done .cld-step-status { color: var(--cld-pink); font-weight: 700; }
.cld-step-done .cld-step-check { display: inline-flex; }

@media (max-width: 480px) {
	.cld-step { padding: 8px 10px; gap: 7px; }
	.cld-step-title { font-size: 13px; }
}

.cld-editor-title {
	margin: 0 0 12px;
	padding: 0 0 10px;
	font-size: 22px;
	font-weight: 700;
	line-height: 1.2;
	color: #000;
	border-bottom: 2px solid #e0e0e0;
}

/* Tipp über dem Mockup */
.cld-tip {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	margin: 0 0 14px;
	padding: 9px 12px;
	background: #fff;
	border: 1px solid #e0e0e0;
	border-left: 3px solid var(--cld-pink);
	font-size: 13px;
	color: #000;
}
.cld-tip .cld-ic { flex: 0 0 auto; margin-top: 1px; color: var(--cld-pink); }

.cld-ic { vertical-align: middle; }

/* Buttons – Marken-Stil: pink, weiß, eckig, Sweep-Hover */
.cld-btn {
	position: relative;
	overflow: hidden;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 12px 18px;
	font-size: 14px;
	font-weight: 700;
	letter-spacing: .02em;
	line-height: 1;
	color: #fff;
	background: var(--cld-pink);
	border: none;
	border-radius: 0;
	cursor: pointer;
}
.cld-btn::before {
	content: '';
	position: absolute;
	inset: 0;
	background: var(--cld-pink-dark);
	transform: translateX(-100%);
	transition: transform .3s ease;
	z-index: 0;
}
.cld-btn:hover::before { transform: translateX(0); }
.cld-btn > * { position: relative; z-index: 1; }
.cld-btn:disabled { opacity: .5; cursor: not-allowed; }
.cld-btn:disabled::before { display: none; }
.cld-btn-danger { background: #000; }
.cld-btn-danger::before { background: #333; }

/* Add-Buttons: volle Breite, zweigeteilt */
.cld-toolbar-add { display: flex; gap: 10px; margin-bottom: 12px; }
.cld-toolbar-add .cld-btn { flex: 1 1 0; }

/* Textsteuerung */
.cld-text-controls {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 14px;
	margin-bottom: 12px;
	padding: 8px 10px;
	background: #fff;
	border: 1px solid #e0e0e0;
}
.cld-color-label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }

/* Textausrichtung */
.cld-align { display: inline-flex; border: 1px solid #ccc; border-radius: 0; overflow: hidden; }
.cld-align-btn {
	display: inline-flex; align-items: center; justify-content: center;
	width: 36px; height: 34px; padding: 0;
	background: #fff; color: #000; border: none; border-left: 1px solid #eee; cursor: pointer;
}
.cld-align-btn:first-child { border-left: none; }
.cld-align-btn:hover { background: #faf2f6; }
.cld-align-btn.cld-active { background: var(--cld-pink); color: #fff; }

/* Custom Font-Picker mit Schriftvorschau */
.cld-fontpicker { position: relative; min-width: 200px; }
.cld-fp-toggle {
	display: flex; align-items: center; justify-content: space-between; gap: 8px;
	width: 100%; padding: 8px 10px; font-size: 16px;
	background: #fff; border: 1px solid #ccc; border-radius: 0; cursor: pointer; color: #000;
}
.cld-fp-caret { color: #777; font-size: 12px; }
.cld-fp-list {
	position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px);
	margin: 0; padding: 4px; list-style: none; max-height: 260px; overflow-y: auto;
	background: #fff; border: 1px solid #ccc;
	box-shadow: 0 6px 18px rgba(0,0,0,.12);
}
.cld-fp-list li { padding: 8px 10px; font-size: 18px; cursor: pointer; color: #000; }
.cld-fp-list li:hover { background: #f5f5f5; }

/* Mockup-Stage in voller Contentbreite */
.cld-stage-wrap { width: 100%; }
.cld-stage {
	position: relative;
	display: block;
	width: 100%;
	line-height: 0;
	border: 1px solid #ddd;
	overflow: hidden;
	background: #fff repeating-linear-gradient(45deg, #f0f0f0 0 8px, #f7f7f7 8px 16px);
}
.cld-stage canvas { display: block; }
.cld-stage .canvas-container { max-width: 100%; }
.cld-stage .canvas-container,
.cld-stage .lower-canvas,
.cld-stage .upper-canvas { border-radius: 0; }

/* Overlay: Zurücksetzen (klein, oben links) */
.cld-overlay-reset {
	position: absolute; top: 8px; left: 8px; z-index: 20;
	display: inline-flex; align-items: center; justify-content: center;
	width: 32px; height: 32px; padding: 0;
	background: #fff; color: #000; border: 1px solid #ccc; border-radius: 0; cursor: pointer;
	transition: background .15s, color .15s;
}
.cld-overlay-reset:hover { background: var(--cld-pink); color: #fff; border-color: var(--cld-pink); }

/* Overlay: Motiv speichern (oben rechts) */
.cld-overlay-save {
	position: absolute; top: 8px; right: 8px; z-index: 20;
	display: inline-flex; align-items: center; gap: 7px;
	padding: 8px 12px;
	background: var(--cld-pink); color: #fff; border: none; border-radius: 0; cursor: pointer;
	font-family: 'Quicksand', sans-serif; font-weight: 700; font-size: 13px; line-height: 1;
	box-shadow: 0 2px 8px rgba(0,0,0,.18);
	overflow: hidden;
}
.cld-overlay-save::before { content: ''; position: absolute; inset: 0; background: var(--cld-pink-dark); transform: translateX(-100%); transition: transform .3s ease; z-index: 0; }
.cld-overlay-save:hover::before { transform: translateX(0); }
.cld-overlay-save > * { position: relative; z-index: 1; }

/* Gespeichert-Badge (bleibt nach Speichern, gleiche Position) */
.cld-saved-badge {
	position: absolute; top: 8px; right: 8px; z-index: 20;
	display: inline-flex; align-items: center; justify-content: center;
	width: 32px; height: 32px;
	background: var(--cld-pink); color: #fff; border-radius: 50%;
	box-shadow: 0 2px 8px rgba(0,0,0,.2);
}

/* Toast (momentane Bestätigung) */
.cld-toast {
	position: absolute; left: 50%; top: 50%; z-index: 25;
	transform: translate(-50%, -50%) scale(.9);
	display: inline-flex; align-items: center; gap: 8px;
	padding: 12px 18px; font-size: 15px; font-weight: 700; line-height: 1;
	color: #fff; background: var(--cld-pink);
	box-shadow: 0 6px 22px rgba(0,0,0,.25);
	opacity: 0; transition: opacity .2s, transform .2s;
}
.cld-toast.cld-toast-in { opacity: 1; transform: translate(-50%, -50%) scale(1); }

/* Auflösungs-Ampel – als gut sichtbarer Chip */
.cld-resolution {
	display: inline-flex; align-items: center; gap: 9px;
	margin: 14px 0 8px; padding: 8px 14px;
	font-size: 14px; font-weight: 600; color: #000;
	background: #fff; border: 1px solid #e0e0e0; border-radius: 999px;
}
.cld-amp { width: 16px; height: 16px; border-radius: 50%; background: #bbb; flex: 0 0 auto; box-shadow: inset 0 0 0 1px rgba(0,0,0,.15); }

/* Speichern-Status unter dem Mockup */
.cld-savestate {
	margin: 4px 0 10px; padding: 8px 12px;
	font-size: 13px; font-weight: 600; border-radius: 4px;
}
.cld-ss-ok   { background: #edf7ed; color: #14622f; border: 1px solid #1a9d4b; }
.cld-ss-warn { background: #fff7e6; color: #7a5300; border: 1px solid #e2b203; }
.cld-ss-bad  { background: #fcebea; color: #8a1f20; border: 1px solid #d63638; }

/* Deaktivierter Save-Overlay-Button */
.cld-overlay-save.cld-disabled,
.cld-overlay-save:disabled {
	background: #b8b8b8; cursor: not-allowed; box-shadow: none;
}
.cld-overlay-save.cld-disabled::before,
.cld-overlay-save:disabled::before { display: none; }
.cld-amp-idle   { background: #bbb; }
.cld-amp-green  { background: #1a9d4b; }
.cld-amp-yellow { background: #e2b203; }
.cld-amp-red    { background: #d63638; }

/* Dezenter Hinweis-Chip unter dem Warenkorb-Button (außerhalb von .cld-editor → literale Farben) */
.cld-cart-hint {
	display: flex;
	align-items: center;
	gap: 8px;
	flex: 0 0 100%;
	width: 100%;
	box-sizing: border-box;
	margin: 10px 0 0;
	padding: 9px 12px;
	font-size: 13px;
	line-height: 1.4;
	color: #7a5300;
	background: #fff7e6;
	border: 1px solid #f0d9a6;
	border-radius: 8px;
}
.cld-cart-hint-ic { display: inline-flex; flex: 0 0 auto; color: #e2b203; }
.cld-cart-hint .cld-cart-hint-lead { color: #6b6b6b; font-weight: 600; }
.cld-cart-hint a { color: #c5306e; text-decoration: underline; cursor: pointer; font-weight: 600; }
.cld-cart-hint a:hover { color: #9d2657; }

/* Modals */
.cld-modal { position: fixed; inset: 0; z-index: 100000; display: flex; align-items: center; justify-content: center; }
.cld-modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.55); }
.cld-modal-dialog {
	position: relative; z-index: 1; width: min(520px, 92vw);
	max-height: 88vh; overflow-y: auto;
	background: #fff; border-radius: 0; padding: 22px;
	box-shadow: 0 16px 48px rgba(0,0,0,.3);
	font-family: 'Quicksand', sans-serif; color: #000;
}
.cld-modal-title { margin: 0 0 14px; font-size: 18px; font-weight: 700; color: #000; }
.cld-modal-actions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }

.cld-rights { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; line-height: 1.45; color: #000; }
.cld-rights input { margin-top: 3px; flex: 0 0 auto; }
.cld-rights.cld-error { color: var(--cld-pink); }
.cld-rights.cld-error input { outline: 2px solid var(--cld-pink); }

@media (max-width: 600px) {
	.cld-toolbar-add { flex-direction: column; }
	.cld-fontpicker { min-width: 160px; }
	.cld-overlay-save-label { display: none; }
}
