/* ============================================================
   Complete Covers — 3D Designer V2 Styles (Decoupled Module)
   Desktop + Mobile Touch Responsive UI
   ============================================================ */

/* ── Floating Camera & View Controls Toolbar inside 3D Canvas ── */
.cc3d-toolbar {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 7px;
  background: rgba(26, 29, 38, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
  pointer-events: auto;
  user-select: none;
  -webkit-user-select: none;
  max-width: calc(100% - 20px);
  overflow-x: auto;
  scrollbar-width: none;
}
.cc3d-toolbar::-webkit-scrollbar {
  display: none;
}

.cc3d-tool-btn {
  appearance: none;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.82);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 5px 10px;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  transition: background 0.18s ease, color 0.18s ease, transform 0.12s ease;
}
.cc3d-tool-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}
.cc3d-tool-btn:active {
  transform: scale(0.96);
}
.cc3d-tool-btn.is-active {
  background: #C37D4A;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(195, 125, 74, 0.45);
}
.cc3d-tool-sep {
  width: 1px;
  height: 14px;
  background: rgba(255, 255, 255, 0.16);
  margin: 0 2px;
  flex-shrink: 0;
}

/* ── Top-left Live Dimension Summary Chip inside 3D Canvas ── */
.cc3d-status-pill {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 25;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(139, 111, 71, 0.18);
  border-radius: 999px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  color: #2c2520;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
  pointer-events: none;
  max-width: calc(100% - 24px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cc3d-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
  flex-shrink: 0;
}

/* ── Upgraded 3D Dimension Callout Badges (Scoped inside 3D Container) ── */
.dim-label-badge {
  position: absolute !important;
  z-index: 28 !important;
  transform: translate(-50%, -50%);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  background: rgba(24, 26, 34, 0.86);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #f8fafc;
  border: 1.5px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.2;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
  white-space: nowrap;
}
.dim-label-badge:hover {
  background: rgba(195, 125, 74, 0.95);
  border-color: #ffffff;
  box-shadow: 0 6px 18px rgba(195, 125, 74, 0.4);
}
.dim-label-badge.set {
  background: rgba(20, 83, 45, 0.90);
  border-color: rgba(74, 222, 128, 0.55);
}
.dim-label-badge.is-focused {
  background: #059669 !important;
  border-color: #6ee7b7 !important;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.35), 0 8px 20px rgba(0, 0, 0, 0.3) !important;
  z-index: 9999 !important;
}
.dim-label-badge.hidden {
  opacity: 0 !important;
  pointer-events: none !important;
}
.dim-label-badge .dim-icon {
  font-size: 11px;
  opacity: 0.85;
}
.dim-label-badge .dim-name-tag {
  font-size: 10px;
  font-weight: 500;
  opacity: 0.78;
  letter-spacing: 0.01em;
}
.dim-label-badge .dim-value {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700 !important;
  font-size: 12px;
  color: #ffffff !important;
}
.dim-label-badge.set .dim-value {
  color: #86efac !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}
.dim-label-badge .dim-value.unset {
  color: #fbbf24 !important;
  opacity: 0.9;
}
.dim-label-badge .dim-unit {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.85) !important;
  opacity: 0.9;
}

/* Hide legacy static labels inside #dev-3d-canvas when V2 HUD is mounted */
#dev-3d-canvas .dev-3d-label,
#dev-3d-canvas .dev-3d-hint {
  display: none !important;
}

/* Allow clicking badges even inside Step 0 form preview */
.dev-step0 ~ .dim-label-badge:not(.hidden) {
  display: inline-flex !important;
  z-index: 9990 !important;
  pointer-events: auto !important;
}

/* ── 3D Zipper Edge Callout & Direct-Manipulation Hotspot Pills ── */
.cc3d-zip-pill {
  position: absolute;
  z-index: 32;
  transform: translate(-50%, -50%);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  pointer-events: auto;
  transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
  background: rgba(28, 25, 23, 0.84);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: rgba(255, 255, 255, 0.9);
  border: 1.5px dashed rgba(245, 196, 81, 0.65);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}
.cc3d-zip-pill:hover {
  transform: translate(-50%, -50%) scale(1.05);
  background: rgba(195, 125, 74, 0.96);
  border-style: solid;
  border-color: #fde68a;
  color: #ffffff;
  box-shadow: 0 6px 20px rgba(195, 125, 74, 0.45);
}
.cc3d-zip-pill.is-active {
  background: linear-gradient(135deg, #b45309 0%, #92400e 100%);
  border: 1.5px solid #fde68a;
  color: #ffffff;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.28), 0 6px 18px rgba(0, 0, 0, 0.32);
  z-index: 34;
}
.cc3d-zip-pill .cc3d-zip-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(253, 230, 138, 0.22);
  color: #fde68a;
  font-size: 10.5px;
  font-weight: 800;
}
.cc3d-zip-pill.is-active .cc3d-zip-icon {
  background: #fde68a;
  color: #78350f;
}
.cc3d-zip-pill.hidden {
  opacity: 0 !important;
  pointer-events: none !important;
}

/* ── Upgraded Zipper Quick-Select Cards inside Sewing/Craft Panel ── */
.cc3d-zip-panel-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}
.cc3d-zip-choice-card {
  appearance: none;
  width: 100%;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 13px;
  border-radius: 10px;
  border: 1.5px solid rgba(139, 111, 71, 0.22);
  background: #faf7f2;
  color: #1f1d1a;
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.16s ease;
}
.cc3d-zip-choice-card:hover {
  border-color: #c37d4a;
  background: #fff9f2;
}
.cc3d-zip-choice-card.is-selected {
  border-color: #d97706;
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  color: #78350f;
  box-shadow: 0 2px 10px rgba(217, 119, 6, 0.15);
}
.cc3d-zip-choice-left {
  display: flex;
  align-items: center;
  gap: 9px;
}
.cc3d-zip-choice-badge {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(139, 111, 71, 0.14);
  color: #6e665e;
}
.cc3d-zip-choice-card.is-selected .cc3d-zip-choice-badge {
  background: #d97706;
  color: #ffffff;
}

/* ── Mobile Responsive Adaptation (< 768px) ── */
@media (max-width: 767px) {
  .cc3d-zip-pill {
    padding: 4px 8px;
    font-size: 10.5px;
    gap: 4px;
  }
  .cc3d-toolbar {
    bottom: 8px;
    padding: 4px 6px;
    gap: 2px;
  }
  .cc3d-tool-btn {
    font-size: 10.5px;
    padding: 4px 8px;
  }
  .cc3d-status-pill {
    top: 8px;
    left: 8px;
    font-size: 10px;
    padding: 4px 8px;
  }
  .dim-label-badge {
    padding: 3px 7px;
    font-size: 10.5px;
    gap: 3px;
  }
  .dim-label-badge .dim-name-tag {
    display: none; /* Compact on mobile screens to prevent clutter */
  }
  .dim-label-badge.is-focused .dim-name-tag {
    display: inline; /* Show name on mobile when actively focused */
  }
  .dim-label-badge .dim-value {
    font-size: 11px;
  }
  /* Keep 3D preview comfortable and visible while editing dimensions on phone */
  #dev-form-3d-container {
    min-height: 270px !important;
    height: 270px !important;
  }
}
