body {
  font-family: sans-serif;
  margin: 20px;
  background: #f9f9f9;
}

h1 {
  text-align: center;
}

/* Slider container */
.slider-container {
  position: relative;
  max-width: 100%;
  overflow: hidden;
  margin: 20px auto;
  padding: 0 40px;
}

/* Slider items */
.slider {
  display: flex;
  gap: 20px;
  transition: transform 0.3s ease;
}

/* Product card */
.product-card {
  flex: 1 1 calc(25% - 20px);
  background: white;
  border: 1px solid #ddd;
  border-radius: 10px;
  padding: 10px;
  text-align: center;
  position: relative;
}

.product-card img {
  max-width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: 8px;
}

.product-card button {
  margin-top: 10px;
  padding: 10px 15px;
  background: #333;
  color: white;
  border: none;
  border-radius: 20px;
  cursor: pointer;
  transition: background 0.3s ease;
}

.product-card button:hover {
  background: red;
}

.product-card button.added::after {
  content: " ✅";
}

/* Hover icons */
.product-icons {
  position: absolute;
  top: 10px;
  right: 10px;
  display: none;
  flex-direction: column;
  gap: 10px;
  z-index: 2;
}

.product-card:hover .product-icons {
  display: flex;
}

.product-icons i {
  background: white;
  border-radius: 50%;
  padding: 6px;
  box-shadow: 0 0 5px rgba(0,0,0,0.2);
  cursor: pointer;
  transition: transform 0.2s;
}

.product-icons i:hover {
  transform: scale(1.2);
}

.favorite.active {
  color: red;
}

/* Navigation arrows */
.nav-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: #333;
  color: white;
  border: none;
  font-size: 20px;
  padding: 10px;
  cursor: pointer;
  z-index: 1;
}

.left {
  left: 0;
}

.right {
  right: 0;
}

/* Cart toggle button */
#cart-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  background: white;
  border-radius: 50px;
  padding: 10px 15px;
  border: 1px solid #ccc;
  z-index: 1000;
  cursor: pointer;
}

#cart-count {
  background: red;
  color: white;
  padding: 2px 6px;
  border-radius: 50%;
  margin-left: 5px;
  font-weight: bold;
}

/* Cart sidebar */
#cart-sidebar {
  position: fixed;
  top: 0;
  right: -350px; /* initially hidden */
  width: 350px;
  height: 100%;
  background: #fff;
  box-shadow: -2px 0 10px rgba(0,0,0,0.2);
  transition: right 0.4s ease;
  z-index: 9999;
  overflow-y: auto;
}

/* ---------- Responsive Design ---------- */

/* Tablets */
@media (max-width: 992px) {
  .slider-container {
    padding: 0 20px;
  }

  .product-card {
    flex: 1 1 calc(33.333% - 20px);
  }

  #cart-sidebar {
    width: 300px;
  }
}

/* Phones (landscape & portrait) */
@media (max-width: 768px) {
  body {
    margin: 10px;
  }

  h1 {
    font-size: 1.5em;
  }

  .slider-container {
    padding: 0 10px;
  }

  .slider {
    gap: 10px;
  }

  .product-card {
    flex: 1 1 calc(50% - 10px);
  }

  #cart-sidebar {
    width: 280px;
  }

  #cart-toggle {
    top: 10px;
    right: 10px;
    padding: 8px 12px;
  }
}

/* Small phones */
@media (max-width: 480px) {
  .product-card {
    flex: 1 1 100%;
  }

  .product-card img {
    height: 120px;
  }

  .product-card button {
    padding: 8px 12px;
    font-size: 0.9em;
  }

  #cart-sidebar {
    width: 100%;
  }
}
