/* Polier-Beispiel Lackaufbereitung (Kundenwunsch 01.12.2026). Nur auf /lackaufbereitung/ eingebunden, Verhalten in polier.js.
   Ohne JavaScript bleibt das Kundenfoto stehen, Hinweis und Leiste sind dann aus. */

.tb-bild.polier { aspect-ratio: auto; overflow: visible; border-radius: 0; box-shadow: none; }
.polier-flaeche { position: relative; aspect-ratio: 4 / 3.4; border-radius: var(--r); overflow: hidden; background: var(--graphit); box-shadow: var(--schatten); isolation: isolate;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
.polier-flaeche img, .polier-flaeche canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.polier-flaeche img { object-fit: cover; object-position: 50% 50%; }
/* Seitlich wischen poliert, senkrecht scrollt die Seite weiter, zwei Finger zoomen */
.polier-flaeche canvas { touch-action: pan-y pinch-zoom; transition: opacity .9s ease; }
.polier.js:not(.bereit) .polier-flaeche img { opacity: 0; }
@media (hover: hover) and (pointer: fine) {
  .polier.bereit:not(.fertig) .polier-flaeche canvas { cursor: none; }
}

/* Poliermaschine als Zeiger: Scheibe mit Goldkante, Schaum dreht sich beim Polieren */
.polier-maschine { position: absolute; left: 0; top: 0; z-index: 2; width: calc(var(--r, 50px) * 3.6); aspect-ratio: 1; pointer-events: none; opacity: 0; transition: opacity .25s ease; will-change: transform; filter: drop-shadow(0 14px 16px rgba(0, 0, 0, .5)); }
.polier-maschine svg { display: block; width: 100%; height: 100%; overflow: visible; }
.polier-flaeche.zeigt .polier-maschine { opacity: 1; }
.polier-schaum { transform-box: fill-box; transform-origin: center; }
.polier-flaeche.laeuft .polier-schaum { animation: polier-dreh .45s linear infinite; }
@keyframes polier-dreh { to { transform: rotate(360deg); } }

.polier .polier-hinweis { position: absolute; left: 50%; bottom: 16px; z-index: 1; transform: translateX(-50%); margin: 0; display: inline-flex; align-items: center; gap: 9px; max-width: calc(100% - 28px);
  padding: 9px 16px; border-radius: 999px; background: rgba(7, 8, 9, .64); border: 1px solid rgba(255, 255, 255, .14); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  color: #fff; font-size: 14px; font-weight: 650; line-height: 1.3; white-space: nowrap; pointer-events: none; transition: opacity .4s ease; }
.polier-hinweis svg { width: 18px; height: 18px; flex: none; color: var(--gold); }
.polier-flaeche.benutzt .polier-hinweis, .polier.fertig .polier-hinweis { opacity: 0; }

/* Glanzlicht einmal über den fertigen Lack */
.polier-flaeche::after { content: ''; position: absolute; inset: 0; z-index: 3; pointer-events: none; background: linear-gradient(105deg, transparent 38%, rgba(255, 255, 255, .2) 50%, transparent 62%); transform: translateX(-130%); }
.polier.fertig .polier-flaeche::after { animation: polier-glanz 1.5s .45s cubic-bezier(.4, 0, .2, 1) both; }
@keyframes polier-glanz { to { transform: translateX(130%); } }
.polier.fertig .polier-flaeche canvas, .polier.fertig .polier-maschine { opacity: 0; }

/* Leiste unter dem Foto: Fortschritt und Erfolg liegen übereinander, damit nichts springt */
.polier-unten { display: grid; margin-top: 18px; }
.polier:not(.js) .polier-unten, .polier:not(.js) .polier-hinweis { display: none; }
.polier-leiste, .polier-erfolg { grid-area: 1 / 1; display: flex; align-items: center; gap: 14px 24px; transition: opacity .35s ease, visibility .35s; }
.polier-stand { flex: 1; min-width: 0; }
.polier-zahl { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 9px; font-family: var(--kopf); line-height: 1.2; }
.polier-zahl span { font-stretch: 118%; font-size: 12px; font-weight: 700; letter-spacing: .17em; text-transform: uppercase; color: var(--grau); }
.polier-zahl b { font-stretch: 110%; font-size: 20px; font-weight: 760; font-variant-numeric: tabular-nums; color: #fff; }
.polier-balken { height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .12); overflow: hidden; }
.polier-balken i { display: block; height: 100%; border-radius: inherit; background: var(--gold-verlauf); transform: scaleX(0); transform-origin: left; transition: transform .3s ease; }
.polier-erfolg { visibility: hidden; opacity: 0; }
.polier.fertig .polier-leiste { visibility: hidden; opacity: 0; }
.polier.fertig .polier-erfolg { visibility: visible; opacity: 1; transition-delay: .35s; }
.polier-erfolg > div:first-child { flex: 1; min-width: 0; }
.polier .polier-erfolg .etikett { margin: 0 0 4px; }
.polier .polier-erfolg p:not(.etikett) { margin: 0; font-size: 15.5px; line-height: 1.45; }
.polier .polier-erfolg .aktionen { margin: 0; flex-wrap: nowrap; gap: 10px; }

.ton-hell .polier-zahl span { color: var(--grau-2); }
.ton-hell .polier-zahl b { color: var(--tinte); }
.ton-hell .polier-balken { background: rgba(18, 19, 22, .12); }

@media (max-width: 560px) {
  .polier .polier-hinweis { font-size: 13px; padding: 8px 13px; gap: 7px; bottom: 12px; }
  .polier-leiste, .polier-erfolg { flex-wrap: wrap; }
  .polier-stand, .polier-erfolg > div:first-child { flex-basis: 100%; }
  .polier-leiste .knopf, .polier .polier-erfolg .aktionen { width: 100%; }
  .polier .polier-erfolg .aktionen .knopf { flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .polier-flaeche canvas { transition-duration: .2s; }
  .polier-flaeche.laeuft .polier-schaum, .polier.fertig .polier-flaeche::after { animation: none; }
}
