/* Cart Styles */
.cart-btn {
  position: relative;
  background: none;
  border: none;
  color: white;
  padding: 8px;
  border-radius: 8px;
  transition: all 0.3s ease;
  cursor: pointer;
}

.cart-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
  transform: scale(1.05);
}

.cart-counter {
  position: absolute;
  top: -5px;
  right: -5px;
  background-color: #f39c12;
  color: white;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: bold;
  min-width: 20px;
  font-family: 'Courier New', monospace;
}

.cart-menu-item {
  margin-left: 15px;
}

/* Cart Offcanvas Styles */
.cart-offcanvas {
  width: 400px !important;
  background-color: #fff;
}

/* تصميم السلة للهواتف المحمولة */
@media (max-width: 768px) {
  .cart-offcanvas {
    width: 50% !important;
    max-width: 50vw !important;
    min-width: 280px !important;
  }
  
  /* ترتيب أزرار البحث والسلة في الهاتف */
  .mobile-menu-buttons {
    display: flex;
    align-items: center;
    gap: 20px; /* مسافة تساوي حجم السلة تقريباً */
  }
  
  .mobile-menu-buttons .search-btn,
  .mobile-menu-buttons .cart-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
  }
  
  .mobile-menu-buttons .search-btn:hover,
  .mobile-menu-buttons .cart-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
  }
  
  .mobile-menu-buttons .search-btn svg,
  .mobile-menu-buttons .cart-btn svg {
    width: 18px;
    height: 18px;
  }
  
  /* تحسين عرض السلة في الهاتف */
  .cart-offcanvas .offcanvas-body {
    padding: 15px;
  }
  
  .cart-item {
    padding: 10px 0;
  }
  
  .cart-item-image {
    width: 50px;
    height: 50px;
  }
  
  .cart-item-title {
    font-size: 14px;
  }
  
  .cart-item-price {
    font-size: 13px;
  }
  
  .cart-item-quantity-wrapper input {
    width: 40px;
    font-size: 12px;
  }
  
  .cart-item-quantity-wrapper .qty-btn {
    padding: 3px 8px;
    font-size: 12px;
  }
  
  .remove-item-btn {
    width: 25px;
    height: 25px;
  }
  
  .remove-item-btn i {
    font-size: 10px;
  }
  
  /* تحسين عرض السلة في الهاتف - عرض أفضل */
  .cart-offcanvas .offcanvas-header {
    padding: 15px;
  }
  
  .cart-offcanvas .offcanvas-title {
    font-size: 18px;
  }
  
  .cart-summary {
    padding: 15px;
  }
  
  .cart-summary .btn-primary {
    padding: 12px 20px;
    font-size: 16px;
  }
  
  /* تحسين عرض العناصر الفارغة */
  .empty-cart {
    padding: 20px 10px;
  }
  
  .empty-cart .fa-shopping-cart {
    font-size: 2rem !important;
  }
  
  .empty-cart p {
    font-size: 14px;
  }
  
  /* تحسين عرض السلة في الهاتف - عرض أفضل */
  .cart-offcanvas .offcanvas-header {
    padding: 15px;
  }
  
  .cart-offcanvas .offcanvas-title {
    font-size: 18px;
  }
  
  .cart-summary {
    padding: 15px;
  }
  
  .cart-summary .btn-primary {
    padding: 12px 20px;
    font-size: 16px;
  }
  
  /* تحسين عرض السلة في الهاتف - عرض أفضل */
  .cart-offcanvas .offcanvas-header {
    padding: 15px;
  }
  
  .cart-offcanvas .offcanvas-title {
    font-size: 18px;
  }
}

/* إزالة الخلفية المعتمة (backdrop) */
.cart-offcanvas.show ~ .offcanvas-backdrop {
  display: none !important;
}

/* إزالة الخلفية المعتمة عند إغلاق السلة */
.offcanvas-backdrop {
  display: none !important;
}

/* إزالة الخلفية المعتمة من جميع offcanvas */
body.modal-open .offcanvas-backdrop {
  display: none !important;
}

/* إزالة الخلفية المعتمة عند فتح السلة */
.offcanvas-backdrop.show {
  display: none !important;
}

.cart-offcanvas .offcanvas-header {
  background-color: #f39c12;
  color: white;
  border-bottom: 1px solid #e0e0e0;
}

.cart-offcanvas .btn-close {
  filter: invert(1);
}

.cart-item {
  display: flex;
  align-items: center;
  padding: 15px 0;
  border-bottom: 1px solid #f0f0f0;
}

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

/* إضافة تأثير تحميل للصور */
.cart-item-image {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 8px;
  display: block !important;
  background-color: #f8f9fa;
  border: 1px solid #e9ecef;
  transition: transform 0.3s ease, opacity 0.3s ease;
  min-width: 60px;
  min-height: 60px;
  opacity: 1;
}

.cart-item-image:hover {
  transform: scale(1.05);
}

