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

body {
  font-family: 'Noto Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: #fff;
  color: #000;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  padding-bottom: 80px;
}

.search-section {
  display: flex;
  gap: 10px;
  margin-bottom: 30px;
  position: sticky;
  top: 20px;
  z-index: 10;
  background: #fff;
  padding: 10px 0;
}

#searchInput {
  flex: 1;
  padding: 14px 18px;
  border: 2px solid #000;
  font-size: 16px;
  outline: none;
  font-family: inherit;
}

#generateBtn {
  padding: 14px 32px;
  background: #000;
  color: #fff;
  border: none;
  font-size: 16px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  transition: transform 0.1s;
}

#generateBtn:active {
  transform: scale(0.98);
}

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

.product-card {
  border: 2px solid #000;
  background: #fff;
  overflow: hidden;
  transition: transform 0.2s;
}

.product-card:active {
  transform: scale(0.98);
}

.product-image {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: #f5f5f5;
}

.product-info {
  padding: 16px;
}

.product-name {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
}

.product-description {
  font-size: 13px;
  color: #666;
  margin-bottom: 12px;
  line-height: 1.4;
}

.product-price {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 12px;
}

.add-to-cart {
  width: 100%;
  padding: 12px;
  background: #000;
  color: #fff;
  border: none;
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  transition: transform 0.1s;
}

.add-to-cart:active {
  transform: scale(0.98);
}

.cart-icon {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #000;
  color: #fff;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  transition: transform 0.2s;
}

.cart-icon:active {
  transform: scale(0.95);
}

#cartCount {
  position: absolute;
  top: 8px;
  right: 8px;
  background: #fff;
  color: #000;
  font-size: 12px;
  font-weight: 700;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  animation: fadeIn 0.2s;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  background: #fff;
  margin: 40px auto;
  padding: 30px;
  border: 2px solid #000;
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
  animation: slideUp 0.3s;
}

@keyframes slideUp {
  from { transform: translateY(30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.close {
  float: right;
  font-size: 32px;
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
}

.close:hover {
  color: #666;
}

.modal-content h2 {
  margin-bottom: 20px;
  font-size: 24px;
}

.cart-item {
  display: flex;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid #e0e0e0;
}

.cart-item-image {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border: 1px solid #000;
}

.cart-item-info {
  flex: 1;
}

.cart-item-name {
  font-weight: 600;
  margin-bottom: 4px;
}

.cart-item-price {
  font-weight: 700;
}

.remove-item {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 20px;
  padding: 4px;
}

.cart-total {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 2px solid #000;
  font-size: 20px;
  text-align: right;
}

.checkout-btn {
  width: 100%;
  padding: 16px;
  background: #000;
  color: #fff;
  border: none;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 20px;
  font-family: inherit;
  transition: transform 0.1s;
}

.checkout-btn:active {
  transform: scale(0.98);
}

.loading {
  text-align: center;
  padding: 40px;
  font-size: 18px;
}

.spinner {
  margin: 20px auto;
  width: 40px;
  height: 40px;
  border: 4px solid #f0f0f0;
  border-top: 4px solid #000;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

#generateBtn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

@media (max-width: 768px) {
  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
  }
  
  .modal-content {
    margin: 20px auto;
    width: 95%;
  }
}