/* ──────────────────────────────────────────────────────────────────────
   The "?" guide on the customer 3D viewer (2026-10-31): the round "?" button (top-left, beside the Fit | Real size switch since 2026-11-01)
   and the window it opens. Markup: views/partials/viewer-help.ejs, views/partials/viewer-topleft.ejs   Behaviour: public/js/viewer-help.js
   The window's classes (vh-*) are shared with the Compare guide in the shop (views/partials/compare-help.ejs).
   The window copies the look of the "Watch AR demo videos" window (.ar-demo-* in ar-viewer.css, which the product page does not load):
   same card, header, eyebrow and close button, with the same site tokens. The icon chips repeat the real viewer buttons
   (34px round, translucent charcoal; ON = rattan brown; OFF = dimmed with a slash, see .mv-toggle-btn in model-fullscreen.css).
   ────────────────────────────────────────────────────────────────────── */

/* ── The "?" button, top-left, to the right of the Fit | Real size switch (2026-11-01) ──
   It opens a window; it does not switch anything. So it is NOT one of the dark / brown round buttons (.mv-toggle-btn) and not
   part of the pill: a cream circle with a brown "?" and a brown ring. Same height as the pill (30px; 40px in fullscreen, where
   the pill's buttons are bigger). The tap target is made 44px by an invisible ring, like the other viewer buttons. */
.mv-topleft {
  position: absolute;
  top: var(--space-4, 1rem);
  left: var(--space-4, 1rem);
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 8px;
  /* model-viewer's default slot does not take pointer events: the children below turn them back on */
  pointer-events: none;
}
/* inside the box the switch is a flex item, not a corner-pinned element (real-size.css pins it when it stands alone) */
.mv-topleft > .rs-switch { position: static; }

.mv-help-btn {
  position: relative;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1.5px solid var(--color-primary-dark);
  border-radius: 50%;
  background-color: var(--color-cream);
  color: var(--color-brown-mid);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  cursor: pointer;
  pointer-events: auto;
  box-shadow: 0 1px 4px rgba(44, 36, 24, 0.25);
  -webkit-tap-highlight-color: transparent;
  transition: background-color 150ms ease, color 150ms ease;
}
.mv-help-btn[hidden] { display: none; }
.mv-help-btn i { font-size: 1.05rem; }
.mv-help-btn::after { content: ""; position: absolute; inset: -7px; border-radius: 50%; }
.mv-help-btn:hover { background-color: #fff; color: var(--color-charcoal); }
.mv-help-btn:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }

.model-pseudo-fullscreen .mv-topleft {
  top: calc(12px + env(safe-area-inset-top, 0px));
  left: calc(16px + env(safe-area-inset-left, 0px));
}
.model-pseudo-fullscreen .mv-help-btn { width: 40px; height: 40px; }
.model-pseudo-fullscreen .mv-help-btn i { font-size: 1.25rem; }
.model-pseudo-fullscreen .mv-help-btn::after { inset: -2px; }

@media (prefers-reduced-motion: reduce) {
  .mv-help-btn { transition: none; }
}

/* ── The attention pulse (2026-11-07) ───────────────────────────────────────────────────────────────────────
   Until a visitor presses a "?" it grows to about 1.3x twice, then rests for a couple of seconds, and repeats. public/js/help-pulse.js adds
   .is-pulsing (the 3D viewer's .mv-help-btn here; the shop's .cmp-help-btn too, the shop links this file) and takes it away for good, on this
   device, at the first press. Transform only: nothing around the button moves. It holds still while the pointer or focus is on it. A visitor
   who asks for less motion gets no scaling, just a soft static ring that goes the same way (on until pressed). */
@keyframes mira-help-pulse {
  0%, 36%, 100% { transform: scale(1); }
  9%, 27% { transform: scale(1.28); }
  18% { transform: scale(1); }
}
.mv-help-btn.is-pulsing,
.cmp-help-btn.is-pulsing {
  animation: mira-help-pulse 3.6s ease-in-out infinite;
  will-change: transform;
}
.mv-help-btn.is-pulsing:hover,
.mv-help-btn.is-pulsing:focus-visible,
.cmp-help-btn.is-pulsing:hover,
.cmp-help-btn.is-pulsing:focus-visible { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) {
  .mv-help-btn.is-pulsing,
  .cmp-help-btn.is-pulsing {
    animation: none;
    will-change: auto;
    box-shadow: 0 0 0 4px rgba(168, 132, 94, 0.28), 0 1px 4px rgba(44, 36, 24, 0.25);
  }
}