.cart-item-image-wrapper {
  margin-left: 15px;
  flex-shrink: 0;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #e9ecef;
  position: relative;
  overflow: hidden;
}

.cart-item-image-wrapper::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, #f8f9fa, #e9ecef);
  z-index: 1;
  opacity: 0.5;
}

.cart-item-image-wrapper img {
  position: relative;
  z-index: 2;
}

.cart-item-details {
  flex: 1;
}

.cart-item-category {
  font-size: 11px;
  font-weight: 500;
  color: #f39c12;
  background-color: rgba(243, 156, 18, 0.1);
  padding: 3px 10px;
  border-radius: 15px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 6px;
  border: 1px solid rgba(243, 156, 18, 0.2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

.cart-item-category:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.category-icon {
  font-size: 12px;
  line-height: 1;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
  animation: categoryIconPulse 2s ease-in-out infinite;
}

@keyframes categoryIconPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

/* ألوان مختلفة لكل تصنيف */
.cart-item-category[data-category="المقبلات"] {
  color: #e74c3c;
  background-color: rgba(231, 76, 60, 0.1);
  border-color: rgba(231, 76, 60, 0.2);
  box-shadow: 0 2px 4px rgba(231, 76, 60, 0.1);
}

.cart-item-category[data-category="المقبلات"]:hover {
  background-color: rgba(231, 76, 60, 0.15);
  box-shadow: 0 4px 8px rgba(231, 76, 60, 0.2);
}

.cart-item-category[data-category="السلطة"] {
  color: #27ae60;
  background-color: rgba(39, 174, 96, 0.1);
  border-color: rgba(39, 174, 96, 0.2);
  box-shadow: 0 2px 4px rgba(39, 174, 96, 0.1);
}

.cart-item-category[data-category="السلطة"]:hover {
  background-color: rgba(39, 174, 96, 0.15);
  box-shadow: 0 4px 8px rgba(39, 174, 96, 0.2);
}

.cart-item-category[data-category="الطبق الرئيسي"] {
  color: #8e44ad;
  background-color: rgba(142, 68, 173, 0.1);
  border-color: rgba(142, 68, 173, 0.2);
  box-shadow: 0 2px 4px rgba(142, 68, 173, 0.1);
}

.cart-item-category[data-category="الطبق الرئيسي"]:hover {
  background-color: rgba(142, 68, 173, 0.15);
  box-shadow: 0 4px 8px rgba(142, 68, 173, 0.2);
}

.cart-item-category[data-category="البيتزا"] {
  color: #e67e22;
  background-color: rgba(230, 126, 34, 0.1);
  border-color: rgba(230, 126, 34, 0.2);
  box-shadow: 0 2px 4px rgba(230, 126, 34, 0.1);
}

.cart-item-category[data-category="البيتزا"]:hover {
  background-color: rgba(230, 126, 34, 0.15);
  box-shadow: 0 4px 8px rgba(230, 126, 34, 0.2);
}

.cart-item-category[data-category="المعكرونة"] {
  color: #f39c12;
  background-color: rgba(243, 156, 18, 0.1);
  border-color: rgba(243, 156, 18, 0.2);
  box-shadow: 0 2px 4px rgba(243, 156, 18, 0.1);
}

.cart-item-category[data-category="المعكرونة"]:hover {
  background-color: rgba(243, 156, 18, 0.15);
  box-shadow: 0 4px 8px rgba(243, 156, 18, 0.2);
}

.cart-item-category[data-category="السندويشات"] {
  color: #16a085;
  background-color: rgba(22, 160, 133, 0.1);
  border-color: rgba(22, 160, 133, 0.2);
  box-shadow: 0 2px 4px rgba(22, 160, 133, 0.1);
}

.cart-item-category[data-category="السندويشات"]:hover {
  background-color: rgba(22, 160, 133, 0.15);
  box-shadow: 0 4px 8px rgba(22, 160, 133, 0.2);
}

.cart-item-category[data-category="المشروبات الساخنة"] {
  color: #c0392b;
  background-color: rgba(192, 57, 43, 0.1);
  border-color: rgba(192, 57, 43, 0.2);
  box-shadow: 0 2px 4px rgba(192, 57, 43, 0.1);
}

.cart-item-category[data-category="المشروبات الساخنة"]:hover {
  background-color: rgba(192, 57, 43, 0.15);
  box-shadow: 0 4px 8px rgba(192, 57, 43, 0.2);
}

.cart-item-category[data-category="المشروبات الباردة"] {
  color: #3498db;
  background-color: rgba(52, 152, 219, 0.1);
  border-color: rgba(52, 152, 219, 0.2);
  box-shadow: 0 2px 4px rgba(52, 152, 219, 0.1);
}

.cart-item-category[data-category="المشروبات الباردة"]:hover {
  background-color: rgba(52, 152, 219, 0.15);
  box-shadow: 0 4px 8px rgba(52, 152, 219, 0.2);
}

.cart-item-category[data-category="العصائر الطازجة"] {
  color: #2ecc71;
  background-color: rgba(46, 204, 113, 0.1);
  border-color: rgba(46, 204, 113, 0.2);
  box-shadow: 0 2px 4px rgba(46, 204, 113, 0.1);
}

.cart-item-category[data-category="العصائر الطازجة"]:hover {
  background-color: rgba(46, 204, 113, 0.15);
  box-shadow: 0 4px 8px rgba(46, 204, 113, 0.2);
}

.cart-item-category[data-category="الحلويات"] {
  color: #e91e63;
  background-color: rgba(233, 30, 99, 0.1);
  border-color: rgba(233, 30, 99, 0.2);
  box-shadow: 0 2px 4px rgba(233, 30, 99, 0.1);
}

.cart-item-category[data-category="الحلويات"]:hover {
  background-color: rgba(233, 30, 99, 0.15);
  box-shadow: 0 4px 8px rgba(233, 30, 99, 0.2);
}

.cart-item-category[data-category="الشيشة"] {
  color: #795548;
  background-color: rgba(121, 85, 72, 0.1);
  border-color: rgba(121, 85, 72, 0.2);
  box-shadow: 0 2px 4px rgba(121, 85, 72, 0.1);
}

.cart-item-category[data-category="الشيشة"]:hover {
  background-color: rgba(121, 85, 72, 0.15);
  box-shadow: 0 4px 8px rgba(121, 85, 72, 0.2);
}

.cart-item-category[data-category="عام"] {
  color: #95a5a6;
  background-color: rgba(149, 165, 166, 0.1);
  border-color: rgba(149, 165, 166, 0.2);
  box-shadow: 0 2px 4px rgba(149, 165, 166, 0.1);
}

.cart-item-category[data-category="عام"]:hover {
  background-color: rgba(149, 165, 166, 0.15);
  box-shadow: 0 4px 8px rgba(149, 165, 166, 0.2);
}

.cart-item-name {
  font-weight: 600;
  margin-bottom: 5px;
  color: #333;
  font-size: 14px;
}

.cart-item-price {
  color: #f39c12;
  font-weight: 600;
  margin-bottom: 8px;
}

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

.quantity-btn {
  background-color: #f39c12;
  color: white;
  border: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.quantity-btn:hover {
  background-color: #e67e22;
  transform: scale(1.1);
}

.quantity-input {
  width: 50px;
  text-align: center;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 5px;
}

.remove-item-btn {
  background-color: #dc3545;
  color: white;
  border: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-right: 10px;
  position: relative;
}

.remove-item-btn:hover {
  background-color: #c82333;
  transform: scale(1.1);
}

.remove-item-btn:active {
  transform: scale(0.95);
}

.remove-item-btn i {
  font-size: 12px;
}

.cart-summary {
  background-color: #f8f9fa;
  padding: 20px;
  border-radius: 8px;
  margin-top: 20px;
}

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

.empty-cart i {
  color: #ccc;
  margin-bottom: 15px;
}

.add-to-cart-btn {
  transition: all 0.3s ease;
}

.add-to-cart-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(243, 156, 18, 0.3);
}

.add-to-cart-btn.added {
  background-color: #28a745 !important;
  border-color: #28a745 !important;
}

.add-to-cart-btn.added::after {
  content: " ✓";
}

/* Responsive Design */
@media (max-width: 768px) {
  .cart-offcanvas {
    width: 100% !important;
  }
  
  .cart-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  
  .cart-item-image-wrapper {
    margin-left: 0;
    align-self: center;
  }
  
  .cart-item-image {
    width: 80px;
    height: 80px;
  }
  
  .cart-item-quantity {
    width: 100%;
    justify-content: space-between;
  }
  
  .cart-item-category {
    font-size: 10px;
    padding: 2px 8px;
    margin-bottom: 4px;
  }
  
  .category-icon {
    font-size: 10px;
    animation: none; /* إزالة الحركة في الهواتف المحمولة */
  }
  
  .cart-item-name {
    font-size: 13px;
  }
}

/* Animation for cart counter */
@keyframes cartBounce {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.cart-counter.updated {
  animation: cartBounce 0.3s ease;
}

/* Cart item animation */
@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.cart-item {
  animation: slideInRight 0.3s ease;
}

/* Notification Styles */
.alert {
  border: none;
  border-radius: 8px;
  font-weight: 500;
}

.alert-success {
  background-color: #d4edda;
  color: #155724;
  border-left: 4px solid #28a745;
}

.alert-info {
  background-color: #d1ecf1;
  color: #0c5460;
  border-left: 4px solid #17a2b8;
}

.alert-danger {
  background-color: #f8d7da;
  color: #721c24;
  border-left: 4px solid #dc3545;
}

/* Animation for notifications */
@keyframes slideInFromRight {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.alert {
  animation: slideInFromRight 0.3s ease;
}
