:root {
  --primary: #710000;
  --gold: #f0c28b;
  --white: #fff;
  --black: #222;
  --gray: #f7f7f7;
  --shadow: 0 2px 10px rgba(0,0,0,0.08);
}
body {
  font-family: "Cairo", "Segoe UI", Arial, sans-serif;
  direction: rtl;
  background: var(--gray);
  color: var(--black);
  margin: 0;
  padding: 0 6px;
  box-sizing: border-box;
}
header {
  background: var(--white);
  box-shadow: var(--shadow);
  padding: 10px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid var(--gold);
  width: 100%;
}
header h1 {
  color: var(--primary);
  margin: 0 18px;
  font-size: 26px;
  font-family: inherit;
}
.floating-cart {
  margin: 0 22px 0 0;
  background: var(--primary);
  color: var(--gold);
  font-size: 22px;
  padding: 7px 8px 7px 8px;
  border-radius: 50%;
  box-shadow: var(--shadow);
  cursor: pointer;
  border: 2px solid var(--gold);
  transition: background 0.3s, color 0.3s, transform 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.floating-cart:hover {
  background: var(--gold);
  color: var(--primary);
  transform: scale(1.08) rotate(-5deg);
}
.floating-cart img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}
main {
  max-width: 900px;
  margin: 18px auto 0 auto;
  padding: 0 8px;
}

/* زر العودة للتسوق */
.back-to-shop {
  display: block;
  width: 35vw;
  min-width: 250px;
  max-width: 550px;
  margin: 35px auto 30px auto;
  padding: 13px 0;
  background-color: var(--primary);
  color: white;
  border-radius: 14px;
  font-size: 22px;
  font-weight: bold;
  text-align: center;
  text-decoration: none;
  box-shadow: var(--shadow);
  letter-spacing: 1px;
  transition: background 0.2s, color 0.2s;
  border: none;
}
.back-to-shop:hover {
    background: linear-gradient(90deg, #a90000, #f0c28b 80%);
  color: #710000;
  box-shadow: 0 4px 25px rgba(113,0,0,0.15);
  transform: translateY(-2px) scale(1.03);
}

/* السلة */
#cartItemsContainer {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 33px;
}
.cart-item {
  background: var(--white);
  border-radius: 15px;
  box-shadow: var(--shadow);
  border: none;
  padding: 0;
  min-height: 140px;
  display: flex;
  align-items: center;
  flex-direction: row-reverse;
  gap: 0;
  position: relative;
  transition: box-shadow 0.3s;
  overflow: hidden;
  justify-content: space-between;
}

/* صورة المنتج */
.cart-img, .cart-item img {
  width: 135px;
  height: 135px;
  object-fit: cover;
  border-radius: 10px;
  margin: 14px 25px 14px 15px;
  border: 1.5px solid #eee;
  background: var(--gray);
  box-shadow: 0 2px 7px rgba(0,0,0,0.08);
}

/* زر الحذف أقصى اليسار */
.cart-remove-btn, .remove-btn {
  background-color: #dc3545;
  color: #fff;
  border: none;
  border-radius: 7px;
  font-size: 18px;
  padding: 11px 18px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.3s;
  margin-left: 28px;
  margin-right: 0;
  position: static;
  order: 3;
}
.cart-remove-btn:hover, .remove-btn:hover {
  background: #b72b38;
}

/* معلومات المنتج يمين */
.cart-info {
  flex: 1;
  display: flex;
  align-items: center;
  flex-direction: row-reverse;
  gap: 0;
  min-width: 0;
  justify-content: flex-start;
  order: 1;
}
.cart-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  margin-right: 0;
  min-width: 0;
  padding-right: 0;
  gap: 3px;
  order: 2;
}
.cart-title, .cart-item h3 {
  font-size: 25px;
  font-weight: bold;
  margin-bottom: 4px;
  margin-top: 0;
  color: var(--black);
  letter-spacing: 0.5px;
}
.cart-meta, .cart-item p, .cart-item .cart-meta {
  font-size: 16.5px;
  color: #222;
  line-height: 1.6;
  margin-top: 4px;
}
.cart-meta span {
  margin-left: 7px;
}

/* أخفاء حقل الكمية */
.qty-input {
  display: none !important;
}

/* الإجمالي */
.total-price {
  text-align: left;
  margin: 50px 60px 0 30px;
  font-weight: bold;
  font-size: 28px;
  color: #000;
  letter-spacing: .2px;
}
.total-price .usd {
  font-size: 23px;
  margin-left: 4px;
}

/* زر الطلب */
.place-order-btn, #openOrderBtn {
  margin: 35px auto 18px auto;
  display: block;
  background: linear-gradient(90deg, #710000, #a90000);
  color: #fff;
  font-size: 22px;
  border-radius: 15px;
  border: none;
  box-shadow: 0 3px 18px rgba(113,0,0,0.07);
  font-weight: bold;
  letter-spacing: 1px;
  padding: 18px 0;
  width: 85vw;
  max-width: 520px;
  min-width: 220px;
  transition: background 0.2s, box-shadow 0.2s, color 0.2s, transform 0.2s;
  cursor: pointer;
  text-align: center;
}
.place-order-btn:hover, #openOrderBtn:hover {
  background: linear-gradient(90deg, #a90000, #f0c28b 80%);
  color: #710000;
  box-shadow: 0 4px 25px rgba(113,0,0,0.15);
  transform: translateY(-2px) scale(1.03);
}

