/* URBAN LEAF Personalisierung — trigger, confirmation card & editor modal.
   The editor itself brings its own URBAN-LEAF look; this frames the entry point
   on the PDP and the modal shell around the iframe. */

.ulp-wrap {
	margin: 0 0 1.25rem;
}

/* ---- trigger (CTA) ------------------------------------------------------- */
.ulp-open {
	display: flex;
	align-items: center;
	gap: 0.85rem;
	width: 100%;
	padding: 0.9rem 1.1rem;
	border: 1px solid #1a1a1a;
	border-radius: 12px;
	background: #111;
	color: #fff;
	cursor: pointer;
	text-align: left;
	transition: background 140ms ease, transform 140ms ease;
}

.ulp-open:hover {
	background: #000;
	transform: translateY(-1px);
}

.ulp-open-ic {
	font-size: 1.1rem;
	line-height: 1;
	color: #d9b87a;
}

.ulp-open-tx {
	display: flex;
	flex-direction: column;
	gap: 2px;
	flex: 1 1 auto;
}

.ulp-open-h {
	font-weight: 700;
	font-size: 0.98rem;
	letter-spacing: 0.01em;
}

.ulp-open-s {
	font-size: 0.8rem;
	opacity: 0.75;
	font-weight: 400;
}

.ulp-open-arr {
	font-size: 1.05rem;
	opacity: 0.8;
}

/* ---- confirmation card --------------------------------------------------- */
.ulp-card {
	display: flex;
	gap: 0.9rem;
	align-items: center;
	padding: 0.85rem;
	border: 1px solid #e3e0da;
	border-radius: 12px;
	background: #faf9f6;
}

/* The display rules above out-rank the UA [hidden] style (display:none), so the
   card/CTA would stay visible even when the markup or JS sets `hidden` — which
   showed the card on every load and left CTA + card stacked after "Entfernen".
   Restore [hidden] meaning explicitly. */
.ulp-card[hidden],
.ulp-cta[hidden] {
	display: none !important;
}

.ulp-card-thumb {
	width: 64px;
	height: 64px;
	flex: 0 0 64px;
	border-radius: 8px;
	object-fit: cover;
	background: #fff;
	border: 1px solid #eceae4;
}

.ulp-card-body {
	display: flex;
	flex-direction: column;
	gap: 3px;
	min-width: 0;
}

.ulp-card-title {
	font-size: 0.9rem;
	font-weight: 700;
}

.ulp-card-summary {
	font-size: 0.82rem;
	color: #555;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* Per-option surcharge line under the summary ("2 × 4,99 € Optionen = + 9,98 €"). */
.ulp-card-price {
	white-space: normal;
	overflow-wrap: anywhere;
	font-size: 0.82rem;
	font-weight: 600;
	color: #1a1a1a;
}

.ulp-card-actions {
	display: flex;
	gap: 0.75rem;
	margin-top: 4px;
}

.ulp-edit,
.ulp-remove {
	background: none;
	border: 0;
	padding: 0;
	font-size: 0.8rem;
	font-weight: 600;
	cursor: pointer;
	text-decoration: underline;
}

.ulp-edit {
	color: #111;
}

.ulp-remove {
	color: #b3261e;
}

.ulp-error {
	margin: 0.5rem 0 0;
	color: #b3261e;
	font-size: 0.9em;
	font-weight: 600;
}

/* ---- modal ---------------------------------------------------------------
   The dialog is a responsive box; the iframe FILLS it and the editor scrolls
   internally (no content-driven height). Mobile = full screen, desktop = large
   centred panel for the Welanda-style two-column editor. */
.ulp-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
}

.ulp-modal[hidden] {
	display: none;
}

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

/* Stacked backdrop-filters over a cross-origin iframe sporadically drop
   frames in WebKit/Chromium — you'd briefly see the page behind the modal. */
.ulp-modal-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(10, 10, 10, 0.62);
}

.ulp-modal-dialog {
	position: relative;
	z-index: 1;
	/* mobile: full-screen sheet */
	width: 100vw;
	height: 100dvh;
	max-height: 100dvh;
	display: flex;
	flex-direction: column;
	background: #fff;
	border-radius: 0;
	box-shadow: 0 24px 70px rgba(0, 0, 0, 0.4);
	overflow: hidden;
}

.ulp-modal-close {
	position: absolute;
	top: 8px;
	right: 10px;
	z-index: 2;
	width: 36px;
	height: 36px;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.9);
	color: #111;
	font-size: 1.5rem;
	line-height: 1;
	cursor: pointer;
	box-shadow: 0 1px 6px rgba(0, 0, 0, 0.18);
}

.ulp-modal-close:hover {
	background: #fff;
}

/* iOS-Safari-Falle: ein iframe mit height:100% im Flex-Kontext wird von
   WebKit auf seine CONTENT-Hoehe aufgeblasen — der interne Editor-Scroll und
   die Uebernehmen-Leiste rutschen unerreichbar unter den Viewport. Absolut
   positioniert in einem relativen Rahmen behaelt das iframe seine Box. */
.ulp-modal-frame {
	position: relative;
	flex: 1 1 auto;
	min-height: 0;
	overflow: hidden;
}

.ulp-iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
	display: block;
	min-height: 0;
	/* opaque fill catches repaint gaps of the editor app — no more flash-through */
	background: #fff;
}

/* Loading indicator: covers the blank iframe until the editor signals READY.
   z-index:1 keeps it above the iframe but below the close button (z-index:2). */
.ulp-loader {
	position: absolute;
	inset: 0;
	z-index: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 16px;
	background: #fff;
	color: #6b6459;
	font: 600 13px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	letter-spacing: .02em;
	transition: opacity .35s ease, visibility .35s ease;
}

.ulp-loader.is-hidden {
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
}

.ulp-spinner {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	border: 3px solid rgba(20, 18, 14, .12);
	border-top-color: #d9b87a;
	animation: ulp-spin .8s linear infinite;
}

.ulp-loader-text {
	opacity: .85;
}

@keyframes ulp-spin {
	to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
	.ulp-spinner { animation-duration: 1.8s; }
}

/* desktop: large centred panel with rounded corners */
@media (min-width: 768px) {
	.ulp-modal {
		padding: 2vh 2vw;
	}
	.ulp-modal-dialog {
		width: min(1080px, 95vw);
		height: min(760px, 92vh);
		max-height: 92vh;
		border-radius: 16px;
	}
}

/* ---- admin order preview ------------------------------------------------- */
.ulp-admin-preview img {
	max-width: 96px;
	height: auto;
}
