html, body { margin:0; padding:0; width:100%; height:100%; overflow:hidden; font-family:sans-serif; }
#error { position:absolute; top:10px; right:10px; background:white; color:red; padding:10px; border-radius:8px; z-index:3; display:none; }
.mirror-container { position:absolute; top:0; left:0; width:100vw; height:100vh; overflow:hidden; background:#000; }
video, canvas {
  position:absolute;
  top:50%; left:50%;
  min-width:100vw; min-height:100vh;
  width:auto; height:auto;
  object-fit:cover;
  transform:translate(-50%,-50%) scaleX(-1);
}
#controls { position:absolute; top:10px; left:10px; z-index:2; }
#typeSelect { font-size:15px; padding:4px 8px; border-radius:6px; border:1px solid #888;
  background:rgba(255,255,255,0.9); min-width:100px; }
#drawBtn { font-size:15px; margin-left:8px; padding:4px 12px; border-radius:6px; }


#productCarousel {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 90px;
  padding: 0;
  overflow-x: auto;
  white-space: nowrap;
  background: rgba(255,255,255,0.95);
  z-index: 100;
  display: flex;
  align-items: flex-end;
  border-top: 1px solid #eee;
  box-shadow: 0 -2px 12px rgba(0,0,0,0.08);
}

@media (pointer: coarse), (max-width: 600px) {
  #productCarousel {
    height: 90px;
    padding: 0;
  }
}
body, html {
  margin: 0;
  padding: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: #000;
}
.carousel-item-container {
  position: relative;
  display: inline-block;
  vertical-align: top;
  width: 84px;         /* 120px * 0.7 = 84px */
  margin-right: 12px;  /* 18px * 0.7 = 12.6px */
  text-align: center;
}
.carousel-item {
  width: 84px;         /* 120px * 0.7 = 84px */
  height: 84px;        /* 120px * 0.7 = 84px */
  border: 2px solid transparent;
  border-radius: 8px;  /* 12px * 0.7 = 8.4px */
  object-fit: cover;
  background: #eee;
  display: block;
  margin: 0 auto;
  cursor: pointer;
}
.swatch {
  position: static;         /* Remove absolute positioning */
  width: 32px;              /* Or your preferred size */
  height: 32px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 3px rgba(0,0,0,0.5);
  margin: 4px 0;
  background: #eee;
  flex: 0 0 auto;           /* Ensure it stays in the flex row */
  cursor: pointer;
}
#selectedProductTile {
  position: absolute;
  top: 60px;                /* Just below the controls */
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  min-width: 220px;         /* Increased width */
  width: 320px;             /* Set a wider default width, adjust as needed */
  min-height: 63px;
  background: rgba(255,255,255,0.97);
  border-radius: 10px;
  box-shadow: 0 3px 11px rgba(0,0,0,0.13);
  padding: 13px 20px 11px 20px; /* More horizontal padding for width */
  z-index: 1000 !important;
  visibility: hidden;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 18px;                /* Slightly more gap for wider tile */
}
#selectedProductTile .tile-info {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}
#selectedProductTile .name { font-size: 14px; font-weight: bold; margin-bottom: 4px; }   /* 20px * 0.7 */
#selectedProductTile .price { color: #b00; font-size: 12.6px; margin-bottom: 3px; }      /* 18px * 0.7 */
#selectedProductTile .rating { color: #f90; font-size: 11.9px; margin-bottom: 6px; }     /* 17px * 0.7 */
#selectedProductTile .buy-btn {
  display: inline-block;
  background: #222;
  color: #fff;
  font-size: 12px;      /* 17px * 0.7 */
  font-weight: 500;
  border-radius: 5.6px; /* 8px * 0.7 */
  padding: 5px 13px;    /* 7px 18px * 0.7 */
  text-decoration: none;
  margin-top: 6px;      /* 8px * 0.7 */
  margin-bottom: 3px;   /* 4px * 0.7 */
}
#tileLargeThumb {
  width: 56px;          /* 80px * 0.7 */
  height: 56px;         /* 80px * 0.7 */
  object-fit: cover;
  border-radius: 8.4px; /* 12px * 0.7 */
  box-shadow: 0 1.4px 5.6px rgba(0,0,0,0.10); /* 0 2px 8px * 0.7 */
  background: #fff;
  flex-shrink: 0;
  display: block;
  margin-left: 8px;     /* 12px * 0.7 */
}
.carousel-item.selected {
  border-color: #0078ff !important;
  box-shadow: 0 0 0 4px #b3d8ff;
  z-index: 3;
}
.swatch.selected {
  border-color: #0078ff !important;
  box-shadow: 0 0 0 2px #0078ff;
}
#hairColorBar { display: none; }
/* Swatch bar: scrollable and transparent */
#swatchThumbnails {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 100px;
  width: 100vw;
  min-width: 100vw;
  max-width: 100vw;
  display: flex;
  flex-direction: row;
  justify-content: flex-start;
  gap: 10px;
  z-index: 1100;
  pointer-events: auto;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  padding-bottom: 6px;
  scrollbar-width: thin;
  background: transparent;
}
#swatchThumbnails > * {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  margin: 4px 0;
  object-fit: cover;
  cursor: pointer;
  border: 2px solid #fff;
  box-shadow: 0 0 3px rgba(0,0,0,0.5);
}
#swatchThumbnails::-webkit-scrollbar {
  height: 8px;
}
#swatchThumbnails::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 4px;
}
#swatchThumbnails::-webkit-scrollbar-track {
  background: transparent;
}
#swatchThumbnails img.selected,
.swatch.selected {
  border-color: #0078ff !important;
  box-shadow: 0 0 0 2px #0078ff;
}
