.cart-container {
  max-width: 1000px;
  margin: 0 auto;
}

.cart-header h2 {
  font-size: 18px;
  border-bottom: 3px solid #2c3e50;
  display: inline-block;
  padding-bottom: 5px;
}

.cart-content {
  display: flex;
  flex-direction: row-reverse;
  gap: 20px;
  margin-top: 20px;
}

.cart-items-list {
  flex: 3;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 12px;
  overflow: hidden;
}

.cart-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
  border-bottom: 1px solid #eee;
  direction: rtl;
}

.item-image img {
  width: 80px;
  height: auto;
}

.item-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: right;
}

.item-name {
  font-weight: bold;
  margin-bottom: 5px;
}
.item-desc {
  color: #888;
  font-size: 0.9em;
}

.item-price {
  font-weight: bold;

  color: #333;
}

.quantity-controls {
  display: flex;
  align-items: center;
  border: 1px solid #ddd;
  border-radius: 5px;
  padding: 5px;
}

.quantity-controls button {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 18px;
  padding: 0 10px;
}

.quantity-controls span {
  margin: 0 10px;
  min-width: 20px;
  text-align: center;
}

.cart-summary {
  flex: 1;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 12px;
  padding: 20px;
  height: fit-content;
  direction:rtl;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 15px;
  font-size: 0.9em;
}

.checkout-btn {
  width: 100%;
  background-color: #58aae2;
  color: white;
  border: none;
  padding: 12px;
  border-radius: 8px;

  cursor: pointer;
  font-weight: bold;
  margin-top: 10px;
}
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.cart-item {
  animation: slideIn 0.4s ease-out;
  transition: all 0.5s ease-in-out; /* برای جابجایی نرم سایر آیتم‌ها */
}

/* کلاسی که هنگام حذف با جاوااسکریپت اضافه می‌شود */
.item-exit {
  opacity: 0 !important;
  transform: translateX(-100px) !important; /* به سمت چپ سر می‌خورد */
  margin-bottom: -100px !important; /* ارتفاع را کم می‌کند تا بقیه آیتم‌ها نرم بالا بیایند */
  pointer-events: none;
}
@media (max-width: 500px) {
  .cart-content {
    display: flex;
    flex-direction: column-reverse;
  }
  .cart-items-list,
  .cart-summary {
    width: 100%;
    flex: none;
  }
  .cart-header h2 {
    text-align: center;
    display: flex;
    justify-content: center;
  }
}
