/* Mobile UX Enhancements */
/* Touch gestures, quick actions, mobile optimizations */

/* Touch-friendly button sizes */
@media (max-width: 768px) {
  .btn,
  .quick-shop-btn,
  .add-to-cart-btn,
  .buy-now-btn {
    min-height: 44px; /* iOS recommended touch target */
    min-width: 44px;
    padding: 0.8rem 1.2rem;
    font-size: 1rem;
  }
  
  /* Larger tap targets for mobile */
  .product-card,
  .category-card {
    cursor: pointer;
    -webkit-tap-highlight-color: rgba(154, 133, 85, 0.2);
  }
  
  /* Swipe gestures for product cards */
  .product-card {
    touch-action: pan-y;
  }
  
  /* Floating action buttons */
  .fab {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--accent-color);
    color: var(--dark-bg);
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    z-index: 1000;
    cursor: pointer;
    transition: all 0.3s ease;
  }
  
  .fab:hover,
  .fab:active {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
  }
  
  /* Quick action menu */
  .quick-actions-menu {
    position: fixed;
    bottom: 90px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 999;
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
    transition: all 0.3s ease;
  }
  
  .quick-actions-menu.open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
  }
  
  .quick-action-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: white;
    color: var(--primary-color);
    border: 2px solid var(--border-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
  }
  
  .quick-action-btn:hover,
  .quick-action-btn:active {
    background: var(--secondary-color);
    color: white;
    transform: scale(1.1);
  }
  
  /* Mobile navigation improvements */
  .main-nav {
    display: none;
  }
  
  .mobile-menu-toggle {
    display: block;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
  }
  
  /* Bottom navigation bar */
  .bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 0.5rem 0;
    z-index: 1000;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
  }
  
  .bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    text-decoration: none;
    color: #666;
    font-size: 0.75rem;
    flex: 1;
    padding: 0.5rem;
    transition: var(--transition);
  }
  
  .bottom-nav-item.active {
    color: var(--secondary-color);
  }
  
  .bottom-nav-item i {
    font-size: 1.3rem;
  }
  
  /* Pull to refresh */
  .pull-to-refresh {
    text-align: center;
    padding: 1rem;
    color: var(--secondary-color);
    display: none;
  }
  
  .pull-to-refresh.active {
    display: block;
  }
  
  /* Swipeable product cards */
  .swipeable-card {
    position: relative;
    overflow: hidden;
  }
  
  .swipe-actions {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    background: var(--error-color);
    padding: 0 1rem;
    transform: translateX(100%);
    transition: transform 0.3s ease;
  }
  
  .swipeable-card.swiped .swipe-actions {
    transform: translateX(0);
  }
  
  /* Improved cart sidebar for mobile */
  .cart-sidebar {
    width: 100%;
    max-width: 100%;
  }
  
  /* Better form inputs on mobile */
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  textarea,
  select {
    font-size: 16px; /* Prevents zoom on iOS */
  }
  
  /* Improved touch feedback */
  button:active,
  .btn:active,
  a:active {
    opacity: 0.7;
    transform: scale(0.98);
  }
  
  /* Loading states */
  .loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
  }
  
  .loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
  }
  
  @keyframes spin {
    to { transform: rotate(360deg); }
  }
}

/* Tablet optimizations */
@media (min-width: 769px) and (max-width: 1024px) {
  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }
  
  .categories-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }
}

/* Performance optimizations */
.product-image,
.category-icon img {
  will-change: transform;
  backface-visibility: hidden;
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
