@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap");

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

body {
  font-family: 'Inter', sans-serif;
  background-color: #fff;
  color: #222;
}

header {
  padding: 2rem 1rem;
  text-align: center;
}

.title {
  font-size: 1.75rem;
  font-weight: 600;
}

.container {
  display: flex;
  gap: 2rem;
  padding: 0 2rem 2rem;
  max-width: 1200px;
  margin: auto;
  flex-wrap: wrap;
}

.product-grid {
  flex: 2;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}

.product-card {
  background-color: #fff;
  border: 1px solid #ddd;
  padding: 1rem;
}

.product-card img {
  width: 100%;
  margin-bottom: 0.75rem;
}

.product-card h3 {
  font-size: 1rem;
  margin: 0.5rem 0;
}

.product-card p {
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}

.product-card button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: #fff;
  border: 1px solid #000;
  padding: 0.5rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.product-card button.selected {
  background: #000;
  color: #fff;
}

.product-card button .icon {
  width: 16px;
  height: 16px;
}

.product-card button .hidden {
  display: none;
}

/* Sidebar */
.bundle-sidebar {
  flex: 1;
  background: #fff;
  padding: 1rem;
  border: 1px solid #000;
  min-width: 280px;
  position: sticky;
  top: 1rem;
  height: fit-content;
}

.bundle-sidebar h2 {
  font-size: 1.2rem;
  margin-bottom: 0.25rem;
}

.instruction {
  font-size: 0.9rem;
  color: #555;
  margin-bottom: 1rem;
}

.progress-container {
  margin-bottom: 1rem;
}

#progressCount {
  font-size: 0.85rem;
  margin-bottom: 0.3rem;
  display: block;
}

.progress-bar {
  background: #ddd;
  height: 4px;
  width: 100%;
}

#progressFill {
  background: #000;
  height: 100%;
  width: 0%;
  transition: width 0.3s ease;
}

.selected-products {
  list-style: none;
  margin-top: 1rem;
  margin-bottom: 1rem;
  max-height: 240px;
  overflow-y: auto;
}

.selected-products li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.selected-products img {
  width: 50px;
  height: 50px;
  object-fit: cover;
}

.selected-products span {
  font-size: 0.85rem;
  flex: 1;
}

.quantity {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.quantity button {
  background: #f0f0f0;
  border: 1px solid #ccc;
  padding: 0.25rem 0.5rem;
  cursor: pointer;
  font-weight: bold;
}

.quantity span {
  min-width: 20px;
  text-align: center;
}

.remove {
  background: none;
  border: none;
  font-size: 1.2rem;
  color: #888;
  cursor: pointer;
}

.summary {
  margin-top: 1rem;
  border-top: 1px solid #ddd;
  padding-top: 1rem;
}

.summary p {
  margin: 0.25rem 0;
}

#bundleBtn {
  margin-top: 1rem;
  width: 100%;
  padding: 1rem;
  font-weight: 600;
  border: none;
  background: #ccc;
  color: #fff;
  cursor: not-allowed;
  transition: background 0.3s ease;
}

#bundleBtn.active {
  background: #000;
  cursor: pointer;
}

#bundleBtn:hover:enabled {
  background: #222;
}

/* Modal */
.cart-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.4);
  justify-content: center;
  align-items: center;
  z-index: 10;
}

.cart-modal .cart-content {
  background: #fff;
  padding: 2rem;
  width: 90%;
  max-width: 400px;
}

/* Responsive */
@media (max-width: 768px) {
  .container {
    flex-direction: column;
  }

  .bundle-sidebar {
    position: static;
    width: 100%;
    margin-top: 2rem;
  }
}
