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

.cart-offcanvas .offcanvas-header {
  background-color: #212529;
  border-bottom-color: rgba(255, 107, 53, 0.1) !important;
  padding: 1.5rem;
}

.cart-offcanvas .offcanvas-title {
  font-size: 1.25rem;
  font-weight: 600;
}

.cart-offcanvas .offcanvas-body {
  display: flex;
  flex-direction: column;
  padding: 0;
}

/* Empty Cart State */
#empty-cart-offcanvas {
  flex: 1;
  display: flex !important;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

#empty-cart-offcanvas.hidden {
  display: none !important;
}

#cart-items-container {
  display: none;
}

#cart-items-container.show {
  display: flex !important;
  flex-direction: column;
  height: 100%;
}

/* Cart Items List */
.cart-items-list {
  flex: 1;
  overflow-y: auto;
}

.cart-items-list::-webkit-scrollbar {
  width: 6px;
}

.cart-items-list::-webkit-scrollbar-track {
  background: #2d2d2d;
}

.cart-items-list::-webkit-scrollbar-thumb {
  background: #FF6B35;
  border-radius: 3px;
}

.cart-items-list::-webkit-scrollbar-thumb:hover {
  background: #E55A2B;
}

/* Cart Item Card */
.offcanvas-cart-item {
  background-color: #2d2d2d;
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 1rem;
  transition: all 0.3s ease;
  border: 1px solid transparent;
}

.offcanvas-cart-item:hover {
  border-color: rgba(255, 107, 53, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 107, 53, 0.15);
}

.offcanvas-cart-item-image {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
  background-color: #404040;
}

.offcanvas-cart-item-info {
  flex: 1;
  padding-left: 1rem;
}

.offcanvas-cart-item-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 0.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.offcanvas-cart-item-price {
  font-size: 1rem;
  color: #FF6B35;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.offcanvas-cart-item-quantity {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.offcanvas-quantity-btn {
  width: 28px;
  height: 28px;
  border: none;
  background-color: #404040;
  color: #ffffff;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.9rem;
}

.offcanvas-quantity-btn:hover:not(:disabled) {
  background-color: #FF6B35;
  transform: scale(1.1);
}

.offcanvas-quantity-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.offcanvas-quantity-value {
  font-size: 0.9rem;
  color: #ffffff;
  font-weight: 600;
  min-width: 30px;
  text-align: center;
}

.offcanvas-cart-item-remove {
  background: none;
  border: none;
  color: #dc3545;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 6px;
  transition: all 0.2s ease;
  font-size: 1rem;
}

.offcanvas-cart-item-remove:hover {
  background-color: rgba(220, 53, 69, 0.1);
  transform: scale(1.1);
}

/* Cart Summary */
.cart-summary {
  background-color: #212529;
  border-top-color: rgba(255, 107, 53, 0.1) !important;
  margin-top: auto;
}

.cart-summary .border-bottom {
  border-color: rgba(255, 107, 53, 0.1) !important;
}

/* Responsive */
@media (max-width: 576px) {
  .cart-offcanvas {
    width: 100% !important;
  }

  .offcanvas-cart-item {
    padding: 0.75rem;
  }

  .offcanvas-cart-item-image {
    width: 60px;
    height: 60px;
  }

  .offcanvas-cart-item-name {
    font-size: 0.85rem;
  }

  .offcanvas-cart-item-price {
    font-size: 0.9rem;
  }
}

/* Loading State */
.cart-loading {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 3rem;
}

.cart-loading .spinner-border {
  color: #FF6B35;
}

/* Empty State Animation */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#empty-cart-offcanvas {
  animation: fadeInUp 0.4s ease-out;
}

/* Item Animation */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.offcanvas-cart-item {
  animation: slideIn 0.3s ease-out;
}

/* Toast Notifications */
.toast-container {
  z-index: 9999 !important;
  max-width: 420px;
  min-width: 320px;
}

.toast {
  background-color: rgba(26, 26, 26, 0.98) !important;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 107, 53, 0.2);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05);
  border-radius: 14px;
  overflow: hidden;
  animation: slideInLeft 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  margin-bottom: 0.75rem;
}

.toast.bg-success {
  background: linear-gradient(135deg, rgba(25, 135, 84, 0.95) 0%, rgba(20, 108, 67, 0.95) 100%) !important;
  border-color: rgba(25, 135, 84, 0.6);
  box-shadow: 0 10px 40px rgba(25, 135, 84, 0.3), 0 0 20px rgba(25, 135, 84, 0.2);
}

.toast.bg-warning {
  background: linear-gradient(135deg, rgba(255, 193, 7, 0.95) 0%, rgba(230, 173, 0, 0.95) 100%) !important;
  border-color: rgba(255, 193, 7, 0.6);
  box-shadow: 0 10px 40px rgba(255, 193, 7, 0.3), 0 0 20px rgba(255, 193, 7, 0.2);
}

.toast.bg-info {
  background: linear-gradient(135deg, rgba(13, 202, 240, 0.95) 0%, rgba(10, 162, 192, 0.95) 100%) !important;
  border-color: rgba(13, 202, 240, 0.6);
  box-shadow: 0 10px 40px rgba(13, 202, 240, 0.3), 0 0 20px rgba(13, 202, 240, 0.2);
}

.toast.bg-danger {
  background: linear-gradient(135deg, rgba(220, 53, 69, 0.95) 0%, rgba(180, 40, 55, 0.95) 100%) !important;
  border-color: rgba(220, 53, 69, 0.6);
  box-shadow: 0 10px 40px rgba(220, 53, 69, 0.3), 0 0 20px rgba(220, 53, 69, 0.2);
}

.toast-body {
  padding: 1rem 1.25rem;
  font-size: 1rem;
  font-weight: 500;
  color: #ffffff;
}

.toast-body i {
  font-size: 1.15rem;
  opacity: 0.95;
}

.toast .btn-close {
  opacity: 0.7;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast .btn-close:hover {
  opacity: 1;
  transform: scale(1.1);
}

/* Toast Animation */
@keyframes slideInLeft {
  0% {
    opacity: 0;
    transform: translateX(-120%) scale(0.9);
  }
  50% {
    transform: translateX(10px) scale(1.02);
  }
  100% {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

/* Stack toasts vertically with gap */
.toast-container .toast + .toast {
  margin-top: 0.75rem;
}

/* Responsive adjustments for mobile */
@media (max-width: 576px) {
  .toast-container {
    left: 0 !important;
    right: 0 !important;
    padding: 1rem !important;
    max-width: 100%;
    min-width: auto;
  }

  .toast {
    width: 100%;
  }

  .toast-body {
    font-size: 0.9rem;
    padding: 0.875rem 1rem;
  }
}

