@font-face {
  font-family: vazir;

  src: url("../fonts/Vazirmatn-VariableFont_wght.ttf");
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;

  font-family: vazir, Arial, sans-serif;

  background-color: #f5f5f5;
}

/* ---------------- هدر ---------------- */

.cart-header {
  min-height: 100px;

  padding: 15px 4%;

  background-color: white;

  display: flex;

  align-items: center;

  justify-content: space-between;

  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.cart-header h1 {
  margin: 0;

  font-size: 30px;
}

.back-to-products {
  color: #222;

  text-decoration: none;

  font-size: 16px;
}

.cart-logo img {
  width: 85px;

  height: 70px;

  object-fit: contain;
}

/* ---------------- محتوا ---------------- */

.cart-container {
  width: 90%;

  max-width: 1200px;

  margin: 40px auto;

  display: grid;

  grid-template-columns: 1fr 330px;

  gap: 30px;
}

/* ---------------- محصولات ---------------- */

.cart-items {
  background-color: white;

  padding: 25px;

  border-radius: 15px;
}

.cart-items h2 {
  margin-top: 0;
}

.cart-item {
  display: flex;

  align-items: center;

  gap: 20px;

  padding: 20px 0;

  border-bottom: 1px solid #ddd;
}

.cart-item:last-child {
  border-bottom: none;
}

.cart-item img {
  width: 100px;

  height: 100px;

  object-fit: contain;
}

.cart-item-info {
  flex: 1;
}

.cart-item-info h3 {
  margin: 0 0 10px;
}

.cart-item-price {
  font-weight: bold;

  color: #d71920;
}

/* ---------------- تعداد ---------------- */

.quantity-controls {
  display: flex;

  align-items: center;

  gap: 8px;
}

.quantity-controls button {
  width: 32px;

  height: 32px;

  border: none;

  border-radius: 6px;

  cursor: pointer;

  font-size: 18px;
}

.quantity {
  min-width: 25px;

  text-align: center;
}

/* ---------------- حذف ---------------- */

.remove-button {
  border: none;

  background: transparent;

  color: #d71920;

  cursor: pointer;

  font-family: inherit;
}

/* ---------------- خلاصه ---------------- */

.cart-summary {
  height: fit-content;

  background-color: white;

  padding: 25px;

  border-radius: 15px;
}

.cart-summary h2 {
  margin-top: 0;
}

.summary-row {
  display: flex;

  align-items: center;

  justify-content: space-between;

  margin: 20px 0;
}

.total-row {
  padding-top: 20px;

  border-top: 1px solid #ddd;

  font-size: 18px;

  font-weight: bold;
}

.checkout-button {
  width: 100%;

  padding: 14px;

  border: none;

  border-radius: 10px;

  background-color: #222;

  color: white;

  font-family: inherit;

  font-size: 16px;

  cursor: pointer;
}

.checkout-button:hover {
  background-color: #444;
}

/* ---------------- سبد خالی ---------------- */

.empty-cart {
  text-align: center;

  padding: 50px 20px;

  color: #777;
}

/* ---------------- موبایل ---------------- */

@media (max-width: 800px) {
  .cart-container {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 500px) {
  .cart-header h1 {
    font-size: 22px;
  }

  .cart-logo img {
    width: 60px;
  }

  .cart-item {
    flex-wrap: wrap;
  }
}

.back-home {
  display: inline-block;
  padding: 10px 20px;
  margin: 20px;
  border-radius: 10px;

  background: #222;
  color: #fff;

  text-decoration: none;
  font-size: 15px;
  font-weight: 700;

  transition: 0.3s;
}

.back-home:hover {
  transform: translateY(-2px);
  opacity: 0.85;
}
