/* Page background */
body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #020617;
  color: #e5e7eb;
}

/* Root of the shop layout */
.shop-layout {
  display: flex;
  height: 100vh;
  max-width: 1200px;
  margin: 0 auto;
}

/* Left: library / directory list */
.shop-sidebar {
  width: 260px;
  min-width: 220px;
  border-right: 1px solid rgba(148, 163, 184, 0.3);
  background: #020617;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.shop-sidebar-header {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6b7280;
  margin-bottom: 4px;
}

.shop-sidebar-item {
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

.shop-sidebar-item:hover {
  background: rgba(148, 163, 184, 0.2);
  transform: translateX(2px);
}

.shop-sidebar-item--active {
  background: linear-gradient(135deg, #38bdf8, #6366f1);
  color: #0b1120;
}

.shop-item-title {
  font-size: 0.9rem;
  font-weight: 500;
}

.shop-item-meta {
  font-size: 0.8rem;
  opacity: 0.85;
}

/* Right: viewer + controls */
.shop-main {
  flex: 1;
  position: relative;
  background: radial-gradient(circle at top, #1e293b 0%, #020617 55%);
  overflow: hidden;
}

/* Canvas fills the right pane */
.viewer-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* Overlay panel for controls + payment */
.shop-overlay {
  position: absolute;
  top: 16px;
  right: 16px;
  padding: 12px 14px;
  background: rgba(15, 23, 42, 0.9);
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  backdrop-filter: blur(12px);
  z-index: 10;
  max-width: 260px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.shop-overlay-title {
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 4px;
}

.scale-row {
  display: flex;
  gap: 6px;
  align-items: center;
}

.scale-label {
  font-size: 0.8rem;
  width: 1.2rem;
  color: #9ca3af;
}

.scale-input {
  flex: 1;
  padding: 4px 6px;
  border-radius: 6px;
  border: 1px solid #4b5563;
  background: #020617;
  color: #e5e7eb;
  font-size: 0.8rem;
}

.scale-input:focus {
  outline: none;
  border-color: #38bdf8;
  box-shadow: 0 0 0 1px #38bdf8;
}

.scale-apply-button {
  margin-top: 4px;
  padding: 6px 10px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, #38bdf8, #6366f1);
  color: #0b1120;
  font-size: 0.8rem;
  cursor: pointer;
  font-weight: 500;
  transition: filter 0.2s ease;
}

.scale-apply-button:hover {
  filter: brightness(1.07);
}

.shop-price {
  font-size: 0.85rem;
  color: #e5e7eb;
  margin-top: 4px;
}

/* mobile */
@media (max-width: 800px) {
  .shop-layout {
    flex-direction: column;
  }

  .shop-sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid rgba(148, 163, 184, 0.3);
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
  }

  .shop-sidebar-item {
    min-width: 160px;
  }

  .shop-main {
    height: calc(100vh - 110px);
  }

  .shop-overlay {
    top: 10px;
    right: 10px;
    max-width: 220px;
  }
}
