/* Mobile cart specific styles */
.cart-item-mobile {
  background-color: #ffffff;
  border-radius: 16px;
  margin-bottom: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cart-item-mobile:active {
  transform: scale(0.98);
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.mobile-cart-open {
  overflow: hidden !important;
}

/* Enhanced Mobile Cart */
#mobile-cart-panel {
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
}

#mobile-cart-panel:before {
  content: '';
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 50px;
  height: 5px;
  background-color: rgba(0,0,0,0.2);
  border-radius: 99px;
}

/* Mobile app animation effects */
@keyframes slideInUp {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

#mobile-cart-panel {
  animation: slideInUp 0.3s ease-out;
}

#mobile-cart-overlay {
  animation: fadeIn 0.2s ease-out;
}

/* Bottom nav bar spacing for cart button */
@media (max-width: 768px) {
  #bottom-nav {
    padding-bottom: max(16px, env(safe-area-inset-bottom));
  }
  
  #mobile-cart-btn {
    bottom: calc(80px + max(0px, env(safe-area-inset-bottom)));
  }
  
  #mobile-cart-fab {
    box-shadow: 0 4px 12px rgba(67, 97, 238, 0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
  }
  
  #mobile-cart-fab:active {
    transform: scale(0.95);
    box-shadow: 0 2px 8px rgba(67, 97, 238, 0.2);
  }
}

/* Improved mobile touch targets */
@media (max-width: 640px) {
  .form-control, 
  button,
  .btn,
  select,
  input[type="text"],
  input[type="number"],
  input[type="email"],
  input[type="tel"] {
    min-height: 48px;
    font-size: 16px; /* Prevent iOS zoom on input */
  }
  
  .qty-btn {
    min-width: 48px;
    min-height: 48px;
  }
  
  /* App-like card styles for mobile */
  .bg-white, .card, .product-card {
    border-radius: 16px !important;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05) !important;
  }
  
  /* Improved form field appearance */
  input, select, textarea {
    border-radius: 12px !important;
  }
  
  /* Large buttons with better touch affordance */
  .rounded-lg {
    border-radius: 12px !important;
  }
  
  .rounded-xl {
    border-radius: 16px !important;
  }
  
  /* Smoother scrolling for mobile */
  * {
    -webkit-overflow-scrolling: touch;
  }
}

/* Active state for buttons on touch devices */
@media (hover: none) {
  button:active, .btn:active {
    opacity: 0.8;
    transform: scale(0.98);
  }
}