/**
 * COOPCRECER JUNTOS - Responsive & Media Queries
 * Adaptaciones para 360px, 390px, 576px, 768px, 992px, 1200px, 1440px
 */

/* ==========================================================================
   1. CONTROL DE DESBORDAMIENTO GLOBAL
   ========================================================================== */
body, html {
  overflow-x: hidden;
  max-width: 100vw;
}

/* ==========================================================================
   2. BREAKPOINTS Y ADAPTACIONES ESPECÍFICAS
   ========================================================================== */

/* Dispositivos Muy Pequeños (360px - 480px) */
@media (max-width: 480px) {
  :root {
    --space-2xl: 3rem;
    --space-3xl: 4rem;
  }

  .topbar {
    display: none; /* Ocultar topbar en pantallas ultra compactas para maximizar pantalla */
  }

  .brand-logo img {
    height: 36px;
  }

  .hero {
    padding: var(--space-xl) 0 var(--space-2xl);
  }

  .hero-badge {
    font-size: 0.68rem;
    padding: 0.35rem 0.75rem;
    word-break: break-word;
  }

  .hero-title {
    font-size: 1.75rem;
  }

  .hero-lead {
    font-size: 0.95rem;
  }

  .hero-ctas {
    flex-direction: column;
    width: 100%;
  }

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

  .hero-metrics {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }

  .grid-cols-2,
  .grid-cols-3,
  .grid-cols-4,
  .grid-cols-5 {
    grid-template-columns: 1fr !important;
  }

  .whatsapp-float span {
    display: none; /* Dejar solo icono para no tapar contenido */
  }

  .whatsapp-float {
    padding: 0.75rem;
    border-radius: var(--radius-full);
    bottom: 16px;
    right: 16px;
  }
}

/* Dispositivos Móviles y Tablets Pequeñas (< 768px) */
@media (max-width: 767px) {
  .grid-cols-2-mobile {
    grid-template-columns: repeat(2, 1fr);
  }

  .form-row {
    flex-direction: column;
  }

  .custody-grid {
    grid-template-columns: 1fr;
  }

  .quote-media-card {
    min-height: 280px;
  }

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

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

/* Tablets (768px - 1079px) */
@media (min-width: 768px) and (max-width: 1079px) {
  .grid-cols-4 {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  .grid-cols-5 {
    grid-template-columns: repeat(3, 1fr) !important;
  }

  .custody-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Escritorio Estándar (1080px - 1439px) */
@media (min-width: 1080px) {
  .grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
  .grid-cols-5 { grid-template-columns: repeat(5, 1fr); }
}

/* Pantallas Grandes (>= 1440px) */
@media (min-width: 1440px) {
  .container {
    max-width: 1360px;
  }
}

/* ==========================================================================
   3. ACCESIBILIDAD Y PREFERENCIAS DEL USUARIO
   ========================================================================== */
@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;
  }
}

/* Soporte de Impresión Limpia */
@media print {
  .topbar,
  .site-header,
  .whatsapp-float,
  .skip-link,
  .btn,
  .form-card {
    display: none !important;
  }

  body {
    background: #FFFFFF !important;
    color: #000000 !important;
  }

  .section-bg-green {
    background: #FFFFFF !important;
    color: #000000 !important;
  }

  .card, .principle-card, .custody-step {
    border: 1px solid #CCCCCC !important;
    box-shadow: none !important;
    page-break-inside: avoid;
  }
}
