/* ==========================================================================
   Toast + confirm dialog — the single feedback system for frontend, shop,
   account and backend. Loaded by index.php, backend.php and preview.php.
   Markup is created by assets/js/toast.js; do not hand-write it.
   ========================================================================== */

.vp-toast-layer {
	position: fixed;
	bottom: 30px;
	left: 50%;
	transform: translateX(-50%);
	display: flex;
	flex-direction: column-reverse;
	align-items: center;
	gap: 10px;
	/* Above the fixed header (9999) and the floating mobile menu (10000/10001) */
	z-index: 10070;
	pointer-events: none;
	width: max-content;
	max-width: min(90vw, 560px);
}

.vp-toast {
	display: flex;
	align-items: center;
	gap: 16px;
	background: #000;
	color: #fff;
	padding: 14px 28px;
	border-radius: 30px;
	font-size: 0.95rem;
	font-weight: 700;
	line-height: 1.35;
	text-align: center;
	box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
	opacity: 0;
	transform: translateY(20px);
	transition: opacity .35s cubic-bezier(0.22, 1, 0.36, 1),
	            transform .35s cubic-bezier(0.22, 1, 0.36, 1);
	pointer-events: none;
}
.vp-toast.is-visible {
	opacity: 1;
	transform: translateY(0);
}

/* Types. Neutral (default) stays black, matching the site's button language. */
.vp-toast-success { background: #16a34a; }
.vp-toast-error   { background: #ef4444; }
.vp-toast-warn    { background: #f59e0b; color: #1f1300; }

/* Toast carrying an action (e.g. "Rückgängig") must be clickable */
.vp-toast-action { pointer-events: auto; padding: 12px 20px; }
.vp-toast-action-btn {
	background: none;
	border: 1px solid rgba(255, 255, 255, 0.45);
	color: inherit;
	padding: 4px 14px;
	border-radius: 20px;
	font-size: 0.82rem;
	font-weight: 700;
	font-family: inherit;
	cursor: pointer;
	transition: .2s;
	white-space: nowrap;
}
.vp-toast-action-btn:hover {
	background: #fff;
	color: #000;
	border-color: #fff;
}
.vp-toast-action-btn:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

/* --- Confirm dialog --- */

.vp-dialog-backdrop {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.5);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	z-index: 10080;
	opacity: 0;
	transition: opacity .2s ease;
}
.vp-dialog-backdrop.is-visible { opacity: 1; }

.vp-dialog {
	background: #fff;
	color: #111827;
	border-radius: 20px;
	padding: 28px;
	width: 100%;
	max-width: 440px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
	transform: translateY(12px) scale(0.98);
	transition: transform .2s ease;
}
.vp-dialog-backdrop.is-visible .vp-dialog { transform: none; }

.vp-dialog-title {
	margin: 0 0 10px;
	font-size: 1.05rem;
	font-weight: 700;
}
.vp-dialog-title-note {
	display: block;
	margin-top: 2px;
	font-weight: 400;
	font-size: 0.8rem;
	color: #6b7280;
}
.vp-dialog-text {
	margin: 0 0 22px;
	font-size: 0.95rem;
	line-height: 1.5;
	white-space: pre-line;
	color: #374151;
}
.vp-dialog-actions {
	display: flex;
	justify-content: flex-end;
	gap: 10px;
	flex-wrap: wrap;
}

/* Prompt variant */
.vp-dialog-input {
	width: 100%;
	padding: 10px 12px;
	margin: 0 0 22px;
	border: 1px solid #e5e7eb;
	border-radius: 10px;
	font-family: inherit;
	font-size: 0.95rem;
	box-sizing: border-box;
}
.vp-dialog-input.has-hint { margin-bottom: 6px; }
.vp-dialog-hint {
	margin: 0 0 22px;
	font-size: 0.8rem;
	line-height: 1.4;
	color: #6b7280;
}
.vp-dialog-warn {
	margin: 0 0 6px;
	min-height: 1.1rem;
	font-size: 0.78rem;
	line-height: 1.4;
	font-weight: 500;
	color: #b45309;
}
.vp-dialog-warn.is-last { margin-bottom: 16px; }
.vp-dialog-warn.is-info { color: #4b5563; }
.vp-dialog-warn.is-error { color: #b91c1c; }

/* Suggestions under a prompt input */
.vp-dialog-chips-label {
	margin: 4px 0 6px;
	font-size: 0.78rem;
	color: #6b7280;
}
.vp-dialog-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 0 0 10px;
	max-height: 132px;
	overflow-y: auto;
}
.vp-dialog-chip {
	padding: 5px 12px;
	border: 1px solid #d1d5db;
	border-radius: 20px;
	background: #fff;
	color: #111827;
	font-family: inherit;
	font-size: 0.85rem;
	cursor: pointer;
	transition: .15s;
}
.vp-dialog-chip:hover:not(:disabled) { border-color: #111827; }
.vp-dialog-chip.is-selected { background: #111827; border-color: #111827; color: #fff; }
.vp-dialog-chip:disabled { opacity: .4; cursor: not-allowed; text-decoration: line-through; }
.vp-dialog-chip:focus-visible {
	outline: 2px solid var(--btn-focus, #4f46e5);
	outline-offset: 1px;
}
.vp-dialog-input:focus-visible {
	outline: 2px solid var(--btn-focus, #4f46e5);
	outline-offset: 1px;
}

body.vp-dialog-open { overflow: hidden; }

@media (max-width: 560px) {
	.vp-dialog-actions { flex-direction: column-reverse; }
	.vp-dialog-actions .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
	.vp-toast, .vp-dialog, .vp-dialog-backdrop { transition: none; }
}
