/* pz.css – Modul „Personalisieren“ (Produktseite). */

/* ---------------------------------------------------- Ebene über dem Foto */
.pz-stage { position: absolute; inset: 0; z-index: 4; overflow: hidden;
  background: inherit; display: flex; align-items: center; justify-content: center; }
.pz-stage[hidden] { display: none; }
/* Ab dem ersten Gestaltungsschritt bleibt das Foto im Blick (--pz-top setzt pz.js):
   Desktop senkrecht mittig neben dem Formular, Handy kleiner oben unter der Kopfzeile. */
@media (min-width: 901px) {
  .pdp-hero:has(.pz-buy) > .pdp-stage { grid-row: 1 / span 2; }
  .pdp-hero:has(.pz-buy) > .pdp-badges { grid-row: 3; }
  .pdp-stage.pz-on { position: sticky; top: var(--pz-top, 130px); align-self: start; }
}
@media (max-width: 900px) {
  /* Im Raster wäre das Foto in seiner Zeile gefangen – als Block klebt es über dem ganzen Kaufbereich */
  body.pz-aktiv .pdp-hero { display: block; }
  body.pz-aktiv { overflow-anchor: none; }   /* Größenwechsel beim Schweben: kein Scroll-Sprung */
  body.pz-aktiv .pdp-hero > * + * { margin-top: 24px; }
  .pdp-stage.pz-on { position: sticky; top: var(--pz-top, 0px); z-index: 30; }
  /* Oben (nicht schwebend): ganz normale Bildergalerie */
  .pdp-stage.pz-on:not(.pz-float) .pz-stage { display: none; }
  /* Schwebend: über die ganze Breite, oben bündig, nur unten gerundet, Foto groß */
  .pdp-stage.pz-float {
    width: 100vw; margin-left: calc(50% - 50vw); margin-right: 0;
    /* Höhe = auf die Maske zugeschnittener Fotoausschnitt (--pz-h setzt pz.js) */
    aspect-ratio: auto; height: var(--pz-h, min(100vw, 65vh));
    border-radius: 0 0 var(--radius-lg, 22px) var(--radius-lg, 22px); border-top: 0;
    box-shadow: 0 10px 28px rgba(0,0,0,.18); }
  .pdp-stage.pz-float .pdp-gal-nav, .pdp-stage.pz-float .pdp-dots { visibility: hidden; }
  .pdp-stage.pz-float .pz-photo { position: relative; display: block; overflow: hidden; }
}

/* Während des Gestaltens: ruhige Fläche, keine Einblend-Verschiebung.
   Am Desktop bleiben die Galerie-Pfeile: ein Klick zeigt wieder die Fotos. */
