/* ==============================================
   MOBILE RESPONSIVE STYLES
   ============================================== */

/* Mobile First Approach */
@media (max-width: 768px) {
  
  /* Container adjustments */
  .container {
    padding: 0 var(--space-2);
  }
  
  /* Header mobile */
  .header-content {
    flex-wrap: wrap;
    gap: var(--space-2);
  }
  
  .logo {
    order: 1;
  }
  
  .mobile-menu-toggle {
    order: 2;
    margin-left: auto;
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--primary);
    cursor: pointer;
  }
  
  .search-bar {
    order: 4;
    width: 100%;
    margin-top: var(--space-2);
  }
  
  .user-actions {
    order: 3;
    gap: var(--space-1);
  }
  
  .user-info {
    flex-direction: column;
    align-items: center;
    gap: 2px;
    font-size: 0.75rem;
  }
  
  .action-btn span {
    display: none;
  }
  
  .action-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    justify-content: center;
  }
  
  /* Navigation mobile */
  .nav-items {
    padding: 0 var(--space-2);
  }
  
  .nav-item {
    padding: var(--space-1) var(--space-2);
    font-size: 0.8rem;
  }
  
  /* Top users mobile */
  .top-users-list {
    flex-direction: column;
    align-items: center;
  }
  
  .top-user-item {
    width: 100%;
    max-width: 300px;
  }
  
  /* Hero banners mobile */
  .hero-banners {
    height: 250px;
    margin: var(--space-2) var(--space-2);
    border-radius: 8px;
  }
  
  .banner-content {
    left: var(--space-2);
    right: var(--space-2);
  }
  
  .banner-content h2 {
    font-size: 1.5rem;
  }
  
  /* Categories mobile */
  .categories-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-2);
  }
  
  .category-card {
    padding: var(--space-3);
  }
  
  .category-icon {
    font-size: 2rem;
  }
  
  .category-card h3 {
    font-size: 1rem;
  }
  
  /* Products mobile */
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-2);
  }
  
  .product-card {
    border-radius: 8px;
  }
  
  .product-image {
    height: 150px;
  }
  
  .product-info {
    padding: var(--space-2);
  }
  
  .product-info h3 {
    font-size: 0.9rem;
    line-height: 1.2;
  }
  
  .product-actions {
    flex-direction: column;
  }
  
  .product-actions .btn {
    font-size: 0.75rem;
    padding: var(--space-1);
  }
  
  /* Stats mobile */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-2);
  }
  
  .stat-item {
    flex-direction: column;
    text-align: center;
    padding: var(--space-3);
  }
  
  .stat-icon {
    width: 50px;
    height: 50px;
    font-size: 1.25rem;
  }
  
  .stat-content h3 {
    font-size: 1.5rem;
  }
  
  /* Cart mobile */
  .cart-container {
    grid-template-columns: 1fr;
    gap: var(--space-3);
  }
  
  .cart-item {
    flex-direction: column;
    gap: var(--space-2);
  }
  
  .item-image {
    width: 80px;
    height: 80px;
    align-self: center;
  }
  
  .item-controls {
    justify-content: space-between;
  }
  
  /* Checkout mobile */
  .checkout-container {
    grid-template-columns: 1fr;
  }
  
  .form-row {
    grid-template-columns: 1fr;
  }
  
  /* Payment mobile */
  .payment-container {
    grid-template-columns: 1fr;
  }
  
  .payment-buttons {
    grid-template-columns: 1fr;
  }
  
  .upi-btn {
    padding: var(--space-3);
  }
  
  /* Auth mobile */
  .auth-container {
    padding: var(--space-2);
  }
  
  .auth-card {
    padding: var(--space-4);
  }
  
  .form-options {
    flex-direction: column;
    gap: var(--space-2);
    align-items: flex-start;
  }
  
  /* Footer mobile */
  .footer-content {
    grid-template-columns: 1fr;
    gap: var(--space-3);
  }
  
  .badge-item {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-1);
  }
  
  /* WhatsApp button mobile */
  .whatsapp-help {
    bottom: var(--space-2);
    right: var(--space-2);
  }
  
  .whatsapp-btn {
    padding: var(--space-2);
    border-radius: 50%;
    width: 60px;
    height: 60px;
  }
  
  .whatsapp-btn span {
    display: none;
  }
  
  /* Typography mobile */
  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.5rem; }
  h3 { font-size: 1.25rem; }
  
  .section-title {
    font-size: 1.5rem;
    margin-bottom: var(--space-3);
  }
  
  /* Utility classes mobile */
  .hidden-mobile { display: none !important; }
  .block-mobile { display: block !important; }
  .flex-mobile { display: flex !important; }
}

/* Tablet styles */
@media (min-width: 769px) and (max-width: 1024px) {
  
  .categories-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .products-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .cart-container {
    grid-template-columns: 1fr 300px;
  }
  
  .checkout-container {
    grid-template-columns: 1fr 300px;
  }
  
  .payment-container {
    grid-template-columns: 1fr 300px;
  }
}

/* Large desktop styles */
@media (min-width: 1400px) {
  
  .container {
    max-width: 1400px;
  }
  
  .products-grid {
    grid-template-columns: repeat(5, 1fr);
  }
  
  .categories-grid {
    grid-template-columns: repeat(6, 1fr);
  }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
  
  .btn {
    min-height: 44px;
    min-width: 44px;
  }
  
  .action-btn {
    min-height: 44px;
    min-width: 44px;
  }
  
  .nav-item {
    min-height: 44px;
  }
  
  .form-group input,
  .form-group textarea,
  .form-group select {
    min-height: 44px;
  }
  
  /* Remove hover effects on touch devices */
  .product-card:hover {
    transform: none;
    box-shadow: var(--shadow);
  }
  
  .category-card:hover {
    transform: none;
    box-shadow: var(--shadow);
  }
  
  .btn:hover {
    transform: none;
  }
}

/* High DPI display support */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  
  .product-image img,
  .banner-slide img {
    image-rendering: -webkit-optimize-contrast;
  }
}

/* Print styles */
@media print {
  
  .main-header,
  .main-nav,
  .whatsapp-help,
  .main-footer {
    display: none !important;
  }
  
  .container {
    max-width: none;
    margin: 0;
    padding: 0;
  }
  
  .product-card,
  .cart-item {
    break-inside: avoid;
  }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
  
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .banner-slide {
    transition: none;
  }
  
  .whatsapp-btn {
    animation: none;
  }
  
  .animated-clap {
    animation: none;
  }
}

/* Dark mode adjustments for mobile */
@media (max-width: 768px) and (prefers-color-scheme: dark) {
  
  .theme-light {
    --bg-primary: var(--gray-900);
    --bg-secondary: var(--gray-800);
    --text-primary: var(--gray-100);
    --text-secondary: var(--gray-300);
    --border-color: var(--gray-700);
  }
}

/* Mobile app-like experience */
@media (max-width: 768px) {
  
  /* PWA styles */
  @media (display-mode: standalone) {
    
    .main-header {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      z-index: 1000;
    }
    
    body {
      padding-top: 80px;
    }
    
    .whatsapp-help {
      bottom: calc(var(--space-2) + env(safe-area-inset-bottom));
    }
  }
  
  /* Safe area insets for notched devices */
  .main-header {
    padding-top: max(var(--space-2), env(safe-area-inset-top));
  }
  
  .main-footer {
    padding-bottom: max(var(--space-3), env(safe-area-inset-bottom));
  }
}