/* ============================================================
   SensFlow - Mobile Optimizations
   Améliorations spécifiques pour l'expérience mobile
   ============================================================ */

/* ========== Touch Targets - Mobile uniquement (WCAG 2.5) ========== */

@media (max-width: 968px) {
  /* Boutons principaux */
  .btn {
    min-height: 44px;
    min-width: 44px;
  }

  .btn-sm {
    min-height: 44px;
  }

  .btn-ghost {
    min-height: 44px;
  }

  /* Toggle menu hamburger */
  .navbar-toggle {
    min-width: 44px;
    min-height: 44px;
    padding: 10px;
  }

  /* Password toggle */
  .password-toggle {
    min-width: 44px;
    min-height: 44px;
  }

  /* Social login buttons */
  .social-login-btn {
    min-height: 48px;
  }
}

/* ========== Hero Shapes - Responsive Scaling ========== */

@media (max-width: 768px) {
  .hero-shape-1 {
    width: 300px;
    height: 300px;
    top: -100px;
    right: -50px;
  }

  .hero-shape-2 {
    width: 200px;
    height: 200px;
    bottom: -50px;
    left: -50px;
  }

  .hero-shape-3 {
    width: 150px;
    height: 150px;
  }
}

@media (max-width: 480px) {
  .hero-shape-1 {
    width: 200px;
    height: 200px;
    top: -50px;
    right: -30px;
  }

  .hero-shape-2 {
    width: 150px;
    height: 150px;
    bottom: -30px;
    left: -30px;
  }

  .hero-shape-3 {
    width: 100px;
    height: 100px;
  }
}

/* ========== Mobile Navigation Improvements ========== */

@media (max-width: 968px) {
  .navbar-menu.active {
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1);
  }

  /* Hero: texte en premier, mockup en dessous sur mobile */
  .hero-visual,
  .hero-visual-booking {
    order: 1;
  }

  .hero-content {
    order: 0;
  }
}

/* ========== Booking Features - No Horizontal Scroll on Mobile ========== */

@media (max-width: 768px) {
  .booking-features-row {
    flex-direction: column;
    align-items: center;
    overflow-x: visible;
    scroll-snap-type: none;
    gap: var(--space-4);
    padding-bottom: 0;
  }

  .booking-feature-card-compact {
    flex: none;
    width: 100%;
    max-width: 320px;
  }
}

@media (max-width: 480px) {
  .booking-feature-card-compact {
    max-width: 100%;
  }
}

/* ========== Typography - Minimum Readable Sizes ========== */

/* Textes très petits remontés à minimum 12px (0.75rem) */
.color-name,
.perso-items span,
.calendar-slots .slot,
.demo-specialty-tag {
  font-size: 0.75rem;
}

.mockup-reviews,
.mockup-consult-meta,
.mockup-step-label {
  font-size: 0.8125rem;
}

/* Amélioration lisibilité sur mobile */
@media (max-width: 480px) {
  body {
    font-size: 16px;
    line-height: 1.7;
  }

  p {
    font-size: 1rem;
    line-height: 1.7;
  }

  .hero-description {
    font-size: 1.0625rem;
  }

  .booking-feature-content-compact p {
    font-size: 0.875rem;
    line-height: 1.5;
  }

  .booking-feature-content-compact h3 {
    font-size: 1rem;
  }

  /* Footer texte */
  .footer-description,
  .footer-link,
  .footer-contact-item {
    font-size: 0.9375rem;
  }
}

/* ========== Forms - Mobile Optimization ========== */

@media (max-width: 640px) {
  .auth-card {
    padding: var(--space-5);
    margin: var(--space-4);
    border-radius: var(--radius-xl);
  }

  .form-input,
  .form-select,
  .form-textarea {
    height: 52px;
    font-size: 16px; /* Empêche le zoom iOS */
    padding: 0 var(--space-4);
  }

  .form-textarea {
    height: auto;
    min-height: 120px;
    padding: var(--space-3) var(--space-4);
  }

  .form-label {
    font-size: 0.9375rem;
    margin-bottom: var(--space-2);
  }

  .form-row {
    flex-direction: column;
    gap: var(--space-4);
  }

  .form-group {
    margin-bottom: var(--space-4);
  }

  /* Bouton submit pleine largeur */
  .auth-form .btn,
  .contact-form .btn {
    width: 100%;
  }
}

/* Contact form specific */
@media (max-width: 768px) {
  .contact-form-row {
    flex-direction: column;
    gap: var(--space-4);
  }

  .contact-form-row > * {
    width: 100%;
  }
}

/* ========== Hero Section - Mobile Specific ========== */

@media (max-width: 480px) {
  .hero {
    padding: calc(var(--space-16) + 60px) 0 var(--space-10);
  }

  .hero-title {
    font-size: clamp(1.75rem, 8vw, 2.25rem);
    margin-bottom: var(--space-4);
  }

  .hero-description {
    margin-bottom: var(--space-6);
  }

  .hero-cta {
    flex-direction: column;
    gap: var(--space-3);
  }

  .hero-cta .btn {
    width: 100%;
  }

  .hero-badge {
    font-size: 0.8125rem;
    padding: var(--space-1) var(--space-3);
  }

  .hero-visual {
    max-width: 100%;
    padding: 0 var(--space-2);
  }

  /* Mockup booking */
  .hero-booking-mockup {
    max-width: 100%;
    margin: 0;
  }

  .mockup-photo {
    width: 48px;
    height: 48px;
  }

  .mockup-name {
    font-size: 1rem;
  }

  .mockup-body {
    padding: var(--space-4);
  }

  .mockup-consultation {
    padding: var(--space-2) var(--space-3);
  }

  .mockup-consult-name {
    font-size: 0.875rem;
  }
}

