/* ===== Showroom page (uses the colour variables from style.css) ===== */

.showroom-page {
  overflow-y: auto;
}

.showroom {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 24px;
  padding: calc(var(--nav-height) + 24px) 32px 24px;
  max-width: 1500px;
  margin: 0 auto;
}

/* ----- The 3D stage ----- */
.stage {
  position: relative;
  height: min(72vh, 760px);
  min-height: 420px;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  /* Spotlit showroom backdrop */
  background:
    radial-gradient(ellipse 60% 45% at 50% 30%, rgba(77, 163, 255, 0.14) 0%, transparent 70%),
    radial-gradient(ellipse at 50% 40%, #243149 0%, #121a28 55%, #0b0f17 100%);
}

/* Soft floor glow under the model */
.stage::before {
  content: "";
  position: absolute;
  left: 10%;
  right: 10%;
  bottom: 8%;
  height: 30%;
  background: radial-gradient(ellipse at 50% 50%, rgba(255, 255, 255, 0.07) 0%, transparent 70%);
  pointer-events: none;
}

.stage:fullscreen {
  height: 100vh;
  border-radius: 0;
}

model-viewer {
  width: 100%;
  height: 100%;
  background: transparent;
  --poster-color: transparent;
}

/* Loading bar */
.progress-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.08);
  transition: opacity 0.4s;
}

.progress-bar.hide {
  opacity: 0;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  transform-origin: left;
  transform: scaleX(0);
  transition: transform 0.2s;
}

/* AR button */
.ar-btn {
  position: absolute;
  left: 16px;
  bottom: 16px;
  padding: 10px 16px;
  border: none;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font: 500 0.9rem "Inter", sans-serif;
  cursor: pointer;
}

/* Control buttons */
.stage-controls {
  position: absolute;
  right: 16px;
  bottom: 16px;
  display: flex;
  gap: 8px;
}

.ctrl-btn {
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: rgba(11, 15, 23, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: var(--text);
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.ctrl-btn:hover {
  border-color: var(--accent);
}

.ctrl-btn[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
}

.stage-hint {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
  pointer-events: none;
}

.stage-error {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 32px;
  text-align: center;
  color: var(--text-muted);
}

.stage-error[hidden] {
  display: none;
}

/* ----- Hotspot labels pinned to the model ----- */
.hotspot {
  width: 16px;
  height: 16px;
  padding: 0;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(77, 163, 255, 0.3);
  cursor: pointer;
  transition: opacity 0.3s;
}

/* Fade labels on the far side of the model */
.hotspot:not([data-visible]) {
  opacity: 0.25;
}

.hotspot-label {
  position: absolute;
  left: 22px;
  top: 50%;
  transform: translateY(-50%);
  padding: 5px 10px;
  border-radius: 4px;
  background: rgba(11, 15, 23, 0.85);
  border: 1px solid var(--border);
  color: var(--text);
  font: 500 0.8rem "Inter", sans-serif;
  white-space: nowrap;
  pointer-events: none;
}

model-viewer.hide-labels .hotspot {
  display: none;
}

/* ----- Info panel ----- */
.info-panel {
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  align-self: start;
}

.info-category {
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.info-title {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.8rem;
  line-height: 1.15;
  margin-bottom: 14px;
}

.info-description {
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 22px;
}

.spec-list {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px 16px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
}

.spec-list dt {
  color: var(--text-muted);
}

.spec-list dd {
  text-align: right;
}

/* ----- Gallery ----- */
.gallery-section {
  max-width: 1500px;
  margin: 0 auto;
  padding: 16px 32px 64px;
}

.gallery-section h2 {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.4rem;
  margin-bottom: 16px;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.gallery-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 0 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--text);
  text-align: left;
  font-family: inherit;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.2s, transform 0.2s;
}

.gallery-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.gallery-card.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.thumb {
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  margin-bottom: 8px;
  background: radial-gradient(ellipse at 50% 40%, #243149 0%, #121a28 70%);
  color: var(--text-muted);
  font-size: 2rem;
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.card-title {
  padding: 0 14px;
  font-weight: 600;
}

.card-category {
  padding: 0 14px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ----- Smaller screens ----- */
@media (max-width: 900px) {
  .showroom {
    grid-template-columns: 1fr;
    padding: calc(var(--nav-height) + 16px) 16px 16px;
  }

  .stage {
    height: 60vh;
    min-height: 360px;
  }

  .stage-hint {
    display: none;
  }

  .gallery-section {
    padding: 8px 16px 48px;
  }

  .gallery {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }
}
