:root {
  --bg-primary: #0e1115;
  --bg-surface: rgba(18, 22, 28, 0.75);
  --bg-surface-elevated: rgba(28, 34, 44, 0.85);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-active: rgba(238, 197, 88, 0.6);
  --jetr-gold: #EEC558;
  --jetr-gold-glow: rgba(238, 197, 88, 0.25);
  --jetr-frequency: #7B9EA8;
  --jetr-dark-grey: #434343;
  --jetr-stone: #F0EFEB;
  --jetr-offwhite: #F2F1EE;
  --jetr-cyan: #009BBD;
  --jetr-lime: #9ECC3B;
  --text-main: #F2F1EE;
  --text-muted: #94A3B8;
  --font-display: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-body: 'Roboto', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --blur-glass: blur(20px);
  --radius-dock: 24px;
  --radius-sm: 10px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-primary);
  color: var(--text-main);
  font-family: var(--font-body);
  user-select: none;
  -webkit-user-select: none;
}

#canvas-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  touch-action: none;
}

#webgl-canvas {
  width: 100%;
  height: 100%;
  display: block;
  outline: none;
  touch-action: none;
}

/* Studio Vignette Overlay */
.vignette-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  background: radial-gradient(circle at 50% 45%, transparent 40%, rgba(10, 12, 16, 0.65) 100%);
}

/* Header Bar */
.brand-header {
  position: absolute;
  top: 20px;
  left: 20px;
  right: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 10;
  pointer-events: none;
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  pointer-events: auto;
  background: var(--bg-surface);
  backdrop-filter: var(--blur-glass);
  -webkit-backdrop-filter: var(--blur-glass);
  border: 1px solid var(--border-subtle);
  padding: 8px 16px;
  border-radius: 40px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.brand-logo-img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #FFFFFF;
  line-height: 1.1;
}

.brand-subtitle {
  font-size: 10.5px;
  font-weight: 400;
  color: var(--jetr-gold);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Header Action Buttons */
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
}

.header-btn {
  background: var(--bg-surface);
  backdrop-filter: var(--blur-glass);
  -webkit-backdrop-filter: var(--blur-glass);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 8px 14px;
  border-radius: 40px;
  font-size: 12px;
  font-weight: 500;
  font-family: var(--font-body);
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.header-btn:hover {
  background: var(--bg-surface-elevated);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.header-btn:active {
  transform: scale(0.97);
}

.header-btn.active {
  border-color: var(--jetr-gold);
  color: var(--jetr-gold);
}

.header-btn svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
}

/* Camera Perspective Pills */
.camera-views-bar {
  position: absolute;
  top: 80px;
  left: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 10;
}

.cam-btn {
  background: rgba(18, 22, 28, 0.6);
  backdrop-filter: var(--blur-glass);
  -webkit-backdrop-filter: var(--blur-glass);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cam-btn:hover {
  color: var(--text-main);
  background: var(--bg-surface-elevated);
  border-color: rgba(255, 255, 255, 0.15);
}

.cam-btn.active {
  color: var(--jetr-gold);
  border-color: var(--jetr-gold);
  background: rgba(238, 197, 88, 0.1);
}

/* Bottom Floating Control Dock */
.control-dock {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 620px;
  background: var(--bg-surface);
  backdrop-filter: var(--blur-glass);
  -webkit-backdrop-filter: var(--blur-glass);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-dock);
  padding: 16px 20px;
  z-index: 10;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 1px 1px rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translate(-50%, 30px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

/* Part Tabs */
.part-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 2px;
}

.part-tabs::-webkit-scrollbar {
  display: none;
}

.part-tab {
  flex: 1 0 auto;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid transparent;
  color: var(--text-muted);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.part-tab .color-preview-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--jetr-gold);
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: inline-block;
}

.part-tab:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.08);
}

.part-tab.active {
  background: rgba(238, 197, 88, 0.15);
  color: var(--jetr-gold);
  border-color: var(--border-active);
  font-weight: 600;
}

/* Swatches & Color Picker Row */
.palette-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.swatches-scroller {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 4px 2px;
  flex: 1;
}

.swatches-scroller::-webkit-scrollbar {
  display: none;
}

.swatch {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid rgba(255, 255, 255, 0.15);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.swatch:hover {
  transform: scale(1.15);
  border-color: #FFFFFF;
}

.swatch.active {
  transform: scale(1.22);
  border-color: #FFFFFF;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.5);
}

.swatch.active::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #FFFFFF;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.8);
}

/* Custom Color Wheel Picker */
.custom-picker-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
}

.color-input-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: conic-gradient(red, yellow, lime, aqua, blue, magenta, red);
  border: 2px solid rgba(255, 255, 255, 0.4);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s ease;
}

