* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: 'Poppins', sans-serif;
  background: linear-gradient(135deg, #f5f7fa, #c3cfe2);
  color: #222;
  transition: all 0.3s ease-in-out;
}

/* === HEADER === */
header {
  background: linear-gradient(90deg, #00c6ff, #0072ff);
  color: white;
  text-align: center;
  padding: 20px;
  border-radius: 0 0 20px 20px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}
header h1 { margin-bottom: 5px; font-size: 2.2em; }
.top-controls { margin-top: 12px; }
select, button {
  margin: 5px;
  padding: 8px 14px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: 0.3s;
}
button:hover, select:hover {
  transform: scale(1.05);
}

/* === MAIN === */
main {
  margin: 20px;
  margin-right: 270px; /* leave space for sidebar */
}
main h2 {
  margin-bottom: 15px;
  font-size: 1.8em;
  color: #0072ff;
}
.product-list {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
}
.product-card {
  background: rgba(255,255,255,0.85);
  border-radius: 15px;
  padding: 15px;
  width: 200px;
  text-align: center;
  box-shadow: 0 6px 20px rgba(0,0,0,0.1);
  transition: 0.3s ease;
  backdrop-filter: blur(10px);
}
.product-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}
.product-card img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 10px;
}
.add-btn {
  background: #0072ff;
  color: white;
  margin-top: 10px;
  padding: 8px 12px;
  border-radius: 8px;
}
.add-btn:hover {
  background: #0056cc;
}

/* === CART SIDEBAR === */
#cartSidebar {
  position: fixed;
  top: 0;
  right: 0;
  width: 260px;
  height: 100%;
  background: rgba(255,255,255,0.9);
  border-left: 3px solid #0072ff;
  padding: 20px;
  overflow-y: auto;
  box-shadow: -4px 0 15px rgba(0,0,0,0.15);
  backdrop-filter: blur(10px);
}
#cartSidebar h2 {
  margin-bottom: 12px;
  text-align: center;
  color: #0072ff;
}
.cart-item {
  border-bottom: 1px solid #ccc;
  padding: 10px 0;
}
.cart-item h4 {
  margin-bottom: 5px;
  font-weight: 600;
}
.cart-item input {
  width: 45px;
  text-align: center;
  padding: 3px;
  border-radius: 5px;
  border: 1px solid #0072ff;
}
.cart-item button {
  background: crimson;
  color: white;
  border: none;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
}
#clearCartBtn {
  display: block;
  margin: 15px auto;
  background: crimson;
  color: white;
  padding: 8px 14px;
  border-radius: 8px;
  font-weight: bold;
  transition: 0.3s;
}
#clearCartBtn:hover {
  background: darkred;
}

/* === FOOTER === */
footer {
  text-align: center;
  padding: 15px;
  background: linear-gradient(90deg, #0072ff, #00c6ff);
  color: white;
  margin-top: 30px;
  border-radius: 20px 20px 0 0;
}

/* === DARK MODE === */
.dark-mode {
  background: linear-gradient(135deg, #1f1f1f, #3a3a3a);
  color: #f0f0f0;
}
.dark-mode header, .dark-mode footer {
  background: linear-gradient(90deg, #0f2027, #203a43, #2c5364);
}
.dark-mode .product-card, .dark-mode #cartSidebar {
  background: rgba(40,40,40,0.9);
  border-color: #555;
}
.dark-mode .add-btn {
  background: #00c6ff;
}