/* ===== FLOATING CART BUTTON (FAB) ===== */
.cart-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 60px;
  height: 60px;
  background: var(--primary);
  color: var(--white);
  border: none;
  border-radius: 50%;
  box-shadow: 0 4px 16px rgba(139, 0, 0, 0.4);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  z-index: 999;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  transform: scale(0);
  opacity: 0;
  pointer-events: none;
}

.cart-fab.visible {
  transform: scale(1);
  opacity: 1;
  pointer-events: auto;
}

.cart-fab:hover {
  background: var(--primary-dark);
  transform: scale(1.08) translateY(-3px);
  box-shadow: 0 6px 20px rgba(139, 0, 0, 0.5);
}

.cart-fab:active {
  transform: scale(0.95) translateY(0);
}

/* Badge count */
.cart-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  background: var(--secondary);
  color: var(--text-dark);
  font-weight: 800;
  font-size: 0.78rem;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--white);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  animation: popBadge 0.3s ease-out;
}

@keyframes popBadge {
  0% { transform: scale(0); }
  80% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

/* ===== TOAST NOTIFICATION ===== */
.cart-toast-container {
  position: fixed;
  bottom: 96px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 998;
  pointer-events: none;
}

.cart-toast {
  background: rgba(255, 255, 255, 0.95);
  border-left: 4px solid var(--secondary);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  border-radius: 8px;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  pointer-events: auto;
  animation: slideInToast 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  transition: all 0.3s ease;
  max-width: 320px;
}

.cart-toast.fade-out {
  opacity: 0;
  transform: translateY(10px) scale(0.9);
}

@keyframes slideInToast {
  from { transform: translateX(50px) scale(0.9); opacity: 0; }
  to { transform: translateX(0) scale(1); opacity: 1; }
}

.cart-toast i {
  color: var(--secondary);
  font-size: 1.1rem;
}

.cart-toast span {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-dark);
}

.cart-toast a {
  color: var(--primary);
  font-weight: 700;
  text-decoration: underline;
  margin-left: auto;
  font-size: 0.85rem;
  cursor: pointer;
}

/* ===== ORDER DETAILS MODAL ===== */
.cart-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.cart-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.cart-modal-box {
  background: var(--white);
  width: 90%;
  max-width: 520px;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  transform: translateY(20px);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: flex;
  flex-direction: column;
  max-height: 80vh;
}

.cart-modal-overlay.active .cart-modal-box {
  transform: translateY(0);
}

.cart-modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid #f0f0f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cart-modal-header h3 {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-dark);
  display: flex;
  align-items: center;
  gap: 8px;
}

.cart-modal-header h3 i {
  color: var(--primary);
}

.cart-close-btn {
  background: none;
  border: none;
  font-size: 1.2rem;
  color: var(--text-gray);
  cursor: pointer;
  transition: color 0.2s;
}

.cart-close-btn:hover {
  color: var(--primary);
}

.cart-modal-body {
  padding: 16px 20px;
  overflow-y: auto;
  flex: 1;
}

/* Empty State */
.cart-empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-gray);
}

.cart-empty-state i {
  font-size: 3rem;
  margin-bottom: 12px;
  color: #ddd;
}

.cart-empty-state p {
  font-size: 0.95rem;
}

/* Cart Item List */
.cart-items-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cart-item-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f5f5f5;
}

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

.cart-item-img {
  width: 54px;
  height: 54px;
  border-radius: 8px;
  object-fit: cover;
  background: #f5f5f5;
}

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

.cart-item-name {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text-dark);
  margin-bottom: 4px;
}

.cart-item-price {
  color: var(--primary);
  font-weight: 700;
  font-size: 0.88rem;
}

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

.cart-qty-btn-group {
  display: flex;
  align-items: center;
  border: 1px solid #ddd;
  border-radius: 6px;
  overflow: hidden;
}

.cart-qty-btn-group button {
  background: #fdfdfd;
  border: none;
  width: 26px;
  height: 26px;
  cursor: pointer;
  font-weight: bold;
  font-size: 0.9rem;
  color: var(--text-dark);
  transition: background 0.2s;
}

.cart-qty-btn-group button:hover {
  background: #f0f0f0;
}

.cart-qty-val {
  padding: 0 10px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-dark);
}

.cart-item-delete {
  background: none;
  border: none;
  color: #c9c9c9;
  cursor: pointer;
  font-size: 0.95rem;
  transition: color 0.2s;
  padding: 4px;
}

.cart-item-delete:hover {
  color: var(--primary);
}

/* Modal Footer */
.cart-modal-footer {
  padding: 16px 20px;
  border-top: 1px solid #f0f0f0;
  background: #fafafa;
  border-radius: 0 0 16px 16px;
}

.cart-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.cart-total-row span {
  font-weight: 600;
  color: var(--text-gray);
  font-size: 0.95rem;
}

.cart-total-row strong {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--primary);
}

.cart-btn-confirm {
  width: 100%;
  background: var(--primary);
  color: var(--white);
  border: none;
  padding: 12px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 3px 10px rgba(139, 0, 0, 0.2);
  transition: all 0.2s;
}

.cart-btn-confirm:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(139, 0, 0, 0.3);
}

.cart-btn-confirm:active {
  transform: translateY(0);
}
