/* Mobile CSS - Epic Mobile Experience for Collision Hub */

/* Mobile-only styles - only apply to screens smaller than 768px */
@media screen and (max-width: 767px) {
  
  /* Global Mobile Optimizations */
  body {
    font-size: 16px;
    line-height: 1.5;
    -webkit-tap-highlight-color: transparent;
    -webkit-text-size-adjust: none;
    touch-action: manipulation;
  }

  /* Smooth scrolling for mobile */
  html {
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
  }

  /* Hero Section Mobile Optimizations */
  .hero-banner {
    height: 60vh !important;
    min-height: 400px !important;
    max-height: 500px !important;
  }

  .hero-logo {
    transform: scale(2) !important;
    margin-bottom: 1rem;
    filter: brightness(0) invert(1) !important;
  }

  /* Category Buttons Mobile Epic Styling */
  .category-buttons-container {
    padding: 1rem !important;
    background: linear-gradient(135deg, #000000 0%, #1a1a1a 100%) !important;
  }

  .category-button {
    padding: 1.25rem 1rem !important;
    font-size: 0.9rem !important;
    font-weight: 800 !important;
    letter-spacing: 0.1em !important;
    border-width: 3px !important;
    border-radius: 12px !important;
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.3) !important;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
    text-transform: uppercase;
    background: rgba(0, 0, 0, 0.9) !important;
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
  }

  .category-button:active {
    transform: scale(0.95) !important;
    box-shadow: 0 2px 6px rgba(249, 115, 22, 0.4) !important;
  }

  .category-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(249, 115, 22, 0.2), transparent);
    transition: left 0.6s ease;
  }

  .category-button:active::before {
    left: 100%;
  }

  /* Grid spacing for mobile */
  .category-buttons-grid {
    gap: 1rem !important;
    grid-template-columns: 1fr !important;
    max-width: 300px;
    margin: 0 auto;
  }

  /* Products Section Mobile */
  .products-section {
    padding: 2rem 1rem !important;
    background: linear-gradient(180deg, #000000 0%, #1a1a1a 50%, #000000 100%) !important;
  }

  .products-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 1rem !important;
    max-width: 400px;
    margin: 0 auto;
  }

  .product-card {
    border-radius: 16px !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6) !important;
    transform: translateY(0);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(107, 114, 128, 0.95) !important;
    backdrop-filter: blur(10px);
  }

  .product-card:active {
    transform: translateY(2px) scale(0.98);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.8) !important;
  }

  .product-image {
    border-radius: 12px !important;
    border-width: 2px !important;
    border-color: rgba(156, 163, 175, 0.6) !important;
  }

  /* Floating Buttons Mobile Optimizations */
  .floating-cart-button {
    top: 1rem !important;
    right: 1rem !important;
    width: 56px !important;
    height: 56px !important;
    box-shadow: 0 8px 24px rgba(249, 115, 22, 0.4) !important;
  }

  .floating-call-button {
    bottom: 1rem !important;
    right: 1rem !important;
    width: 56px !important;
    height: 56px !important;
    box-shadow: 0 8px 24px rgba(249, 115, 22, 0.4) !important;
  }

  .floating-back-button {
    top: 1rem !important;
    left: 1rem !important;
    width: 56px !important;
    height: 56px !important;
    box-shadow: 0 8px 24px rgba(249, 115, 22, 0.4) !important;
  }

  /* Cart Badge Mobile */
  .cart-badge {
    font-size: 0.75rem !important;
    min-width: 20px !important;
    height: 20px !important;
    top: -6px !important;
    right: -6px !important;
    border-width: 2px !important;
  }

  /* Modal Mobile Optimizations */
  .product-filter-modal {
    width: 95% !important;
    max-height: 85vh !important;
    margin: 2.5vh auto !important;
    border-radius: 20px !important;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.8) !important;
  }

  .modal-header {
    padding: 1.5rem 1rem 1rem !important;
    text-align: center;
  }

  .modal-title {
    font-size: 2rem !important;
    margin-bottom: 1rem !important;
  }

  .modal-filter-buttons {
    flex-direction: column !important;
    gap: 0.75rem !important;
    padding: 0 1rem !important;
    margin-bottom: 1.5rem !important;
  }

  .modal-filter-button {
    padding: 1rem !important;
    font-size: 0.875rem !important;
    border-radius: 12px !important;
    width: 100% !important;
  }

  .modal-products-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 1rem !important;
    padding: 0 1rem !important;
  }

  /* Product Cards in Modal */
  .modal-product-card {
    border-radius: 12px !important;
    background: rgba(107, 114, 128, 0.9) !important;
  }

  .modal-product-image {
    height: 140px !important;
    border-radius: 8px !important;
  }

  .modal-product-overlay {
    border-radius: 8px !important;
  }

  .modal-product-buttons {
    gap: 0.5rem !important;
  }

  .modal-product-button {
    padding: 0.5rem !important;
    font-size: 0.7rem !important;
    border-radius: 6px !important;
  }

  /* Footer Mobile */
  .footer {
    padding: 2rem 1rem !important;
  }

  .footer-content {
    flex-direction: column !important;
    gap: 2rem !important;
    text-align: center !important;
  }

  .footer-section {
    margin-bottom: 1.5rem !important;
  }

  .footer-links {
    justify-content: center !important;
    flex-wrap: wrap !important;
    gap: 1rem !important;
  }

  /* Typography Mobile */
  h1 {
    font-size: 2.5rem !important;
    line-height: 1.2 !important;
  }

  h2 {
    font-size: 2rem !important;
    line-height: 1.3 !important;
  }

  h3 {
    font-size: 1.5rem !important;
    line-height: 1.4 !important;
  }

  /* Touch-friendly interactions */
  button, a, [role="button"] {
    min-height: 44px !important;
    min-width: 44px !important;
    touch-action: manipulation;
  }

  /* Prevent zoom on input focus */
  input, select, textarea {
    font-size: 16px !important;
  }

  /* Improved scrolling */
  .modal-content, .products-container {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }

  /* Safe area handling for notched devices */
  .floating-cart-button {
    top: max(1rem, env(safe-area-inset-top)) !important;
  }

  .floating-back-button {
    top: max(1rem, env(safe-area-inset-top)) !important;
  }

  .floating-call-button {
    bottom: max(1rem, env(safe-area-inset-bottom)) !important;
  }

  /* Performance optimizations */
  .product-card, .category-button, .modal-product-card {
    will-change: transform;
    backface-visibility: hidden;
    perspective: 1000px;
  }

  /* Loading states */
  .loading-skeleton {
    background: linear-gradient(90deg, #374151 25%, #4b5563 50%, #374151 75%) !important;
    background-size: 200% 100% !important;
    animation: loading 1.5s infinite ease-in-out !important;
  }

  @keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
  }

  /* Accessibility improvements */
  @media (prefers-reduced-motion: reduce) {
    * {
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.01ms !important;
      scroll-behavior: auto !important;
    }
  }

  /* High contrast support */
  @media (prefers-contrast: high) {
    .category-button, .product-card {
      border-width: 3px !important;
      border-color: #f97316 !important;
    }
  }
}

/* Extra small devices (phones in portrait) */
@media screen and (max-width: 375px) {
  .category-button {
    padding: 1rem 0.75rem !important;
    font-size: 0.8rem !important;
  }

  .products-grid {
    grid-template-columns: 1fr !important;
    max-width: 280px;
  }

  .modal-products-grid {
    grid-template-columns: 1fr !important;
  }

  .hero-logo {
    transform: scale(1.5) !important;
    filter: brightness(0) invert(1) !important;
  }
}

/* Landscape orientation adjustments */
@media screen and (max-width: 767px) and (orientation: landscape) {
  .hero-banner {
    height: 80vh !important;
    min-height: 300px !important;
  }

  .category-buttons-container {
    padding: 0.75rem !important;
  }

  .category-buttons-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    max-width: 500px;
  }
}