/* NWS 3D device viewer ("TableServ zum Anfassen") and its section (TableServ overview, menu and system
   pages). Markup: <!-- nws:viewer --> blocks (Generator viewer.py, nur lokal beim Umbau), logic: js/nws/device-viewer.js. */

/* Section: dark CI accent in both themes, like the dark template sections. */
.nws-viewer-section {
  padding: clamp(72px, 9vw, 120px) 0;
  background: #12132c;
  color: rgba(255, 255, 255, 0.76);
}
.nws-viewer-section .nws-viewer-head {
  display: grid;
  justify-items: center;
  gap: 14px;
  max-width: 820px;
  margin: 0 auto clamp(32px, 5vw, 56px);
  text-align: center;
}
.nws-viewer-section .nws-viewer-head h2,
.nws-viewer-section .nws-viewer-head h3 {
  margin: 0;
  color: #fff;
  letter-spacing: normal;
  text-wrap: balance;
}
.nws-viewer-section .nws-viewer-head p {
  margin: 0;
  color: rgba(255, 255, 255, 0.76);
  font-size: 1.125rem;
  line-height: 1.6;
}
.nws-viewer-section .nws-t-eyebrow {
  background: rgba(74, 129, 211, 0.2);
  color: #8db0ee;
}

/* Resets against the template's element styles inside the viewer. */
.nws-viewer button {
  font: inherit;
  cursor: pointer;
}
.nws-viewer p {
  margin: 0;
  line-height: 1.6;
}
.nws-viewer .nws-btn {
  font-family: var(--nws-font-body);
}

