/* »twister« – eigene Teile der Produktseite (twister.js), nur unter .p3--tw / .p3-tw-…; Grundlage bleibt produkt3d.css.
   Sichtfenster mit dem Weg eines Artikels (5 Schritte), Ausführungen (Umschalter + Zählwerk), Kacheln mit kleinen Bewegtbildern,
   Reihenschaltung mit Schildern über den Geräten. */

/* ---------------------------------------------------------------- Sichtfenster */
.p3-tw-hero { height: 780vh; }
.p3-tw-sym { position: absolute; left: 50%; top: 56%; width: min(92vh, 980px, 130vw); height: auto; z-index: 0; pointer-events: none;
  transform: translate(-50%, -50%) rotate(var(--r, 0deg)); fill: none; stroke: #e4e4e8; stroke-width: .55; stroke-linecap: round; }
.p3-tw-path { position: absolute; z-index: 2; left: var(--gutter); top: calc(var(--p3-top) + 5vh); width: min(390px, 31vw);
  opacity: 0; transform: translateY(18px); transition: opacity .5s, transform .9s var(--ease-out); pointer-events: none; }
.p3-tw-path.is-on { opacity: 1; transform: none; }
.p3-tw-path__h { font-size: clamp(1.9rem, 1.1rem + 2.2vw, 3.2rem); font-weight: 500; letter-spacing: -.035em; line-height: 1.02; margin: .35em 0 1.1em !important; }
.p3-tw-path__h em { font-style: normal; color: var(--p3-em); }
.p3-tw-steps { display: grid; gap: .25rem; counter-reset: s; }
.p3-tw-steps li { position: relative; display: grid; grid-template-columns: 2.2rem 1fr; gap: .2rem .6rem; padding: .7rem 0 .8rem; border-top: 1px solid var(--p3-line); color: #a6a8ac; transition: color .4s; }
.p3-tw-steps li i { font-style: normal; font-size: .78rem; font-weight: 500; font-variant-numeric: tabular-nums; padding-top: .3rem; }
.p3-tw-steps li b { display: block; font-size: clamp(1.05rem, .9rem + .45vw, 1.3rem); letter-spacing: -.01em; color: inherit; }
.p3-tw-steps li span { display: block; max-height: 0; overflow: hidden; opacity: 0; font-size: .92rem; line-height: 1.45; color: var(--p3-muted); transition: max-height .6s var(--ease-out), opacity .4s, margin .4s; }
.p3-tw-steps li::after { content: ""; position: absolute; left: 0; right: 0; top: -1px; height: 2px; background: var(--yellow); transform: scaleX(var(--f, 0)); transform-origin: 0 50%; opacity: 0; }
.p3-tw-steps li.is-on { color: #000; }
.p3-tw-steps li.is-on::after { opacity: 1; }
.p3-tw-steps li.is-on span { max-height: 9em; opacity: 1; margin-top: .35rem; }
.p3-tw-steps li.is-done { color: #5d6064; }
.p3-tw-steps li.is-done i::before { content: "✓ "; color: #000; }
.p3-tw-note { display: block; margin-top: 1rem; font-size: .75rem; color: var(--p3-muted); }
.p3-tw-hero .scroll-cue { border-color: rgba(0, 0, 0, .28); z-index: 2; transition: opacity .4s; }
.p3-tw-hero.is-moved .scroll-cue { opacity: 0; }

/* ---------------------------------------------------------------- Ausführungen */
.p3-tw-ver { height: 400vh; background: var(--p3-card); }
.p3-tw-ver__ui { position: absolute; z-index: 2; right: calc(var(--gutter) + 52px); top: calc(var(--p3-top) + 6vh); width: min(420px, 34vw); }
.p3-tw-ver__ui .p3-h2 { margin-bottom: 1.4rem !important; }
.p3-tw-seg { position: relative; display: inline-grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: 999px; background: #e6e7ea; }
.p3-tw-seg button { position: relative; z-index: 1; padding: .6rem 1.2rem; border-radius: 999px; font-weight: 500; font-size: .95rem; color: var(--p3-muted); transition: color .3s; white-space: nowrap; }
.p3-tw-seg button[aria-selected="true"] { color: #000; }
.p3-tw-seg i { position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px); border-radius: 999px; background: #fff; box-shadow: 0 6px 18px -8px rgba(0, 0, 0, .35); transition: transform .55s var(--ease-out); }
.p3-tw-ver.is-v2 .p3-tw-seg i { transform: translateX(100%); }
.p3-tw-cnt { display: flex; gap: 2.2rem; margin: 1.6rem 0 1.2rem; }
.p3-tw-cnt b { display: block; font-size: clamp(3rem, 1.8rem + 3.6vw, 5.4rem); font-weight: 500; letter-spacing: -.05em; line-height: .9; font-variant-numeric: tabular-nums; }
.p3-tw-cnt small { display: block; margin-top: .35rem; font-size: .85rem; color: var(--p3-muted); font-weight: 500; }
.p3-tw-vlist { display: grid; gap: .5rem; }
.p3-tw-vlist li { padding: .7rem .9rem; border-radius: 14px; box-shadow: inset 0 0 0 1px var(--p3-line); color: #a6a8ac; transition: color .35s, background .35s, box-shadow .35s; }
.p3-tw-vlist li.is-on { color: #000; background: #fff; box-shadow: inset 0 0 0 1.5px #000; }
.p3-tw-vlist b { font-weight: 500; } .p3-tw-vlist span { font-size: .9rem; }
.p3-tw-vlist small { display: block; margin-top: .2rem; font-size: .85rem; line-height: 1.4; color: inherit; opacity: .85; }
.p3-tw-vnote { margin-top: 1rem !important; font-size: .82rem; line-height: 1.45; color: var(--p3-muted); }
.p3-tw-ver .p3-more { margin-top: 1.1rem; }
.p3-tw-ver__photo { display: none; }

/* ---------------------------------------------------------------- Details: Kacheln */
.p3-bento--tw .p3-t--goods, .p3-bento--tw .p3-t--win, .p3-bento--tw .p3-t--wide { grid-column: span 2; }
.p3-bento--tw .p3-t--tl { grid-column: auto; }
.p3-tw-pic { position: relative; height: 104px; margin: .5rem 0 .2rem; border-radius: 10px; background: #33363a; overflow: hidden; }
.p3-tw-pic::after { content: ""; position: absolute; left: 6px; right: 6px; bottom: 8px; height: 5px; border-radius: 3px; background: #d3d5d4; }   /* Fachboden */
/* Trennleisten: verschieben sich zwischen zwei Einteilungen */
.p3-tw-pic--split i { position: absolute; inset: 0 6px; transform: translateX(var(--a)); }
.p3-tw-pic--split i::before { content: ""; position: absolute; left: 0; top: 16px; bottom: 13px; width: 3px; margin-left: -1.5px; border-radius: 2px; background: #d3d5d4; }
.p3-tw-pic.is-vis.p3-tw-pic--split i { animation: p3tw-split 5s var(--ease-in-out) infinite; }
@keyframes p3tw-split { 0%, 30% { transform: translateX(var(--a)); } 45%, 80% { transform: translateX(var(--b)); } 95%, 100% { transform: translateX(var(--a)); } }
/* Führungsschienen: fahren von den Seitenwänden ein, das Fach wird schmal für Kleinstteile */
.p3-tw-pic--rails i { position: absolute; top: 18px; bottom: 13px; width: 30%; background: repeating-linear-gradient(90deg, #8f9599 0 2px, transparent 2px 9px); }
.p3-tw-pic--rails i:first-child { left: 6px; transform-origin: 0 50%; } .p3-tw-pic--rails i:nth-child(2) { right: 6px; transform-origin: 100% 50%; }
.p3-tw-pic--rails em { position: absolute; left: 50%; bottom: 13px; width: 16px; height: 22px; margin-left: -8px; border-radius: 2px; background: var(--yellow); }
.p3-tw-pic--rails i { transform: scaleX(.15); }
.p3-tw-pic.is-vis.p3-tw-pic--rails i { animation: p3tw-rails 5s var(--ease-in-out) infinite; }
@keyframes p3tw-rails { 0%, 25% { transform: scaleX(.15); } 45%, 80% { transform: scaleX(1); } 95%, 100% { transform: scaleX(.15); } }
/* Motoren: einer fällt heraus, zwei Reihen werden ein breites Fach */
.p3-tw-pic--motors i { position: absolute; bottom: 14px; width: 18%; height: 12px; border-radius: 2px; background: #18191b; box-shadow: inset 0 0 0 1px #55595d; }
.p3-tw-pic--motors i:nth-child(1) { left: 5%; } .p3-tw-pic--motors i:nth-child(2) { left: 29%; } .p3-tw-pic--motors i:nth-child(3) { left: 53%; } .p3-tw-pic--motors i:nth-child(4) { left: 77%; }
.p3-tw-pic--motors u { position: absolute; top: 16px; bottom: 13px; width: 3px; border-radius: 2px; background: #d3d5d4; }
.p3-tw-pic--motors u:nth-of-type(1) { left: 50%; } .p3-tw-pic--motors u:nth-of-type(2) { left: 74.5%; }
.p3-tw-pic.is-vis.p3-tw-pic--motors i:nth-child(3), .p3-tw-pic.is-vis.p3-tw-pic--motors u:nth-of-type(2) { animation: p3tw-out 5s var(--ease-in-out) infinite; }
@keyframes p3tw-out { 0%, 25% { transform: none; opacity: 1; } 45%, 80% { transform: translateY(46px); opacity: 0; } 95%, 100% { transform: none; opacity: 1; } }
/* Reihenhöhe: der Boden darüber geht hoch, eine hohe Packung (z. B. Schutzhandschuhe) passt hinein */
.p3-tw-pic--height i { position: absolute; left: 6px; right: 6px; top: 44px; height: 5px; border-radius: 3px; background: #d3d5d4; }
.p3-tw-pic--height em { position: absolute; left: 36%; width: 28%; bottom: 13px; height: 30px; border-radius: 2px; background: #f1f1ee; transform-origin: 50% 100%; }
.p3-tw-pic--height s { position: absolute; left: 6px; right: 6px; top: 10px; height: 1px; background: rgba(255, 255, 255, .18); }
.p3-tw-pic.is-vis.p3-tw-pic--height i { animation: p3tw-up 5s var(--ease-in-out) infinite; }
.p3-tw-pic.is-vis.p3-tw-pic--height em { animation: p3tw-grow 5s var(--ease-in-out) infinite; }
@keyframes p3tw-up { 0%, 25% { transform: none; } 45%, 80% { transform: translateY(-30px); } 95%, 100% { transform: none; } }
@keyframes p3tw-grow { 0%, 30% { transform: scaleY(1); } 50%, 80% { transform: scaleY(2.15); } 95%, 100% { transform: scaleY(1); } }
.p3-tw-win { width: 64px; height: 104px; margin: .4rem 0 .2rem; padding: 6px; border-radius: 6px; background: #33363a; }
.p3-tw-win i { display: block; height: 70%; border-radius: 3px; background: linear-gradient(160deg, rgba(255, 255, 255, .55), rgba(255, 255, 255, .12) 45%, rgba(255, 255, 255, .3)); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25); }
@media (max-width: 1000px) { .p3-bento--tw .p3-t--goods, .p3-bento--tw .p3-t--win, .p3-bento--tw .p3-t--wide { grid-column: span 2; } }
@media (max-width: 640px) { .p3-bento--tw .p3-t--goods, .p3-bento--tw .p3-t--win, .p3-bento--tw .p3-t--wide { grid-column: auto; } }

/* ---------------------------------------------------------------- Reihenschaltung */
.p3-tw-chain { height: 320vh; background: #fff; }
.p3-tw-chain__t { position: absolute; z-index: 2; left: 50%; top: calc(var(--p3-top) + 4vh); transform: translateX(-50%); width: min(760px, calc(100vw - 2 * var(--gutter))); text-align: center; }
.p3-tw-chain__t p { margin: 1rem auto 0 !important; max-width: 34em; color: var(--p3-muted); font-size: clamp(1rem, .9rem + .35vw, 1.2rem); line-height: 1.5; }
.p3-tw-tags { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.p3-tw-tags span { position: absolute; left: 0; top: 0; padding: .35rem .75rem; border-radius: 999px; background: #000; color: #fff; font-size: .78rem; font-weight: 500; letter-spacing: .02em; opacity: 0; white-space: nowrap; }
.p3-tw-tags span:first-child { background: var(--yellow); color: #000; }
.p3-tw-chain__photo { display: none; }

/* ---------------------------------------------------------------- schmale Bildschirme */
@media (max-width: 900px) {
  /* unten als Blatt über der Bühne (Nahaufnahmen reichen bis hierher): die Schrift liegt nie auf dem Gerät */
  .p3-tw-path { left: 0; right: 0; top: auto; bottom: 0; width: auto; padding: 1.1rem 5.25rem 1.4rem var(--gutter); background: linear-gradient(rgba(255, 255, 255, 0), #fff 1.1rem); }
  .p3-tw-path__h, .p3-tw-note { display: none; }
  .p3-tw-steps li { display: none; border-top: 0; padding: .4rem 0 0; }
  .p3-tw-steps li.is-on { display: grid; }
  .p3-tw-steps li::after { top: 0; }
  .p3-tw-ver__ui { left: var(--gutter); right: var(--gutter); width: auto; top: calc(var(--p3-top) + 1.2rem); }
  .p3-tw-ver__ui .p3-h2 { font-size: clamp(1.9rem, 1.4rem + 2.4vw, 2.6rem); margin-bottom: .8rem !important; }
  .p3-tw-cnt { margin: .9rem 0 .2rem; gap: 1.6rem; } .p3-tw-cnt b { font-size: 2.6rem; }
  .p3-tw-vlist, .p3-tw-vnote, .p3-tw-ver .p3-more { display: none; }
  .p3-tw-chain__t .p3-h2 { font-size: clamp(2rem, 1.4rem + 2.8vw, 2.8rem); }
}

/* ohne 3D (kein WebGL / weniger Bewegung): Startbild bleibt stehen, Bühnen werden kurz */
.p3.no3d .p3-tw-hero { height: 300vh; }
.p3.no3d .p3-tw-ver { height: auto; } .p3.no3d .p3-tw-ver .p3-sticky { position: relative; height: auto; min-height: 100vh; }
.p3.no3d .p3-tw-ver__ui { position: relative; right: auto; top: auto; margin: 0 var(--gutter) 0 auto; padding: calc(var(--p3-top) + 4rem) 0 4rem; }
.p3.no3d .p3-tw-ver__photo { display: block; position: absolute; left: var(--gutter); top: 50%; width: min(46vw, 620px); height: auto; border-radius: var(--p3-r); transform: translateY(-50%); }
.p3.no3d .p3-tw-chain { height: auto; } .p3.no3d .p3-tw-chain .p3-sticky { position: relative; height: auto; padding: 6rem 0; }
.p3.no3d .p3-tw-chain__t { position: relative; left: auto; top: auto; transform: none; margin: 0 auto; }
@media (max-width: 900px) { .p3.no3d .p3-tw-ver__photo { position: relative; left: auto; top: auto; transform: none; width: calc(100% - 2 * var(--gutter)); margin: 0 var(--gutter) 2rem; }
  .p3.no3d .p3-tw-ver__ui { margin: 0 var(--gutter); padding-top: calc(var(--p3-top) + 2rem); } .p3.no3d .p3-tw-vlist, .p3.no3d .p3-tw-vnote, .p3.no3d .p3-tw-ver .p3-more { display: grid; } }