/* ── Window ──────────────────────────────────────────────── */
.vh-dialog { max-width: 560px; }

.vh-content {
  display: flex;
  flex-direction: column;
  border: none;
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: var(--bg-card);
  box-shadow: var(--shadow-lg);
  max-height: calc(100vh - 1.5rem);
}
@supports (height: 100dvh) {
  .vh-content { max-height: calc(100dvh - 1.5rem); }
}
/* From 576px Bootstrap keeps 1.75rem above and below the window (3.5rem in all), so on a short laptop screen the window must be that much
   shorter than the screen or its bottom edge runs off (seen at 1440x900: 4px). On a phone the margin is 0.5rem and 1.5rem above is enough. */
@media (min-width: 576px) {
  .vh-content { max-height: calc(100vh - 3.5rem); }
}
@supports (height: 100dvh) {
  @media (min-width: 576px) {
    .vh-content { max-height: calc(100dvh - 3.5rem); }
  }
}

.vh-header {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-5) var(--space-6) var(--space-3);
  border-bottom: 1px solid var(--border-light);
}
.vh-eyebrow {
  margin: 0 0 2px;
  font-size: var(--fs-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-brown-light);
}
.vh-eyebrow i { color: var(--color-primary-dark); margin-right: 2px; }
.vh-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--fs-xl);
  font-weight: 600;
  line-height: 1.2;
  color: var(--color-charcoal);
}
.vh-close {
  position: relative;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: var(--bg-section-alt);
  color: var(--color-brown-mid);
  font-size: 0.95rem;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
}
.vh-close:hover { background: var(--color-stone); color: var(--color-charcoal); }
.vh-close:focus-visible {
  outline: 2px solid var(--color-primary-dark);
  outline-offset: 2px;
}
/* a 44px tap target around the 36px button */
.vh-close::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; }

.vh-body {
  padding: var(--space-5) var(--space-6) var(--space-6);
  overflow-y: auto; /* nothing is ever out of reach on a short screen */
  overscroll-behavior: contain;
}
.vh-lead {
  margin: 0 0 var(--space-4);
  font-size: var(--fs-sm);
  line-height: 1.55;
  color: var(--color-brown-mid);
}
.vh-section {
  margin: var(--space-5) 0 var(--space-3);
  font-family: var(--font-body);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-brown-light);
}
.vh-lead + .vh-section { margin-top: var(--space-4); }

/* ── One row per button ──────────────────────────────────── */
.vh-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.vh-row {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
}
/* a button this viewer does not have is left out (public/js/viewer-help.js) */
.vh-row[hidden],
.vh-states[hidden] { display: none; }

.vh-chip {
  position: relative;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background-color: rgba(44, 36, 24, 0.55);
  color: #fff;
  font-size: 1.05rem;
  line-height: 1;
}
.vh-chip--on { background-color: var(--color-primary-dark); }
.vh-chip--off i { opacity: 0.7; }
.vh-chip--off::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 62%;
  height: 2px;
  border-radius: 1px;
  background-color: #fff;
  transform: translate(-50%, -50%) rotate(-45deg);
}
.vh-chip--sm { width: 28px; height: 28px; font-size: 0.8rem; }

.vh-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.vh-name {
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  line-height: 1.3;
  color: var(--color-charcoal);
}
.vh-where {
  font-weight: 400;
  color: var(--color-brown-light);
}
.vh-desc {
  font-size: var(--fs-xs);
  line-height: 1.5;
  color: var(--color-brown-mid);
  overflow-wrap: anywhere;
}

/* "Brown = on / dimmed with a slash = off" */
.vh-states {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-5);
  margin-top: var(--space-4);
  padding: var(--space-3) var(--space-4);
  background: var(--bg-section-alt);
  border-radius: var(--radius-md);
}
.vh-state {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--fs-xs);
  line-height: 1.3;
  color: var(--color-brown-mid);
}

/* ── Phones ──────────────────────────────────────────────── */
@media (max-width: 575.98px) {
  .vh-header { padding: var(--space-4) var(--space-4) var(--space-3); }
  .vh-title { font-size: var(--fs-lg); }
  .vh-body { padding: var(--space-4) var(--space-4) var(--space-5); }
  .vh-close { width: 44px; height: 44px; margin: -4px -6px 0 0; }
  .vh-close::after { inset: 0; }
}
