/* تنسيقات خاصة بصفحة العربة */
.cart.section {
  padding: 100px 0 60px;
  min-height: 70vh;
}

/* رمز الريال السعودي */
.sar-symbol {
  font-family: Arial, sans-serif;
  font-weight: bold;
  margin-right: 2px;
  margin-left: 2px;
}

.cart-items {
  background: var(--surface-color);
  border-radius: 10px;
  padding: 25px;
  margin-bottom: 30px;
}

.cart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
  padding-bottom: 15px;
  border-bottom: 2px solid var(--accent-color);
}

.cart-header h3 {
  color: var(--heading-color);
  margin: 0;
  font-size: 1.5rem;
}

.item-count {
  background: var(--accent-color);
  color: var(--contrast-color);
  padding: 5px 15px;
  border-radius: 20px;
  font-weight: 600;
}

.cart-content {
  min-height: 200px;
}

.empty-cart {
  padding: 40px 20px;
}

.empty-cart i {
  font-size: 4rem;
  color: rgba(255, 255, 255, 0.3);
  margin-bottom: 20px;
}

.empty-cart h4 {
  color: var(--heading-color);
  margin-bottom: 10px;
}

.empty-cart p {
  color: var(--default-color);
  margin-bottom: 25px;
}

/* عنصر العربة */
.cart-item {
  display: flex;
  align-items: center;
  padding: 20px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
}

.cart-item:last-child {
  border-bottom: none;
}

.cart-item-image {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
  border: 2px solid var(--accent-color);
  margin-left: 20px;
  flex-shrink: 0;
}

.cart-item-details {
  flex: 1;
  min-width: 0;
}

.cart-item-details h5 {
  color: var(--heading-color);
  margin-bottom: 8px;
  font-size: 1.1rem;
  word-wrap: break-word;
}

.cart-item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0;
}

/* شارات العروض والتفاصيل */
.offer-badge {
  background: #ff9800;
  color: white;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: bold;
  display: inline-block;
}

.weight-badge,
.size-badge,
.cooking-badge {
  background: rgba(205, 164, 94, 0.15);
  color: var(--accent-color);
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  display: inline-block;
  border: 1px solid rgba(205, 164, 94, 0.3);
}

.cooking-badge {
  background: rgba(76, 175, 80, 0.15);
  color: #4CAF50;
  border: 1px solid rgba(76, 175, 80, 0.3);
}

.cart-item-price-unit {
  margin-top: 8px;
}

.cart-item-price-unit small {
  color: var(--default-color);
  font-size: 0.9rem;
}

/* التحكم في الكمية والسعر */
.cart-item-controls {
  display: flex;
  align-items: center;
  gap: 30px;
  margin-right: 10px;
}

.quantity-control {
  display: flex;
  align-items: center;
  gap: 10px;
}

.quantity-control button {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--accent-color);
  color: var(--accent-color);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.quantity-control button:hover {
  background: var(--accent-color);
  color: var(--contrast-color);
}

.quantity-control input {
  width: 50px;
  text-align: center;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--default-color);
  padding: 5px;
  border-radius: 5px;
  font-family: var(--nav-font);
}

/* السعر وزر الإزالة - جنباً إلى جنب */
.cart-item-total {
  text-align: right;
  min-width: 160px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.price-and-remove {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 5px;
}

.cart-item-total .price {
  color: var(--accent-color);
  font-weight: 600;
  font-size: 1.1rem;
  display: inline-block;
  white-space: nowrap;
}

.cart-item-total .remove-btn {
  background: transparent;
  color: #dc3545;
  border: none;
  padding: 5px 10px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  text-align: right;
  display: inline-block;
  white-space: nowrap;
  border: 1px solid rgba(220, 53, 69, 0.3);
  border-radius: 5px;
}

.cart-item-total .remove-btn:hover {
  color: #ff6b6b;
  background: rgba(220, 53, 69, 0.1);
  border-color: rgba(220, 53, 69, 0.5);
}

/* ملخص الطلب */
.cart-summary {
  background: var(--surface-color);
  border-radius: 10px;
  padding: 25px;
  position: sticky;
  top: 100px;
}

.cart-summary h3 {
  color: var(--heading-color);
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 2px solid var(--accent-color);
}

.summary-details {
  margin-bottom: 25px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--default-color);
  align-items: center;
}

