/* ============================================
   DRUCKVORLAGEN-KONFIGURATOR
   Wird sowohl im Kunden-Dashboard als auch im Admin-Portal verwendet.
   Eine Quelle, kein Drift.
   ============================================ */
.print-config-wrap {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 24px;
  align-items: start;
}
@media (max-width: 900px) {
  .print-config-wrap { grid-template-columns: 1fr; }
}
.print-config-panel { position: sticky; top: 20px; }
.print-format-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.print-format-btn {
  background: #fff;
  border: 2px solid var(--border, #e0e0e0);
  border-radius: 8px;
  padding: 10px 6px;
  cursor: pointer;
  text-align: center;
  font-size: 0.85rem;
  transition: all 0.15s;
  color: inherit;
}
.print-format-btn:hover { border-color: var(--primary, #b8860b); }
.print-format-btn.active {
  border-color: var(--primary, #b8860b);
  background: #fff8e6;
}
.print-preview-wrap {
  background: #e8e8e8;
  border-radius: 12px;
  padding: 32px 20px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 600px;
}
.print-preview-scale {
  transform-origin: top center;
  transition: transform 0.2s ease;
}
/* Druck-Vorschau (Bildschirm-Ansicht) */
.print-preview {
  background: #fdf8ee;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
  overflow: hidden;
  position: relative;
  box-sizing: border-box;
}
/* Format-Größen (Bildschirm zeigt verkleinert via transform:scale) */
.print-preview.format-a4 { width: 210mm; height: 297mm; padding: 20mm; }
.print-preview.format-postcard { width: 148mm; height: 105mm; padding: 8mm; }
.print-preview.format-business { width: 85mm; height: 55mm; padding: 4mm; }

/* Innen-Layout */
.pp-inner { display: flex; flex-direction: column; height: 100%; gap: 4mm; }
.pp-headline { font-weight: 800; text-align: center; line-height: 1.1; }
.pp-subtitle { text-align: center; line-height: 1.4; }
.pp-cta { text-align: center; font-weight: 700; }
.pp-qr-wrap { text-align: center; flex: 1; display: flex; align-items: center; justify-content: center; }
.pp-qr-wrap img { display: block; max-width: 100%; height: auto; background: #fff; padding: 3mm; border-radius: 4mm; }
.pp-footer { text-align: center; opacity: 0.85; }
.pp-image { display: block; margin: 0 auto; border-radius: 3mm; max-height: 35%; object-fit: cover; }
.pp-divider { height: 1px; background: currentColor; opacity: 0.25; margin: 2mm 0; }

/* Stil-Varianten */
.print-preview.style-elegant .pp-headline { font-family: 'Playfair Display', Georgia, serif; font-style: italic; }
.print-preview.style-elegant .pp-subtitle { font-family: 'Inter', sans-serif; font-style: italic; }
.print-preview.style-modern .pp-headline { font-family: 'Inter', sans-serif; letter-spacing: -0.02em; }
.print-preview.style-modern .pp-subtitle { font-family: 'Inter', sans-serif; }
.print-preview.style-playful .pp-headline { font-family: 'Dancing Script', 'Playfair Display', cursive; }
.print-preview.style-playful .pp-subtitle { font-family: 'Inter', sans-serif; }
.print-preview.style-bold .pp-headline { font-family: 'Inter', sans-serif; font-weight: 900; text-transform: uppercase; letter-spacing: 0.04em; }
.print-preview.style-bold .pp-subtitle { font-family: 'Inter', sans-serif; }

/* Format-spezifische Typo */
.print-preview.format-a4 .pp-headline { font-size: 14mm; }
.print-preview.format-a4 .pp-subtitle { font-size: 5mm; max-width: 140mm; margin: 0 auto; }
.print-preview.format-a4 .pp-cta { font-size: 5.5mm; margin-bottom: 2mm; }
.print-preview.format-a4 .pp-footer { font-size: 4mm; }

.print-preview.format-postcard .pp-headline { font-size: 8mm; }
.print-preview.format-postcard .pp-subtitle { font-size: 3mm; max-width: 95mm; margin: 0 auto; }
.print-preview.format-postcard .pp-cta { font-size: 3.5mm; margin-bottom: 1mm; }
.print-preview.format-postcard .pp-footer { font-size: 2.8mm; }
.print-preview.format-postcard .pp-image { max-height: 20mm; }

.print-preview.format-business .pp-headline { font-size: 4.5mm; }
.print-preview.format-business .pp-subtitle { font-size: 2.2mm; }
.print-preview.format-business .pp-cta { font-size: 2.5mm; }
.print-preview.format-business .pp-footer { font-size: 2.2mm; }
.print-preview.format-business .pp-image { display: none; }

/* Cliparts/Deko-Layer auf der Vorlage */
.pp-decorations {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.pp-deco {
  position: absolute;
  line-height: 0;
  pointer-events: auto;        /* Cliparts sind klick-/drag-bar … */
  cursor: grab;
  user-select: none;
}
.pp-deco:active { cursor: grabbing; }
.pp-deco svg { display: block; width: 100%; height: auto; pointer-events: none; }
.pp-inner { position: relative; z-index: 1; pointer-events: none; }
.pp-inner * { pointer-events: auto; }

/* Ausgewähltes Clipart: gestrichelte Markierung + Handles */
.pp-deco--selected {
  outline: 2px dashed #1d4ed8;
  outline-offset: 2px;
}
.pp-deco-handle {
  position: absolute;
  background: #1d4ed8;
  color: #fff;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
  z-index: 5;
}
.pp-deco-handle--resize {
  right: -7px;
  bottom: -7px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  cursor: nwse-resize;
}
.pp-deco-handle--del {
  right: -7px;
  top: -7px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #dc2626;
  font-size: 13px;
  font-weight: 700;
  line-height: 14px;
  text-align: center;
  cursor: pointer;
  font-family: 'Helvetica', sans-serif;
}

/* Clipart-Auswahlraster im Konfigurator-Panel */
.pc-clipart-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}
.pc-clipart-btn {
  background: #fff;
  border: 2px solid var(--border, #e0e0e0);
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
  text-align: left;
  font-size: 0.85rem;
  transition: all 0.15s;
  color: inherit;
}
.pc-clipart-btn:hover { border-color: var(--primary, #b8860b); }
.pc-clipart-btn.pc-clipart--on {
  border-color: var(--primary, #b8860b);
  background: #fff8e6;
  font-weight: 600;
}

/* Der Druck läuft jetzt über ein verstecktes iframe (siehe print-configurator.js
   → printNow()). Damit ist garantiert: genau EINE Seite + exakt das gewählte
   Format. Die alte @media-print-Regel hier produzierte eine zweite leere Seite,
   weil visibility:hidden den Konfigurator-Inhalt zwar unsichtbar machte, sein
   Layout aber weiterhin Platz beanspruchte. */
