/* 
  PeçaRadar — Visual Explorer CSS 
  Estética: Premium, Glassmorphism, Techno-Design
  Atualizado: Sketchfab Viewer API (iframe)
*/

.explorer-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px);
  z-index: 9999;
  display: none;
  /* Ativado via JS */
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.3s ease-out;
}

.explorer-modal-overlay.show {
  display: flex;
}

.explorer-modal-box {
  background: rgba(18, 18, 24, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.1);
  width: 95%;
  max-width: 1200px;
  height: 85vh;
  border-radius: 24px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5),
    0 0 40px rgba(0, 97, 255, 0.1);
}

.explorer-header {
  padding: 20px 30px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.explorer-title {
  font-family: 'Syne', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
}

.explorer-title span {
  color: var(--blue, #0061FF);
  font-weight: 800;
}

.explorer-close {
  background: rgba(255, 255, 255, 0.05);
  border: none;
  color: #888;
  font-size: 24px;
  cursor: pointer;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.explorer-close:hover {
  background: #ff4d4d;
  color: white;
  transform: rotate(90deg);
}

.explorer-body {
  flex: 1;
  display: flex;
  min-height: 0;
  position: relative;
}

/* ── Sketchfab Container ── */
#sketchfab-container {
  flex: 3;
  position: relative;
  background: radial-gradient(circle at center, #1a1a2e 0%, #0d0d12 100%);
  overflow: hidden;
}

#sketchfab-frame {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* ── Painel Lateral ── */
#explorer-info {
  flex: 1;
  min-width: 260px;
  max-width: 320px;
  background: rgba(0, 0, 0, 0.3);
  border-left: 1px solid rgba(255, 255, 255, 0.05);
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
}

.info-card {
  background: rgba(255, 255, 255, 0.05);
  padding: 20px;
  border-radius: 16px;
  border-left: 4px solid var(--blue, #0061FF);
  animation: slideInRight 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  flex-shrink: 0;
}

.info-card h3 {
  font-family: 'Syne', sans-serif;
  margin-bottom: 10px;
  color: #fff;
  font-size: 1.1rem;
}

.info-card p {
  color: #aaa;
  line-height: 1.6;
  font-size: 0.9rem;
}

.part-search-label {
  margin-top: 14px;
  font-size: 0.8rem;
  color: #888;
  background: rgba(0, 97, 255, 0.1);
  border-radius: 8px;
  padding: 8px 12px;
  border: 1px solid rgba(0, 97, 255, 0.2);
}

.part-search-label strong {
  color: var(--blue, #0061FF);
}

/* ── Grade de Botões de Peças ── */
.explorer-part-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

.part-selector-btn {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #ccc;
  padding: 11px 16px;
  border-radius: 12px;
  font-size: 0.85rem;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.2s ease;
}

.part-selector-btn:hover {
  background: rgba(0, 97, 255, 0.15);
  border-color: rgba(0, 97, 255, 0.4);
  color: #fff;
  transform: translateX(4px);
}

.part-selector-btn.active {
  background: rgba(0, 97, 255, 0.2);
  border-color: var(--blue, #0061FF);
  color: #fff;
  box-shadow: 0 0 12px rgba(0, 97, 255, 0.2);
}

.part-selector-btn .part-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}

/* ── Controles rodapé ── */
.explorer-controls {
  text-align: center;
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  font-size: 0.78rem;
  color: #555;
  margin-top: auto;
  flex-shrink: 0;
}

/* ── Loader ── */
#explorer-loader {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #0d0d12;
  z-index: 10;
  transition: opacity 0.5s;
  gap: 12px;
}

#explorer-loader p {
  color: #666;
  font-size: 0.9rem;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(0, 97, 255, 0.1);
  border-top-color: #0061FF;
  border-radius: 50%;
  animation: explorer-spin 1s linear infinite;
}

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

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(20px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ── Responsividade Mobile ── */
@media (max-width: 900px) {
  .explorer-body {
    flex-direction: column;
  }

  #sketchfab-container {
    flex: 0 0 55%;
  }

  #explorer-info {
    flex: 1;
    max-width: 100%;
    border-left: none;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding: 16px;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 12px;
    overflow-y: auto;
  }

  .info-card {
    flex: 1 1 100%;
  }

  .explorer-part-grid {
    flex: 1 1 100%;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }

  .explorer-controls {
    flex: 1 1 100%;
    margin-top: 0;
  }

  .explorer-modal-box {
    width: 100%;
    height: 95vh;
  }
}