/* ===== Cart Sidebar ===== */
.cart-sidebar {
  position: fixed;
  top: 0;
  right: -320px; /* hidden off-screen by default */
  width: 300px;
  height: 100vh;
  background: #FFEBD2;
  box-shadow: -4px 0 12px rgba(0,0,0,0.2);
  padding: 1.5rem;
  transition: right 0.3s ease, opacity 0.3s ease;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  opacity: 0;
}

.cart-sidebar.open {
  right: 0;
  opacity: 1;
}

.cart-sidebar h3 {
  font-family: 'Alex Brush', cursive;
  font-size: 1.8rem;
  margin-bottom: 1rem;
  color: #004AAA;
}

/* ===== Cart Items ===== */
#cart-items {
  list-style: none;
  padding: 0;
  flex-grow: 1;
  overflow-y: auto;
  margin-bottom: 1rem;
  color: #004AAA;
}

#cart-items li {
  margin-bottom: 0.8rem;
  border-bottom: 1px solid #bfbfbf;
  padding-bottom: 0.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
}

/* Remove Buttons */
#cart-items li button.remove-item-btn {
  background-color: #b50202;
  color: white;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  padding: 0 6px;
  font-weight: bold;
  font-size: 0.9rem;
  margin-left: 0.5rem;
  transition: background-color 0.3s ease;
}

#cart-items li button.remove-item-btn:hover {
  background-color: #FF940E;
}

/* ===== Total & Checkout ===== */
.cart-total {
  font-weight: bold;
  font-size: 1.2rem;
  text-align: right;
  margin-bottom: 1rem;
  color: #030998;
}

.checkout-btn {
  background-color: #030998;
  color: white;
  padding: 0.7rem;
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
  border: none;
  margin-bottom: 0.5rem;
  transition: background-color 0.3s ease;
}

.checkout-btn:hover {
  background-color: #b50202;
}

/* ===== Close Button ===== */
.close-cart-btn {
  background: transparent;
  border: none;
  color: #b50202;
  font-weight: bold;
  cursor: pointer;
  text-align: center;
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

/* Ensure the close button is visible and at the bottom */
#close-cart {
  order: 99;
  align-self: stretch;
  margin-top: auto;
  display: block;
  padding: 0.7rem;
  background-color: #b50202;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 1rem;
  text-align: center;
  transition: background-color 0.3s ease;
}

#close-cart:hover {
  background-color: #FF940E;
}

/* ===== Cart Toggle Button ===== */
.cart-toggle-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: #FEB803;
  color: #004AAA;
  border: none;
  border-radius: 50px;
  padding: 0.7rem 1.2rem;
  cursor: pointer;
  font-weight: bold;
  box-shadow: 0 3px 8px rgba(0,0,0,0.15);
  z-index: 10000;
  transition: background-color 0.3s ease, transform 0.2s ease;
}

.cart-toggle-btn:hover {
  background-color: #FF940E;
  transform: scale(1.05);
}

/* ===== Scrollbar Styling ===== */
#cart-items::-webkit-scrollbar {
  width: 6px;
}

#cart-items::-webkit-scrollbar-thumb {
  background-color: rgba(0,0,0,0.2);
  border-radius: 3px;
}

#cart-items::-webkit-scrollbar-track {
  background-color: transparent;
}

/* ===== Responsive ===== */
@media (max-width: 480px) {
  .cart-sidebar {
    width: 80%; /* narrower sidebar for phones */
  }
}
