/* FÈ SA Mobile-First Optimization CSS */

/* ===== CRITICAL MOBILE-FIRST RULES ===== */

/* MOBILE FIRST - Start with mobile styles */
.container {
  padding: 0 16px;
  max-width: 100%;
}

/* Prevent iOS text size adjustment */
body {
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
}

/* Mobile-first typography */
html {
  font-size: 16px; /* Base size - prevents iOS zoom */
}

.hero-title {
  font-size: 1.75rem; /* 28px on mobile */
  line-height: 1.2;
  margin-bottom: 1rem;
}

.hero-subtitle {
  font-size: 1rem; /* 16px on mobile */
  line-height: 1.4;
}

/* Touch-friendly buttons */
.btn, .card, .provider-card {
  min-height: 48px; /* Apple/Google recommendation */
  cursor: pointer;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
}

/* Touch feedback */
.btn:active {
  transform: scale(0.98);
  transition: transform 0.1s ease;
}

/* Larger touch targets for mobile */
.nav-item, .filter-option {
  padding: 12px 16px;
  margin: 4px 0;
}

/* Form inputs */
.form-input, .search-input {
  min-height: 48px;
  font-size: 16px; /* Prevents iOS zoom */
  padding: 12px 16px;
  border-radius: 8px;
}

/* WhatsApp floating button - mobile optimized */
.sticky-whatsapp-button {
  width: 60px;
  height: 60px;
  bottom: 20px;
  right: 20px;
  border-radius: 50%;
  box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
}

/* ===== MOBILE NAVIGATION ===== */

/* Mobile hamburger button */
.nav-toggle {
  display: block;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--primary);
  cursor: pointer;
  padding: 8px;
  min-height: 44px;
  min-width: 44px;
}

/* Hide desktop nav items on mobile */
@media (max-width: 767px) {
  .nav-links {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: white;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    gap: 2rem;
}

  .nav-links.mobile-active {
    display: flex;
  }
  
  .nav-item {
    font-size: 1.5rem;
    padding: 1rem 2rem;
    text-align: center;
    width: 100%;
    border-bottom: 1px solid #e5e7eb;
  }
  

}

/* Desktop navigation - unchanged */
@media (min-width: 768px) {
  .nav-toggle {
    display: none;
  }
  
  .nav-links {
    display: flex;
    gap: 1rem;
  }
  

}



/* ===== PROVIDER CARDS MOBILE LAYOUT ===== */

/* Mobile provider cards */
.provider-card-taskrabbit {
  display: block; /* Stack vertically on mobile */
  padding: 16px;
  margin-bottom: 16px;
}

.provider-left-section {
  width: 100%;
  margin-bottom: 16px;
    text-align: center;
}

.provider-right-section {
  width: 100%;
}

.provider-header-taskrabbit {
  flex-direction: column;
    text-align: center;
  gap: 8px;
}

.provider-price-large {
  font-size: 1.5rem;
  color: var(--primary);
  font-weight: 700;
}

/* Tablet and up */
@media (min-width: 768px) {
  .provider-card-taskrabbit {
    display: flex;
    flex-direction: row;
    padding: 24px;
  }
  
  .provider-left-section {
    width: 200px;
    margin-bottom: 0;
    text-align: left;
  }
  
  .provider-header-taskrabbit {
    flex-direction: row;
    text-align: left;
  }
}

/* ===== MOBILE FILTER SIDEBAR ===== */

/* Mobile filter implementation for provider-selection.html */
@media (max-width: 1023px) {
  .providers-section .container {
    display: block; /* Remove flex layout on mobile */
  }
  
  /* Add mobile filter toggle button */
  .mobile-filter-toggle {
    display: block;
    width: 100%;
    padding: 12px 16px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
  }
  
  /* Hide sidebar by default on mobile */
  .filter-sidebar {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: white;
    z-index: 2000;
    padding: 24px;
    overflow-y: auto;
    border-radius: 0;
  }
  
  .filter-sidebar.mobile-active {
    display: block;
  }
  
  /* Mobile filter header */
  .mobile-filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid #e5e7eb;
  }
  
  .mobile-filter-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #6b7280;
    cursor: pointer;
    min-height: 44px;
    min-width: 44px;
  }
  
    /* Improve filter options for touch */
  .filter-option {
    padding: 16px 12px;
    margin: 4px 0;
    border-radius: 8px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
  }

  .filter-option:hover,
  .filter-option:active {
    background: #f9fafb;
    border-color: #e5e7eb;
    padding-left: 16px;
    padding-right: 16px;
    margin-left: -4px;
    margin-right: -4px;
  }

  .filter-checkbox {
    width: 20px;
    height: 20px;
    margin-right: 12px;
    border-radius: 4px;
    border: 2px solid #d1d5db;
    background: white;
    flex-shrink: 0;
  }
  
  .filter-checkbox.checked {
    background: var(--primary);
    border-color: var(--primary);
    transform: scale(1.05);
  }
  
  /* Providers content takes full width */
  .providers-content {
    max-width: 100% !important;
    margin: 0 !important;
  }
}

/* Desktop filter - enhanced */
@media (min-width: 1024px) {
  .mobile-filter-toggle {
    display: none;
  }
  
  .filter-sidebar {
    display: block !important;
    position: static;
    width: 300px;
    height: auto;
    background: white;
    border-radius: 24px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
    z-index: auto;
  }
}

/* ===== TABLET SCALING ===== */

@media (min-width: 768px) {
  .container {
    padding: 0 24px;
  }
  
  .hero-title {
    font-size: 2.25rem; /* 36px */
  }
  
  .hero-subtitle {
    font-size: 1.125rem; /* 18px */
  }
}

