/* Archivo: responsive.css - Versión Final Corregida (Logo, Topbar y Márgenes) */

/* CORRECCIÓN NUCLEAR: Evita que cualquier elemento estire la web hacia los lados */
html, body {
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: hidden !important;
  position: relative;
}

@media (max-width: 900px) {
  
  /* --- 1. AJUSTE GLOBAL DE CONTENEDORES --- */
  .container {
    padding: 0 20px !important;
    width: 100% !important;
    max-width: 100vw !important; /* Fuerza a que nunca sea mayor que el visor */
    box-sizing: border-box !important;
  }

  /* --- 2. TOP BAR (Corrección de visibilidad y espacio) --- */
  .top-bar {
    padding: 8px 0;
    min-height: auto;
  }
  .bar-flex {
    flex-direction: column; 
    gap: 4px;
    text-align: center;
  }
  .top-bar span, .top-bar strong {
    color: #ffffff !important; 
    font-size: 0.75rem;
    display: block;
  }

  /* --- 3. CABECERA Y LOGO --- */
  .site-header { 
    min-height: 60px; 
    z-index: 1000; 
    top: 0;
  }
  .header-flex { 
    padding: 8px 0; 
    align-items: center;
  }
  .logo a { 
    font-size: 1.4rem !important; /* Reducido ligeramente para asegurar espacio */
    line-height: 1;
  }

  .menu-toggle { 
    display: block; 
    z-index: 1100;
    position: relative;
    padding: 5px;
  }
  
  /* --- 4. NAVEGACIÓN MÓVIL --- */
  .main-nav {
    position: fixed;
    top: 0;
    right: -320px; 
    width: 290px;
    height: 100vh;
    background: #ffffff;
    padding: 80px 25px 40px;
    box-shadow: -10px 0 30px rgba(0,0,0,0.15);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: block !important; 
    z-index: 1050;
    overflow-y: auto;
    visibility: hidden;
    pointer-events: none;
  }

  .main-nav.active {
    right: 0;
    visibility: visible;
    pointer-events: auto;
  }

  .nav-list { 
    flex-direction: column; 
    align-items: flex-start; 
    gap: 5px; 
    width: 100%;
  }

  .nav-list li { 
    width: 100%; 
    border-bottom: 1px solid #f1f5f9; 
  }

  .nav-list li a { 
    display: block; 
    padding: 16px 0; 
    font-size: 1.05rem; 
    font-weight: 600;
    color: var(--text-main);
  }

  /* SUBMENÚS ACORDEÓN */
  .dropdown-menu {
    position: static !important;
    display: none;
    width: 100% !important;
    background: #f8fafc !important;
    box-shadow: none !important;
    padding: 5px 20px !important;
    border: none !important;
    transform: none !important;
    opacity: 1 !important;
    visibility: visible !important;
  }
  .dropdown.open .dropdown-menu { display: block; }

  .nav-phone {
    margin-top: 25px;
    display: block;
    width: 100%;
    text-align: center;
    background: var(--text-main) !important;
    color: #fff !important;
    padding: 14px !important;
    border-radius: 10px !important;
  }

  /* --- 5. HERO SECTION --- */
  .hero-home {
    padding: 90px 20px 50px; 
    margin-top: -60px; 
    min-height: 450px;
  }
  .hero-home h1 { font-size: 1.8rem !important; }
  .hero-home h2 { font-size: 1.2rem !important; }
  .hero-actions { flex-direction: column; gap: 10px; }

  /* --- 6. ZONA DE CAJAS Y PASOS (CORRECCIÓN TOTAL BENTO) --- */
  .bento-container, .three-cols {
    display: flex !important; /* Cambiamos de Grid a Flex para mejor control en móvil */
    flex-direction: column !important;
    width: 100% !important;
    gap: 20px !important;
  }
  .bento-item {
    width: 100% !important;
    max-width: 100% !important;
    min-height: auto !important;
    padding: 25px !important;
    box-sizing: border-box !important;
    margin: 0 !important; /* Evita que márgenes invisibles empujen la caja */
  }
  .bento-footer {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 15px !important;
  }
  .price-tag-sm { width: fit-content; }

  .comparison-list li {
    margin-bottom: 15px !important;
    padding: 18px !important;
    border-radius: 12px;
  }
  .step-v-item { margin-bottom: 30px; gap: 12px; }
  .security-notice {
    padding: 18px !important;
    margin: 25px 0 !important;
  }

  /* --- 7. FOOTER --- */
  .footer-grid { grid-template-columns: 1fr; gap: 30px; }
  .footer-col { text-align: center; }

  /* --- 8. BOTONES FLOTANTES (REDISEÑO SEGURO) --- */
  .mobile-sticky-btn { 
    display: block !important; 
    position: fixed !important;
    bottom: 15px !important; 
    left: 15px !important;
    /* En lugar de 'right: 15px', calculamos el ancho para que no dependa del borde derecho */
    width: calc(100% - 30px) !important; 
    right: auto !important;
    padding: 16px !important;
    z-index: 2000 !important;
    box-sizing: border-box !important;
  }
  .whatsapp-float { display: none !important; }
}