/* Responsive for Tablet and Mobile */
@media (max-width: 900px) {
  .back-to-shop {
    font-size: 18px;
    width: 85vw;
    min-width: 0;
    margin: 19px auto 20px auto;
  }
  #cartItemsContainer {
    gap: 21px;
    max-width: 99vw;
  }
  .cart-item {
    min-height: 110px;
  }
  .cart-title, .cart-item h3 {
    font-size: 19px;
  }
  .cart-img, .cart-item img {
    width: 85px;
    height: 85px;
    margin: 12px 11px 12px 7px;
  }
  .cart-meta, .cart-item p {
    font-size: 13.8px;
  }
  .total-price {
    margin: 30px 9px 0 12px;
    font-size: 20px;
  }
  .place-order-btn, #openOrderBtn {
    font-size: 18px;
    padding: 13px 0;
    border-radius: 10px;
  }
}

@media (max-width: 650px) {
  #cartItemsContainer {
    gap: 11px;
  }
  .cart-item {
    flex-direction: column;
    align-items: stretch;
    min-height: 0;
    padding: 4px 0 5px 0;
  }
  .cart-info {
    flex-direction: row-reverse;
    align-items: center;
    justify-content: space-between;
    padding: 0 6px;
  }
  .cart-details {
    align-items: flex-end;
    padding: 0 10px 0 0;
  }
  .cart-title, .cart-item h3 {
    font-size: 16.5px;
  }
  .cart-img, .cart-item img {
    width: 80px;
    height: 80px;
    margin: 8px 8px 8px 0;
  }
  .cart-remove-btn, .remove-btn {
    margin-left: 0;
    margin-right: 0;
    margin-bottom: 10px;
    font-size: 14px;
    padding: 7px 12px;
    order: 3;
  }
  .total-price {
    font-size: 17px;
    margin: 23px 7px 0 8px;
  }
}

@media (max-width: 390px) {
  .cart-title, .cart-item h3 { font-size: 12px; }
  .cart-meta, .cart-item p { font-size: 11px; }
  .cart-img, .cart-item img { width: 55px; height: 55px; }
}

/* لجعل نافذة المودال قابلة للسكرول */
.modal-content {
  max-height: 90vh;
  overflow-y: auto;
}
.modal-content::-webkit-scrollbar {
  width: 7px;
  background: var(--gold);
}
.modal-content::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 5px;
}
/* ... (كل كود السلة كما أرسلته لك سابقاً) ... */

/* نافذة الدايالوق = المودال */
.modal-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background: rgba(0,0,0,0.55);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}
.modal-content {
  background: #fff;
  padding: 25px 18px 18px 18px;
  border-radius: 16px;
  border: 2px solid var(--gold);
  width: 370px;
  max-width: 96vw;
  box-shadow: 0 4px 24px rgba(113,0,0,0.17), 0 1.5px 10px rgba(0,0,0,0.09);
  text-align: right;
  position: relative;
  font-size: 15px;
  display: flex;
  flex-direction: column;
  max-height: 90vh;
  overflow-y: auto;
  transition: box-shadow 0.2s, transform 0.18s;
}
.modal-content h3 {
  margin-top: 0;
  color: var(--primary);
  margin-bottom: 13px;
  font-size: 19px;
  text-align: center;
  letter-spacing: 0.5px;
}
.close-modal {
  position: absolute;
  top: 10px;
  left: 15px;
  font-size: 32px;
  color: var(--primary);
  cursor: pointer;
  transition: color 0.18s, background 0.2s;
  padding: 0 6px;
  border-radius: 7px;
}
.close-modal:hover {
  color: #fff;
  background: var(--primary);
}
.modal-content label {
  display: block;
  margin: 12px 0 4px 0;
  font-weight: 600;
  color: var(--primary);
  font-size: 15px;
}
.modal-content input[type="text"],
.modal-content input[type="tel"],
.modal-content select {
  width: 100%;
  padding: 8px 10px;
  margin-bottom: 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
  box-sizing: border-box;
}
.modal-content input[type="radio"], .modal-content input[type="checkbox"] {
  margin-left: 7px;
  margin-top: 0;
}

/* سكرول خاص للدايالوق */
.modal-content::-webkit-scrollbar {
  width: 7px;
  background: var(--gold);
}
.modal-content::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 5px;
}

/* أزرار الدفع */
#paymentBtns {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.send-order-btn {
  background: linear-gradient(90deg, var(--primary), #b90000);
  color: #fff;
  padding: 10px 0;
  width: 100%;
  border: none;
  border-radius: 8px;
  font-size: 17px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.23s, color 0.18s, box-shadow 0.2s;
  box-shadow: 0 2px 8px rgba(113,0,0,0.08);
}
.send-order-btn:hover {
  background: linear-gradient(90deg, var(--gold) 60%, var(--primary));
  color: var(--primary);
}

@media (max-width: 520px) {
  .modal-content {
    width: 99vw;
    padding: 15px 5px 10px 5px;
    min-width: 0;
  }
}