/* Просмотр кейсов (нет макета — см. docs/design-deviations.md) */
.case-viewer {
  position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0; background: rgba(0, 0, 0, .9); color: var(--c-white);
  overflow: hidden;
}
.case-viewer:not([open]) { display: none; }
.case-viewer::backdrop { background: rgba(0, 0, 0, .9); }
.case-viewer__stage {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.case-viewer__img { display: block; flex: none; width: 100%; height: 100%; max-width: none; object-fit: contain; user-select: none; -webkit-user-drag: none; }
.case-viewer.is-loading .case-viewer__img { opacity: 0; }
.case-viewer__img { transition: opacity .2s; }

.case-viewer__spinner {
  position: absolute; left: 50%; top: 50%; width: 40px; height: 40px; margin: -20px 0 0 -20px;
  border: 3px solid rgba(255, 255, 255, .25); border-top-color: var(--c-white); border-radius: 50%;
  opacity: 0; pointer-events: none; animation: case-viewer-spin .8s linear infinite;
}
.case-viewer.is-loading .case-viewer__spinner { opacity: 1; }
@keyframes case-viewer-spin { to { transform: rotate(360deg); } }

.case-viewer__btn {
  position: absolute; z-index: 2; width: 48px; height: 48px; padding: 0; border: 0; border-radius: 50%;
  background: var(--c-white); color: var(--c-black); font: 600 28px/1 var(--font-body);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  box-shadow: 0 2px 12px rgba(0, 0, 0, .45);
  transition: background-color .15s, color .15s;
}
.case-viewer__btn:hover { background: var(--c-black); color: var(--c-white); box-shadow: 0 0 0 1px var(--c-white); }
.case-viewer__btn:focus-visible { outline: 3px solid var(--c-lime); outline-offset: 3px; }
.case-viewer__btn[hidden] { display: none; }
.case-viewer__close { top: 16px; right: 16px; font-size: 34px; }
.case-viewer__prev, .case-viewer__next { top: 50%; margin-top: -24px; font-size: 34px; padding-bottom: 4px; }
.case-viewer__prev { left: 16px; }
.case-viewer__next { right: 16px; }
.case-viewer__zoom { position: absolute; z-index: 2; left: 50%; bottom: 16px; transform: translateX(-50%); display: flex; gap: 12px; }
.case-viewer__zoom .case-viewer__btn { position: static; }

@media (max-width: 760px) {
  /* внизу кнопки (44px + отступы): резервируем место, чтобы они не перекрывали борд на низких экранах */
  .case-viewer__stage { bottom: 64px; }
  .case-viewer__btn { width: 44px; height: 44px; font-size: 26px; }
  .case-viewer__close { top: 10px; right: 10px; }
  .case-viewer__prev, .case-viewer__next { top: auto; bottom: 10px; margin-top: 0; }
  .case-viewer__prev { left: 10px; }
  .case-viewer__next { right: 10px; }
  .case-viewer__zoom { bottom: 10px; gap: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .case-viewer__spinner { animation-duration: 2.4s; }
  .case-viewer__img, .case-viewer__btn { transition: none; }
}
