body {
  margin: 0;
  padding: 2rem;
  font-family: sans-serif;
  background-color: #f8f9fa;
}

h1 {
  text-align: center;
  font-size: 3rem;
  margin-bottom: 1rem;
  color: #212121;
}

#searchInput {
  display: block;
  margin: 0 auto 2rem auto;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  width: 90%;
  max-width: 400px;
  border: 2px solid #ccc;
  border-radius: 8px;
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.product {
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  text-align: center;
  padding: 1rem;
  border: 2px solid #e0e0e0;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.product:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
  border-color: #2196f3;
}

model-viewer {
  width: 100%;
  height: 300px;
  background-color: #f5f5f5;
  border-radius: 8px;
  cursor: pointer;
}

h3 {
  margin: 0.5rem 0 0.25rem 0;
  color: #333;
}

.download-btn {
  margin-top: 0.75rem;
  padding: 0.5rem 1rem;
  font-size: 0.95rem;
  background-color: #2196f3;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.download-btn:hover {
  background-color: #1976d2;
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.85);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  flex-direction: column;
}

.modal model-viewer {
  width: 90%;
  height: 90vh;
}

.close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: #fff;
  border: none;
  font-size: 1.5rem;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  cursor: pointer;
}

.model-failed {
  opacity: 0.5;
  border-color: #ffcdd2;
}

.model-failed h3 {
  color: #d32f2f;
}
