* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background: #fafafa;
  color: #333;
  line-height: 1.6;
}

header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 3rem 2rem;
  text-align: center;
}

header h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  font-weight: 700;
}

header p {
  font-size: 1.1rem;
  opacity: 0.9;
  max-width: 600px;
  margin: 0 auto;
}

nav {
  background: white;
  padding: 1rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

nav ul {
  list-style: none;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  max-width: 1200px;
  margin: 0 auto;
}

nav a {
  text-decoration: none;
  color: #667eea;
  padding: 0.5rem 1rem;
  border-radius: 25px;
  font-weight: 500;
  transition: all 0.3s ease;
  font-size: 0.95rem;
}

nav a:hover,
nav a.active {
  background: #667eea;
  color: white;
}

/* Search Container */
.search-container {
  background: linear-gradient(135deg, #f5f7fa 0%, #e8ecf1 100%);
  padding: 2rem 1.5rem;
  border-bottom: 1px solid #ddd;
}

.search-box {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  position: relative;
  display: flex;
  gap: 0.75rem;
}

.search-box input {
  flex: 1;
  padding: 1.5rem 2rem;
  font-size: 1.3rem;
  border: 2px solid #ddd;
  border-radius: 50px;
  outline: none;
  transition: all 0.3s ease;
  background: white;
}

.search-box input:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.2);
}

.search-box input::placeholder {
  color: #999;
}

.search-btn {
  padding: 1.5rem 2.5rem;
  font-size: 1.2rem;
  font-weight: 600;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.search-btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.clear-btn {
  position: absolute;
  right: 140px;
  top: 50%;
  transform: translateY(-50%);
  background: #ddd;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  color: #666;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.clear-btn:hover {
  background: #ccc;
  color: #333;
}

.search-options {
  width: 100%;
  max-width: 100%;
  margin: 1rem auto 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.sort-label {
  font-size: 0.9rem;
  color: #666;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sort-label select {
  padding: 0.5rem 1.25rem 0.5rem 1rem;
  border: 2px solid #ddd;
  border-radius: 50px;
  background: white;
  font-size: 0.9rem;
  cursor: pointer;
  outline: none;
  transition: all 0.3s ease;
}

.sort-label select:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.results-count {
  font-size: 0.9rem;
  color: #888;
  font-weight: 500;
}

main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.category {
  margin-bottom: 3rem;
}

.category h2 {
  font-size: 1.8rem;
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 3px solid #667eea;
  display: inline-block;
}

.products {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

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

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.product-image {
  width: 100%;
  height: 200px;
  background: #f5f5f5;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

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

.product-info {
  padding: 1rem;
}

.product-brand {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  color: #667eea;
  background: rgba(102, 126, 234, 0.1);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.product-info h3 {
  font-size: 0.95rem;
  font-weight: 500;
  margin-bottom: 0.75rem;
  line-height: 1.4;
  height: 2.8em;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.product-price {
  font-size: 1.2rem;
  font-weight: 700;
  color: #667eea;
  margin-bottom: 0.75rem;
}

.buy-btn {
  display: block;
  width: 100%;
  padding: 0.75rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  text-align: center;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  transition: opacity 0.3s ease;
}

.buy-btn:hover {
  opacity: 0.9;
}

/* No Results */
.no-results {
  text-align: center;
  padding: 3rem;
  color: #666;
}

.no-results p {
  font-size: 1.2rem;
  margin-bottom: 1rem;
}

.no-results button {
  padding: 0.75rem 1.5rem;
  background: #667eea;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.3s ease;
}

.no-results button:hover {
  background: #5a6fd6;
}

footer {
  background: #333;
  color: #999;
  text-align: center;
  padding: 2rem;
  margin-top: 3rem;
}

footer p {
  font-size: 0.85rem;
}

footer a {
  color: #999;
}

.disclosure {
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 2rem;
  font-size: 0.9rem;
  color: #856404;
}

@media (max-width: 768px) {
  header h1 {
    font-size: 1.8rem;
  }
  
  nav ul {
    gap: 0.25rem;
  }
  
  nav a {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
  }
  
  .search-container {
    padding: 1.25rem 1rem;
  }
  
  .search-box {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .search-box input {
    padding: 1.25rem 1.5rem;
    font-size: 1.1rem;
    border-radius: 30px;
  }
  
  .search-btn {
    padding: 1rem 1.5rem;
    border-radius: 30px;
    font-size: 1rem;
  }
  
  .clear-btn {
    right: 20px;
    top: 32px;
  }
  
  .search-options {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }
  
  .sort-label {
    justify-content: space-between;
  }
  
  .results-count {
    text-align: center;
  }
  
  .products {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
  }
  
  .product-image {
    height: 150px;
  }
  
  .product-brand {
    font-size: 0.65rem;
  }
}
