html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  min-height: 100%;
  overflow-x: hidden;
  font-family: sans-serif;
  background: #090a0c;
}

/* ================= VISUAL HUB ================= */

.visual-hub {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

/* ACTIVE VIEW */
#active-view {
  position: relative;
  width: 100%;
  height: min(75vh, 720px);
  background: #f5f5f5;
}

#viewer-container,
#active-snapshot {
  width: 100%;
  height: 100%;
}

/* Ensure Three.js canvas always fills its parent */
#viewer-container canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

#active-snapshot {
  display: none;
  object-fit: contain;
}

/* ================= THUMB SLIDER (desktop) ================= */

.thumb-slider {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px;
}

.thumb-nav {
  width: 26px;
  height: 26px;
  border: none;
  background: #ddd;
  border-radius: 50%;
  cursor: pointer;
  flex-shrink: 0;
}

.thumb-track {
  display: flex;
  flex-direction: row;   /* always horizontal */
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  flex: 1;
  scrollbar-width: none;
}
.thumb-track::-webkit-scrollbar { display: none; }

.thumb {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  background: #e0e0e0;
  flex-shrink: 0;
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 12px;
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px;
  pointer-events: none;
}

.thumb-360 {
  background: #111;
  color: #fff;
  font-weight: 600;
}

.thumb.active {
  outline: 2px solid #111;
}

/* ================= COLOR PANEL ================= */

.color-panel {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  gap: 10px;
  z-index: 10;
}

.color-btn {
  width: 30px;
  height: 30px;
  border-radius: 30%;
  border: 2px solid #ddd;
  cursor: pointer;
}

.color-btn[data-colorkey="MATTE_BLACK"]  { background: #111; }
.color-btn[data-colorkey="CHERRY_RED"]   { background: #c8111e; }
.color-btn[data-colorkey="WHITE"]        { background: #f5f5f5; }
.color-btn[data-colorkey="GLOSSY_BLACK"] { background: #000; }
.color-btn[data-colorkey="STEEL_GREY"]  { background: #9e9e9e; }
.color-btn[data-colorkey="PRO"]         { background: linear-gradient(135deg, #111 50%, #c8111e 50%); }

/* ================= FULLSCREEN BTN ================= */

#btn-fullscreen {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 10;
  background: rgba(0,0,0,0.6);
  color: #fff;
  border: none;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  cursor: pointer;
}

/* ================= MOBILE ================= */
/* NOTE: Mobile thumb-slider layout is intentionally handled in product.css
   via the .mobile-detached class (applied by JS in core.js).
   Do NOT add vertical flex-direction or position:absolute for mobile here. */

@media (max-width: 768px) {
  #active-view {
    height: 60vh;
  }
}