:root {
  color-scheme: light;
  --surface: #f7f7f5;
  --control-bg: rgb(255 255 255 / 88%);
  --control-border: rgb(36 36 34 / 12%);
  --control-shadow: 0 8px 30px rgb(33 33 31 / 12%);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--surface);
}

body {
  min-height: 100svh;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

.viewer-shell {
  width: 100%;
  height: 100%;
  min-height: 100svh;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: var(--surface);
  cursor: grab;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}

.viewer-shell.is-dragging {
  cursor: grabbing;
}

.product-image {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  -webkit-user-drag: none;
}

.drag-hint,
.viewer-error {
  position: fixed;
  z-index: 1000;
}

.drag-hint {
  left: 50%;
  bottom: calc(18px + env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 13px;
  border: 1px solid var(--control-border);
  border-radius: 999px;
  background: var(--control-bg);
  box-shadow: var(--control-shadow);
  color: rgb(36 36 34 / 76%);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  pointer-events: none;
  transform: translateX(-50%);
  transition: opacity 240ms ease, transform 240ms ease;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.drag-hint.is-hidden {
  opacity: 0;
  transform: translate(-50%, 6px);
}

.drag-hint__icon {
  font-size: 15px;
}

.viewer-error {
  inset: 50% auto auto 50%;
  width: min(88vw, 360px);
  padding: 16px 18px;
  border: 1px solid rgb(120 40 40 / 15%);
  border-radius: 12px;
  background: rgb(255 248 248 / 94%);
  color: #742d2d;
  font-size: 14px;
  line-height: 1.5;
  text-align: center;
  transform: translate(-50%, -50%);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 540px) {
  .drag-hint {
    bottom: calc(12px + env(safe-area-inset-bottom));
  }
}

@media (prefers-reduced-motion: reduce) {
  .drag-hint {
    transition: none;
  }
}
