/**
 * Bottom-center canvas bar: Front/Back + zoom + fit-to-screen consolidated
 * into one floating pill, matching the mockup. Replaces the old top
 * .canvas-toolbar's side-toggle (left section) and the separate
 * bottom-right .zoom-widget with a single bar -- both real elements are
 * relocated here wholesale (canvas-bar.js) rather than reimplemented, same
 * reparenting approach as every other studio2 module. Positioned
 * absolute within .studio-workspace (already position:relative -- the
 * real .zoom-widget already relied on this), so it stays correctly
 * centered on resize with no JS recalculation needed.
 */

.s2h-canvas-bar {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--s2h-shadow-md);
  z-index: 40;
  pointer-events: auto;
}

.s2h-canvas-bar .side-toggle {
  margin: 0;
}

.s2h-bar-sep {
  width: 1px;
  height: 24px;
  background: var(--line);
  flex-shrink: 0;
}

/* Flatten the real .zoom-widget's own box styling so it blends into the
   bar's pill instead of nesting a second one inside it. */
.s2h-canvas-bar .zoom-widget {
  position: static;
  background: none;
  border: none;
  box-shadow: none;
  backdrop-filter: none;
  padding: 0;
}

.s2h-canvas-bar #fitToScreenBtn,
.s2h-canvas-bar #rotateTemplateBtn {
  margin: 0;
}

/* At full size this bar is ~463px wide (Front/Back with layer counts +
   zoom controls + fit button) -- comfortably fits a desktop canvas, but
   wider than a phone's entire canvas workspace (as narrow as ~340px), so
   it was overflowing off both edges of the screen while still technically
   "visible" (display/opacity/position were all fine -- just off-canvas).
   Compact it at phone widths rather than letting it wrap or clip. */
@media (max-width: 480px) {
  .s2h-canvas-bar {
    gap: 6px;
    padding: 5px 8px;
    bottom: 10px;
  }

  .s2h-canvas-bar .side-toggle-option {
    padding: 6px 10px;
  }

  /* The "(0)" layer-count is the least essential part of "Front (0)" --
     drop it first, before touching the icon or label. */
  .s2h-canvas-bar .side-toggle-option .layer-count {
    display: none;
  }

  .s2h-canvas-bar .zoom-widget {
    gap: 4px;
  }

  .s2h-canvas-bar .zoom-widget .icon-btn {
    width: 24px;
    height: 24px;
  }

  .s2h-canvas-bar .zoom-widget .zoom-display {
    min-width: 34px;
    font-size: 0.78rem;
  }

  .s2h-canvas-bar #fitToScreenBtn,
  .s2h-canvas-bar #rotateTemplateBtn {
    width: 30px;
    height: 30px;
  }
}