.summary-row.total {
  border-bottom: none;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--accent-color);
  margin-top: 20px;
  padding-top: 20px;
  border-top: 2px solid var(--accent-color);
}

.summary-row span:last-child {
  font-weight: 600;
  color: var(--heading-color);
}

.summary-row.total strong:last-child {
  color: var(--accent-color);
}

.delivery-options {
  margin: 25px 0;
  padding: 20px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  border: 1px solid rgba(205, 164, 94, 0.3);
}

.delivery-options h5 {
  color: var(--heading-color);
  margin-bottom: 15px;
  font-size: 1.1rem;
}

.form-check {
  margin-bottom: 12px;
  padding-right: 1.5em;
  cursor: pointer;
}

.form-check-input {
  margin-left: 10px;
  margin-right: 0;
  float: right;
  position: relative;
}

.form-check-input:checked {
  background-color: var(--accent-color);
  border-color: var(--accent-color);
}

.form-check-label {
  color: var(--default-color);
  cursor: pointer;
  display: block;
  padding-right: 1.5em;
}

.form-check-label:hover {
  color: var(--heading-color);
}

.checkout-btn {
  background: var(--accent-color);
  color: var(--contrast-color);
  border: none;
  padding: 15px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1.1rem;
  width: 100%;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
  font-family: var(--nav-font);
}

.checkout-btn:hover:not(:disabled) {
  background: #b8944d;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(205, 164, 94, 0.3);
}

.checkout-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

.security-notice {
  text-align: center;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.security-notice small {
  color: rgba(255, 255, 255, 0.6);
}

.security-notice i {
  color: #4CAF50;
}

/* تنسيقات للجوال */
@media (max-width: 992px) {
  .cart.section {
      padding: 80px 0 40px;
  }
  
  .cart-summary {
      position: static;
      margin-top: 30px;
  }
  
  .cart-item {
      align-items: flex-start;
  }
}

@media (max-width: 768px) {
  .cart-item {
      flex-direction: column;
      align-items: flex-start;
      gap: 15px;
      padding: 25px 0;
      position: relative;
  }
  
  .cart-item-image {
      margin-left: 0;
      width: 100%;
      height: 150px;
      object-fit: cover;
  }
  
  .cart-item-controls {
      width: 100%;
      flex-direction: row;
      justify-content: space-between;
      align-items: center;
      margin-right: 0;
      margin-top: 10px;
  }
  
  .cart-item-total {
      text-align: left;
      min-width: auto;
      align-items: flex-start;
  }
  
  .cart-item-total .price {
      font-size: 1.2rem;
  }
  
  .price-and-remove {
      flex-direction: row;
      align-items: center;
      gap: 15px;
  }
  
  .cart-items,
  .cart-summary {
      padding: 20px;
  }
}

@media (max-width: 576px) {
  .cart-header {
      flex-direction: column;
      align-items: flex-start;
      gap: 10px;
  }
  
  .item-count {
      align-self: flex-end;
      font-size: 0.9rem;
      padding: 4px 12px;
  }
  
  .cart-item-meta {
      gap: 5px;
  }
  
  .offer-badge,
  .weight-badge,
  .size-badge,
  .cooking-badge {
      font-size: 11px;
      padding: 3px 8px;
  }
  
  .cart-item-controls {
      flex-direction: column;
      align-items: stretch;
      gap: 10px;
  }
  
  .cart-item-total {
      text-align: center;
      padding-top: 10px;
      border-top: 1px solid rgba(255, 255, 255, 0.1);
      align-items: center;
  }
  
  .price-and-remove {
      justify-content: center;
      width: 100%;
  }
  
  .checkout-btn {
      padding: 12px;
      font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .cart-item-details h5 {
      font-size: 1rem;
  }
  
  .cart-item-price-unit small {
      font-size: 0.8rem;
  }
  
  .cart-item-total .price {
      font-size: 1rem;
  }
  
  .cart-item-total .remove-btn {
      font-size: 0.85rem;
      padding: 4px 8px;
  }
  
  .summary-row {
      font-size: 0.9rem;
  }
  
  .summary-row.total {
      font-size: 1.1rem;
  }
  
  .delivery-options {
      padding: 15px;
  }
  
  .form-check-label {
      font-size: 0.9rem;
  }
}