/* Alive Again Women – gerahmte 3D-Vorschau und Overlay auf der Inhaltsstoffseite.
   Ergänzt site.css. Ohne JavaScript bleibt der Rahmen ein Link auf die
   vollständige Ansicht, das Standbild trägt die Produktabbildung. */

/* ------------------------------------------------------------- Vorschau */

.wx-preview {
  --wx-accent: var(--accent, var(--orchid));
  position: relative;
  width: min(100%, 300px);
  margin: 0 0 24px;
}

.wx-preview__frame {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 300 / 340;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid var(--line-dark-soft);
  background:
    radial-gradient(78% 58% at 50% 108%, color-mix(in srgb, var(--wx-accent) 20%, transparent), transparent 72%),
    radial-gradient(64% 46% at 50% -6%, rgba(242, 238, 232, 0.09), transparent 70%),
    linear-gradient(180deg, #16131a 0%, #0d0b10 58%, #08070a 100%);
  box-shadow: inset 0 1px 0 rgba(242, 238, 232, 0.08);
  transition: border-color 320ms var(--ease-out), transform 320ms var(--ease-out), box-shadow 320ms var(--ease-out);
}

/* Goldene Haarlinie als Rahmenveredelung, liegt über der Bühne. */
.wx-preview__frame::after {
  position: absolute;
  z-index: 4;
  inset: 7px;
  border: 1px solid rgba(214, 164, 58, 0.16);
  content: "";
  pointer-events: none;
  transition: border-color 320ms var(--ease-out);
}

.wx-preview__frame:hover,
.wx-preview__frame:focus-visible {
  border-color: color-mix(in srgb, var(--wx-accent) 42%, var(--line-dark));
  box-shadow: inset 0 1px 0 rgba(242, 238, 232, 0.12), 0 18px 44px rgba(0, 0, 0, 0.45);
  transform: translateY(-2px);
}

.wx-preview__frame:hover::after,
.wx-preview__frame:focus-visible::after {
  border-color: rgba(214, 164, 58, 0.4);
}

.wx-preview__frame:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.wx-preview__stage {
  position: absolute;
  z-index: 2;
  inset: 0;
  display: block;
}

.wx-preview__stage canvas {
  display: block;
  width: 100%;
  height: 100%;
  /* Die Vorschau reagiert auf Mausbewegung, nicht auf Zeigerdruck. */
  pointer-events: none;
  touch-action: manipulation;
}

.wx-preview__still {
  position: absolute;
  z-index: 3;
  top: 50%;
  left: 50%;
  width: auto;
  max-width: 62%;
  height: auto;
  max-height: 74%;
  object-fit: contain;
  filter: drop-shadow(0 26px 40px rgba(0, 0, 0, 0.6));
  transform: translate(-50%, -54%);
  transition: opacity 420ms var(--ease-out);
}

.wx-preview[data-state="live"] .wx-preview__still {
  opacity: 0;
  pointer-events: none;
}

.wx-preview__badge {
  position: absolute;
  z-index: 5;
  top: 16px;
  left: 16px;
  padding: 4px 8px;
  border: 1px solid var(--line-gold);
  color: var(--gold-light);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.54rem;
  letter-spacing: 0.18em;
}

.wx-preview__cta {
  position: absolute;
  z-index: 5;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  gap: 3px;
  padding: 34px 16px 14px;
  background: linear-gradient(180deg, rgba(8, 7, 10, 0), rgba(8, 7, 10, 0.86) 62%);
}

.wx-preview__cta-main {
  color: var(--pearl);
  font-size: 0.85rem;
  letter-spacing: 0.01em;
}

.wx-preview__cta-sub {
  color: var(--pearl-muted);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.52rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

/* --------------------------------------------------------------- Overlay */

.wx-modal[hidden] {
  display: none;
}

.wx-modal {
  position: fixed;
  z-index: 960;
  display: grid;
  inset: 0;
  place-items: center;
  padding: clamp(0px, 2vw, 26px);
}

.wx-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 3, 6, 0.82);
  backdrop-filter: blur(6px);
}

.wx-modal__dialog {
  position: relative;
  display: flex;
  width: min(100%, 1180px);
  height: min(100%, 880px);
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line-dark);
  background: var(--night);
  box-shadow: var(--shadow-deep);
}

.wx-modal__dialog:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: -4px;
}

.wx-modal__bar {
  display: flex;
  flex: none;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
  padding: 12px 14px 12px 18px;
  border-bottom: 1px solid var(--line-dark-soft);
  background: linear-gradient(180deg, rgba(25, 22, 28, 0.92), rgba(13, 11, 15, 0.92));
}

.wx-modal__title {
  min-width: 0;
  flex: 1 1 200px;
  margin: 0;
  font-family: "Prata", Georgia, serif;
  font-size: clamp(0.95rem, 0.8rem + 0.5vw, 1.25rem);
  font-weight: 400;
  letter-spacing: -0.01em;
}

.wx-modal__tab {
  flex: none;
  color: var(--pearl-muted);
  border-bottom: 1px solid var(--line-gold);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: color 240ms var(--ease-out);
}

.wx-modal__tab:hover,
.wx-modal__tab:focus-visible {
  color: var(--gold-light);
}

.wx-modal__close {
  display: inline-flex;
  width: 44px;
  height: 44px;
  flex: none;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--line-dark);
  background: transparent;
  color: var(--pearl);
  cursor: pointer;
  transition: border-color 240ms var(--ease-out), color 240ms var(--ease-out);
}

.wx-modal__close:hover,
.wx-modal__close:focus-visible {
  border-color: var(--line-gold);
  color: var(--gold-light);
}

.wx-modal__x {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
}

.wx-modal__frame {
  position: relative;
  min-height: 0;
  flex: 1 1 auto;
  background: var(--night-deep);
}

.wx-modal__iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.wx-modal__status {
  position: absolute;
  z-index: 2;
  top: 50%;
  right: 20px;
  left: 20px;
  margin: 0;
  color: var(--pearl-muted);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-align: center;
  text-transform: uppercase;
  transform: translateY(-50%);
}

.wx-modal__status[hidden] {
  display: none;
}

/* Fängt den Tabulator auf, der den Iframe nach hinten verlässt. */
.wx-modal__guard {
  position: absolute;
  width: 1px;
  height: 1px;
  bottom: 0;
  left: 0;
  overflow: hidden;
  outline: none;
}

/* Sperrt das Dokument, solange das Overlay offen ist. */
.wx-locked,
.wx-locked body {
  overflow: hidden;
}

.wx-locked body {
  padding-right: var(--wx-scrollbar, 0px);
}

@media (max-width: 760px) {
  .wx-modal {
    padding: 0;
  }

  .wx-modal__dialog {
    width: 100%;
    height: 100%;
    border: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .wx-preview__frame,
  .wx-preview__frame::after,
  .wx-preview__still,
  .wx-modal__tab,
  .wx-modal__close {
    transition: none;
  }

  .wx-preview__frame:hover,
  .wx-preview__frame:focus-visible {
    transform: none;
  }

  .wx-modal__backdrop {
    backdrop-filter: none;
  }
}