.pdp-stage.pz-on { background: var(--ink-1, #f6efe2); transform: none !important; opacity: 1 !important; transition: none !important; }
.pdp-stage.pz-on .pdp-gal-nav { z-index: 6; }
.pz-photo { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; }
.pz-photo img { display: block; max-width: 96%; max-height: 96%; width: auto; height: auto; object-fit: contain;
  user-select: none; -webkit-user-drag: none; pointer-events: none; }
.pz-warp { position: absolute; left: 0; top: 0; transform-origin: 0 0; pointer-events: none; }
.pz-warp svg { display: block; overflow: visible; pointer-events: auto; }

/* Gravur-Look: dunkel ins Holz „hineingedrückt“ */
.pz-ink { mix-blend-mode: multiply; opacity: .9; }
.pz-it { cursor: grab; }
.is-drag .pz-it { cursor: grabbing; }
.pz-hit { fill: transparent; }
.pz-box { fill: none; stroke: #fff; filter: drop-shadow(0 0 1px rgba(0,0,0,.6)); }
.pz-h { fill: #fff; stroke: #285c14; cursor: pointer; }
.pz-h-rot { cursor: alias; }
.pz-h-size { cursor: nwse-resize; }
/* Maske ist unsichtbar – nur beim Ziehen eine feine Andeutung */
.pz-area { fill: none; stroke: transparent; pointer-events: none; }
.is-drag .pz-area { stroke: rgba(255,255,255,.75); stroke-width: .6; stroke-dasharray: 2 2; }


/* ------------------------------------------------------- Bedienfeld */
.pz-buy { margin: 0 0 14px; padding: 14px; background: #fff; color: #241a0c;
  border: 1px solid var(--line, #d9cdb4); border-radius: 14px; }
.pz-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.pz-title { font-weight: 700; font-size: 1rem; }
.pz-extra { margin-left: auto; font-size: .82rem; color: #285c14; font-weight: 600; }
.pz-hint { font-size: .84rem; color: #6b5a3c; margin: 0 0 10px; }
.pz-hint[hidden] { display: none; }
.pz-add { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.pz-addbtn { display: inline-flex; align-items: center; padding: 8px 14px; font: inherit; font-size: .88rem; font-weight: 600;
  color: #285c14; background: #eef6e8; border: 1px solid #b9d7a6; border-radius: 999px; cursor: pointer; }
.pz-addbtn:hover { background: #e3f1d9; }
.pz-addbtn.is-off { opacity: .45; cursor: not-allowed; }

.pz-list { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.pz-list:empty { display: none; }
.pz-chip { display: inline-flex; align-items: center; border: 1px solid var(--line, #d9cdb4); border-radius: 999px; background: #fbf6ec; }
.pz-chip.is-sel { border-color: #285c14; background: #e3f1d9; }
.pz-chip button { font: inherit; font-size: .82rem; color: #3a2a14; background: none; border: 0; cursor: pointer; }
.pz-chip-n { padding: 5px 4px 5px 11px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pz-chip-x { padding: 5px 10px 5px 6px; font-size: 1rem !important; line-height: 1; color: #8a5a2c !important; }

.pz-edit { margin-bottom: 10px; display: flex; flex-direction: column; gap: 8px; }
.pz-edit[hidden] { display: none; }
.pz-rng { display: grid; grid-template-columns: 64px 1fr 56px; align-items: center; gap: 8px; font-size: .84rem; color: #3a2a14; }
.pz-rng input { width: 100%; accent-color: #285c14; }
.pz-rng output { text-align: right; font-variant-numeric: tabular-nums; color: #6b5a3c; }
.pz-tip { font-size: .78rem; color: #8a7a5c; margin: 0; }

.pz-motifs { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; margin-bottom: 10px;
  max-height: 260px; overflow: auto; padding: 2px; }
.pz-motifs[hidden] { display: none; }
.pz-mot { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 6px; font: inherit; font-size: .72rem; color: #3a2a14;
  background: #fbf6ec; border: 1px solid var(--line, #d9cdb4); border-radius: 10px; cursor: pointer; }
.pz-mot:hover { border-color: #285c14; }
.pz-mot svg { width: 56px; height: 56px; object-fit: contain; }
.pz-mot span { text-align: center; line-height: 1.2; }

.pz-dds { display: flex; flex-direction: column; gap: 10px; }
.pz-dds:empty { display: none; }
.pz-dd { display: flex; flex-direction: column; gap: 4px; font-size: .86rem; }
.pz-dd-l { font-weight: 600; }
.pz-dd select { width: 100%; padding: 8px 10px; font: inherit; color: #241a0c; background: #fff;
  border: 1px solid var(--line, #d9cdb4); border-radius: 9px; }
.pz-dd-i { color: #8a7a5c; }

.pz-msg { margin: 10px 0 0; font-size: .84rem; color: #3a2a14; }
.pz-msg.is-err { color: #a33; }
.pz-msg[hidden] { display: none; }
.pz-need { margin: 10px 0 0; font-size: .86rem; color: #a35a00; }
.pz-need[hidden] { display: none; }
.pz-buy .rtg-ack { margin: 10px 0 0; font-size: .82rem; }
.pz-buy .rtg-ack[hidden] { display: none; }
.pz-buy .rtg-ack .custom-note { margin: 0; }

@media (max-width: 780px) {
  .pz-addbtn { padding: 10px 14px; }
  .pz-rng { grid-template-columns: 56px 1fr 50px; }
}

/* ---- Abschnitte (immer offen) ---- */
.pz-sec { margin: 0 0 14px; }
.pz-sec-h { display: flex; align-items: baseline; gap: 8px; margin: 0 0 6px; font-weight: 600; font-size: .9rem; }
.pz-preis { margin-left: auto; font-weight: 600; font-size: .8rem; color: #285c14; white-space: nowrap; }
.pz-tb, .pz-ib { padding: 8px; margin: 0 0 8px; border: 1px solid transparent; border-radius: 12px; display: flex; flex-direction: column; gap: 6px; }
.pz-ib { background: #fbf6ec; border-color: var(--line, #d9cdb4); }
.pz-tb.is-sel, .pz-ib.is-sel { border-color: #285c14; background: #f3f9ee; }
.pz-tb { padding: 0; }
.pz-tb.is-sel { padding: 6px; }
.pz-tb-h { display: flex; align-items: center; gap: 8px; font-size: .84rem; font-weight: 600; }
.pz-x { margin-left: auto; font: inherit; font-size: 1.1rem; line-height: 1; padding: 2px 8px; color: #8a5a2c; background: none; border: 0; cursor: pointer; }
.pz-tb .rtg-te-feld { position: relative; }
.pz-tb.is-leer .rtg-te-feld::before { content: attr(data-ph); position: absolute; left: 10px; top: 8px; color: #a8987a; pointer-events: none; }
.pz-mot { position: relative; }
.pz-mot.is-on { border-color: #285c14; background: #e3f1d9; box-shadow: inset 0 0 0 1px #285c14; }
.pz-mot-n { font-weight: 600; }
.pz-mot-p { color: #285c14; font-weight: 600; }
.pz-motifs { max-height: none; margin: 0; }
.pz-upbtn { display: inline-flex; align-items: center; padding: 8px 14px; font-size: .88rem; font-weight: 600; color: #285c14;
  background: #eef6e8; border: 1px solid #b9d7a6; border-radius: 999px; cursor: pointer; }
.pz-uphint { display: block; margin-top: 6px; color: #8a7a5c; font-size: .76rem; }
.pz-imgs:empty { display: none; }

/* ---- Format-Kacheln (Brett-Varianten) ---- */
.pz-formats { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }
.pz-fmt { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 6px; font: inherit; font-size: .72rem; color: #3a2a14;
  background: #fbf6ec; border: 1px solid var(--line, #d9cdb4); border-radius: 10px; cursor: pointer; }
.pz-fmt:hover { border-color: #285c14; }
.pz-fmt.is-on { border-color: #285c14; background: #e3f1d9; box-shadow: inset 0 0 0 1px #285c14; }
.pz-fmt svg { width: 72px; height: 48px; }