.color-input-btn:hover {
  transform: scale(1.1);
}

.color-input-btn input[type="color"] {
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  opacity: 0;
  cursor: pointer;
}

/* Material Finish Controls */
.finish-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 10px;
}

.finish-tabs {
  display: flex;
  gap: 4px;
  background: rgba(0, 0, 0, 0.3);
  padding: 3px;
  border-radius: 10px;
}

.finish-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 500;
}

.finish-btn.active {
  background: rgba(255, 255, 255, 0.12);
  color: #FFFFFF;
}

.current-spec-summary {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.current-spec-summary strong {
  color: var(--jetr-gold);
}

/* Dock Bottom Actions (Share & Reserve) */
.dock-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.cta-reserve {
  flex: 2;
  background: var(--jetr-gold);
  color: #121417;
  border: none;
  padding: 10px 16px;
  border-radius: 12px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 18px var(--jetr-gold-glow);
}

.cta-reserve:hover {
  background: #f5cf6d;
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(238, 197, 88, 0.4);
}

.cta-reserve:active {
  transform: scale(0.98);
}

.cta-share {
  flex: 1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 10px 12px;
  border-radius: 12px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.cta-share:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

/* Loading Overlay */
#loading-overlay {
  position: absolute;
  inset: 0;
  background: #0e1115;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  z-index: 100;
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.6s;
}

#loading-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
  animation: pulseLogo 2s ease-in-out infinite;
}

@keyframes pulseLogo {
  0%, 100% { transform: scale(1); opacity: 0.9; }
  50% { transform: scale(1.08); opacity: 1; }
}

.loader-bar-track {
  width: 180px;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}

.loader-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--jetr-gold);
  border-radius: 2px;
  transition: width 0.2s ease-out;
  box-shadow: 0 0 10px var(--jetr-gold);
}

.loader-status-text {
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Modal Popup (Reserve / Share) */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.modal-backdrop.open {
  opacity: 1;
  visibility: visible;
}

.modal-card {
  width: 100%;
  max-width: 440px;
  background: #14181f;
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  padding: 28px 24px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
  transform: translateY(20px) scale(0.96);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-backdrop.open .modal-card {
  transform: translateY(0) scale(1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.modal-header h3 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  color: #FFFFFF;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  padding: 4px;
}

.modal-close-btn:hover {
  color: #FFFFFF;
}

.modal-body {
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 20px;
}

.spec-list {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 12px 16px;
  margin: 16px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12.5px;
}

.spec-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.spec-item span:first-child {
  color: var(--text-muted);
}

.spec-item span:last-child {
  color: #FFFFFF;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
}

.spec-color-chip {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.modal-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: #FFFFFF;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 12px;
  outline: none;
  transition: border-color 0.2s ease;
}

.modal-input:focus {
  border-color: var(--jetr-gold);
}

.modal-primary-btn {
  width: 100%;
  background: var(--jetr-gold);
  color: #121417;
  border: none;
  padding: 12px;
  border-radius: 10px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.modal-primary-btn:hover {
  background: #f5cf6d;
}

/* Toast notification */
.toast-notice {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(-30px);
  background: rgba(20, 24, 31, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid var(--jetr-gold);
  color: #FFFFFF;
  padding: 10px 20px;
  border-radius: 30px;
  font-size: 12.5px;
  font-weight: 500;
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.toast-notice.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Responsive queries */
@media (max-width: 600px) {
  .brand-header {
    top: 14px;
    left: 14px;
    right: 14px;
  }
  .brand-badge {
    padding: 6px 12px;
    gap: 8px;
  }
  .brand-logo-img {
    width: 24px;
    height: 24px;
  }
  .brand-title {
    font-size: 13px;
  }
  .brand-subtitle {
    font-size: 9px;
  }
  .header-btn span {
    display: none;
  }
  .header-btn {
    padding: 8px;
  }
  .camera-views-bar {
    top: 66px;
    left: 14px;
  }
  .cam-btn {
    padding: 5px 10px;
    font-size: 10px;
  }
  .control-dock {
    bottom: 14px;
    width: calc(100% - 24px);
    padding: 12px 14px;
    gap: 10px;
    border-radius: 20px;
  }
  .part-tab {
    padding: 6px 10px;
    font-size: 11px;
  }
  .swatch {
    width: 28px;
    height: 28px;
    min-width: 28px;
  }
  .finish-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .dock-actions {
    flex-direction: row;
  }
  .cta-reserve {
    font-size: 12px;
    padding: 9px 12px;
  }
  .cta-share {
    font-size: 11px;
    padding: 9px 10px;
  }
}