/* ========== Sections - Spacing Mobile ========== */

@media (max-width: 768px) {
  section {
    padding: var(--space-12) 0;
  }

  .section-title {
    font-size: clamp(1.5rem, 6vw, 2rem);
    margin-bottom: var(--space-3);
  }

  .section-subtitle {
    font-size: 1rem;
    margin-bottom: var(--space-8);
  }
}

@media (max-width: 480px) {
  section {
    padding: var(--space-10) 0;
  }

  .container {
    padding: 0 var(--space-4);
  }
}

/* ========== Cards & Grid - Mobile Layout ========== */

@media (max-width: 640px) {
  .features-grid,
  .pricing-grid,
  .testimonials-grid {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }

  .feature-card,
  .pricing-card,
  .testimonial-card {
    padding: var(--space-5);
  }
}

/* Demo client grid */
@media (max-width: 480px) {
  .demo-client-grid {
    grid-template-columns: 1fr;
  }
}

/* ========== Gallery & Lightbox - Mobile ========== */

@media (max-width: 640px) {
  .demo-gallery-item {
    padding-bottom: 66.67%; /* 3:2 ratio meilleur pour mobile */
  }

  .lightbox-close {
    top: var(--space-3);
    right: var(--space-3);
    width: 44px;
    height: 44px;
  }

  .zoom-btn {
    width: 44px;
    height: 44px;
    bottom: var(--space-3);
    right: var(--space-3);
  }
}

/* ========== Footer - Mobile ========== */

@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: var(--space-8);
    text-align: center;
  }

  .footer-brand {
    align-items: center;
  }

  .footer-links {
    justify-content: center;
  }

  .footer-social {
    justify-content: center;
  }

  .footer-bottom {
    flex-direction: column;
    gap: var(--space-4);
    text-align: center;
  }

  .footer-legal {
    justify-content: center;
    flex-wrap: wrap;
  }
}

/* ========== Accessibility - Reduced Motion ========== */

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

  .hero-float {
    animation: none;
  }

  .hero-booking-mockup {
    transform: none;
  }

  .hero-booking-mockup:hover {
    transform: none;
  }
}

/* ========== Safe Area - iPhone Notch ========== */

@supports (padding: max(0px)) {
  .navbar {
    padding-top: max(var(--space-4), env(safe-area-inset-top));
    padding-left: max(var(--space-4), env(safe-area-inset-left));
    padding-right: max(var(--space-4), env(safe-area-inset-right));
  }

  .footer {
    padding-bottom: max(var(--space-8), env(safe-area-inset-bottom));
  }
}

/* ========== Sticky Elements - Mobile ========== */

@media (max-width: 768px) {
  /* CTA sticky en bas sur mobile pour les pages longues */
  .sticky-cta-mobile {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: var(--space-3) var(--space-4);
    padding-bottom: max(var(--space-3), env(safe-area-inset-bottom));
    background: var(--sf-white);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    z-index: 100;
  }

  .sticky-cta-mobile .btn {
    width: 100%;
  }
}

/* ========== Images - Lazy Loading Placeholder ========== */

img[loading="lazy"] {
  background: var(--sf-gray-100);
}

/* ========== Focus States - Better for Touch ========== */

@media (hover: none) and (pointer: coarse) {
  /* Appareils tactiles uniquement */
  .btn:focus,
  .navbar-link:focus,
  input:focus,
  select:focus,
  textarea:focus {
    outline: 3px solid var(--sf-sage);
    outline-offset: 2px;
  }

  /* Désactiver les effets hover sur tactile */
  .btn:hover {
    transform: none;
  }

  .booking-feature-card-compact:hover {
    transform: none;
  }

  /* Active state pour le feedback tactile */
  .btn:active {
    transform: scale(0.98);
    opacity: 0.9;
  }
}

/* ========== Scroll Optimizations ========== */

/* Prevent overscroll bounce on iOS */
html {
  overscroll-behavior: none;
}

/* Smooth momentum scrolling on iOS */
.booking-features-row,
.testimonials-slider {
  -webkit-overflow-scrolling: touch;
}

/* ========== Input Zoom Prevention iOS ========== */

@media screen and (max-width: 768px) {
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="tel"],
  input[type="number"],
  input[type="date"],
  select,
  textarea {
    font-size: 16px !important;
  }
}

/* ========== Landscape Mode ========== */

@media (max-width: 896px) and (orientation: landscape) {
  .hero {
    min-height: auto;
    padding: var(--space-16) 0 var(--space-8);
  }

  .navbar-menu {
    padding: var(--space-8) var(--space-6);
  }

  .navbar-links {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
  }
}
