/* CH product stage — 360 spin viewer, attachment picker, AR, video and
   gallery for the Compact Handler product pages. Driven by /js/ch-stage.js. */
.chs {
  --chs-red: #e30614;
  --chs-ease: cubic-bezier(0.23, 1, 0.32, 1);   /* one quick ease-out for every hover, press and fade */
  --chs-ink: #0f0f10;
  --chs-line: #dedede;
  --chs-muted: #6b6b70;
  --chs-head: "Zalando Sans SemiExpanded", sans-serif;
  --chs-body: Helveticanowdisplay, "Helvetica Now Display", Arial, sans-serif;
  width: 100%;
  margin: 8px 0 0;
  font-family: var(--chs-body);
  color: var(--chs-ink);
}
.chs *, .chs *::before, .chs *::after { box-sizing: border-box; }

/* ── Stage ─────────────────────────────────────────────────────────────── */
.chs-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 78vh;
  min-height: 360px;
  border-radius: 20px;
  overflow: hidden;
  background: radial-gradient(ellipse 120% 95% at 50% 72%, #3b3c41 0%, #18181b 52%, #050506 100%);
  isolation: isolate;
}
.chs-stage:fullscreen { max-height: none; border-radius: 0; aspect-ratio: auto; }
.chs-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: transparent;
}
/* 3D View = the 360 spin: pre-rendered frames drawn into a canvas by ch-stage.js.
   touch-action pan-y: a sideways swipe spins it, a vertical swipe still scrolls the page.
   The stage background is replaced by ch-stage.js with the render's own edge colours, so no box shows. */
