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

/* Body Styling */
body {
  font-family: Arial, sans-serif;
  background-color: #f4f4f4;
  color: #333;
  margin: 0;
  padding: 0;
}

/* Header Styling */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #007bff;
  color: white;
  padding: 15px 30px;
  flex-wrap: wrap;
}

.header-left h1 {
  font-size: 22px;
  margin-bottom: 5px;
}

.header-left p {
  font-size: 14px;
  font-weight: 300;
}

.header-right {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 10px;
  width: 100%;
  max-width: 400px;
}

.reseller-input {
  display: flex;
  width: 100%;
  max-width: 300px; /* Membatasi lebar */
}

.reseller-input input {
  padding: 10px;
  width: 100%;
  font-size: 14px;
  margin-right: 10px;
  border-radius: 5px;
  border: 1px solid #ccc;
}

.reseller-input button {
  padding: 8px 18px;
  font-size: 14px;
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}

.reseller-input button:hover {
  background-color: #0056b3;
}

/* Cart Button */
.cart-btn {
  padding: 10px;
  font-size: 14px;
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}

.cart-btn:hover {
  background-color: #0056b3;
}

/* Loading Spinner */
.loading {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.spinner {
  border: 4px solid #f3f3f3;
  border-top: 4px solid #007bff;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 2s linear infinite;
}

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

.loading p {
  color: white;
  font-size: 16px;
  margin-top: 10px;
}

/* Product Grid Styling */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
  padding: 20px;
  margin-top: 20px;
}

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

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

.product-card img {
  width: 100%;
  height: auto;
  max-height: 200px;
  object-fit: contain;
}

.product-info {
  padding: 15px;
}

.product-info h3 {
  font-size: 16px;
  font-weight: bold;
}

.product-info p {
  color: #555;
  font-size: 12px;
  margin: 8px 0;
}

.product-info p strong {
  font-weight: bold;
}

.btn-buy, .btn-detail, .btn-cart {
  background-color: #007bff;
  color: white;
  padding: 10px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  width: 100%;
  margin-top: 10px;
}

.btn-buy:hover, .btn-detail:hover, .btn-cart:hover {
  background-color: #0056b3;
}

/* Popup Styling */
.popup {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.popup-content {
  background-color: white;
  padding: 20px;
  border-radius: 10px;
  text-align: center;
}

.popup-content button {
  margin-top: 10px;
  background-color: #007bff;
  color: white;
  padding: 10px 20px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}

.popup-content button:hover {
  background-color: #0056b3;
}

/* Responsif untuk tampilan mobile */
@media (max-width: 768px) {
  .header-left h1 {
    font-size: 20px;
  }

  .header-left p {
    font-size: 12px;
  }

  .reseller-input input {
    font-size: 14px;
  }

  .reseller-input button {
    font-size: 14px;
  }

  nav ul {
    flex-direction: column;
    padding: 0;
  }

  nav ul li {
    margin: 10px 0;
  }

  .product-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .product-info h3 {
    font-size: 14px;
  }

  .product-info p {
    font-size: 12px;
  }

  .btn-buy, .btn-cart, .btn-detail {
    font-size: 14px;
  }

  #category-select {
    font-size: 14px;
    width: 100%;
    margin-top: 10px;
  }
}

@media (max-width: 480px) {
  .product-grid {
    grid-template-columns: 1fr;
  }
}