.nws-viewer {
  display: block;
  padding: clamp(16px, 3vw, 40px);
  border-radius: var(--nws-radius-l);
  background: var(--nws-grad-dark);
  color: var(--nws-c-text-2);
}
.nws-viewer .nws-viewer__body {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: center;
}
@media (max-width: 1068px) {
  .nws-viewer .nws-viewer__body {
    grid-template-columns: 1fr;
  }
}
.nws-viewer .nws-viewer__stage {
  position: relative;
  aspect-ratio: 4/3;
  border-radius: var(--nws-radius-l);
  overflow: hidden;
  background: var(--nws-c-stage-bg);
  border: 1px solid var(--nws-c-stage-line);
  cursor: grab;
  /* horizontal drag rotates the device; vertical scrolling and two-finger zoom stay with the browser */
  touch-action: pan-y pinch-zoom;
  outline: none;
}
.nws-viewer .nws-viewer__stage:active {
  cursor: grabbing;
}
.nws-viewer .nws-viewer__stage:focus-visible {
  box-shadow: 0 0 0 3px var(--nws-c-focus);
}
@media (max-width: 734px) {
  .nws-viewer .nws-viewer__stage {
    aspect-ratio: 4/5;
  }
}
.nws-viewer .nws-viewer__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.9s var(--nws-ease-out);
}
.nws-viewer .nws-viewer__canvas.is-ready {
  opacity: 1;
}
.nws-viewer .nws-viewer__fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  transition: opacity 0.9s var(--nws-ease-out);
}
.nws-viewer .nws-viewer__fallback.is-hidden {
  opacity: 0;
}
.nws-viewer .nws-frame {
  padding: 9px;
  border-radius: 30px;
  background: linear-gradient(145deg, #3a4266, #151a36);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
}
.nws-viewer .nws-frame img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 22px;
}
.nws-viewer .nws-frame--phone {
  width: min(230px, 46%);
}
.nws-viewer .nws-frame--tablet, .nws-viewer .nws-frame--laptop {
  width: 78%;
  border-radius: 22px;
}
.nws-viewer .nws-frame--tablet img, .nws-viewer .nws-frame--laptop img {
  border-radius: 14px;
}
.nws-viewer .nws-viewer__badge,
.nws-viewer .nws-viewer__hint {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--nws-radius-pill);
  font-size: 0.8125rem;
  font-weight: 600;
  pointer-events: none;
}
.nws-viewer .nws-viewer__badge {
  top: 14px;
  left: 14px;
  background: var(--nws-c-stage-badge-bg);
  border: 1px solid var(--nws-c-stage-badge-line);
  color: var(--nws-c-stage-badge-fg);
}
.nws-viewer .nws-viewer__hint {
  bottom: 14px;
  left: 50%;
  translate: -50% 0;
  background: var(--nws-c-stage-card);
  border: 1px solid var(--nws-c-stage-line);
  color: var(--nws-c-stage-fg-2);
  animation: nws-hint-fade 4s ease 1.5s forwards;
}
@keyframes nws-hint-fade {
  to {
    opacity: 0.35;
  }
}
.nws-viewer .nws-viewer__panel {
  display: grid;
  gap: 20px;
}
.nws-viewer .nws-viewer__areas {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.nws-viewer .nws-area {
  padding: 10px 18px;
  border: 1px solid var(--nws-c-line);
  border-radius: var(--nws-radius-btn);
  background: transparent;
  color: var(--nws-c-text-2);
  font-family: var(--nws-font-heading);
  font-size: 1rem;
  font-weight: 600;
  transition: background var(--nws-dur-fast) ease, color var(--nws-dur-fast) ease;
}
@media (hover: hover) and (pointer: fine) {
  .nws-viewer .nws-area:hover {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.3);
  }
}
.nws-viewer .nws-area.is-active {
  border-color: transparent;
  background: var(--nws-grad-brand);
  color: #fff;
}
.nws-viewer .nws-viewer__desc {
  color: var(--nws-c-text-2);
  font-size: 1.0625rem;
}
.nws-viewer .nws-viewer__screens {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.nws-viewer .nws-chip {
  padding: 7px 14px;
  border: 1px solid var(--nws-c-line);
  border-radius: var(--nws-radius-pill);
  background: rgba(255, 255, 255, 0.04);
  color: var(--nws-c-text-2);
  font-size: 0.9375rem;
}
@media (hover: hover) and (pointer: fine) {
  .nws-viewer .nws-chip:hover {
    color: #fff;
  }
}
.nws-viewer .nws-chip.is-active {
  background: #fff;
  border-color: #fff;
  color: #12132c;
  font-weight: 600;
}
.nws-viewer .nws-viewer__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.nws-viewer .nws-viewer__note {
  padding: 14px 16px;
  border-radius: var(--nws-radius-s);
  background: rgba(255, 159, 10, 0.08);
  border: 1px solid rgba(255, 190, 90, 0.25);
  color: var(--nws-c-text-2);
  font-size: 0.875rem;
  line-height: 1.55;
}
.nws-viewer .nws-viewer__note strong {
  color: #ffc56e;
}

/* The template hyphenates automatically – the small labels on the stage stay on one line. */
.nws-viewer {
  -webkit-hyphens: manual;
  hyphens: manual;
}
.nws-viewer .nws-viewer__badge,
.nws-viewer .nws-viewer__hint {
  white-space: nowrap;
}

/* "Vergrößern" (phones/tablets – on desktop the viewer stays as it is): the stage opens full screen, one finger
   rotates, two fingers zoom and move, +/− zoom around the centre (js/nws/device-viewer.js). */
.nws-viewer .nws-viewer__stage-wrap {
  position: relative;
  min-width: 0;
}
.nws-viewer .nws-viewer__expand {
  display: none;
}
@media (pointer: coarse), (max-width: 734px) {
  .nws-viewer .nws-viewer__expand {
    position: absolute;
    top: 10px;
    right: 10px;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid var(--nws-c-stage-line);
    border-radius: 14px;
    background: var(--nws-c-stage-card);
    color: var(--nws-c-stage-fg);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
  }
}
.nws-viewer .nws-viewer__expand:focus-visible,
.nws-viewer--overlay button:focus-visible {
  outline: 2px solid var(--nws-c-focus);
  outline-offset: 2px;
}

.nws-viewer.nws-viewer--overlay {
  position: fixed;
  inset: 0;
  z-index: 99990; /* above navbar and service bar; the floating buttons step back (below) */
  padding: 0;
  border-radius: 0;
  background: var(--nws-c-stage-bg);
}
.nws-viewer.nws-viewer--overlay[hidden] {
  display: none;
}
.nws-viewer--overlay .nws-viewer__overlay-slot {
  position: absolute;
  inset: 0;
}
.nws-viewer--overlay .nws-viewer__stage {
  position: absolute;
  inset: 0;
  aspect-ratio: auto;
  border: 0;
  border-radius: 0;
}
.nws-viewer--overlay.has-3d .nws-viewer__stage {
  touch-action: none; /* the 3D handles rotating and zooming itself */
}
.nws-viewer--overlay .nws-viewer__stage .nws-viewer__hint {
  display: none;
}
.nws-viewer--overlay .nws-viewer__badge {
  top: calc(16px + env(safe-area-inset-top));
  left: calc(16px + env(safe-area-inset-left));
}
.nws-viewer--overlay .nws-viewer__close,
.nws-viewer--overlay .nws-viewer__zoom button {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 1px solid var(--nws-c-stage-line);
  border-radius: 14px;
  background: var(--nws-c-stage-card);
  color: var(--nws-c-stage-fg);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}
.nws-viewer--overlay .nws-viewer__close {
  position: absolute;
  top: calc(10px + env(safe-area-inset-top));
  right: calc(10px + env(safe-area-inset-right));
}
.nws-viewer--overlay .nws-viewer__zoom {
  position: absolute;
  right: calc(12px + env(safe-area-inset-right));
  bottom: calc(16px + env(safe-area-inset-bottom));
  display: grid;
  gap: 10px;
}
.nws-viewer--overlay .nws-viewer__overlay-hint {
  position: absolute;
  left: calc(16px + env(safe-area-inset-left));
  bottom: calc(22px + env(safe-area-inset-bottom));
  max-width: calc(100% - 100px);
  padding: 7px 13px;
  border: 1px solid var(--nws-c-stage-line);
  border-radius: var(--nws-radius-pill);
  background: var(--nws-c-stage-card);
  color: var(--nws-c-stage-fg-2);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.35;
  pointer-events: none;
}
.nws-viewer--overlay:not(.has-3d) .nws-viewer__zoom,
.nws-viewer--overlay:not(.has-3d) .nws-viewer__overlay-hint {
  display: none;
}
/* while the full screen view is open: page fixed, floating buttons / pop-up step back */
html.nws-viewer-open,
html.nws-viewer-open body {
  overflow: hidden;
}
html.nws-viewer-open .nw-cookie-button,
html.nws-viewer-open .nw-ts-button,
html.nws-viewer-open .nw-ts-banner,
html.nws-viewer-open .float-text,
html.nws-viewer-open .scrollbar-v {
  visibility: hidden;
}