.chs-spin { position: absolute; inset: 0; cursor: grab; touch-action: pan-y; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
.chs-spin.dragging { cursor: grabbing; }
.chs-spin.is-still { cursor: default; }
.chs-spin canvas { display: block; width: 100%; height: 100%; }
.chs-spin:focus-visible { outline: 2px solid var(--chs-red); outline-offset: -2px; }
.chs-spin[hidden] { display: none; }
/* The old live 3D viewer is kept ONLY for "View in your space" (AR): off-screen, not display:none,
   so AR still has a rendering surface. It is never shown. */
.chs-mv { position: absolute; left: -9999px; top: 0; width: 320px; height: 240px; opacity: 0; pointer-events: none; }
.chs-video { object-fit: contain; background: #000; }
/* Video starts below the 3D View / Video switch so it never covers the clip's own title (Naveen 11-12). */
.chs-video { top: 64px; height: calc(100% - 64px); }
.chs-video[hidden] { display: none; }

.chs-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; z-index: 2; pointer-events: none; background: rgba(255, 255, 255, 0.08); }
.chs-progress > span { display: block; height: 100%; width: 0; background: var(--chs-red); transition: width 0.2s var(--chs-ease); }
.chs-progress.done { opacity: 0; transition: opacity 0.4s var(--chs-ease) 0.3s; }

/* Overlay controls */
.chs-top, .chs-bottom {
  position: absolute;
  left: 16px;
  right: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  pointer-events: none;
  z-index: 2;
}
.chs-top { top: 16px; }
.chs-bottom { bottom: 16px; align-items: flex-end; }
.chs-top > *, .chs-bottom > * { pointer-events: auto; }

.chs-tabs {
  display: inline-flex;
  padding: 4px;
  border-radius: 999px;
  background: rgba(15, 15, 16, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
}
.chs-tab {
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  font: 600 13px/1 var(--chs-head);
  padding: 9px 16px;
  border-radius: 999px;
  cursor: pointer;
}
.chs-tab[aria-selected="true"] { background: #fff; color: var(--chs-ink); }
/* Press feedback (Naveen 11-13): controls give a little when pressed. */
.chs-tab, .chs-height, .chs-tool, .chs-card {
  transition: background-color 0.16s var(--chs-ease), color 0.16s var(--chs-ease), border-color 0.16s var(--chs-ease), transform 0.1s var(--chs-ease);
}
.chs-tab:active:not(:disabled), .chs-height:active, .chs-tool:active { transform: scale(0.97); }
.chs-card:not([aria-checked="true"]):active { transform: scale(0.98); }   /* the selected tab stays flush with the stage */
.chs-ar { transition: scale 0.1s var(--chs-ease); }
.chs-ar:active { scale: 0.97; }   /* separate from its centring transform */
.chs-tab:disabled { opacity: 0.35; cursor: not-allowed; }   /* attachment has no video yet */

.chs-readout {
  padding: 9px 14px;
  border-radius: 999px;
  background: rgba(15, 15, 16, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 13px;
  backdrop-filter: blur(8px);
  white-space: nowrap;
}
.chs-readout strong { font-family: var(--chs-head); font-weight: 700; }
.chs-readout span { color: rgba(255, 255, 255, 0.65); }

.chs-tools { display: inline-flex; gap: 8px; }
.chs-tool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 40px;
  min-width: 40px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(15, 15, 16, 0.72);
  color: #fff;
  font: 600 12px/1 var(--chs-head);
  cursor: pointer;
  backdrop-filter: blur(8px);
}
.chs-tool svg { width: 16px; height: 16px; flex: 0 0 auto; }
.chs-tool[hidden] { display: none; }

.chs-hint {
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(15, 15, 16, 0.55);
  transition: opacity 0.5s var(--chs-ease);
}
.chs-hint.gone { opacity: 0; pointer-events: none; }

/* Camera height buttons (Low / Eye / High) */
.chs-heights { display: inline-flex; padding: 3px; border-radius: 999px; background: rgba(15, 15, 16, 0.72); border: 1px solid rgba(255, 255, 255, 0.16); backdrop-filter: blur(8px); }
.chs-height { border: 0; background: transparent; color: rgba(255, 255, 255, 0.75); font: 600 12px/1 var(--chs-head); padding: 0 12px; height: 32px; border-radius: 999px; cursor: pointer; }
.chs-height[aria-pressed="true"] { background: #fff; color: var(--chs-ink); }

/* AR button: ch-stage.js un-hides it only where AR is actually available */
.chs-ar[hidden] { display: none; }
.chs-ar {
  position: absolute;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 13px 20px;
  border: 0;
  border-radius: 999px;
  background: var(--chs-red);
  color: #fff;
  font: 700 14px/1 var(--chs-head);
  box-shadow: 0 8px 24px rgba(227, 6, 20, 0.35);
  cursor: pointer;
}
.chs-ar svg { width: 18px; height: 18px; }

/* ── Layout: stage + attachment film strip ────────────────────────────── */
.chs-layout { display: block; }
.chs-arnote { margin: 10px 0 0; font-size: 13px; color: var(--chs-muted); }
.chs-arnote[hidden] { display: none; }

/* Attachments as binder divider tabs (Naveen 11-12).
   Phone / tablet: folder tabs sitting on top of the stage. Desktop: tabs sticking out of the
   stage's right edge. The selected tab takes the stage colour so it joins the stage, like an
   open divider. */
.chs-layout { display: flex; flex-direction: column; }
.chs-strip-wrap { order: -1; min-width: 0; margin: 0 0 -1px; }
.chs-strip { display: flex; gap: 4px; overflow-x: auto; padding: 0 12px; scrollbar-width: none; }
.chs-strip::-webkit-scrollbar { display: none; }
.chs-card {
  flex: 0 0 auto;
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px;
  padding: 8px 14px 9px;
  border: 0;
  border-radius: 10px 10px 0 0;
  background: #e8e8eb;
  color: var(--chs-ink);
  text-align: left;
  cursor: pointer;
}
.chs-card:focus-visible { outline: 2px solid var(--chs-red); outline-offset: -2px; }
.chs-card[aria-checked="true"] { background: #16171a; color: #fff; }
.chs-card-name { font: 700 14px/1.2 var(--chs-head); white-space: nowrap; }
.chs-card-cap { font-size: 12px; color: var(--chs-muted); white-space: nowrap; }
.chs-card[aria-checked="true"] .chs-card-cap { color: #ff6b73; }

@media (min-width: 992px) {
  /* Desktop: paper-divider tabs down the stage's right edge, spread evenly over the stage
     height (Naveen's binder-divider picture, 11-12). Labels read across, name over rating:
     seven names written top to bottom did not fit a laptop-height stage. */
  .chs-layout { display: grid; grid-template-columns: minmax(0, 1fr) 136px; gap: 0; align-items: stretch; }
  .chs-strip-wrap { order: 0; margin: 0 0 0 -1px; position: relative; }
  .chs-strip { position: absolute; inset: 18px 0 18px 0; flex-direction: column; overflow: visible; gap: 5px; padding: 0; }
  .chs-card {
    /* Fixed tab height on every page (Naveen 11-18): one eighth of the stage, the most tabs any
       machine has (CH 10 OMNI). Pages with fewer tabs leave the rest of the edge empty instead of
       stretching them. */
    flex: 0 0 calc((100% - 35px) / 8); width: 100%; min-height: 0;
    padding: 0 12px 0 16px; justify-content: center;
    border-radius: 0 9px 9px 0;
    clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 9px, 100% calc(100% - 9px), calc(100% - 9px) 100%, 0 100%);   /* angled divider corners */
    box-shadow: inset 4px 0 6px -4px rgba(0, 0, 0, 0.35);                 /* tucked behind the stage */
  }
  .chs-card-name { font-size: 13px; }
  .chs-card[aria-checked="true"] { box-shadow: none; }
  .chs-stage { z-index: 1; }
  .chs-card { position: relative; z-index: 0; }
  .chs-card[aria-checked="true"] { z-index: 2; }
}


/* ── Gallery ───────────────────────────────────────────────────────────── */
.chs-gallery { margin-top: 34px; }
.chs-gallery .chs-label { display: block; margin-bottom: 10px; }
.chs-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.chs-shot {
  position: relative;
  padding: 0;
  border: 0;
  border-radius: 14px;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: linear-gradient(180deg, #020203 0%, #0d0d0f 55%, #2a2a2d 100%);
  cursor: zoom-in;
}
.chs-shot img { width: 100%; height: 100%; object-fit: contain; display: block; transition: transform 0.35s var(--chs-ease); }
.chs-shot .chs-cap {
  position: absolute;
  left: 12px;
  bottom: 10px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(15, 15, 16, 0.72);
  color: #fff;
  font: 600 12px/1 var(--chs-head);
}

/* Lightbox */
.chs-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 56px 72px;
  background: rgba(5, 5, 6, 0.94);
}
.chs-lightbox[hidden] { display: none; }
.chs-lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px; }
.chs-lb-cap {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
  white-space: nowrap;
}
.chs-lb-btn {
  position: absolute;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.chs-lb-close { top: 16px; right: 16px; }
.chs-lb-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.chs-lb-next { right: 16px; top: 50%; transform: translateY(-50%); }

/* ── Spec extras (attachment table, feature list) ──────────────────────── */
.chs-table { width: 100%; border-collapse: collapse; margin: 6px 0 0; font-size: 16px; }
.chs-table th {
  text-align: left;
  font: 600 12px/1.2 var(--chs-head);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--chs-muted);
  padding: 10px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.12);
}
.chs-table td { padding: 14px 0; border-bottom: 1px solid rgba(0, 0, 0, 0.12); }
.chs-table tr:last-child td { border-bottom: 0; }
.chs-table td:first-child { font-weight: 500; }
.chs-table button {
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  color: var(--chs-red);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.chs-features { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 6px 0 0; padding: 0; list-style: none; }
.chs-features li { padding: 18px 20px; border: 1px solid var(--chs-line); border-radius: 14px; background: #fafafa; }
.chs-features strong { display: block; font: 700 15px/1.3 var(--chs-head); margin-bottom: 6px; }
.chs-features span { font-size: 15px; line-height: 1.5; color: #444; }
.chs-note { font-size: 15px; line-height: 1.55; color: #444; margin: 8px 0 0; }
.chs-note a { color: var(--chs-red); }

@media (max-width: 767px) {
  .chs-stage { aspect-ratio: 4 / 5; max-height: 72vh; border-radius: 16px; }
  .chs-top { top: 12px; left: 12px; right: 12px; flex-wrap: wrap; }
  .chs-bottom { bottom: 12px; left: 12px; right: 12px; }
  .chs-hint { display: none; }
  .chs-tool-label { display: none; }
  .chs-ar { bottom: 70px; }
  .chs-card { padding: 8px 12px; }
  .chs-card-name { font-size: 14px; }
  .chs-card-cap { font-size: 12px; }
  .chs-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .chs-shot .chs-cap { display: none; }
  .chs-lightbox { padding: 56px 8px; }
  .chs-lb-prev, .chs-lb-next { top: auto; bottom: 8px; transform: none; }
  .chs-features { grid-template-columns: 1fr; }
}

/* Shown by ch-stage.js when the 360 frames fail to load */
.chs-error {
  position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%);
  max-width: calc(100% - 32px); padding: 8px 14px; border-radius: 10px;
  background: rgba(0, 0, 0, 0.8); color: #fff; font-size: 14px; text-align: center;
}

/* Hover only where there is a mouse: on phones a tapped control must not stay lit. */
@media (hover: hover) {
  .chs-tool:hover { border-color: rgba(255, 255, 255, 0.45); }
  .chs-card:not([aria-checked="true"]):hover { background: #dcdce0; }
  .chs-shot:hover img { transform: scale(1.03); }
  .chs-lb-btn:hover { background: rgba(255, 255, 255, 0.18); }
}

/* Crossfade between attachments (ch-stage.js lays the old picture over the new one and fades it out). */
.chs-ghost { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; transition: opacity 0.18s var(--chs-ease); }

@media (prefers-reduced-motion: reduce) {
  .chs *, .chs *::before, .chs *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
