html {
  height: 100%;
}

body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: #111;
}

.car-viewer {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 100vh;
  background: url('./assets/images/woo-background3.webp') center center / cover no-repeat;}

.car-viewer__canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none; /* prevents page scroll from fighting orbit/pinch gestures */
}

.car-viewer__loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #fff;
  font-family: sans-serif;
  font-size: 14px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: rgba(0, 0, 0, 0.65);
  padding: 16px 24px;
  border-radius: 6px;
  text-align: center;
  min-width: 180px;
}

.car-viewer__loading-spinner {
  width: 24px;
  height: 24px;
  margin: 0 auto 10px;
  border: 3px solid rgba(255, 255, 255, 0.25);
  border-top-color: #e68c1e;
  border-radius: 50%;
  animation: car-viewer-spin 0.8s linear infinite;
}

@keyframes car-viewer-spin {
  to { transform: rotate(360deg); }
}

.car-viewer__loading--hidden {
  display: none;
}

.car-viewer__markers {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.car-viewer__marker {
  position: absolute;
  left: 0;
  top: 0;
  will-change: transform;
  width: 28px;
  height: 28px;
  margin-left: -14px;
  margin-top: -14px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.65);
  border: 2px solid #fff;
  color: #fff;
  font-family: sans-serif;
  font-size: 13px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  cursor: pointer;
  transition: background 0.15s ease;
}

.car-viewer__marker:hover,
.car-viewer__marker--active {
  background: rgba(230, 140, 30, 0.9);
}

.car-viewer__marker--hidden {
  display: none;
}

/* Show only the selected hotspot's pin */
.car-viewer__marker:not(.car-viewer__marker--active) {
  display: none;
}

/* Calibrate mode: show all pins */
.car-viewer--calibrating .car-viewer__marker:not(.car-viewer__marker--hidden) {
  display: flex;
}

.car-viewer__popup {
  position: absolute;
  left: 0;
  top: 0;
  will-change: transform;
  width: min(260px, 80vw);
  max-height: calc(100% - 32px);
  overflow-y: auto;
  background: rgba(20, 20, 20, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  padding: 16px 18px;
  color: #fff;
  font-family: sans-serif;
  box-sizing: border-box;
}

.car-viewer__popup-image {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 4px;
  margin-top: 8px;
}

.car-viewer__popup--hidden {
  display: none;
}

.car-viewer__header {
  position: absolute;
  top: 16px;
  left: 16px;
  right: 16px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
}

.car-viewer__header > .car-viewer__toolbar {
  justify-self: start;
}

.car-viewer__nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 300px;
  background: rgba(20, 20, 20, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  padding: 8px 20px;
  font-family: sans-serif;
  box-sizing: border-box;
}

.car-viewer__nav-arrow {
  flex: 0 0 auto;
  background: none;
  border: none;
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}

.car-viewer__nav-arrow:hover {
  color: #e68c1e;
}

.car-viewer__nav-title {
  flex: 1 1 auto;
  min-width: 0;
  color: #fff;
  font-size: 14px;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.car-viewer__toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(20, 20, 20, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  padding: 10px 18px;
  font-family: sans-serif;
}

.car-viewer__toolbar-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.car-viewer__toolbar-divider {
  width: 1px;
  height: 20px;
  background: rgba(255, 255, 255, 0.15);
}

.car-viewer__toolbar-label {
  color: #999;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.car-viewer__model-select {
  background: #2a2a2a;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
}



.car-viewer__stat {
  color: #9f9;
  font-size: 12px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.car-viewer__toolbar-toggle {
  white-space: nowrap;
  background: #2a2a2a;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.car-viewer__toolbar-toggle:hover {
  border-color: #e68c1e;
}

.car-viewer__toolbar-toggle--active {
  background: #e68c1e;
  border-color: #e68c1e;
}

.car-viewer__calibrate {
  display:none;
  position: absolute;
  left: 16px;
  bottom: 16px;
  font-family: sans-serif;
  z-index: 10;
}

.car-viewer__calibrate-toggle {
  background: #2a2a2a;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 4px;
  padding: 8px 14px;
  font-size: 13px;
  cursor: pointer;
}

.car-viewer__calibrate-toggle--active {
  background: #e68c1e;
  border-color: #e68c1e;
}

.car-viewer__calibrate-hint {
  color: #fff;
  font-size: 12px;
  margin-top: 6px;
  max-width: 260px;
}

.car-viewer__calibrate-output {
  color: #9f9;
  background: rgba(0, 0, 0, 0.75);
  font-size: 11px;
  margin-top: 6px;
  padding: 8px;
  max-width: 320px;
  max-height: 160px;
  overflow: auto;
  border-radius: 4px;
  white-space: pre-wrap;
}

.car-viewer__popup-title {
  margin: 0 0 8px 0;
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.car-viewer__popup-body {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: #ccc;
}

/* Tablet */
@media (max-width: 1024px) {
  .car-viewer__nav {
    width: 260px;
    gap: 12px;
    padding: 6px 16px;
  }

  .car-viewer__nav-title {
    font-size: 13px;
  }
}

/* Phone */
@media (max-width: 640px) {
  .car-viewer__marker {
    width: 34px;
    height: 34px;
    margin-left: -17px;
    margin-top: -17px;
    font-size: 14px;
  }

  .car-viewer__popup {
    padding: 12px 14px;
  }

  .car-viewer__popup-title {
    font-size: 14px;
  }

  .car-viewer__popup-body {
    font-size: 12px;
  }

  .car-viewer__header {
    top: 12px;
    left: 12px;
    right: 12px;
    display: flex;
    gap: 8px;
  }

  .car-viewer__toolbar {
    flex: none;
    padding: 6px 8px;
  }

  .car-viewer__nav {
    flex: 1;
    min-width: 0;
    width: auto;
    gap: 10px;
    padding: 6px 12px;
    justify-content: space-between;
  }

  .car-viewer__nav-title {
    min-width: 0;
    font-size: 12px;
    flex: 1;
  }

  .car-viewer__nav-arrow {
    font-size: 20px;
  }

  /* Calibration tool is for internal use only; keep it out of the way on phone */
  .car-viewer__calibrate {
    left: 8px;
    bottom: 8px;
    transform: scale(0.85);
    transform-origin: bottom left;
  }

  .car-viewer__calibrate-output {
    max-width: 220px;
    max-height: 110px;
  }
}