:root {
  --primary: #ff9900;
  --secondary: #146eb4;
  --dark: #131921;
  --light: #f3f3f3;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', system-ui, sans-serif;
}

body {
  background-color: var(--light);
  padding: 2rem;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
}

h1 {
  color: var(--dark);
  text-align: center;
  margin-bottom: 2rem;
}

.search-box {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  justify-content: center;
}

#keywordInput {
  padding: 0.8rem 1rem;
  width: 400px;
  border: 2px solid #ddd;
  border-radius: 4px;
  font-size: 1rem;
  transition: all 0.3s;
}

#keywordInput:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(255, 153, 0, 0.2);
}

#searchButton {
  padding: 0 2rem;
  background-color: var(--primary);
  color: white;
  border: none;
  border-radius: 4px;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.3s;
}

#searchButton:hover {
  background-color: #e68a00;
}

#searchButton:disabled {
  background-color: #cccccc;
  cursor: not-allowed;
}

#loadingIndicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin: 2rem 0;
}

.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid rgba(0, 0, 0, 0.1);
  border-left-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.hidden {
  display: none !important;
}

#resultsContainer {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.product-card {
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s;
}

.product-card:hover {
  transform: translateY(-5px);
}

.product-image {
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  border-bottom: 1px solid #eee;
}

.product-image img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.product-info {
  padding: 1.5rem;
}

.product-title {
  font-size: 1rem;
  margin-bottom: 0.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-price {
  color: #b12704;
  font-weight: bold;
  font-size: 1.2rem;
  margin: 0.5rem 0;
}

.product-rating {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--secondary);
  margin-top: 1rem;
}

.error-message {
  color: #d32f2f;
  background-color: #fde0e0;
  padding: 1rem;
  border-radius: 4px;
  text-align: center;
  margin-top: 2rem;
}

@media (max-width: 768px) {
  .search-box {
    flex-direction: column;
  }

  #keywordInput {
    width: 100%;
  }
}