/* ===== DESKTOP SCALING ===== */

@media (min-width: 1024px) {
  .container {
    padding: 0 32px;
    max-width: 1200px;
    margin: 0 auto;
  }
  
  .hero-title {
    font-size: 3rem; /* 48px */
  }
  
  .hero-subtitle {
    font-size: 1.25rem; /* 20px */
  }
  
  /* Show desktop features */
  .desktop-only {
    display: block !important;
  }
}

/* ===== MOBILE PERFORMANCE OPTIMIZATION ===== */

/* Optimize animations for mobile */
* {
  box-sizing: border-box;
}

/* Reduce motion for better performance */
@media (prefers-reduced-motion: reduce) {
  *, ::before, ::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Hardware acceleration for smooth scrolling */
.provider-card, .btn {
  transform: translateZ(0);
  will-change: transform;
}

/* Lazy loading optimization */
img {
  loading: lazy;
  decoding: async;
}

/* Reduce layout shifts */
.provider-avatar-large {
  aspect-ratio: 1/1;
  background: #f3f4f6;
}

/* ===== MOBILE FORM OPTIMIZATION ===== */

/* Mobile form styling */
.booking-form {
  padding: 20px 16px;
}

.form-group {
  margin-bottom: 20px;
}

.form-label {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
  display: block;
}

.form-input {
  width: 100%;
  min-height: 48px;
  font-size: 16px; /* Prevents iOS zoom */
  padding: 12px 16px;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  background: white;
}

.form-input:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(255, 87, 34, 0.1);
}

/* Progress indicator mobile */
.progress-bar {
    display: flex;
    justify-content: space-between;
  margin-bottom: 24px;
  padding: 0 16px;
}

.progress-step {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
    align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
}

/* ===== WHATSAPP MODAL MOBILE ===== */

/* WhatsApp modal mobile */
.whatsapp-modal .modal-content {
  width: 95%;
  max-width: 400px;
  margin: 10% auto;
  border-radius: 12px;
  padding: 24px 20px;
}

.modal-header {
    text-align: center;
  margin-bottom: 24px;
}

.modal-close {
    position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  font-size: 24px;
  color: #6b7280;
    cursor: pointer;
  min-height: 44px;
  min-width: 44px;
}

.btn-whatsapp {
  width: 100%;
  padding: 16px;
  font-size: 18px;
  font-weight: 600;
  background: #25d366;
    color: white;
  border: none;
  border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
  gap: 8px;
}

/* ===== BODY STATES FOR MOBILE NAVIGATION ===== */

/* Body states for mobile navigation */
body.nav-open,
body.filter-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
}

/* Use CSS custom property for mobile viewport height */
.hero-modern {
  min-height: calc(var(--vh, 1vh) * 60);
}

@media (min-width: 768px) {
  .hero-modern {
    min-height: calc(var(--vh, 1vh) * 70);
  }
}

@media (min-width: 1024px) {
  .hero-modern {
    min-height: calc(var(--vh, 1vh) * 80);
  }
}

/* Improved touch targets */
.nav-item,
.filter-option,
.location-item,
.service-category-card {
  min-height: 44px;
    display: flex;
    align-items: center;
  cursor: pointer;
}

/* Remove tap highlight on iOS */
* {
  -webkit-tap-highlight-color: transparent;
}

/* Better touch scrolling */
.location-menu,
.filter-sidebar,
.nav-links {
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

/* ===== SERVICE CARDS MOBILE OPTIMIZATION ===== */

/* Mobile service cards */
@media (max-width: 767px) {
  .service-category-card {
        width: 100%;
    margin-bottom: 16px;
    padding: 20px 16px;
  }
  
  .service-grid {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 0 16px;
  }
  
  .service-icon {
    width: 60px;
    height: 60px;
    margin-bottom: 16px;
  }
  
  .service-title {
    font-size: 1.25rem;
    margin-bottom: 8px;
  }
  
  .service-description {
    font-size: 0.875rem;
    line-height: 1.4;
  }
}

/* ===== SEARCH BAR MOBILE OPTIMIZATION ===== */

@media (max-width: 767px) {
  .search-bar {
    width: 100%;
    margin-bottom: 16px;
  }
  
  .search-input {
    width: 100%;
    min-height: 48px;
    font-size: 16px;
    padding: 12px 16px;
  }
  
  .search-icon {
    left: 16px;
  }
  
  .search-clear {
    right: 16px;
    min-height: 44px;
    min-width: 44px;
  }
}

/* ===== PAGINATION MOBILE ===== */

@media (max-width: 767px) {
  .pagination-container {
    flex-direction: column;
    gap: 16px;
    align-items: center;
  }
  
  .pagination-btn {
    min-height: 48px;
    min-width: 48px;
    font-size: 18px;
  }
  
  .pagination-info {
    font-size: 14px;
    text-align: center;
  }
}

/* ===== CRITICAL MOBILE FIXES ===== */

/* Fix for iOS Safari viewport issues */
@supports (-webkit-touch-callout: none) {
  .hero {
    min-height: -webkit-fill-available;
  }
}

/* Fix for Android Chrome address bar */
@media screen and (max-height: 600px) {
  .hero {
    min-height: 100vh;
  }
}

/* Ensure proper spacing on very small screens */
@media (max-width: 375px) {
  .container {
    padding: 0 12px;
  }
  
  .provider-card-taskrabbit {
    padding: 12px;
  }
  
  .btn {
    padding: 12px 16px;
    font-size: 14px;
    }
} 