/**
 * Mobile Optimizations CSS
 * Mejoras de rendimiento y UX para dispositivos móviles
 */

/* ==========================================================================
   1. TOUCH TARGETS - Mínimo 44x44px para accesibilidad
   ========================================================================== */

@media (max-width: 992px) {
  /* Botones y enlaces táctiles más grandes */
  .bz-primary-btn,
  .header-btn,
  .submit,
  button[type="submit"] {
    min-height: 48px;
    padding: 14px 28px;
  }

  /* Links del menú móvil */
  .mobile-menu-items ul li a {
    padding: 14px 16px;
    display: block;
  }

  /* Iconos sociales */
  .social-link a {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* Links del footer */
  .footer-list li a {
    padding: 8px 0;
    display: inline-block;
  }
}

/* ==========================================================================
   2. TIPOGRAFÍA MÓVIL - Mejor legibilidad
   ========================================================================== */

@media (max-width: 767px) {
  /* Títulos más pequeños pero legibles */
  h1, .hero-title {
    font-size: clamp(28px, 8vw, 42px);
    line-height: 1.2;
  }

  h2, .section-title {
    font-size: clamp(24px, 6vw, 36px);
    line-height: 1.25;
  }

  h3 {
    font-size: clamp(20px, 5vw, 28px);
  }

  /* Texto base más legible */
  body,
  p {
    font-size: 16px;
    line-height: 1.6;
  }

  /* Reducir espaciado excesivo */
  .section-padding {
    padding: 60px 0;
  }

  .pt-120 {
    padding-top: 60px;
  }

  .pb-120 {
    padding-bottom: 60px;
  }

  .mt-120 {
    margin-top: 60px;
  }

  .mb-120 {
    margin-bottom: 60px;
  }
}

/* ==========================================================================
   3. HEADER MÓVIL OPTIMIZADO
   ========================================================================== */

@media (max-width: 992px) {
  /* Ocultar elementos innecesarios en móvil */
  .top-bar {
    display: none;
  }

  .middle-header {
    display: none;
  }

  /* Header principal compacto */
  .header {
    padding: 10px 0;
  }

  .header-logo img {
    max-height: 45px;
    width: auto;
  }

  /* Menú hamburguesa más accesible */
  .sidebar-trigger {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .sidebar-trigger span {
    width: 24px;
    height: 2px;
  }
}

/* ==========================================================================
   4. BOTÓN WHATSAPP FLOTANTE OPTIMIZADO
   ========================================================================== */

.whatsapp-float {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 999;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.whatsapp-float:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.whatsapp-float img {
  width: 32px;
  height: 32px;
}

@media (max-width: 767px) {
  .whatsapp-float {
    bottom: 16px;
    right: 16px;
    width: 52px;
    height: 52px;
  }

  .whatsapp-float img {
    width: 28px;
    height: 28px;
  }
}

/* ==========================================================================
   5. FORMULARIOS MÓVILES
   ========================================================================== */

@media (max-width: 767px) {
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="number"],
  textarea,
  select {
    font-size: 16px; /* Previene zoom en iOS */
    padding: 14px 16px;
    min-height: 48px;
  }

  .form-control {
    font-size: 16px;
    padding: 14px 16px;
  }

  /* Espaciado entre campos */
  .form-group,
  .mb-20 {
    margin-bottom: 16px;
  }
}

/* ==========================================================================
   6. CARDS Y CONTENIDO MÓVIL
   ========================================================================== */

@media (max-width: 767px) {
  /* Cards de servicios */
  .service-card,
  .service-item {
    padding: 24px 20px;
    margin-bottom: 20px;
  }

  /* Cards de blog */
  .blog-card,
  .blog-item {
    margin-bottom: 24px;
  }

  .blog-card img,
  .blog-item img {
    border-radius: 12px 12px 0 0;
  }

  /* Testimoniales */
  .testi-card {
    padding: 24px 20px;
  }

  /* FAQ acordeón */
  .accordion-button {
    padding: 16px 20px;
    font-size: 16px;
  }

  .accordion-body {
    padding: 16px 20px;
  }
}

/* ==========================================================================
   7. IMÁGENES RESPONSIVAS
   ========================================================================== */

@media (max-width: 767px) {
  /* Imágenes del hero más pequeñas */
  .hero-img,
  .about-img {
    max-width: 100%;
    height: auto;
  }

  /* Ocultar elementos decorativos en móvil */
  .shape,
  .shape-1,
  .shape-2,
  .shape-3 {
    display: none;
  }

  /* Iconos de servicios más compactos */
  .service-icon img {
    max-width: 48px;
    height: auto;
  }
}

/* ==========================================================================
   8. FOOTER MÓVIL
   ========================================================================== */

@media (max-width: 767px) {
  .footer-section {
    padding: 40px 0 20px;
  }

  .footer-widget {
    margin-bottom: 32px;
    text-align: center;
  }

  .footer-logo {
    margin-bottom: 20px;
  }

  .footer-logo img {
    max-width: 180px;
  }

  .footer-list {
    text-align: center;
  }

  .footer-list li {
    margin-bottom: 8px;
  }

  /* Copyright */
  .copyright-area {
    text-align: center;
  }

  .copy-list {
    justify-content: center;
    margin-top: 12px;
  }
}

/* ==========================================================================
   9. MAPA E IFRAME
   ========================================================================== */

@media (max-width: 767px) {
  .map-area iframe,
  .contact-map iframe {
    height: 250px;
  }
}

/* ==========================================================================
   10. PERFORMANCE - Reducir animaciones en móvil
   ========================================================================== */

@media (max-width: 992px) and (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Reducir animaciones complejas en móvil */
@media (max-width: 767px) {
  .wow {
    visibility: visible !important;
    animation: none !important;
  }

  /* Desactivar parallax en móvil */
  [data-parallax] {
    transform: none !important;
  }
}

/* ==========================================================================
   11. SCROLL SUAVE NATIVO
   ========================================================================== */

@media (max-width: 992px) {
  html {
    scroll-behavior: smooth;
  }

  /* Scroll snap para secciones */
  .scroll-snap-section {
    scroll-snap-align: start;
  }
}

/* ==========================================================================
   12. SAFE AREAS (iPhone X+, notch)
   ========================================================================== */

@supports (padding: max(0px)) {
  .header {
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
  }

  .footer-section {
    padding-bottom: max(20px, env(safe-area-inset-bottom));
  }

  .whatsapp-float {
    bottom: max(20px, calc(env(safe-area-inset-bottom) + 16px));
    right: max(20px, env(safe-area-inset-right));
  }
}

/* ==========================================================================
   13. LANDSCAPE MÓVIL
   ========================================================================== */

@media (max-width: 992px) and (orientation: landscape) {
  .hero-section {
    min-height: auto;
    padding: 40px 0;
  }

  .hero-title {
    font-size: clamp(24px, 5vw, 32px);
  }
}

/* ==========================================================================
   14. FOCUS VISIBLE PARA ACCESIBILIDAD
   ========================================================================== */

@media (max-width: 992px) {
  a:focus-visible,
  button:focus-visible,
  input:focus-visible,
  textarea:focus-visible,
  select:focus-visible {
    outline: 3px solid var(--bz-color-theme-primary);
    outline-offset: 2px;
  }
}
